mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-27 07:24:13 +01:00
Show hint when forgot app lock pin
This commit is contained in:
parent
8fb5960940
commit
19ecf9cc33
3 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue