Show hint when forgot app lock pin

This commit is contained in:
12aw 2024-02-17 12:53:31 +01:00
parent 8fb5960940
commit 19ecf9cc33
3 changed files with 10 additions and 2 deletions

View file

@ -138,6 +138,7 @@ import eu.siacs.conversations.utils.ThemeHelper;
import p32929.easypasscodelock.Utils.EasyLock;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.snackbar.Snackbar;
public class ConversationsActivity extends XmppActivity implements OnConversationSelected, OnConversationArchived, OnConversationsListItemUpdated, OnConversationRead, XmppConnectionService.OnAccountUpdate, XmppConnectionService.OnConversationUpdate, XmppConnectionService.OnRosterUpdate, OnUpdateBlocklist, XmppConnectionService.OnShowErrorToast, XmppConnectionService.OnAffiliationChanged, XmppConnectionService.OnRoomDestroy {
@ -710,6 +711,12 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
if (getBooleanPreference("app_lock_enabled", R.bool.app_lock_enabled)) {
EasyLock.setBackgroundColor(getColor(R.color.primary_black));
EasyLock.checkPassword(this);
EasyLock.forgotPassword(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(ConversationsActivity.this, R.string.app_lock_forgot_password, Toast.LENGTH_LONG).show();
}
});
}
super.onCreate(savedInstanceState);
OmemoSetting.load(this);

View file

@ -938,9 +938,9 @@ public class SettingsActivity extends XmppActivity implements OnSharedPreference
appLockPreference.setOnPreferenceChangeListener((preference, newValue) -> {
if (!getBooleanPreference("app_lock_enabled", R.bool.app_lock_enabled)) {
EasyLock.setBackgroundColor(getColor(R.color.primary_black));
EasyLock.setPassword(this, SettingsActivity.class);
EasyLock.setPassword(this, ConversationsActivity.class);
} else {
EasyLock.disablePassword(this, SettingsActivity.class);
EasyLock.disablePassword(this, ConversationsActivity.class);
}
return true;
});

View file

@ -1415,4 +1415,5 @@
<string name="recent_threads">Recent threads</string>
<string name="pref_app_lock_enable_title">Enable app lock (Beta)</string>
<string name="pref_app_lock_enable_summary">Enable the app lock. Be aware you can\'t open the app anymore when you forgot the PIN.</string>
<string name="app_lock_forgot_password">Reinstall app and load chat backup</string>
</resources>