mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Fix theme transitions in chats.
This commit is contained in:
committed by
Greyson Parrelli
parent
3235982f17
commit
5e8318d63f
@@ -657,7 +657,7 @@
|
||||
android:exported="false"/>
|
||||
|
||||
<activity android:name=".groups.ui.invitesandrequests.ManagePendingAndRequestingMembersActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:exported="false"/>
|
||||
|
||||
@@ -1086,13 +1086,13 @@
|
||||
|
||||
<activity android:name=".megaphone.ClientDeprecatedActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="false"/>
|
||||
|
||||
<activity android:name=".ratelimit.RecaptchaProofActivity"
|
||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:exported="false"/>
|
||||
|
||||
<activity android:name=".wallpaper.crop.WallpaperImageSelectionActivity"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.thoughtcrime.securesms.conversation.v2
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.view.MotionEvent
|
||||
import android.view.Window
|
||||
@@ -16,6 +17,7 @@ import org.thoughtcrime.securesms.components.settings.app.subscription.StripeRep
|
||||
import org.thoughtcrime.securesms.components.voice.VoiceNoteMediaController
|
||||
import org.thoughtcrime.securesms.components.voice.VoiceNoteMediaControllerOwner
|
||||
import org.thoughtcrime.securesms.conversation.ConversationIntents
|
||||
import org.thoughtcrime.securesms.util.ConfigurationUtil
|
||||
import org.thoughtcrime.securesms.util.Debouncer
|
||||
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme
|
||||
import java.util.concurrent.TimeUnit
|
||||
@@ -101,6 +103,13 @@ open class ConversationActivity : PassphraseRequiredActivity(), VoiceNoteMediaCo
|
||||
googlePayResultPublisher.onNext(InAppPaymentComponent.GooglePayResult(requestCode, resultCode, data))
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfiguration: Configuration) {
|
||||
super.onConfigurationChanged(newConfiguration)
|
||||
if (ConfigurationUtil.isUiModeChanged(resources.configuration, newConfiguration)) {
|
||||
recreate()
|
||||
}
|
||||
}
|
||||
|
||||
private fun replaceFragment() {
|
||||
val fragment = ConversationFragment().apply {
|
||||
arguments = if (ConversationIntents.isBubbleIntentUri(intent.data)) {
|
||||
|
||||
@@ -20,4 +20,10 @@ public final class ConfigurationUtil {
|
||||
public static float getFontScale(@NonNull Configuration configuration) {
|
||||
return configuration.fontScale;
|
||||
}
|
||||
|
||||
public static boolean isUiModeChanged(@NonNull Configuration configuration, @NonNull Configuration newConfiguration) {
|
||||
int oldTheme = configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
int newTheme = newConfiguration.uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
return oldTheme == newTheme;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user