Make dialogs look better

This commit is contained in:
Niels Andriesse 2021-06-24 13:14:18 +10:00
parent ed5641df03
commit 1dc7f7e9c0
7 changed files with 15 additions and 11 deletions

View File

@ -12,6 +12,7 @@ import network.loki.messenger.R
import org.thoughtcrime.securesms.ApplicationContext
import org.thoughtcrime.securesms.loki.protocol.MultiDeviceProtocol
import org.session.libsession.utilities.KeyPairUtilities
import org.thoughtcrime.securesms.loki.utilities.UiModeUtilities
class ClearAllDataDialog : DialogFragment() {
@ -23,6 +24,8 @@ class ClearAllDataDialog : DialogFragment() {
builder.setView(contentView)
val result = builder.create()
result.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
val isLightMode = UiModeUtilities.isDayUiMode(requireContext())
result.window?.setDimAmount(if (isLightMode) 0.1f else 0.75f)
return result
}

View File

@ -17,6 +17,7 @@ import org.session.libsession.utilities.IdentityKeyUtil
import org.thoughtcrime.securesms.loki.utilities.MnemonicUtilities
import org.session.libsignal.crypto.MnemonicCodec
import org.session.libsignal.utilities.hexEncodedPrivateKey
import org.thoughtcrime.securesms.loki.utilities.UiModeUtilities
class SeedDialog : DialogFragment() {
@ -40,6 +41,8 @@ class SeedDialog : DialogFragment() {
builder.setView(contentView)
val result = builder.create()
result.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
val isLightMode = UiModeUtilities.isDayUiMode(requireContext())
result.window?.setDimAmount(if (isLightMode) 0.1f else 0.75f)
return result
}

View File

@ -7,5 +7,4 @@
<corners android:radius="@dimen/dialog_corner_radius" />
<!-- <stroke android:width="@dimen/border_thickness" android:color="@color/dialog_border" />-->
</shape>

View File

@ -2,6 +2,5 @@
<inset
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/default_dialog_background"
android:insetRight="@dimen/medium_spacing"
android:insetLeft="@dimen/medium_spacing">
android:inset="@dimen/medium_spacing">
</inset>

View File

@ -6,10 +6,8 @@
android:background="@drawable/default_dialog_background_inset"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingLeft="32dp"
android:paddingTop="@dimen/medium_spacing"
android:paddingRight="32dp"
android:paddingBottom="@dimen/medium_spacing">
android:elevation="4dp"
android:padding="32dp">
<TextView
android:layout_width="wrap_content"

View File

@ -6,10 +6,7 @@
android:background="@drawable/default_dialog_background_inset"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingLeft="32dp"
android:paddingTop="@dimen/medium_spacing"
android:paddingRight="32dp"
android:paddingBottom="@dimen/medium_spacing">
android:padding="32dp">
<TextView
android:layout_width="wrap_content"

View File

@ -280,4 +280,9 @@
<item name="android:windowNoTitle">true</item>
</style>
<style name="Session.Dialog" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">#120000FF</item>
<item name="android:windowIsFloating">false</item>
</style>
</resources>