possible crash fix for android 12 and minor UI changes

This commit is contained in:
LagradOst 2021-10-14 18:13:34 +02:00
parent 695c75af10
commit f9ef71a389
2 changed files with 10 additions and 8 deletions

View file

@ -19,7 +19,6 @@ import androidx.work.Data
import androidx.work.ExistingWorkPolicy import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequest import androidx.work.OneTimeWorkRequest
import androidx.work.WorkManager import androidx.work.WorkManager
import com.bumptech.glide.Glide
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.MainActivity import com.lagradost.cloudstream3.MainActivity
import com.lagradost.cloudstream3.R import com.lagradost.cloudstream3.R
@ -215,7 +214,7 @@ object VideoDownloadManager {
} }
} }
suspend fun createNotification( private suspend fun createNotification(
context: Context, context: Context,
source: String?, source: String?,
linkName: String?, linkName: String?,
@ -256,7 +255,11 @@ object VideoDownloadManager {
data = source.toUri() data = source.toUri()
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
} }
val pendingIntent: PendingIntent = PendingIntent.getActivity(context, 0, intent, 0) val pendingIntent: PendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE)
} else {
PendingIntent.getActivity(context, 0, intent, 0)
}
builder.setContentIntent(pendingIntent) builder.setContentIntent(pendingIntent)
} }

View file

@ -416,6 +416,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_marginBottom="10dp"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -423,7 +424,6 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
tools:visibility="visible" tools:visibility="visible"
tools:text="Season 1" tools:text="Season 1"
android:nextFocusUp="@id/result_descript" android:nextFocusUp="@id/result_descript"
android:nextFocusRight="@id/result_episode_select" android:nextFocusRight="@id/result_episode_select"
android:nextFocusLeft="@id/result_episode_select" android:nextFocusLeft="@id/result_episode_select"
@ -432,9 +432,8 @@
android:id="@+id/result_season_button" android:id="@+id/result_season_button"
android:visibility="gone" android:visibility="gone"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="0dp"
style="@style/MultiSelectButton" style="@style/MultiSelectButton">
android:layout_marginEnd="10dp">
</com.google.android.material.button.MaterialButton> </com.google.android.material.button.MaterialButton>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
tools:visibility="visible" tools:visibility="visible"
@ -448,7 +447,7 @@
android:id="@+id/result_episode_select" android:id="@+id/result_episode_select"
android:visibility="gone" android:visibility="gone"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="0dp"
style="@style/MultiSelectButton" style="@style/MultiSelectButton"
> >
</com.google.android.material.button.MaterialButton> </com.google.android.material.button.MaterialButton>