mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-07 15:38:38 +01:00
adding a setting for toggling clipboard visibility
This commit is contained in:
parent
74dea45afe
commit
5e7edbe102
@ -22,6 +22,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
setupPurchaseThankYou()
|
||||
setupCustomizeColors()
|
||||
setupUseEnglish()
|
||||
setupClipboard()
|
||||
|
||||
updateTextColors(settings_scrollview)
|
||||
|
||||
@ -44,7 +45,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
|
||||
// make sure the corners at ripple fit the stroke rounded corners
|
||||
if (settings_purchase_thank_you_holder.isGone()) {
|
||||
settings_use_english_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
|
||||
settings_use_english_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme)
|
||||
}
|
||||
|
||||
settings_purchase_thank_you_holder.setOnClickListener {
|
||||
@ -64,10 +65,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
settings_use_english.isChecked = config.useEnglish
|
||||
|
||||
if (settings_use_english_holder.isGone() && settings_purchase_thank_you_holder.isGone()) {
|
||||
settings_general_settings_label.beGone()
|
||||
settings_general_settings_holder.beGone()
|
||||
} else if (settings_use_english_holder.isGone()) {
|
||||
settings_purchase_thank_you_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
|
||||
settings_show_clipboard_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
|
||||
}
|
||||
|
||||
settings_use_english_holder.setOnClickListener {
|
||||
@ -76,4 +74,12 @@ class SettingsActivity : SimpleActivity() {
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupClipboard() {
|
||||
settings_show_clipboard.isChecked = config.showClipboard
|
||||
settings_show_clipboard_holder.setOnClickListener {
|
||||
settings_show_clipboard.toggle()
|
||||
config.showClipboard = settings_show_clipboard.isChecked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,4 +7,8 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
companion object {
|
||||
fun newInstance(context: Context) = Config(context)
|
||||
}
|
||||
|
||||
var showClipboard: Boolean
|
||||
get() = prefs.getBoolean(SHOW_CLIPBOARD, true)
|
||||
set(showClipboard) = prefs.edit().putBoolean(SHOW_CLIPBOARD, showClipboard).apply()
|
||||
}
|
||||
|
@ -6,3 +6,6 @@ const val SHIFT_ON_PERMANENT = 2
|
||||
|
||||
// limit the count of alternative characters that show up at long pressing a key
|
||||
const val MAX_KEYS_PER_MINI_ROW = 5
|
||||
|
||||
// shared prefs
|
||||
const val SHOW_CLIPBOARD = "show_clipboard"
|
||||
|
@ -281,7 +281,6 @@ class MyKeyboard {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Creates a blank keyboard from the given resource file and populates it with the specified characters in left-to-right, top-to-bottom fashion,
|
||||
* using the specified number of columns. If the specified number of columns is -1, then the keyboard will fit as many keys as possible in each row.
|
||||
* @param context the application or service context
|
||||
|
@ -78,7 +78,7 @@
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners">
|
||||
android:background="@drawable/ripple_background">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_use_english"
|
||||
@ -88,6 +88,22 @@
|
||||
android:text="@string/use_english_language" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_show_clipboard_holder"
|
||||
style="@style/SettingsHolderCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ripple_bottom_corners">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||
android:id="@+id/settings_show_clipboard"
|
||||
style="@style/SettingsCheckboxStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/show_clipboard_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
Loading…
x
Reference in New Issue
Block a user