kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix lock screen issues.
rodzic
642d1984c4
commit
5e8d74bc11
|
@ -35,7 +35,6 @@ import android.view.MenuInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.BounceInterpolator;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
|
@ -51,6 +50,7 @@ import androidx.biometric.BiometricManager;
|
|||
import androidx.biometric.BiometricManager.Authenticators;
|
||||
import androidx.biometric.BiometricPrompt;
|
||||
|
||||
import org.signal.core.util.ThreadUtil;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
|
||||
import org.thoughtcrime.securesms.components.AnimatingToggle;
|
||||
|
@ -98,13 +98,16 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|||
private boolean hadFailure;
|
||||
private boolean alreadyShown;
|
||||
|
||||
private final Runnable resumeScreenLockRunnable = () -> {
|
||||
resumeScreenLock(!alreadyShown);
|
||||
alreadyShown = true;
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.i(TAG, "onCreate()");
|
||||
dynamicTheme.onCreate(this);
|
||||
dynamicLanguage.onCreate(this);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.prompt_passphrase_activity);
|
||||
|
@ -129,11 +132,20 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|||
setLockTypeVisibility();
|
||||
|
||||
if (TextSecurePreferences.isScreenLockEnabled(this) && !authenticated && !hadFailure) {
|
||||
resumeScreenLock(!alreadyShown);
|
||||
alreadyShown = true;
|
||||
ThreadUtil.postToMain(resumeScreenLockRunnable);
|
||||
}
|
||||
|
||||
hadFailure = false;
|
||||
|
||||
fingerprintPrompt.setImageResource(R.drawable.ic_fingerprint_white_48dp);
|
||||
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.signal_accent_primary), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
ThreadUtil.cancelRunnableOnMain(resumeScreenLockRunnable);
|
||||
biometricPrompt.cancelAuthentication();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -388,9 +400,6 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
handleAuthenticated();
|
||||
|
||||
fingerprintPrompt.setImageResource(R.drawable.ic_fingerprint_white_48dp);
|
||||
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.core_ultramarine), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
@ -412,7 +421,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
fingerprintPrompt.setImageResource(R.drawable.ic_fingerprint_white_48dp);
|
||||
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.core_ultramarine), PorterDuff.Mode.SRC_IN);
|
||||
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.signal_accent_primary), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
android:id="@+id/prompt_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<View android:id="@+id/shim"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -58,7 +59,7 @@
|
|||
<ImageView android:id="@+id/fingerprint_auth_container"
|
||||
android:src="@drawable/ic_fingerprint_white_48dp"
|
||||
android:background="@drawable/circle_tintable"
|
||||
android:backgroundTint="@color/core_ultramarine"
|
||||
android:backgroundTint="@color/signal_accent_primary"
|
||||
android:padding="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -70,7 +71,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rounded_rectangle"
|
||||
android:backgroundTint="@color/core_ultramarine"
|
||||
android:backgroundTint="@color/signal_accent_primary"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center_horizontal"
|
||||
android:elevation="3dp"
|
||||
|
|
|
@ -89,8 +89,13 @@
|
|||
<item name="contact_filter_toolbar_icon_tint">@color/signal_text_toolbar_subtitle</item>
|
||||
</style>
|
||||
|
||||
<style name="TextSecure.LightIntroTheme" parent="@style/Theme.AppCompat.Light">
|
||||
<style name="TextSecure.LightIntroTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="android:forceDarkAllowed" tools:targetApi="29">false</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="27">default</item>
|
||||
<item name="android:statusBarColor" tools:ignore="NewApi">@color/login_top_background</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
@ -98,10 +103,16 @@
|
|||
|
||||
<item name="android:textColorHint">#cc000000</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:textColorSecondary">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="TextSecure.DarkIntroTheme" parent="@style/Theme.AppCompat">
|
||||
<item name="android:forceDarkAllowed" tools:targetApi="29">false</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="27">default</item>
|
||||
<item name="android:statusBarColor" tools:ignore="NewApi">@color/login_top_background</item>
|
||||
<item name="android:windowTranslucentNavigation">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
|
Ładowanie…
Reference in New Issue