mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-01-31 06:24:51 +01:00
add a toggle for clickable links and emails
This commit is contained in:
parent
11c366e7a7
commit
b387a95492
@ -22,6 +22,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
setupCustomizeColors()
|
setupCustomizeColors()
|
||||||
|
setupClickableLinks()
|
||||||
setupFontSize()
|
setupFontSize()
|
||||||
setupWidgetNote()
|
setupWidgetNote()
|
||||||
setupGravity()
|
setupGravity()
|
||||||
@ -34,6 +35,14 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupClickableLinks() {
|
||||||
|
settings_clickable_links.isChecked = config.clickableLinks
|
||||||
|
settings_clickable_links_holder.setOnClickListener {
|
||||||
|
settings_clickable_links.toggle()
|
||||||
|
config.clickableLinks = settings_clickable_links.isChecked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupFontSize() {
|
private fun setupFontSize() {
|
||||||
settings_font_size.setSelection(config.fontSize)
|
settings_font_size.setSelection(config.fontSize)
|
||||||
settings_font_size.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
settings_font_size.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||||
|
@ -8,6 +8,10 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
fun newInstance(context: Context) = Config(context)
|
fun newInstance(context: Context) = Config(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var clickableLinks: Boolean
|
||||||
|
get() = prefs.getBoolean(CLICKABLE_LINKS, false)
|
||||||
|
set(clickableLinks) = prefs.edit().putBoolean(CLICKABLE_LINKS, clickableLinks).apply()
|
||||||
|
|
||||||
var fontSize: Int
|
var fontSize: Int
|
||||||
get() = prefs.getInt(FONT_SIZE, FONT_SIZE_MEDIUM)
|
get() = prefs.getInt(FONT_SIZE, FONT_SIZE_MEDIUM)
|
||||||
set(size) = prefs.edit().putInt(FONT_SIZE, size).apply()
|
set(size) = prefs.edit().putInt(FONT_SIZE, size).apply()
|
||||||
|
@ -4,6 +4,7 @@ val NOTE_ID = "note_id"
|
|||||||
|
|
||||||
// shared preferences
|
// shared preferences
|
||||||
val CURRENT_NOTE_ID = "current_note_id"
|
val CURRENT_NOTE_ID = "current_note_id"
|
||||||
|
val CLICKABLE_LINKS = "clickable_links"
|
||||||
val WIDGET_NOTE_ID = "widget_note_id"
|
val WIDGET_NOTE_ID = "widget_note_id"
|
||||||
val FONT_SIZE = "font_size"
|
val FONT_SIZE = "font_size"
|
||||||
val GRAVITY = "gravity"
|
val GRAVITY = "gravity"
|
||||||
|
@ -30,6 +30,26 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_clickable_links_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:padding="@dimen/activity_margin">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
|
android:id="@+id/settings_clickable_links"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:paddingLeft="@dimen/medium_margin"
|
||||||
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:text="@string/links_and_emails_clickable"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/settings_font_size_holder"
|
android:id="@+id/settings_font_size_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="widget_note">Widget Notiz</string>
|
<string name="widget_note">Widget Notiz</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="note_font_size">Schriftgröße</string>
|
<string name="note_font_size">Schriftgröße</string>
|
||||||
<string name="small">Klein</string>
|
<string name="small">Klein</string>
|
||||||
<string name="normal">Normal</string>
|
<string name="normal">Normal</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="note_font_size">Tamaño de fuente</string>
|
<string name="note_font_size">Tamaño de fuente</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="widget_note">Nota del widget</string>
|
<string name="widget_note">Nota del widget</string>
|
||||||
<string name="small">Pequeña</string>
|
<string name="small">Pequeña</string>
|
||||||
<string name="normal">Normal</string>
|
<string name="normal">Normal</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="widget_note">Note utilisée dans le widget</string>
|
<string name="widget_note">Note utilisée dans le widget</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="note_font_size">Taille de la police de la note</string>
|
<string name="note_font_size">Taille de la police de la note</string>
|
||||||
<string name="small">Petite</string>
|
<string name="small">Petite</string>
|
||||||
<string name="normal">Normale</string>
|
<string name="normal">Normale</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="widget_note">A widget-ben használt jegyzet</string>
|
<string name="widget_note">A widget-ben használt jegyzet</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="note_font_size">Betűméret</string>
|
<string name="note_font_size">Betűméret</string>
|
||||||
<string name="small">Kis</string>
|
<string name="small">Kis</string>
|
||||||
<string name="normal">Átlagos</string>
|
<string name="normal">Átlagos</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="note_font_size">Note font size</string>
|
<string name="note_font_size">Note font size</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="widget_note">Note used in widget</string>
|
<string name="widget_note">Note used in widget</string>
|
||||||
<string name="small">Small</string>
|
<string name="small">Small</string>
|
||||||
<string name="normal">Normal</string>
|
<string name="normal">Normal</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="note_font_size">メモのフォントサイズ</string>
|
<string name="note_font_size">メモのフォントサイズ</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="widget_note">ウィジェットで使用するメモ</string>
|
<string name="widget_note">ウィジェットで使用するメモ</string>
|
||||||
<string name="small">小</string>
|
<string name="small">小</string>
|
||||||
<string name="normal">通常</string>
|
<string name="normal">通常</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="note_font_size">Tamanho do texto da nota</string>
|
<string name="note_font_size">Tamanho do texto da nota</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="widget_note">Nota utilizada no widget</string>
|
<string name="widget_note">Nota utilizada no widget</string>
|
||||||
<string name="small">Pequeno</string>
|
<string name="small">Pequeno</string>
|
||||||
<string name="normal">Normal</string>
|
<string name="normal">Normal</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="note_font_size">Note font size</string>
|
<string name="note_font_size">Note font size</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="widget_note">Note used in widget</string>
|
<string name="widget_note">Note used in widget</string>
|
||||||
<string name="small">Small</string>
|
<string name="small">Small</string>
|
||||||
<string name="normal">Normal</string>
|
<string name="normal">Normal</string>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="widget_note">Note used in widget</string>
|
<string name="widget_note">Note used in widget</string>
|
||||||
|
<string name="links_and_emails_clickable">Make links and emails clickable</string>
|
||||||
<string name="note_font_size">Note font size</string>
|
<string name="note_font_size">Note font size</string>
|
||||||
<string name="small">Small</string>
|
<string name="small">Small</string>
|
||||||
<string name="normal">Normal</string>
|
<string name="normal">Normal</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user