Archived
Removed old settings fragment; added licences button; added ColorPickerView dependency, to be used to pick colours for text and highlight; removed transparency settings in favour of ColorPickerView
This commit is contained in:
+3
-1
@@ -11,7 +11,7 @@ android {
|
||||
minSdk 23
|
||||
targetSdk 33
|
||||
versionCode 6
|
||||
versionName "1.3.0"
|
||||
versionName "2.0.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -52,4 +52,6 @@ dependencies {
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
||||
implementation "com.github.skydoves:colorpickerview:2.2.4"
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.denizd.textbasic.fragment
|
||||
import android.content.Context
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.denizd.textbasic.sheet.AppSheet
|
||||
|
||||
open class BaseFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) {
|
||||
|
||||
@@ -14,4 +15,13 @@ open class BaseFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) {
|
||||
}
|
||||
|
||||
override fun getContext(): Context = _context
|
||||
|
||||
/**
|
||||
* Opens a bottom sheet. Sheet must be a subclass of [com.denizd.textbasic.sheet.AppSheet].
|
||||
*
|
||||
* @param sheet element that will be displayed
|
||||
*/
|
||||
protected fun openBottomSheet(sheet: AppSheet) {
|
||||
sheet.show(childFragmentManager, sheet.javaClass.simpleName)
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,10 @@ package com.denizd.textbasic.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import com.denizd.textbasic.R
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
|
||||
class GuideFragment : BaseFragment(R.layout.fragment_guide) {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
exitTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false)
|
||||
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true)
|
||||
|
||||
enterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true)
|
||||
returnTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false)
|
||||
}
|
||||
}
|
||||
@@ -1,286 +0,0 @@
|
||||
package com.denizd.textbasic.fragment
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.*
|
||||
import androidx.annotation.ColorInt
|
||||
import com.denizd.textbasic.util.ColorTransparentUtils
|
||||
import com.denizd.textbasic.db.QuoteStorage
|
||||
import com.denizd.textbasic.R
|
||||
import com.denizd.textbasic.databinding.FragmentSettingsBinding
|
||||
import com.denizd.textbasic.util.viewBinding
|
||||
import com.denizd.textbasic.widget.CanvasText
|
||||
import com.google.android.material.transition.MaterialSharedAxis
|
||||
import java.lang.reflect.Field
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
class SettingsFragment : BaseFragment(R.layout.fragment_settings) {
|
||||
|
||||
private lateinit var storage: QuoteStorage
|
||||
private lateinit var gravityButtons: Array<ImageButton>
|
||||
|
||||
private var widgetGravity = 4
|
||||
private var backgroundIndex = 0
|
||||
private var typefaceIndex = 0
|
||||
private var typefaceStyleIndex = 0
|
||||
|
||||
private val binding: FragmentSettingsBinding by viewBinding(FragmentSettingsBinding::bind)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
exitTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false)
|
||||
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true)
|
||||
|
||||
enterTransition = MaterialSharedAxis(MaterialSharedAxis.Z, true)
|
||||
returnTransition = MaterialSharedAxis(MaterialSharedAxis.Z, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// binding.animationLl.animateLayoutChanges(true)
|
||||
|
||||
// TODO a lot of the buttons don't at all do what they're supposed to do!
|
||||
|
||||
storage = QuoteStorage.getInstance(context)
|
||||
|
||||
gravityButtons = arrayOf(
|
||||
binding.buttonTopLeft, binding.buttonTopMiddle, binding.buttonTopRight,
|
||||
binding.buttonMiddleLeft, binding.buttonMiddleMiddle, binding.buttonMiddleRight,
|
||||
binding.buttonBottomLeft, binding.buttonBottomMiddle, binding.buttonBottomRight
|
||||
)
|
||||
|
||||
widgetGravity = storage.getWidgetGravity()
|
||||
|
||||
binding.textSizePicker.apply {
|
||||
minValue = 1
|
||||
maxValue = 168
|
||||
descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
||||
wrapSelectorWheel = false
|
||||
value = storage.getTextSize()
|
||||
|
||||
setOnValueChangedListener { _, _, _ ->
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.textTransparencyPicker.apply {
|
||||
minValue = 0
|
||||
maxValue = 20
|
||||
val formatter = NumberPicker.Formatter { value ->
|
||||
val temp = value * 5
|
||||
"" + temp
|
||||
}
|
||||
setFormatter(formatter)
|
||||
descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
||||
wrapSelectorWheel = false
|
||||
value = storage.getBackgroundTransparency()
|
||||
|
||||
// Do not touch - fix for value on spinner not showing up until touched
|
||||
val f: Field = NumberPicker::class.java.getDeclaredField("mInputText")
|
||||
f.isAccessible = true
|
||||
val inputText: EditText = f.get(binding.textTransparencyPicker) as EditText
|
||||
inputText.filters = arrayOfNulls(0)
|
||||
|
||||
setOnValueChangedListener { _, _, _ ->
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.bgTransparencyPicker.apply {
|
||||
minValue = 0
|
||||
maxValue = 20
|
||||
val formatter = NumberPicker.Formatter { value ->
|
||||
val temp = value * 5
|
||||
"" + temp
|
||||
}
|
||||
setFormatter(formatter)
|
||||
descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
||||
wrapSelectorWheel = false
|
||||
value = storage.getBackgroundTransparency()
|
||||
|
||||
// Do not touch - fix for value on spinner not showing up until touched
|
||||
val f: Field = NumberPicker::class.java.getDeclaredField("mInputText")
|
||||
f.isAccessible = true
|
||||
val inputText: EditText = f.get(binding.bgTransparencyPicker) as EditText
|
||||
inputText.filters = arrayOfNulls(0)
|
||||
|
||||
setOnValueChangedListener { _, _, _ ->
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.outlinePicker.apply {
|
||||
minValue = 0
|
||||
maxValue = 64
|
||||
descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
||||
wrapSelectorWheel = false
|
||||
value = storage.getOutlineSize().toInt()
|
||||
|
||||
setOnValueChangedListener { _, _, _ ->
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
binding.switchInvert.apply {
|
||||
isChecked = storage.isInvertedEnabled()
|
||||
|
||||
setOnCheckedChangeListener { _, _ ->
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.switchRandom.apply {
|
||||
isChecked = storage.isOrderRandom()
|
||||
|
||||
setOnCheckedChangeListener { _, _ ->
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.typefaceToggleButton.apply {
|
||||
typefaceIndex = storage.getTypefaceIndex()
|
||||
|
||||
check(when (typefaceStyleIndex) {
|
||||
2 -> R.id.button3_monospace
|
||||
1 -> R.id.button2_serif
|
||||
else -> R.id.button1_sansserif
|
||||
})
|
||||
|
||||
addOnButtonCheckedListener { group, checkedId, isChecked ->
|
||||
typefaceIndex = when (checkedId) {
|
||||
R.id.button3_monospace -> 2
|
||||
R.id.button2_serif -> 1
|
||||
else -> 0
|
||||
}
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.typefaceStyleToggleButton.apply {
|
||||
typefaceStyleIndex = storage.getTypefaceStyle()
|
||||
|
||||
check(when (typefaceStyleIndex) {
|
||||
3 -> R.id.button4_bold_italics
|
||||
2 -> R.id.button3_italics
|
||||
1 -> R.id.button2_bold
|
||||
else -> R.id.button1_normal
|
||||
})
|
||||
|
||||
addOnButtonCheckedListener { group, checkedId, isChecked ->
|
||||
typefaceStyleIndex = when (checkedId) {
|
||||
R.id.button4_bold_italics -> 3
|
||||
R.id.button3_italics -> 2
|
||||
R.id.button2_bold -> 1
|
||||
else -> 0
|
||||
}
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
binding.backgroundToggleButton.apply {
|
||||
backgroundIndex = storage.getBackgroundType()
|
||||
|
||||
check(when (backgroundIndex) {
|
||||
2 -> R.id.button3_shadow
|
||||
1 -> R.id.button2_outline
|
||||
else -> R.id.button1_background
|
||||
})
|
||||
|
||||
addOnButtonCheckedListener { group, checkedId, isChecked ->
|
||||
backgroundIndex = when (checkedId) {
|
||||
R.id.button3_shadow -> 2
|
||||
R.id.button2_outline -> 1
|
||||
else -> 0
|
||||
}
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
gravityButtons.forEachIndexed { index, button ->
|
||||
button.setOnClickListener {
|
||||
widgetGravity = index
|
||||
setGravityButtons()
|
||||
updatePreview()
|
||||
}
|
||||
}
|
||||
|
||||
setGravityButtons()
|
||||
updatePreview()
|
||||
}
|
||||
|
||||
private fun setGravityButtons() {
|
||||
val transparent = context.getColor(android.R.color.transparent)
|
||||
|
||||
gravityButtons.forEach { button ->
|
||||
button.setBackgroundColor(transparent)
|
||||
}
|
||||
|
||||
val typedValue = TypedValue()
|
||||
context.theme.resolveAttribute(R.attr.colorSecContainer, typedValue, true)
|
||||
@ColorInt val colorTertiary = typedValue.data
|
||||
|
||||
gravityButtons[widgetGravity].setBackgroundColor(colorTertiary)
|
||||
}
|
||||
|
||||
private fun updatePreview() {
|
||||
|
||||
save()
|
||||
|
||||
if (backgroundIndex == 0) {
|
||||
binding.outlineTextview.visibility = View.GONE
|
||||
binding.outlinePicker.visibility = View.GONE
|
||||
} else {
|
||||
binding.outlineTextview.visibility = View.VISIBLE
|
||||
binding.outlinePicker.visibility = View.VISIBLE
|
||||
if (backgroundIndex == 1) {
|
||||
binding.outlineTextview.text = getString(R.string.thickness)
|
||||
} else {
|
||||
binding.outlineTextview.text = getString(R.string.intensity)
|
||||
}
|
||||
}
|
||||
|
||||
binding.textPreviewBackgroundDark.setBackgroundColor(
|
||||
Color.parseColor(
|
||||
ColorTransparentUtils.transparentColor(
|
||||
context.getColor(R.color.md_theme_dark_background),
|
||||
if (storage.isInvertedEnabled()) {
|
||||
abs((storage.getBackgroundTransparency() * 5))
|
||||
} else {
|
||||
abs((storage.getBackgroundTransparency() * 5) - 100)
|
||||
}
|
||||
))
|
||||
)
|
||||
|
||||
val bitmap = CanvasText.drawText(context, true)
|
||||
|
||||
binding.textPreview.setImageBitmap(bitmap)
|
||||
}
|
||||
|
||||
private fun save() {
|
||||
storage.saveSettings(
|
||||
textSize = binding.textSizePicker.value,
|
||||
inverted = binding.switchInvert.isChecked,
|
||||
textTransparency = binding.textTransparencyPicker.value,
|
||||
bgTransparency = binding.bgTransparencyPicker.value,
|
||||
random = binding.switchRandom.isChecked,
|
||||
widgetPosition = widgetGravity,
|
||||
backgroundType = backgroundIndex,
|
||||
typefaceIndex = typefaceIndex,
|
||||
typefaceStyleIndex = typefaceStyleIndex,
|
||||
outlineSize = binding.outlinePicker.value.toFloat()
|
||||
)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
save()
|
||||
super.onPause()
|
||||
}
|
||||
}
|
||||
@@ -4,18 +4,22 @@ import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageButton
|
||||
import android.widget.PopupMenu
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.transition.TransitionManager
|
||||
import com.denizd.textbasic.BuildConfig
|
||||
import com.denizd.textbasic.R
|
||||
import com.denizd.textbasic.databinding.FragmentSettingsNewBinding
|
||||
import com.denizd.textbasic.db.QuoteStorage
|
||||
import com.denizd.textbasic.sheet.TextSheet
|
||||
import com.denizd.textbasic.util.SettingsPreference
|
||||
import com.denizd.textbasic.util.viewBinding
|
||||
import com.denizd.textbasic.widget.CanvasText
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import java.util.Calendar
|
||||
|
||||
class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
||||
|
||||
@@ -142,42 +146,6 @@ class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
||||
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(checkBackgroundIntensity(storage.getBackgroundType()))
|
||||
@@ -244,42 +212,6 @@ class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
||||
SettingsPreference.HIGHLIGHT_INTENSITY,
|
||||
)
|
||||
|
||||
// --- 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()
|
||||
@@ -306,6 +238,21 @@ class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
||||
}
|
||||
}
|
||||
|
||||
// Set click listener for showing licences dialogue
|
||||
binding.buttonLicences.setOnClickListener {
|
||||
openBottomSheet(
|
||||
TextSheet().also { sheet ->
|
||||
val bundle = Bundle()
|
||||
bundle.putString("header", getString(R.string.sheet_licences_header))
|
||||
bundle.putString("content", getString(
|
||||
R.string.sheet_licences_content,
|
||||
Calendar.getInstance().get(Calendar.YEAR).toString(),
|
||||
))
|
||||
sheet.arguments = bundle
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
@@ -335,24 +282,30 @@ class SettingsNewFragment : BaseFragment(R.layout.fragment_settings_new) {
|
||||
* Retrieves which button to check for the highlight, and sets the visibility of the intensity
|
||||
* modifying layout accordingly.
|
||||
*/
|
||||
private fun checkBackgroundIntensity(index: Int): Int = when (index) {
|
||||
private fun checkBackgroundIntensity(index: Int): Int {
|
||||
TransitionManager.beginDelayedTransition(binding.root.parent as ViewGroup)
|
||||
return when (index) {
|
||||
0 -> { // background
|
||||
binding.layoutIntensity.visibility = View.GONE
|
||||
R.id.toggle_button_highlight_background
|
||||
}
|
||||
|
||||
1 -> { // stroke
|
||||
binding.layoutIntensity.visibility = View.VISIBLE
|
||||
R.id.toggle_button_highlight_stroke
|
||||
}
|
||||
|
||||
2 -> { // shadow
|
||||
binding.layoutIntensity.visibility = View.VISIBLE
|
||||
R.id.toggle_button_highlight_shadow
|
||||
}
|
||||
|
||||
else -> { // none
|
||||
binding.layoutIntensity.visibility = View.GONE
|
||||
R.id.toggle_button_highlight_none
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO horrible, horrible, horrible function. but it works. fix this in the future. please.
|
||||
private fun MaterialButton.setOnClickAction(
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.denizd.textbasic.sheet
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.LayoutRes
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
|
||||
/**
|
||||
* Bottom sheet super class providing common functionality. All bottom sheets should inherit from
|
||||
* this.
|
||||
*
|
||||
* @param layoutId ID of the layout of the bottom sheet
|
||||
*/
|
||||
open class AppSheet(@LayoutRes private val layoutId: Int) : BottomSheetDialogFragment() {
|
||||
|
||||
// Internal context object
|
||||
private lateinit var _context: Context
|
||||
|
||||
/**
|
||||
* Get non-null context. Only valid after onAttach().
|
||||
*/
|
||||
override fun getContext(): Context = _context
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
_context = context
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
|
||||
LayoutInflater.from(context).inflate(layoutId, container, false)
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.denizd.textbasic.sheet
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.denizd.textbasic.R
|
||||
import com.denizd.textbasic.databinding.SheetTextBinding
|
||||
import com.denizd.textbasic.util.viewBinding
|
||||
|
||||
/**
|
||||
* Bottom sheet used for displaying any sort of text to the user.
|
||||
*/
|
||||
class TextSheet : AppSheet(R.layout.sheet_text) {
|
||||
|
||||
// View binding
|
||||
private val binding: SheetTextBinding by viewBinding(SheetTextBinding::bind)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// Retrieve headline for the window
|
||||
val header = arguments?.getString("header") ?: ""
|
||||
|
||||
// Check whether an ID has passed to use LiveData
|
||||
val content = arguments?.getString("content") ?: ""
|
||||
|
||||
binding.textHeader.text = header
|
||||
binding.textContent.text = content
|
||||
|
||||
// Set up a simple X button to be able to close the sheet
|
||||
binding.buttonCancel.setOnClickListener {
|
||||
// Do nothing and dismiss the sheet
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@ 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(QuoteStorage.KEY_OUTLINE_SIZE_NEW), // TODO
|
||||
TEXT_COLOUR("textcolour"),
|
||||
HIGHLIGHT_INTENSITY(QuoteStorage.KEY_OUTLINE_SIZE_NEW),
|
||||
HIGHLIGHT_TRANSPARENCY(QuoteStorage.KEY_BG_TRANSPARENCY),
|
||||
HIGHLIGHT_COLOUR("highlightcolour"),
|
||||
;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<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="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
@@ -1,569 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.SettingsFragment">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_fragment_title"
|
||||
android:textSize="28sp"
|
||||
android:fontFamily="@font/mono_bold_italic"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/text_preview_background_light"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/md_theme_light_background"
|
||||
app:layout_scrollFlags="scroll|snap">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/text_preview_background_dark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/md_theme_dark_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/text_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/widget_preview_content_desc"
|
||||
android:paddingHorizontal="4dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/settings_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/animation_ll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<com.denizd.textbasic.view.VerticalTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_size"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/mono_light"
|
||||
android:padding="4dp"/>
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/text_size_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="4dp"/>
|
||||
|
||||
<!-- TODO the following 4 elements are hidden but must be removed once their features are implemented custom -->
|
||||
<com.denizd.textbasic.view.VerticalTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_opacity"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/mono_light"
|
||||
android:visibility="gone"
|
||||
android:padding="4dp"/>
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/text_transparency_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginHorizontal="4dp"/>
|
||||
|
||||
<com.denizd.textbasic.view.VerticalTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bg_opacity"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/mono_light"
|
||||
android:visibility="gone"
|
||||
android:padding="4dp"/>
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/bg_transparency_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginHorizontal="4dp"/>
|
||||
|
||||
<com.denizd.textbasic.view.VerticalTextView
|
||||
android:id="@+id/outline_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/intensity"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/mono_light"
|
||||
android:padding="4dp"/>
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/outline_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="4dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- TODO this must be replaced with a custom solution later -->
|
||||
<com.google.android.material.button.MaterialButtonToggleGroup
|
||||
android:id="@+id/typeface_toggle_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button1_sansserif"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sansserif"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button2_serif"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/serif"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button3_monospace"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/monospace"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||
|
||||
<com.google.android.material.button.MaterialButtonToggleGroup
|
||||
android:id="@+id/typeface_style_toggle_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button1_normal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/normal"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button2_bold"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bold"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button3_italics"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/italics"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button4_bold_italics"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="4"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bold_italics"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||
|
||||
<com.google.android.material.button.MaterialButtonToggleGroup
|
||||
android:id="@+id/background_toggle_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:singleSelection="true"
|
||||
app:selectionRequired="true">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button1_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="4"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/background"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button2_outline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/outline"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button3_shadow"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/shadow"
|
||||
android:padding="1dp"
|
||||
style="?attr/materialButtonOutlinedStyle"/>
|
||||
|
||||
</com.google.android.material.button.MaterialButtonToggleGroup>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:id="@+id/text_layout_text_colour"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:maxLines="1"
|
||||
android:scrollHorizontally="true"
|
||||
android:hint="@string/text_colour_input_hint"
|
||||
app:boxStrokeColor="@color/selector_text_input"
|
||||
app:hintTextColor="@color/selector_text_input">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"
|
||||
android:maxLength="8"
|
||||
android:digits="abcdefABCDEF1234567890"
|
||||
android:id="@+id/edit_text_text_colour"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/preview_text_colour"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@drawable/rounded_shape"
|
||||
android:backgroundTint="@color/design_default_color_primary"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:id="@+id/text_layout_bg_colour"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:maxLines="1"
|
||||
android:scrollHorizontally="true"
|
||||
android:hint="@string/bg_colour_input_hint"
|
||||
app:boxStrokeColor="@color/selector_text_input"
|
||||
app:hintTextColor="@color/selector_text_input">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"
|
||||
android:maxLength="8"
|
||||
android:digits="abcdefABCDEF1234567890"
|
||||
android:id="@+id/edit_text_bg_colour"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/preview_bg_colour"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@drawable/rounded_shape"
|
||||
android:backgroundTint="@color/design_default_color_primary"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- TODO this view is hidden but must be removed later -->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/invert"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="@font/mono_regular"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
<!-- android:textColor="?attr/colorOnPrimary"-->
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_invert"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/random"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="@font/mono_regular"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="36dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_random"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.denizd.textbasic.view.VerticalTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/position"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/mono_light"
|
||||
android:padding="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/gravity_buttons_container"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/gravity_buttons_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:padding="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_top_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_top_left"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_tl"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_top_middle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_top"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_tc"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_top_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_top_right"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_tr"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_middle_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_left"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_cl"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_middle_middle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/dot"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_cc"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_middle_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_right"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_cr"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_bottom_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_bottom_left"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_bl"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_bottom_middle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_bottom"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_bc"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_bottom_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/arrow_bottom_right"
|
||||
android:background="@android:color/transparent"
|
||||
android:contentDescription="@string/position_button_content_desc_br"
|
||||
android:padding="@dimen/orientation_button_padding"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -5,7 +5,7 @@
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.SettingsFragment">
|
||||
tools:context=".fragment.SettingsNewFragment">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar"
|
||||
@@ -59,6 +59,7 @@
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/settings_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
@@ -274,78 +275,6 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- Text transparency -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
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_text_transparency_header"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
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
|
||||
android:id="@+id/button_text_transparency_decrease"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/minus"
|
||||
android:minWidth="0dp"
|
||||
app:iconPadding="0dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_transparency"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/mono_semibold"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:textSize="28sp"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_text_transparency_increase"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/plus"
|
||||
android:minWidth="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>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -387,8 +316,7 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:animateLayoutChanges="true">
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -526,78 +454,6 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- Highlight transparency -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
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_highlight_transparency_header"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
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
|
||||
android:id="@+id/button_highlight_transparency_decrease"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/minus"
|
||||
android:minWidth="0dp"
|
||||
app:iconPadding="0dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_highlight_transparency"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/mono_semibold"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:textSize="28sp"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_highlight_transparency_increase"
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/plus"
|
||||
android:minWidth="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>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -831,6 +687,34 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp" />
|
||||
|
||||
<!-- Licences -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/button_licences"
|
||||
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_licences_title"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/licences_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_licences_subtitle"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<!-- App version -->
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/button_app_version"
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_cancel"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/cross"
|
||||
app:iconPadding="0dp"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="22sp"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:fontFamily="@font/mono_bold_italic"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_cancel"/>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
@@ -10,11 +10,6 @@
|
||||
android:icon="@drawable/book_outlined"
|
||||
android:title="@string/guide"
|
||||
android:enabled="true"/>
|
||||
<item
|
||||
android:id="@+id/settings_old"
|
||||
android:icon="@drawable/settings_outlined"
|
||||
android:title="old settings"
|
||||
android:enabled="true"/>
|
||||
<item
|
||||
android:id="@+id/settings_new"
|
||||
android:icon="@drawable/settings_outlined"
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
android:name="com.denizd.textbasic.fragment.GuideFragment"
|
||||
tools:layout="@layout/fragment_guide"
|
||||
android:label="GuideFragment"/>
|
||||
<fragment
|
||||
android:id="@+id/settings_old"
|
||||
android:name="com.denizd.textbasic.fragment.SettingsFragment"
|
||||
android:label="SettingsFragment"
|
||||
tools:layout="@layout/fragment_settings"/>
|
||||
<fragment
|
||||
android:id="@+id/settings_new"
|
||||
android:name="com.denizd.textbasic.fragment.SettingsNewFragment"
|
||||
|
||||
@@ -53,6 +53,11 @@
|
||||
<string name="settings_widget_position_title">Setze Position des Texts</string>
|
||||
|
||||
<string name="settings_misc_header">Sonstiges</string>
|
||||
|
||||
<string name="settings_licences_title">Siehe Lizenzen</string>
|
||||
<string name="settings_licences_subtitle">Ressourcen, die diese App möglich gemacht haben</string>
|
||||
<string name="sheet_licences_header">Lizenzen</string>
|
||||
|
||||
<string name="settings_misc_app_version">App-Version</string>
|
||||
|
||||
<string name="edit">Text bearbeiten</string>
|
||||
@@ -88,5 +93,5 @@
|
||||
<string name="bold">Fett</string>
|
||||
<string name="italics">Kursiv</string>
|
||||
<string name="bold_italics">Fett & kursiv</string>
|
||||
<string name="guide1"><i>Text Basic</i> ist eine einfache App, um einen beliebigen Text auf deinem Startbildschirm darzustellen! Füge einfach das <i>Text Basic</i>-Widget auf deinem Startbildschirm hinzu, gib Text in die App ein, und der Text wird auf deinem Bildschirm angezeigt.\n\n<b>Wechsle zwischen Texten:</b> In der App kannst du beliebig viele Texte eingeben, indem du den [+]-Knopf drückst und deinen Text in das neu aufgetauchte Feld eingibst. Alle Texte werden automatisch gespeichert, du musst nichts weiteres tun.\nDu kannst zwischen deinen Texten wechseln, indem du auf deinem Startbildschirm auf das Widget klickst. Die Texte werden in der Reihenfolge angezeigt, in der du sie eingegeben hast, du kannst jedoch \"zufällige Reihenfolge\" in den App-Einstellungen aktivieren, um eine willkürliche Reihenfolge zu nutzen.\nHINWEIS: Sollte das Wechseln zwischen Texten nicht klappen, so versuche bitte, das Widget zu vergrößern und wieder zu verkleinern. Danach sollte der Fehler behoben sein.\n\n<b>Verändere den Look:</b> Du kannst verändern, wie der Text aussieht, indem du in die App-Einstellungen schaust – dort findest du Optionen für verschiedene Schriftarten und -größen, du kannst die Position bearbeiten sowie den Textstil, und du kannst einen Hintergrund, Umriss, oder Schatten hinzufügen.\nTipp: Sollte dein Text durch dein Hintergrundbild nicht leicht zu erkennen sein, versuche die Farben umzukehren.</string>
|
||||
<string name="guide1"><i>Text Basic</i> ist eine einfache App, um einen beliebigen Text auf deinem Startbildschirm darzustellen! Füge einfach das <i>Text Basic</i>-Widget auf deinem Startbildschirm hinzu, gib Text in die App ein, und der Text wird auf deinem Bildschirm angezeigt.\n\n<b>Wechsle zwischen Texten:</b> In der App kannst du beliebig viele Texte eingeben, indem du den [+]-Knopf drückst und deinen Text in das neu aufgetauchte Feld eingibst. Alle Texte werden automatisch gespeichert, du musst nichts weiteres tun.\nDu kannst zwischen deinen Texten wechseln, indem du auf deinem Startbildschirm auf das Widget klickst. Die Texte werden in der Reihenfolge angezeigt, in der du sie eingegeben hast, du kannst jedoch \"zufällige Reihenfolge\" in den App-Einstellungen aktivieren, um eine willkürliche Reihenfolge zu nutzen.\nHINWEIS: Sollte das Wechseln zwischen Texten nicht klappen, so versuche bitte, das Widget zu vergrößern und wieder zu verkleinern. Danach sollte der Fehler behoben sein.\n\n<b>Verändere den Look:</b> Du kannst verändern, wie der Text aussieht, indem du in die App-Einstellungen schaust – dort findest du Optionen für verschiedene Schriftarten und -größen, du kannst die Position bearbeiten sowie den Textstil, und du kannst einen Hintergrund, Umriss, oder Schatten hinzufügen.</string>
|
||||
</resources>
|
||||
@@ -52,6 +52,12 @@
|
||||
<string name="settings_widget_position_title">Set position of the text</string>
|
||||
|
||||
<string name="settings_misc_header">Miscellaneous</string>
|
||||
|
||||
<string name="settings_licences_title">View licences</string>
|
||||
<string name="settings_licences_subtitle">Resources that made this app possible</string>
|
||||
<string name="sheet_licences_header">Licences</string>
|
||||
<string name="sheet_licences_content" translatable="false">Android, Material Design Resources © 2014 – %1$s Google, licenced under the Apache 2.0 License.\nhttps://developer.android.com\nhttps://material.io\n\nRoboto Mono © 2015 – %1$s Christian Robertson, licenced under the Apache 2.0 License.\nhttps://fonts.google.com/specimen/Roboto+Mono\n\nColorPickerView © 2017 – %1$s Jaewoong Eum, licenced under the Apache 2.0 License.\nhttps://github.com/skydoves/ColorPickerView\n\nApp developed by Deniz Düzgören.\ndenizk0461@gmail.com</string>
|
||||
|
||||
<string name="settings_misc_app_version">App Version</string>
|
||||
|
||||
<string name="edit">Edit Text</string>
|
||||
@@ -97,8 +103,7 @@
|
||||
<string name="guide1"><i>Text Basic</i> is a simple app for displaying a text on your home screen! Just add the <i>Text Basic</i> widget to your home screen, enter text in the app, and it will show on your home screen.
|
||||
\n\n<b>Cycle through texts:</b> In the app, you can enter as many texts as you like by clicking the [+] button and entering your text into the newly appeared field. All texts are saved automatically, you have to take no further action.\nYou can cycle through your texts by clicking on the widget on your home screen. They will be shown in the order you added them in, but you can turn on "random order" in the app\'s settings to randomise the order.
|
||||
\nNOTE: if clicking on the widget does not cycle between texts, please try changing the size of the widget and then change it back. This should solve the issue.
|
||||
\n\n<b>Customise the look:</b> You can change how your text will look by heading into the app\'s settings – there, you can edit the text appearance by changing the size, font, position, apply formatting options, and even add a background, an outline, or a shadow.
|
||||
\nTip: if the text is hard to read on your wallpaper, try inverting the colours.</string>
|
||||
\n\n<b>Customise the look:</b> You can change how your text will look by heading into the app\'s settings – there, you can edit the text appearance by changing the size, font, position, apply formatting options, and even add a background, an outline, or a shadow.</string>
|
||||
|
||||
<string-array name="typefaces">
|
||||
<item>Sans-Serif</item>
|
||||
|
||||
Reference in New Issue
Block a user