mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
Merge pull request #469 from tkterris/press-back-twice
Add toggle to disable "Press back again to exit"
This commit is contained in:
@ -330,7 +330,7 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (fragment.mView.breadcrumbs.childCount <= 1) {
|
||||
if (!wasBackJustPressed) {
|
||||
if (!wasBackJustPressed && config.pressBackTwice) {
|
||||
wasBackJustPressed = true
|
||||
toast(R.string.press_back_again)
|
||||
Handler().postDelayed({
|
||||
|
@ -31,6 +31,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
setupChangeDateTimeFormat()
|
||||
setupFontSize()
|
||||
setupShowHidden()
|
||||
setupPressBackTwice()
|
||||
setupHiddenItemPasswordProtection()
|
||||
setupAppPasswordProtection()
|
||||
setupFileDeletionPasswordProtection()
|
||||
@ -115,6 +116,14 @@ class SettingsActivity : SimpleActivity() {
|
||||
config.showHidden = settings_show_hidden.isChecked
|
||||
}
|
||||
|
||||
private fun setupPressBackTwice() {
|
||||
settings_press_back_twice.isChecked = config.pressBackTwice
|
||||
settings_press_back_twice_holder.setOnClickListener {
|
||||
settings_press_back_twice.toggle()
|
||||
config.pressBackTwice = settings_press_back_twice.isChecked
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupHiddenItemPasswordProtection() {
|
||||
settings_password_protection.isChecked = config.isHiddenPasswordProtectionOn
|
||||
settings_password_protection_holder.setOnClickListener {
|
||||
|
@ -22,6 +22,10 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
|
||||
var shouldShowHidden = showHidden || temporarilyShowHidden
|
||||
|
||||
var pressBackTwice: Boolean
|
||||
get() = prefs.getBoolean(PRESS_BACK_TWICE, true)
|
||||
set(pressBackTwice) = prefs.edit().putBoolean(PRESS_BACK_TWICE, pressBackTwice).apply()
|
||||
|
||||
var homeFolder: String
|
||||
get(): String {
|
||||
var path = prefs.getString(HOME_FOLDER, "")!!
|
||||
|
@ -5,6 +5,7 @@ const val MAX_COLUMN_COUNT = 20
|
||||
|
||||
// shared preferences
|
||||
const val SHOW_HIDDEN = "show_hidden"
|
||||
const val PRESS_BACK_TWICE = "press_back_twice"
|
||||
const val HOME_FOLDER = "home_folder"
|
||||
const val TEMPORARILY_SHOW_HIDDEN = "temporarily_show_hidden"
|
||||
const val IS_ROOT_AVAILABLE = "is_root_available"
|
||||
|
@ -129,6 +129,29 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_press_back_twice_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingStart="@dimen/normal_margin"
|
||||
android:paddingTop="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/normal_margin"
|
||||
android:paddingBottom="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/settings_press_back_twice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/press_back_twice"
|
||||
app:switchPadding="@dimen/medium_margin" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/visibility_label"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">تفعيل الدخول الى مسار الروت</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Root icazəsini aktivləşdir</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Povolit přístup ke kořenovým souborům</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Galluogi mynediad craidd</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Aktiver root-adgang</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Root-Zugriff erlauben</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Ενεργοποιήστε την πρόσβαση ριζικού καταλόγου</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Activar acceso root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Ota käyttöön root-ominaisuudet</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Activer les droits root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">रूट एक्सेस</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Omogući root pristup</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Enable root access</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Aktifkan akses root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Aktifkan akses root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Abilita accesso root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">ルートアクセスを有効にする</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">루트 접근 활성화</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Įgalinti šakninę prieigą</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Aktiver root-tilgang</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Root-toegang inschakelen</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Zezwól na dostęp do uprawnień roota</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Ativar o acesso root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Ativar acesso root</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Включить root-доступ</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Povoliť prístup ku koreňovým súborom</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Aktivera rotåtkomst</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Root erişimini etkinleştir</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Playstore. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Активувати root-доступ</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">启用 root 访问</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">啟用root權限</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="enable_root_access">Enable root access</string>
|
||||
<string name="press_back_twice">Require pressing Back twice to leave the app</string>
|
||||
|
||||
<!-- Strings displayed only on Google Play Store. Optional, but good to have -->
|
||||
<!-- App title has to have less than 50 characters. If you cannot squeeze it, just remove a part of it -->
|
||||
|
Reference in New Issue
Block a user