Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix(preferences): remove 'Hide file tree' action
Browse files Browse the repository at this point in the history
  • Loading branch information
itsaky committed Nov 10, 2023
1 parent e5448a4 commit 8881688
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
11 changes: 0 additions & 11 deletions app/src/main/java/com/itsaky/androidide/preferences/editor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import com.itsaky.androidide.preferences.internal.DELETE_TABS_ON_BACKSPACE
import com.itsaky.androidide.preferences.internal.FLAG_PASSWORD
import com.itsaky.androidide.preferences.internal.FONT_LIGATURES
import com.itsaky.androidide.preferences.internal.FONT_SIZE
import com.itsaky.androidide.preferences.internal.HIDE_FILE_TREE_BUTTON
import com.itsaky.androidide.preferences.internal.PIN_LINE_NUMBERS
import com.itsaky.androidide.preferences.internal.PRINTABLE_CHARS
import com.itsaky.androidide.preferences.internal.STICKY_SCROLL_ENABLED
Expand All @@ -54,7 +53,6 @@ import com.itsaky.androidide.preferences.internal.drawLineBreak
import com.itsaky.androidide.preferences.internal.drawTrailingWs
import com.itsaky.androidide.preferences.internal.fontLigatures
import com.itsaky.androidide.preferences.internal.fontSize
import com.itsaky.androidide.preferences.internal.hideFileTreeButton
import com.itsaky.androidide.preferences.internal.pinLineNumbers
import com.itsaky.androidide.preferences.internal.stickyScrollEnabled
import com.itsaky.androidide.preferences.internal.tabSize
Expand Down Expand Up @@ -100,7 +98,6 @@ private class CommonConfigurations(
addPreference(UseCustomFont())
addPreference(UseSoftTab())
addPreference(WordWrap())
addPreference(HideFileTreeButton())
addPreference(UseMagnifier())
addPreference(UseICU())
addPreference(AutoSave())
Expand Down Expand Up @@ -272,14 +269,6 @@ private class WordWrap(
override val icon: Int? = drawable.ic_wrap_text,
) : SwitchPreference(setValue = ::wordwrap::set, getValue = ::wordwrap::get)

@Parcelize
private class HideFileTreeButton(
override val key: String = HIDE_FILE_TREE_BUTTON,
override val title: Int = string.idepref_editor_hide_file_tree_button_title,
override val summary: Int? = string.idepref_editor_hide_file_tree_button_summary,
override val icon: Int? = drawable.ic_folder,
) : SwitchPreference(setValue = ::hideFileTreeButton::set, getValue = ::hideFileTreeButton::get)

@Parcelize
private class UseMagnifier(
override val key: String = USE_MAGNIFER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

package com.itsaky.androidide.preferences.internal

import com.itsaky.androidide.app.BaseApplication
import com.itsaky.androidide.utils.NavigationBar

const val COMPLETIONS_MATCH_LOWER = "idepref_editor_completions_matchLower"

const val FLAG_WS_LEADING = "idepref_editor_wsLeading"
Expand All @@ -34,7 +31,6 @@ const val AUTO_SAVE = "idepref_editor_autoSave"
const val FONT_LIGATURES = "idepref_editor_fontLigatures"
const val FLAG_PASSWORD = "idepref_editor_flagPassword"
const val WORD_WRAP = "idepref_editor_word_wrap"
const val HIDE_FILE_TREE_BUTTON = "idepref_hide_file_tree_button"
const val USE_MAGNIFER = "idepref_editor_use_magnifier"
const val USE_ICU = "idepref_editor_useIcu"
const val USE_SOFT_TAB = "idepref_editor_useSoftTab"
Expand Down Expand Up @@ -119,19 +115,6 @@ var wordwrap: Boolean
prefManager.putBoolean(WORD_WRAP, value)
}

/** By default the File Tree button is hidden into the overflow menu on devices where
* Gesture Navigation is enabled at the moment of accessing the preference.
*/
var hideFileTreeButton: Boolean
get() {
val navigationMode = NavigationBar.getInteractionMode(BaseApplication.getBaseInstance())
val gestureNavigationDisabled = navigationMode != NavigationBar.MODE_GESTURES
return prefManager.getBoolean(HIDE_FILE_TREE_BUTTON, gestureNavigationDisabled)
}
set(value) {
prefManager.putBoolean(HIDE_FILE_TREE_BUTTON, value)
}

var useMagnifier: Boolean
get() = prefManager.getBoolean(USE_MAGNIFER, true)
set(value) {
Expand Down Expand Up @@ -162,19 +145,19 @@ var colorScheme: String
prefManager.putString(COLOR_SCHEME, value)
}

var deleteEmptyLines : Boolean
var deleteEmptyLines: Boolean
get() = prefManager.getBoolean(DELETE_EMPTY_LINES, true)
set(value) {
prefManager.putBoolean(DELETE_EMPTY_LINES, value)
}

var deleteTabsOnBackspace : Boolean
var deleteTabsOnBackspace: Boolean
get() = prefManager.getBoolean(DELETE_TABS_ON_BACKSPACE, true)
set(value) {
prefManager.putBoolean(DELETE_TABS_ON_BACKSPACE, value)
}

var stickyScrollEnabled : Boolean
var stickyScrollEnabled: Boolean
get() = prefManager.getBoolean(STICKY_SCROLL_ENABLED, false)
set(value) {
prefManager.putBoolean(STICKY_SCROLL_ENABLED, value)
Expand Down
2 changes: 0 additions & 2 deletions resources/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@
<string name="idepref_editor_drawhexcolors_summary">Should the editor draw hex color string?</string>
<string name="idepref_editor_word_wrap_title">Word Wrap</string>
<string name="idepref_editor_word_wrap_summary">Use wordwrap of the editor</string>
<string name="idepref_editor_hide_file_tree_button_title">Hide the File Tree button</string>
<string name="idepref_editor_hide_file_tree_button_summary">Move the "File Tree" button into the overflow menu of the editor\'s toolbar.</string>
<string name="idepref_editor_use_magnifier_title">Enable Magnifier</string>
<string name="idepref_editor_use_magnifier_summary">Magnify text at cursor position while selecting text in editor</string>
<string name="idepref_editor_title">Editor</string>
Expand Down

0 comments on commit 8881688

Please sign in to comment.