Archived
Implemented settings for text size, text transparency, font style, highlight style, highlight transparency, and randomised entry order; fixed a bug in QuoteAdapter.onRowMoved()
This commit is contained in:
@@ -11,6 +11,7 @@ import com.denizd.textbasic.R
|
|||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
|
|
||||||
|
|
||||||
class QuoteAdapter(
|
class QuoteAdapter(
|
||||||
quotes: List<String>,
|
quotes: List<String>,
|
||||||
private val onDeleteListener: OnDeleteListener,
|
private val onDeleteListener: OnDeleteListener,
|
||||||
@@ -73,7 +74,7 @@ class QuoteAdapter(
|
|||||||
override fun onRowMoved(from: Int, to: Int) {
|
override fun onRowMoved(from: Int, to: Int) {
|
||||||
if (from < to) for (i in from until to) {
|
if (from < to) for (i in from until to) {
|
||||||
Collections.swap(mutableQuotes, i, i + 1)
|
Collections.swap(mutableQuotes, i, i + 1)
|
||||||
} else for (i in to downTo from - 1) {
|
} else for (i in from downTo to + 1) {
|
||||||
Collections.swap(mutableQuotes, i, i - 1)
|
Collections.swap(mutableQuotes, i, i - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,22 +5,34 @@ import android.graphics.Color
|
|||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import com.denizd.textbasic.util.ColorTransparentUtils
|
import com.denizd.textbasic.util.ColorTransparentUtils
|
||||||
import com.denizd.textbasic.R
|
import com.denizd.textbasic.R
|
||||||
|
import com.denizd.textbasic.util.SettingsPreference
|
||||||
|
|
||||||
class QuoteStorage(context: Context) {
|
class QuoteStorage private constructor(context: Context) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
private lateinit var storage: QuoteStorage
|
||||||
|
|
||||||
|
fun getInstance(context: Context): QuoteStorage {
|
||||||
|
if (!::storage.isInitialized) {
|
||||||
|
synchronized(Object::class.java) {
|
||||||
|
storage = QuoteStorage(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return storage
|
||||||
|
}
|
||||||
|
|
||||||
const val PREF_NAME = "textbasicprefs"
|
const val PREF_NAME = "textbasicprefs"
|
||||||
const val PREF_BACKUP_KEY = "textbasicprefskey"
|
const val PREF_BACKUP_KEY = "textbasicprefskey"
|
||||||
const val SEPARATOR = '\uFFFF'
|
const val SEPARATOR = '\uFFFF'
|
||||||
|
|
||||||
private const val KEY_QUOTES = "quotes"
|
private const val KEY_QUOTES = "quotes"
|
||||||
private const val KEY_QUOTE_COUNTER = "quotecounter"
|
private const val KEY_QUOTE_COUNTER = "quotecounter"
|
||||||
private const val KEY_TEXT_SIZE = "textsize"
|
const val KEY_TEXT_SIZE = "textsize"
|
||||||
private const val KEY_INVERTED = "inverted"
|
private const val KEY_INVERTED = "inverted"
|
||||||
private const val KEY_HIGH_CONTRAST = "hicontrast"
|
private const val KEY_HIGH_CONTRAST = "hicontrast"
|
||||||
private const val KEY_TEXT_TRANSPARENCY = "transparency_text"
|
const val KEY_TEXT_TRANSPARENCY = "transparency_text"
|
||||||
private const val KEY_BG_TRANSPARENCY = "transparency"
|
const val KEY_BG_TRANSPARENCY = "transparency"
|
||||||
private const val KEY_RANDOM = "random"
|
private const val KEY_RANDOM = "random"
|
||||||
private const val KEY_WIDGET_POSITION = "widgetposition"
|
private const val KEY_WIDGET_POSITION = "widgetposition"
|
||||||
private const val KEY_BACKGROUND_TYPE = "backgroundtype"
|
private const val KEY_BACKGROUND_TYPE = "backgroundtype"
|
||||||
@@ -52,13 +64,43 @@ class QuoteStorage(context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getTextSize() = prefs.getInt(KEY_TEXT_SIZE, 18)
|
fun getTextSize() = prefs.getInt(KEY_TEXT_SIZE, 18)
|
||||||
|
fun setTextSize(newValue: Int) {
|
||||||
|
prefs.edit().putInt(KEY_TEXT_SIZE, newValue).apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getInt(
|
||||||
|
pref: SettingsPreference,
|
||||||
|
defaultValue: Int = 0,
|
||||||
|
): Int = prefs.getInt(pref.key, defaultValue)
|
||||||
|
fun setInt(
|
||||||
|
pref: SettingsPreference,
|
||||||
|
newValue: Int,
|
||||||
|
) {
|
||||||
|
prefs.edit().putInt(pref.key, newValue).apply()
|
||||||
|
}
|
||||||
|
|
||||||
fun isInvertedEnabled(): Boolean = prefs.getBoolean(KEY_INVERTED, false)
|
fun isInvertedEnabled(): Boolean = prefs.getBoolean(KEY_INVERTED, false)
|
||||||
fun getTextTransparency(): Int = prefs.getInt(KEY_TEXT_TRANSPARENCY, 100)
|
fun getTextTransparency(): Int = prefs.getInt(KEY_TEXT_TRANSPARENCY, 100)
|
||||||
|
fun setTextTransparency(newValue: Int) {
|
||||||
|
prefs.edit().putInt(KEY_TEXT_TRANSPARENCY, newValue).apply()
|
||||||
|
}
|
||||||
fun getBackgroundTransparency(): Int = prefs.getInt(KEY_BG_TRANSPARENCY, 100)
|
fun getBackgroundTransparency(): Int = prefs.getInt(KEY_BG_TRANSPARENCY, 100)
|
||||||
|
fun setBackgroundTransparency(newValue: Int) {
|
||||||
|
prefs.edit().putInt(KEY_BG_TRANSPARENCY, newValue).apply()
|
||||||
|
}
|
||||||
fun isOrderRandom(): Boolean = prefs.getBoolean(KEY_RANDOM, false)
|
fun isOrderRandom(): Boolean = prefs.getBoolean(KEY_RANDOM, false)
|
||||||
|
fun setIsOrderRandom(newValue: Boolean) {
|
||||||
|
prefs.edit().putBoolean(KEY_RANDOM, newValue).apply()
|
||||||
|
}
|
||||||
|
|
||||||
fun getWidgetGravity(): Int = prefs.getInt(KEY_WIDGET_POSITION, 1)
|
fun getWidgetGravity(): Int = prefs.getInt(KEY_WIDGET_POSITION, 1)
|
||||||
fun getBackgroundType(): Int = prefs.getInt(KEY_BACKGROUND_TYPE, 0)
|
fun setWidgetGravity(newValue: Int) {
|
||||||
|
prefs.edit().putInt(KEY_WIDGET_POSITION, newValue).apply()
|
||||||
|
}
|
||||||
|
fun getBackgroundType(): Int = prefs.getInt(KEY_BACKGROUND_TYPE, 3) // default none
|
||||||
|
fun setBackgroundType(newValue: Int) {
|
||||||
|
prefs.edit().putInt(KEY_BACKGROUND_TYPE, newValue).apply()
|
||||||
|
}
|
||||||
fun getTypefaceIndex(): Int = prefs.getInt(KEY_TYPEFACE, 0)
|
fun getTypefaceIndex(): Int = prefs.getInt(KEY_TYPEFACE, 0)
|
||||||
fun getTypeface(): Typeface = Typeface.create(
|
fun getTypeface(): Typeface = Typeface.create(
|
||||||
when (getTypefaceIndex()) {
|
when (getTypefaceIndex()) {
|
||||||
@@ -69,6 +111,9 @@ class QuoteStorage(context: Context) {
|
|||||||
getTypefaceStyle()
|
getTypefaceStyle()
|
||||||
)
|
)
|
||||||
fun getTypefaceStyle(): Int = prefs.getInt(KEY_TYPEFACE_STYLE, 0)
|
fun getTypefaceStyle(): Int = prefs.getInt(KEY_TYPEFACE_STYLE, 0)
|
||||||
|
fun setTypefaceStyle(newValue: Int) {
|
||||||
|
prefs.edit().putInt(KEY_TYPEFACE_STYLE, newValue).apply()
|
||||||
|
}
|
||||||
fun getOutlineSize(): Float = prefs.getFloat(KEY_OUTLINE_SIZE, 8f)
|
fun getOutlineSize(): Float = prefs.getFloat(KEY_OUTLINE_SIZE, 8f)
|
||||||
|
|
||||||
// Pair<text colour, background colour>
|
// Pair<text colour, background colour>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class QuoteFragment : BaseFragment(R.layout.fragment_quote), QuoteAdapter.OnDele
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
storage = QuoteStorage(context)
|
storage = QuoteStorage.getInstance(context)
|
||||||
quoteAdapter = QuoteAdapter(storage.getAllQuotes(), this)
|
quoteAdapter = QuoteAdapter(storage.getAllQuotes(), this)
|
||||||
|
|
||||||
binding.recyclerView.layoutManager = LinearLayoutManager(context)
|
binding.recyclerView.layoutManager = LinearLayoutManager(context)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class SettingsFragment : BaseFragment(R.layout.fragment_settings) {
|
|||||||
|
|
||||||
// TODO a lot of the buttons don't at all do what they're supposed to do!
|
// TODO a lot of the buttons don't at all do what they're supposed to do!
|
||||||
|
|
||||||
storage = QuoteStorage(context)
|
storage = QuoteStorage.getInstance(context)
|
||||||
|
|
||||||
gravityButtons = arrayOf(
|
gravityButtons = arrayOf(
|
||||||
binding.buttonTopLeft, binding.buttonTopMiddle, binding.buttonTopRight,
|
binding.buttonTopLeft, binding.buttonTopMiddle, binding.buttonTopRight,
|
||||||
|
|||||||
@@ -1,10 +1,228 @@
|
|||||||
package com.denizd.textbasic.fragment
|
package com.denizd.textbasic.fragment
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.denizd.textbasic.BuildConfig
|
||||||
import com.denizd.textbasic.R
|
import com.denizd.textbasic.R
|
||||||
import com.denizd.textbasic.databinding.FragmentSettingsNewBinding
|
import com.denizd.textbasic.databinding.FragmentSettingsNewBinding
|
||||||
|
import com.denizd.textbasic.db.QuoteStorage
|
||||||
|
import com.denizd.textbasic.util.SettingsPreference
|
||||||
import com.denizd.textbasic.util.viewBinding
|
import com.denizd.textbasic.util.viewBinding
|
||||||
|
import com.google.android.material.button.MaterialButton
|
||||||
|
|
||||||
class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
||||||
|
|
||||||
|
private lateinit var storage: QuoteStorage
|
||||||
|
|
||||||
private val binding: FragmentSettingsNewBinding by viewBinding(FragmentSettingsNewBinding::bind)
|
private val binding: FragmentSettingsNewBinding by viewBinding(FragmentSettingsNewBinding::bind)
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
storage = QuoteStorage.getInstance(context)
|
||||||
|
|
||||||
|
// --- font style --- //
|
||||||
|
binding.toggleGroupFont.apply {
|
||||||
|
check(when (storage.getTypefaceStyle()) {
|
||||||
|
1 -> R.id.toggle_button_font_bold
|
||||||
|
2 -> R.id.toggle_button_font_italic
|
||||||
|
3 -> R.id.toggle_button_font_bold_italic
|
||||||
|
else -> R.id.toggle_button_font_default
|
||||||
|
})
|
||||||
|
|
||||||
|
addOnButtonCheckedListener { _, checkedId, isChecked ->
|
||||||
|
if (isChecked) {
|
||||||
|
storage.setTypefaceStyle(when (checkedId) {
|
||||||
|
R.id.toggle_button_font_bold -> 1
|
||||||
|
R.id.toggle_button_font_italic -> 2
|
||||||
|
R.id.toggle_button_font_bold_italic -> 3
|
||||||
|
else -> 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- text size --- //
|
||||||
|
binding.textSize.text = storage.getInt(SettingsPreference.TEXT_SIZE, 18).toString()
|
||||||
|
|
||||||
|
binding.buttonSizeDecreaseFast.setOnClickAction(
|
||||||
|
4,
|
||||||
|
256,
|
||||||
|
isPositive = false,
|
||||||
|
isFast = true,
|
||||||
|
binding.textSize,
|
||||||
|
SettingsPreference.TEXT_SIZE,
|
||||||
|
)
|
||||||
|
binding.buttonSizeDecrease.setOnClickAction(
|
||||||
|
4,
|
||||||
|
256,
|
||||||
|
isPositive = false,
|
||||||
|
isFast = false,
|
||||||
|
binding.textSize,
|
||||||
|
SettingsPreference.TEXT_SIZE,
|
||||||
|
)
|
||||||
|
binding.buttonSizeIncrease.setOnClickAction(
|
||||||
|
4,
|
||||||
|
256,
|
||||||
|
isPositive = true,
|
||||||
|
isFast = false,
|
||||||
|
binding.textSize,
|
||||||
|
SettingsPreference.TEXT_SIZE,
|
||||||
|
)
|
||||||
|
binding.buttonSizeIncreaseFast.setOnClickAction(
|
||||||
|
4,
|
||||||
|
256,
|
||||||
|
isPositive = true,
|
||||||
|
isFast = true,
|
||||||
|
binding.textSize,
|
||||||
|
SettingsPreference.TEXT_SIZE,
|
||||||
|
)
|
||||||
|
|
||||||
|
// --- text transparency --- //
|
||||||
|
binding.textTransparency.text = storage.getInt(SettingsPreference.TEXT_TRANSPARENCY, 100).toString()
|
||||||
|
|
||||||
|
binding.buttonTextTransparencyDecreaseFast.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = false,
|
||||||
|
isFast = true,
|
||||||
|
binding.textTransparency,
|
||||||
|
SettingsPreference.TEXT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
binding.buttonTextTransparencyDecrease.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = false,
|
||||||
|
isFast = false,
|
||||||
|
binding.textTransparency,
|
||||||
|
SettingsPreference.TEXT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
binding.buttonTextTransparencyIncrease.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = true,
|
||||||
|
isFast = false,
|
||||||
|
binding.textTransparency,
|
||||||
|
SettingsPreference.TEXT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
binding.buttonTextTransparencyIncreaseFast.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = true,
|
||||||
|
isFast = true,
|
||||||
|
binding.textTransparency,
|
||||||
|
SettingsPreference.TEXT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
|
||||||
|
// --- highlight style --- //
|
||||||
|
binding.toggleGroupHighlightStyle.apply {
|
||||||
|
check(when (storage.getBackgroundType()) {
|
||||||
|
0 -> R.id.toggle_button_highlight_background
|
||||||
|
1 -> R.id.toggle_button_highlight_stroke
|
||||||
|
2 -> R.id.toggle_button_highlight_shadow
|
||||||
|
else -> R.id.toggle_button_highlight_none // 3
|
||||||
|
})
|
||||||
|
|
||||||
|
addOnButtonCheckedListener { _, checkedId, isChecked ->
|
||||||
|
if (isChecked) {
|
||||||
|
storage.setBackgroundType(when (checkedId) {
|
||||||
|
R.id.toggle_button_highlight_background -> 0
|
||||||
|
R.id.toggle_button_highlight_stroke -> 1
|
||||||
|
R.id.toggle_button_highlight_shadow -> 2
|
||||||
|
else -> 3 // none
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- text highlight transparency --- //
|
||||||
|
binding.textHighlightTransparency.text = storage.getInt(SettingsPreference.HIGHLIGHT_TRANSPARENCY, 100).toString()
|
||||||
|
|
||||||
|
binding.buttonHighlightTransparencyDecreaseFast.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = false,
|
||||||
|
isFast = true,
|
||||||
|
binding.textHighlightTransparency,
|
||||||
|
SettingsPreference.HIGHLIGHT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
binding.buttonHighlightTransparencyDecrease.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = false,
|
||||||
|
isFast = false,
|
||||||
|
binding.textHighlightTransparency,
|
||||||
|
SettingsPreference.HIGHLIGHT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
binding.buttonHighlightTransparencyIncrease.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = true,
|
||||||
|
isFast = false,
|
||||||
|
binding.textHighlightTransparency,
|
||||||
|
SettingsPreference.HIGHLIGHT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
binding.buttonHighlightTransparencyIncreaseFast.setOnClickAction(
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
isPositive = true,
|
||||||
|
isFast = true,
|
||||||
|
binding.textHighlightTransparency,
|
||||||
|
SettingsPreference.HIGHLIGHT_TRANSPARENCY,
|
||||||
|
)
|
||||||
|
|
||||||
|
// --- randomise order entries --- //
|
||||||
|
binding.switchOrderRandom.apply {
|
||||||
|
isChecked = storage.isOrderRandom()
|
||||||
|
|
||||||
|
setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
storage.setIsOrderRandom(isChecked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Display the app's version as set in the build.gradle. Also display if the app is a
|
||||||
|
* development version, and if so, display build timestamp.
|
||||||
|
*/
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
binding.appVersionText.text =
|
||||||
|
"${BuildConfig.VERSION_NAME}-${if (BuildConfig.DEBUG) "dev" else "release"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO horrible, horrible, horrible function. but it works. fix this in the future. please.
|
||||||
|
private fun MaterialButton.setOnClickAction(
|
||||||
|
min: Int,
|
||||||
|
max: Int,
|
||||||
|
isPositive: Boolean,
|
||||||
|
isFast: Boolean,
|
||||||
|
textField: TextView,
|
||||||
|
pref: SettingsPreference,
|
||||||
|
) {
|
||||||
|
setOnClickListener {
|
||||||
|
var value = storage.getInt(pref)
|
||||||
|
if (isFast) {
|
||||||
|
if (isPositive) {
|
||||||
|
if ((value + 10) > max) {
|
||||||
|
value = max
|
||||||
|
} else {
|
||||||
|
value += 10
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((value - 10) < min) {
|
||||||
|
value = min
|
||||||
|
} else {
|
||||||
|
value -= 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isPositive && (value != max)) value += 1
|
||||||
|
if (!isPositive && (value != min)) value -= 1
|
||||||
|
}
|
||||||
|
|
||||||
|
storage.setInt(pref, value)
|
||||||
|
textField.text = value.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.denizd.textbasic.util
|
||||||
|
|
||||||
|
import com.denizd.textbasic.db.QuoteStorage
|
||||||
|
|
||||||
|
enum class SettingsPreference(val key: String) {
|
||||||
|
TEXT_SIZE(QuoteStorage.KEY_TEXT_SIZE),
|
||||||
|
TEXT_TRANSPARENCY(QuoteStorage.KEY_TEXT_TRANSPARENCY),
|
||||||
|
HIGHLIGHT_INTENSITY(""), // TODO
|
||||||
|
HIGHLIGHT_TRANSPARENCY(QuoteStorage.KEY_BG_TRANSPARENCY),
|
||||||
|
;
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@ class CanvasText {
|
|||||||
|
|
||||||
val previewSize = 20f
|
val previewSize = 20f
|
||||||
|
|
||||||
val storage = QuoteStorage(context)
|
val storage = QuoteStorage.getInstance(context)
|
||||||
|
|
||||||
size?.let {
|
size?.let {
|
||||||
storage.setSize(size)
|
storage.setSize(size)
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M17.59,18l1.41,-1.41l-4.58,-4.59l4.58,-4.59l-1.41,-1.41l-6,6z"/>
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M11,18l1.41,-1.41l-4.58,-4.59l4.58,-4.59l-1.41,-1.41l-6,6z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M6.41,6l-1.41,1.41l4.58,4.59l-4.58,4.59l1.41,1.41l6,-6z"/>
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M13,6l-1.41,1.41l4.58,4.59l-4.58,4.59l1.41,1.41l6,-6z"/>
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/selectable_item_ripple" />
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?attr/colorSecondaryContainer"/>
|
||||||
@@ -189,7 +189,7 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||||
android:id="@+id/toggle_button_font_bolditalic"
|
android:id="@+id/toggle_button_font_bold_italic"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -224,6 +224,16 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_size_decrease_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_left"
|
||||||
|
android:layout_marginEnd="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_size_decrease"
|
android:id="@+id/button_size_decrease"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
@@ -250,6 +260,16 @@
|
|||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
app:iconPadding="0dp"/>
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_size_increase_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_right"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
@@ -276,6 +296,16 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_text_transparency_decrease_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_left"
|
||||||
|
android:layout_marginEnd="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_text_transparency_decrease"
|
android:id="@+id/button_text_transparency_decrease"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
@@ -302,6 +332,16 @@
|
|||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
app:iconPadding="0dp"/>
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_text_transparency_increase_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_right"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
@@ -434,6 +474,16 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_intensity_decrease_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_left"
|
||||||
|
android:layout_marginEnd="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_intensity_decrease"
|
android:id="@+id/button_intensity_decrease"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
@@ -460,6 +510,16 @@
|
|||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
app:iconPadding="0dp"/>
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_intensity_increase_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_right"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
@@ -486,6 +546,16 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_highlight_transparency_decrease_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_left"
|
||||||
|
android:layout_marginEnd="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_highlight_transparency_decrease"
|
android:id="@+id/button_highlight_transparency_decrease"
|
||||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
@@ -512,6 +582,16 @@
|
|||||||
android:minWidth="0dp"
|
android:minWidth="0dp"
|
||||||
app:iconPadding="0dp"/>
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/button_highlight_transparency_increase_fast"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/double_arrow_right"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:minWidth="0dp"
|
||||||
|
app:iconPadding="0dp"/>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
@@ -551,13 +631,22 @@
|
|||||||
android:layout_marginHorizontal="16dp" />
|
android:layout_marginHorizontal="16dp" />
|
||||||
|
|
||||||
<!-- Order entries -->
|
<!-- Order entries -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/layout_pref_colour"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingHorizontal="16dp"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:paddingVertical="8dp">
|
app:layout_constraintEnd_toStartOf="@+id/switch_order_random"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -572,35 +661,76 @@
|
|||||||
android:text="@string/settings_widget_order_subtitle"
|
android:text="@string/settings_widget_order_subtitle"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButtonToggleGroup
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
android:id="@+id/toggle_group_order"
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/switch_order_random"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<!-- Miscellaneous settings -->
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
style="@style/Widget.Material3.CardView.Outlined"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:layout_marginHorizontal="8dp"
|
||||||
app:singleSelection="true"
|
android:layout_marginVertical="4dp">
|
||||||
app:selectionRequired="true">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/toggle_button_order_default"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_widget_order_default"
|
android:orientation="vertical"
|
||||||
android:textColor="@color/list_group_button"
|
android:paddingBottom="8dp">
|
||||||
app:strokeColor="?attr/colorOutlineVariant"/>
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<TextView
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/toggle_button_order_random"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/settings_widget_order_random"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:textColor="@color/list_group_button"
|
android:layout_marginTop="16dp"
|
||||||
app:strokeColor="?attr/colorOutlineVariant"/>
|
android:layout_marginBottom="8dp"
|
||||||
|
android:fontFamily="@font/mono_bold_italic"
|
||||||
|
android:text="@string/settings_misc_header"
|
||||||
|
android:textSize="22sp" />
|
||||||
|
|
||||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
<com.google.android.material.divider.MaterialDivider
|
||||||
|
style="@style/DividerTheme"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="16dp" />
|
||||||
|
|
||||||
|
<!-- App version -->
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/button_app_version"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/selectable_item_background"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
|
android:paddingVertical="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/mono_semibold_italic"
|
||||||
|
android:text="@string/settings_misc_app_version"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/app_version_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|||||||
@@ -46,12 +46,15 @@
|
|||||||
<string name="settings_highlight_transparency_header">Highlight-Transparenz</string>
|
<string name="settings_highlight_transparency_header">Highlight-Transparenz</string>
|
||||||
|
|
||||||
<string name="settings_widget_header">Widget</string>
|
<string name="settings_widget_header">Widget</string>
|
||||||
<string name="settings_widget_order_title">Stelle Reihenfolge ein</string>
|
<string name="settings_widget_order_title">Nutze zufällige Reihenfolge</string>
|
||||||
<string name="settings_widget_order_subtitle">Dies ist die Reihenfolge, in welcher deine Einträge angezeigt werden, wenn du auf das Widget klickst</string>
|
<string name="settings_widget_order_subtitle">Sonst wird die Reihenfolge der Liste genutzt; ändere sie durch D rag & Drop</string>
|
||||||
<string name="settings_widget_order_default">Standard</string>
|
<string name="settings_widget_order_default">Standard</string>
|
||||||
<string name="settings_widget_order_random">Zufall</string>
|
<string name="settings_widget_order_random">Zufall</string>
|
||||||
<string name="settings_widget_position_title">Setze Position des Texts</string>
|
<string name="settings_widget_position_title">Setze Position des Texts</string>
|
||||||
|
|
||||||
|
<string name="settings_misc_header">Sonstiges</string>
|
||||||
|
<string name="settings_misc_app_version">App-Version</string>
|
||||||
|
|
||||||
<string name="edit">Text bearbeiten</string>
|
<string name="edit">Text bearbeiten</string>
|
||||||
<string name="nav_items_entries">Einträge</string>
|
<string name="nav_items_entries">Einträge</string>
|
||||||
<string name="guide">Anleitung</string>
|
<string name="guide">Anleitung</string>
|
||||||
|
|||||||
@@ -45,12 +45,15 @@
|
|||||||
<string name="settings_highlight_transparency_header">Transparency</string>
|
<string name="settings_highlight_transparency_header">Transparency</string>
|
||||||
|
|
||||||
<string name="settings_widget_header">Widget</string>
|
<string name="settings_widget_header">Widget</string>
|
||||||
<string name="settings_widget_order_title">Set entry order</string>
|
<string name="settings_widget_order_title">Randomise entry order</string>
|
||||||
<string name="settings_widget_order_subtitle">This is the order in which your entries will be shown when you click on the widget</string>
|
<string name="settings_widget_order_subtitle">Order from the list is preserved otherwise; change by drag-and-drop</string>
|
||||||
<string name="settings_widget_order_default">Default</string>
|
<string name="settings_widget_order_default">Default</string>
|
||||||
<string name="settings_widget_order_random">Random</string>
|
<string name="settings_widget_order_random">Random</string>
|
||||||
<string name="settings_widget_position_title">Set position of the text</string>
|
<string name="settings_widget_position_title">Set position of the text</string>
|
||||||
|
|
||||||
|
<string name="settings_misc_header">Miscellaneous</string>
|
||||||
|
<string name="settings_misc_app_version">App Version</string>
|
||||||
|
|
||||||
<string name="edit">Edit Text</string>
|
<string name="edit">Edit Text</string>
|
||||||
<string name="nav_items_entries">Entries</string>
|
<string name="nav_items_entries">Entries</string>
|
||||||
<string name="guide">Guide</string>
|
<string name="guide">Guide</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user