diff --git a/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt index 0dc1d693..e6c90c33 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt @@ -9,6 +9,7 @@ import android.content.res.Resources import android.os.Build import android.util.DisplayMetrics import android.util.Log +import android.view.Gravity import android.view.KeyEvent import android.view.View import android.view.View.NO_ID @@ -40,6 +41,7 @@ import com.lagradost.cloudstream3.utils.Event import com.lagradost.cloudstream3.utils.UIHelper import com.lagradost.cloudstream3.utils.UIHelper.hasPIPPermission import com.lagradost.cloudstream3.utils.UIHelper.shouldShowPIPMode +import com.lagradost.cloudstream3.utils.UIHelper.toPx import org.schabi.newpipe.extractor.NewPipe import java.lang.ref.WeakReference import java.util.Locale @@ -160,6 +162,7 @@ object CommonActivity { // custom toasts are deprecated and won't appear when cs3 sets minSDK to api30 (A11) val toast = Toast(act) toast.duration = duration ?: Toast.LENGTH_SHORT + toast.setGravity(Gravity.CENTER_HORIZONTAL or Gravity.BOTTOM, 0, 5.toPx) toast.view = binding.root currentToast = toast toast.show() diff --git a/app/src/main/res/layout/toast.xml b/app/src/main/res/layout/toast.xml index 7e9938c6..ff6c1c7b 100644 --- a/app/src/main/res/layout/toast.xml +++ b/app/src/main/res/layout/toast.xml @@ -5,7 +5,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:padding="5dp" - android:layout_gravity="center_horizontal" app:cardCornerRadius="10dp" app:cardBackgroundColor="?attr/primaryBlackBackground" android:background="?attr/primaryBlackBackground">