Implemented #2

Color theme, font, background and monochrome icons can now be set
independently.
This commit is contained in:
Josia Pietsch 2024-09-10 19:50:00 +02:00
parent 870ee56b88
commit 99acdba262
Signed by: jrpie
GPG key ID: E70B571D66986A2D
45 changed files with 350 additions and 197 deletions

5
.idea/misc.xml generated
View file

@ -8,6 +8,11 @@
</map> </map>
</option> </option>
</component> </component>
<component name="EntryPointsManager">
<list size="1">
<item index="0" class="java.lang.String" itemvalue="eu.jonahbauer.android.preference.annotations.Preferences" />
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />

View file

@ -1,6 +1,7 @@
package de.jrpie.android.launcher package de.jrpie.android.launcher
import android.content.Context import android.content.Context
import de.jrpie.android.launcher.preferences.LauncherPreferences
class Application: android.app.Application() { class Application: android.app.Application() {
override fun onCreate() { override fun onCreate() {

View file

@ -39,6 +39,7 @@ import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import android.widget.Switch import android.widget.Switch
import android.widget.Toast import android.widget.Toast
import androidx.annotation.RequiresApi
import de.jrpie.android.launcher.list.ListActivity import de.jrpie.android.launcher.list.ListActivity
import de.jrpie.android.launcher.list.apps.AppInfo import de.jrpie.android.launcher.list.apps.AppInfo
import de.jrpie.android.launcher.list.apps.AppsRecyclerAdapter import de.jrpie.android.launcher.list.apps.AppsRecyclerAdapter
@ -359,24 +360,6 @@ fun loadApps(packageManager: PackageManager, context: Context) {
appsList.addAll(loadList) appsList.addAll(loadList)
} }
fun setWindowFlags(window: Window) {
window.setFlags(0, 0) // clear flags
// Display notification bar
if (LauncherPreferences.display().fullScreen())
window.setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)
else window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
// Screen Timeout
if (LauncherPreferences.display().screenTimeoutDisabled())
window.setFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
)
else window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
// Used in Tutorial and Settings `ActivityOnResult` // Used in Tutorial and Settings `ActivityOnResult`
fun saveListActivityChoice(context: Context, data: Intent?) { fun saveListActivityChoice(context: Context, data: Intent?) {
@ -397,27 +380,6 @@ fun openSoftKeyboard(context: Context, view: View) {
imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT) imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT)
} }
/* Bitmaps */
fun setButtonColor(btn: Button, color: Int) {
if (Build.VERSION.SDK_INT >= 29)
btn.background.colorFilter = BlendModeColorFilter(color, BlendMode.MULTIPLY)
else {
// tested with API 17 (Android 4.4.2 on S4 mini) -> fails
// tested with API 28 (Android 9 on S8) -> necessary
btn.background.colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
}
// not setting it in any other case (yet), unable to find a good solution
}
fun setSwitchColor(sw: Switch, trackColor: Int) {
if (Build.VERSION.SDK_INT >= 29) {
sw.trackDrawable.colorFilter = BlendModeColorFilter(trackColor, BlendMode.MULTIPLY)
}
else {
sw.trackDrawable.colorFilter = PorterDuffColorFilter(trackColor, PorterDuff.Mode.SRC_ATOP)
}
}
// Taken from: https://stackoverflow.com/a/30340794/12787264 // Taken from: https://stackoverflow.com/a/30340794/12787264
fun transformGrayscale(imageView: ImageView){ fun transformGrayscale(imageView: ImageView){
val matrix = ColorMatrix() val matrix = ColorMatrix()

View file

@ -2,6 +2,7 @@ package de.jrpie.android.launcher
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import de.jrpie.android.launcher.preferences.LauncherPreferences
/** /**
* @param id internal id to serialize the action. Used as a key in shared preferences. * @param id internal id to serialize the action. Used as a key in shared preferences.

View file

@ -1,18 +1,19 @@
package de.jrpie.android.launcher package de.jrpie.android.launcher
import android.content.Intent import android.content.Intent
import android.content.res.Resources
import android.os.AsyncTask import android.os.AsyncTask
import android.os.Bundle import android.os.Bundle
import android.view.GestureDetector import android.view.GestureDetector
import android.view.KeyEvent import android.view.KeyEvent
import android.view.MotionEvent import android.view.MotionEvent
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.AppLaunchChecker
import androidx.core.view.GestureDetectorCompat import androidx.core.view.GestureDetectorCompat
import androidx.core.view.isVisible import androidx.core.view.isVisible
import de.jrpie.android.launcher.BuildConfig.VERSION_NAME
import de.jrpie.android.launcher.databinding.HomeBinding import de.jrpie.android.launcher.databinding.HomeBinding
import de.jrpie.android.launcher.list.other.LauncherAction import de.jrpie.android.launcher.list.other.LauncherAction
import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.preferences.migrateToNewVersion
import de.jrpie.android.launcher.tutorial.TutorialActivity import de.jrpie.android.launcher.tutorial.TutorialActivity
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
@ -120,6 +121,12 @@ class HomeActivity: UIObject, AppCompatActivity(),
} }
} }
override fun getTheme(): Resources.Theme {
val mTheme = modifyTheme(super.getTheme())
mTheme.applyStyle(R.style.backgroundWallpaper, true)
return mTheme
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateClock() updateClock()
@ -247,4 +254,8 @@ class HomeActivity: UIObject, AppCompatActivity(),
override fun onShowPress(event: MotionEvent) {} override fun onShowPress(event: MotionEvent) {}
override fun onSingleTapUp(event: MotionEvent): Boolean { return false } override fun onSingleTapUp(event: MotionEvent): Boolean { return false }
override fun isHomeScreen(): Boolean {
return true
}
} }

View file

@ -1,22 +1,61 @@
package de.jrpie.android.launcher package de.jrpie.android.launcher
import android.app.Activity import android.app.Activity
import android.content.res.Resources
import android.os.Build
import android.view.Window
import android.view.WindowManager
import de.jrpie.android.launcher.preferences.LauncherPreferences
/** /**
* An interface implemented by every [Activity], Fragment etc. in Launcher. * An interface implemented by every [Activity], Fragment etc. in Launcher.
* It handles themes and window flags - a useful abstraction as it is the same everywhere. * It handles themes and window flags - a useful abstraction as it is the same everywhere.
*/ */
fun setWindowFlags(window: Window, homeScreen: Boolean) {
window.setFlags(0, 0) // clear flags
// Display notification bar
if (LauncherPreferences.display().fullScreen())
window.setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)
else window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
// Screen Timeout
if (LauncherPreferences.display().screenTimeoutDisabled())
window.setFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
)
else window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
if (!homeScreen) {
LauncherPreferences.theme().background().applyToWindow(window)
}
}
interface UIObject { interface UIObject {
fun onStart() { fun onStart() {
if (this is Activity) setWindowFlags(window) if (this is Activity) setWindowFlags(window, isHomeScreen())
applyTheme()
setOnClicks() setOnClicks()
adjustLayout() adjustLayout()
} }
fun modifyTheme(theme: Resources.Theme): Resources.Theme {
LauncherPreferences.theme().colorTheme().applyToTheme(theme)
LauncherPreferences.theme().background().applyToTheme(theme)
LauncherPreferences.theme().font().applyToTheme(theme)
// Don't use actual themes, rather create them on the fly for faster theme-switching return theme
fun applyTheme() { } }
// fun applyTheme() { }
fun setOnClicks() { } fun setOnClicks() { }
fun adjustLayout() { } fun adjustLayout() { }
fun isHomeScreen(): Boolean {
return false
}
} }

View file

@ -3,6 +3,7 @@ package de.jrpie.android.launcher.list
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.res.Resources
import android.graphics.Rect import android.graphics.Rect
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
@ -14,7 +15,6 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import de.jrpie.android.launcher.LauncherPreferences
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.REQUEST_UNINSTALL import de.jrpie.android.launcher.REQUEST_UNINSTALL
import de.jrpie.android.launcher.UIObject import de.jrpie.android.launcher.UIObject
@ -22,6 +22,7 @@ import de.jrpie.android.launcher.databinding.ListBinding
import de.jrpie.android.launcher.list.apps.ListFragmentApps import de.jrpie.android.launcher.list.apps.ListFragmentApps
import de.jrpie.android.launcher.list.other.LauncherAction import de.jrpie.android.launcher.list.other.LauncherAction
import de.jrpie.android.launcher.list.other.ListFragmentOther import de.jrpie.android.launcher.list.other.ListFragmentOther
import de.jrpie.android.launcher.preferences.LauncherPreferences
// TODO: Better solution for this intercommunication functionality (used in list-fragments) // TODO: Better solution for this intercommunication functionality (used in list-fragments)
@ -102,10 +103,8 @@ class ListActivity : AppCompatActivity(), UIObject {
} }
} }
override fun applyTheme() { override fun getTheme(): Resources.Theme {
// list_close.setTextColor(vibrantColor) return modifyTheme(super.getTheme())
binding.listTabs.setSelectedTabIndicatorColor(LauncherPreferences.theme().vibrant())
} }
override fun setOnClicks() { override fun setOnClicks() {

View file

@ -12,7 +12,6 @@ import android.widget.ImageView
import android.widget.PopupMenu import android.widget.PopupMenu
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import de.jrpie.android.launcher.LauncherPreferences
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.REQUEST_CHOOSE_APP import de.jrpie.android.launcher.REQUEST_CHOOSE_APP
import de.jrpie.android.launcher.appsList import de.jrpie.android.launcher.appsList
@ -21,6 +20,7 @@ import de.jrpie.android.launcher.launchApp
import de.jrpie.android.launcher.list.ListActivity import de.jrpie.android.launcher.list.ListActivity
import de.jrpie.android.launcher.loadApps import de.jrpie.android.launcher.loadApps
import de.jrpie.android.launcher.openAppSettings import de.jrpie.android.launcher.openAppSettings
import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.transformGrayscale import de.jrpie.android.launcher.transformGrayscale
import de.jrpie.android.launcher.uninstallApp import de.jrpie.android.launcher.uninstallApp
import java.util.* import java.util.*
@ -66,7 +66,7 @@ class AppsRecyclerAdapter(val activity: Activity,
viewHolder.textView.text = appLabel viewHolder.textView.text = appLabel
viewHolder.img.setImageDrawable(appIcon) viewHolder.img.setImageDrawable(appIcon)
if (LauncherPreferences.theme().theme() == "dark") transformGrayscale( if (LauncherPreferences.theme().monochromeIcons()) transformGrayscale(
viewHolder.img viewHolder.img
) )

View file

@ -6,13 +6,13 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import de.jrpie.android.launcher.LauncherPreferences
import de.jrpie.android.launcher.UIObject import de.jrpie.android.launcher.UIObject
import de.jrpie.android.launcher.databinding.ListAppsBinding import de.jrpie.android.launcher.databinding.ListAppsBinding
import de.jrpie.android.launcher.list.ListActivity import de.jrpie.android.launcher.list.ListActivity
import de.jrpie.android.launcher.list.forGesture import de.jrpie.android.launcher.list.forGesture
import de.jrpie.android.launcher.list.intention import de.jrpie.android.launcher.list.intention
import de.jrpie.android.launcher.openSoftKeyboard import de.jrpie.android.launcher.openSoftKeyboard
import de.jrpie.android.launcher.preferences.LauncherPreferences
/** /**
@ -36,9 +36,6 @@ class ListFragmentApps : Fragment(), UIObject {
super<UIObject>.onStart() super<UIObject>.onStart()
} }
override fun applyTheme() {
}
override fun setOnClicks() { } override fun setOnClicks() { }
override fun adjustLayout() { override fun adjustLayout() {

View file

@ -1,11 +1,15 @@
package de.jrpie.android.launcher; package de.jrpie.android.launcher.preferences;
import de.jrpie.android.launcher.R;
import de.jrpie.android.launcher.preferences.theme.Background;
import de.jrpie.android.launcher.preferences.theme.ColorTheme;
import de.jrpie.android.launcher.preferences.theme.Font;
import eu.jonahbauer.android.preference.annotations.Preference; import eu.jonahbauer.android.preference.annotations.Preference;
import eu.jonahbauer.android.preference.annotations.PreferenceGroup; import eu.jonahbauer.android.preference.annotations.PreferenceGroup;
import eu.jonahbauer.android.preference.annotations.Preferences; import eu.jonahbauer.android.preference.annotations.Preferences;
@Preferences( @Preferences(
name = "de.jrpie.android.launcher.LauncherPreferences", name = "de.jrpie.android.launcher.preferences.LauncherPreferences",
makeFile = true, makeFile = true,
r = R.class, r = R.class,
value = { value = {
@ -21,9 +25,10 @@ import eu.jonahbauer.android.preference.annotations.Preferences;
}), }),
@PreferenceGroup(name = "theme", prefix = "settings_theme_", suffix = "_key", value = { @PreferenceGroup(name = "theme", prefix = "settings_theme_", suffix = "_key", value = {
@Preference(name = "wallpaper", type = void.class), @Preference(name = "wallpaper", type = void.class),
@Preference(name = "theme", type = String.class), // TODO: change to enum @Preference(name = "color_theme", type = ColorTheme.class, defaultValue = "DEFAULT"),
@Preference(name = "dominant", type = int.class), @Preference(name = "background", type = Background.class, defaultValue = "BLUR"),
@Preference(name = "vibrant", type = int.class), @Preference(name = "font", type = Font.class, defaultValue = "HACK"),
@Preference(name = "monochrome_icons", type = boolean.class, defaultValue = "false"),
}), }),
@PreferenceGroup(name = "clock", prefix = "settings_clock_", suffix = "_key", value = { @PreferenceGroup(name = "clock", prefix = "settings_clock_", suffix = "_key", value = {
@Preference(name = "date_visible", type = boolean.class, defaultValue = "true"), @Preference(name = "date_visible", type = boolean.class, defaultValue = "true"),

View file

@ -1,9 +1,11 @@
package de.jrpie.android.launcher package de.jrpie.android.launcher.preferences
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import de.jrpie.android.launcher.BuildConfig.VERSION_CODE import de.jrpie.android.launcher.BuildConfig.VERSION_CODE
import de.jrpie.android.launcher.Gesture
import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.tutorial.TutorialActivity import de.jrpie.android.launcher.tutorial.TutorialActivity
@ -22,10 +24,10 @@ fun migrateToNewVersion(activity: Activity) {
* were not stored anywhere. Now they have to be stored: * were not stored anywhere. Now they have to be stored:
* -> we just reset them using newly implemented functions * -> we just reset them using newly implemented functions
*/ */
when (LauncherPreferences.theme().theme()) { /*when (LauncherPreferences.theme().colorTheme()) {
"finn" -> resetToDefaultTheme(activity) "finn" -> resetToDefaultTheme(activity)
"dark" -> resetToDarkTheme(activity) "dark" -> resetToDarkTheme(activity)
} } */
LauncherPreferences.internal().versionCode(VERSION_CODE) LauncherPreferences.internal().versionCode(VERSION_CODE)
// show the new tutorial // show the new tutorial
activity.startActivity(Intent(activity, TutorialActivity::class.java)) activity.startActivity(Intent(activity, TutorialActivity::class.java))
@ -48,25 +50,5 @@ fun resetSettings(context: Context) {
LauncherPreferences.theme().vibrant(vibrantColor) LauncherPreferences.theme().vibrant(vibrantColor)
} }
fun resetToDefaultTheme(activity: Activity) {
val dominantColor = activity.resources.getColor(R.color.finnmglasTheme_background_color)
val vibrantColor = activity.resources.getColor(R.color.finnmglasTheme_accent_color)
LauncherPreferences.theme().dominant(dominantColor)
LauncherPreferences.theme().vibrant(vibrantColor)
activity.recreate()
}
fun resetToDarkTheme(activity: Activity) {
val dominantColor = activity.resources.getColor(R.color.darkTheme_background_color)
val vibrantColor = activity.resources.getColor(R.color.darkTheme_accent_color)
LauncherPreferences.theme().dominant(dominantColor)
LauncherPreferences.theme().vibrant(vibrantColor)
activity.recreate()
}

View file

@ -0,0 +1,51 @@
package de.jrpie.android.launcher.preferences.theme
import android.content.res.Resources
import android.os.Build
import android.view.Window
import android.view.WindowManager
import de.jrpie.android.launcher.R
enum class Background(val id: Int, val dim: Boolean = false, val blur: Boolean = false) {
TRANSPARENT(R.style.backgroundWallpaper),
DIM(R.style.backgroundWallpaper, dim = true),
BLUR(R.style.backgroundWallpaper, dim = true, blur = true),
SOLID(R.style.backgroundSolid),
;
fun applyToTheme(theme: Resources.Theme) {
theme.applyStyle(id, true)
}
fun applyToWindow(window: Window) {
val layoutParams: WindowManager.LayoutParams = window.attributes
var dimAmount = 0.5f
var dim = this.dim
var blur = this.blur
// replace blur by more intense dim on old devices
if (blur && Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
blur = false
dimAmount += 0.3f
}
if (dim) {
layoutParams.dimAmount = dimAmount
window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (blur) {
window.addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND)
layoutParams.blurBehindRadius = 10
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND)
layoutParams.blurBehindRadius = 0
}
}
window.setAttributes(layoutParams)
}
}

View file

@ -0,0 +1,14 @@
package de.jrpie.android.launcher.preferences.theme
import android.content.res.Resources
import de.jrpie.android.launcher.R
enum class ColorTheme(val id: Int) {
DEFAULT(R.style.colorThemeDefault),
DARK(R.style.colorThemeDark),
;
fun applyToTheme(theme: Resources.Theme) {
theme.applyStyle(id, true)
}
}

View file

@ -0,0 +1,14 @@
package de.jrpie.android.launcher.preferences.theme
import android.content.res.Resources
import de.jrpie.android.launcher.R
enum class Font(val id: Int) {
HACK(R.style.fontHack),
SYSTEM_DEFAULT(R.style.fontSystemDefault),
;
fun applyToTheme(theme: Resources.Theme) {
theme.applyStyle(id, true)
}
}

View file

@ -2,6 +2,8 @@ package de.jrpie.android.launcher.settings
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Resources
import android.os.Bundle import android.os.Bundle
import android.provider.Settings import android.provider.Settings
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -12,6 +14,7 @@ import de.jrpie.android.launcher.databinding.SettingsBinding
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.settings.actions.SettingsFragmentActions import de.jrpie.android.launcher.settings.actions.SettingsFragmentActions
import de.jrpie.android.launcher.settings.launcher.SettingsFragmentLauncher import de.jrpie.android.launcher.settings.launcher.SettingsFragmentLauncher
import de.jrpie.android.launcher.settings.meta.SettingsFragmentMeta import de.jrpie.android.launcher.settings.meta.SettingsFragmentMeta
@ -26,6 +29,13 @@ import de.jrpie.android.launcher.settings.meta.SettingsFragmentMeta
* Settings are closed automatically if the activity goes `onPause` unexpectedly. * Settings are closed automatically if the activity goes `onPause` unexpectedly.
*/ */
class SettingsActivity: AppCompatActivity(), UIObject { class SettingsActivity: AppCompatActivity(), UIObject {
private var sharedPreferencesListener =
SharedPreferences.OnSharedPreferenceChangeListener { _,prefKey ->
if(prefKey?.startsWith("theme.") == true) {
recreate()
}
}
private lateinit var binding: SettingsBinding private lateinit var binding: SettingsBinding
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@ -46,12 +56,16 @@ class SettingsActivity: AppCompatActivity(), UIObject {
override fun onStart() { override fun onStart() {
super<AppCompatActivity>.onStart() super<AppCompatActivity>.onStart()
super<UIObject>.onStart() super<UIObject>.onStart()
LauncherPreferences.getSharedPreferences().registerOnSharedPreferenceChangeListener(sharedPreferencesListener)
} }
override fun applyTheme() { override fun onPause() {
//settings_system.setTextColor(vibrantColor) LauncherPreferences.getSharedPreferences().unregisterOnSharedPreferenceChangeListener(sharedPreferencesListener)
//settings_close.setTextColor(vibrantColor) super.onPause()
binding.settingsTabs.setSelectedTabIndicatorColor(LauncherPreferences.theme().vibrant()) }
override fun getTheme(): Resources.Theme {
return modifyTheme(super.getTheme())
} }
override fun setOnClicks(){ override fun setOnClicks(){

View file

@ -8,12 +8,10 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import de.jrpie.android.launcher.LauncherPreferences
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.UIObject import de.jrpie.android.launcher.UIObject
import de.jrpie.android.launcher.databinding.SettingsActionsBinding import de.jrpie.android.launcher.databinding.SettingsActionsBinding
import de.jrpie.android.launcher.list.ListActivity import de.jrpie.android.launcher.list.ListActivity
import de.jrpie.android.launcher.setButtonColor
/** /**
@ -43,12 +41,6 @@ SettingsFragmentActions : Fragment(), UIObject {
} }
override fun applyTheme() {
val vibrantColor = LauncherPreferences.theme().vibrant()
setButtonColor(binding!!.settingsActionsButtonViewApps, vibrantColor)
setButtonColor(binding!!.settingsActionsButtonInstallApps, vibrantColor)
}
override fun setOnClicks() { override fun setOnClicks() {
// App management buttons // App management buttons

View file

@ -18,6 +18,7 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import de.jrpie.android.launcher.list.other.LauncherAction import de.jrpie.android.launcher.list.other.LauncherAction
import de.jrpie.android.launcher.databinding.SettingsActionsRecyclerBinding import de.jrpie.android.launcher.databinding.SettingsActionsRecyclerBinding
import de.jrpie.android.launcher.preferences.LauncherPreferences
import java.lang.Exception import java.lang.Exception
/** /**
@ -116,12 +117,9 @@ class ActionsRecyclerAdapter(val activity: Activity):
override fun onBindViewHolder(viewHolder: ViewHolder, i: Int) { override fun onBindViewHolder(viewHolder: ViewHolder, i: Int) {
val gesture = gesturesList[i] val gesture = gesturesList[i]
val vibrantColor = LauncherPreferences.theme().vibrant()
viewHolder.textView.text = gesture.getLabel(activity) viewHolder.textView.text = gesture.getLabel(activity)
setButtonColor(viewHolder.chooseButton, vibrantColor) if (LauncherPreferences.theme().monochromeIcons())
if (LauncherPreferences.theme().theme() == "dark") transformGrayscale( transformGrayscale( viewHolder.img )
viewHolder.img
)
updateViewHolder(gesture, viewHolder) updateViewHolder(gesture, viewHolder)
viewHolder.img.setOnClickListener{ chooseApp(gesture) } viewHolder.img.setOnClickListener{ chooseApp(gesture) }
viewHolder.chooseButton.setOnClickListener{ chooseApp(gesture) } viewHolder.chooseButton.setOnClickListener{ chooseApp(gesture) }

View file

@ -4,10 +4,9 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceFragmentCompat
import de.jrpie.android.launcher.LauncherPreferences import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.setDefaultHomeScreen import de.jrpie.android.launcher.setDefaultHomeScreen
import eu.jonahbauer.android.preference.annotations.Preference
/** /**
@ -18,15 +17,14 @@ import eu.jonahbauer.android.preference.annotations.Preference
class SettingsFragmentLauncher : PreferenceFragmentCompat() { class SettingsFragmentLauncher : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences, rootKey)
preferenceManager.sharedPreferencesName = getString(R.string.preference_file_key) preferenceManager.sharedPreferencesName = getString(R.string.preference_file_key)
preferenceManager.sharedPreferencesMode = Context.MODE_PRIVATE preferenceManager.sharedPreferencesMode = Context.MODE_PRIVATE
setPreferencesFromResource(R.xml.preferences, rootKey)
val selectWallpaper = findPreference<androidx.preference.Preference>(LauncherPreferences.theme().keys().wallpaper()) val selectWallpaper = findPreference<androidx.preference.Preference>(LauncherPreferences.theme().keys().wallpaper())
selectWallpaper?.setOnPreferenceClickListener { selectWallpaper?.setOnPreferenceClickListener {
// https://github.com/LineageOS/android_packages_apps_Trebuchet/blob/6caab89b21b2b91f0a439e1fd8c4510dcb255819/src/com/android/launcher3/views/OptionsPopupView.java#L271 // https://github.com/LineageOS/android_packages_apps_Trebuchet/blob/6caab89b21b2b91f0a439e1fd8c4510dcb255819/src/com/android/launcher3/views/OptionsPopupView.java#L271
val intent = Intent(Intent.ACTION_SET_WALLPAPER) val intent = Intent(Intent.ACTION_SET_WALLPAPER)
//.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
.putExtra("com.android.wallpaper.LAUNCH_SOURCE", "app_launched_launcher") .putExtra("com.android.wallpaper.LAUNCH_SOURCE", "app_launched_launcher")
.putExtra("com.android.launcher3.WALLPAPER_FLAVOR", "focus_wallpaper") .putExtra("com.android.launcher3.WALLPAPER_FLAVOR", "focus_wallpaper")
startActivity(intent) startActivity(intent)

View file

@ -8,12 +8,10 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import de.jrpie.android.launcher.LauncherPreferences
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.UIObject import de.jrpie.android.launcher.UIObject
import de.jrpie.android.launcher.openNewTabWindow import de.jrpie.android.launcher.openNewTabWindow
import de.jrpie.android.launcher.resetSettings import de.jrpie.android.launcher.preferences.resetSettings
import de.jrpie.android.launcher.setButtonColor
import de.jrpie.android.launcher.tutorial.TutorialActivity import de.jrpie.android.launcher.tutorial.TutorialActivity
import de.jrpie.android.launcher.databinding.SettingsMetaBinding import de.jrpie.android.launcher.databinding.SettingsMetaBinding
@ -56,16 +54,6 @@ class SettingsFragmentMeta : Fragment(), UIObject {
return intent return intent
} }
override fun applyTheme() {
val vibrantColor = LauncherPreferences.theme().vibrant()
setButtonColor(binding.settingsMetaButtonViewTutorial, vibrantColor)
setButtonColor(binding.settingsMetaButtonResetSettings, vibrantColor)
setButtonColor(binding.settingsMetaButtonReportBug, vibrantColor)
setButtonColor(binding.settingsMetaButtonContact, vibrantColor)
setButtonColor(binding.settingsMetaButtonForkContact, vibrantColor)
setButtonColor(binding.settingsMetaButtonPrivacy, vibrantColor)
}
override fun setOnClicks() { override fun setOnClicks() {
binding.settingsMetaButtonViewTutorial.setOnClickListener { binding.settingsMetaButtonViewTutorial.setOnClickListener {

View file

@ -8,11 +8,11 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import de.jrpie.android.launcher.LauncherPreferences import de.jrpie.android.launcher.preferences.LauncherPreferences
import de.jrpie.android.launcher.R import de.jrpie.android.launcher.R
import de.jrpie.android.launcher.REQUEST_CHOOSE_APP import de.jrpie.android.launcher.REQUEST_CHOOSE_APP
import de.jrpie.android.launcher.UIObject import de.jrpie.android.launcher.UIObject
import de.jrpie.android.launcher.resetSettings import de.jrpie.android.launcher.preferences.resetSettings
import de.jrpie.android.launcher.saveListActivityChoice import de.jrpie.android.launcher.saveListActivityChoice
import de.jrpie.android.launcher.tutorial.tabs.TutorialFragmentConcept import de.jrpie.android.launcher.tutorial.tabs.TutorialFragmentConcept
import de.jrpie.android.launcher.tutorial.tabs.TutorialFragmentFinish import de.jrpie.android.launcher.tutorial.tabs.TutorialFragmentFinish

View file

@ -8,6 +8,7 @@ import android.view.ViewGroup
import de.jrpie.android.launcher.* import de.jrpie.android.launcher.*
import de.jrpie.android.launcher.BuildConfig.VERSION_CODE import de.jrpie.android.launcher.BuildConfig.VERSION_CODE
import de.jrpie.android.launcher.databinding.TutorialFinishBinding import de.jrpie.android.launcher.databinding.TutorialFinishBinding
import de.jrpie.android.launcher.preferences.LauncherPreferences
/** /**
* The [TutorialFragmentFinish] is a used as a tab in the TutorialActivity. * The [TutorialFragmentFinish] is a used as a tab in the TutorialActivity.
@ -31,12 +32,6 @@ class TutorialFragmentFinish : Fragment(), UIObject {
super<UIObject>.onStart() super<UIObject>.onStart()
} }
override fun applyTheme() {
val vibrantColor = LauncherPreferences.theme().vibrant()
setButtonColor(binding.tutorialFinishButtonStart, vibrantColor)
binding.tutorialFinishButtonStart.blink()
}
override fun setOnClicks() { override fun setOnClicks() {
super.setOnClicks() super.setOnClicks()
binding.tutorialFinishButtonStart.setOnClickListener{ finishTutorial() } binding.tutorialFinishButtonStart.setOnClickListener{ finishTutorial() }

View file

@ -21,6 +21,7 @@ class TutorialFragmentStart : Fragment(), UIObject {
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View { ): View {
binding = TutorialStartBinding.inflate(inflater, container, false) binding = TutorialStartBinding.inflate(inflater, container, false)
binding.tutorialStartIconRight.blink()
return binding.root return binding.root
} }
@ -28,12 +29,4 @@ class TutorialFragmentStart : Fragment(), UIObject {
super<Fragment>.onStart() super<Fragment>.onStart()
super<UIObject>.onStart() super<UIObject>.onStart()
} }
override fun applyTheme() {
val vibrantColor = LauncherPreferences.theme().vibrant()
binding.tutorialStartIconRight.setTextColor(vibrantColor)
binding.tutorialStartIconRight.blink()
}
} }

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<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"/> <path android:fillColor="?android:textColor" 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> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/> <path android:fillColor="?android:textColor" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M6,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/> <path android:fillColor="?android:textColor" android:pathData="M6,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8 0,-1.85 0.63,-3.55 1.69,-4.9L16.9,18.31C15.55,19.37 13.85,20 12,20zM18.31,16.9L7.1,5.69C8.45,4.63 10.15,4 12,4c4.42,0 8,3.58 8,8 0,1.85 -0.63,3.55 -1.69,4.9z"/> <path android:fillColor="?android:textColor" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8 0,-1.85 0.63,-3.55 1.69,-4.9L16.9,18.31C15.55,19.37 13.85,20 12,20zM18.31,16.9L7.1,5.69C8.45,4.63 10.15,4 12,4c4.42,0 8,3.58 8,8 0,1.85 -0.63,3.55 -1.69,4.9z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/> <path android:fillColor="?android:textColor" android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> <path android:fillColor="?android:textColor" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/> <path android:fillColor="?android:textColor" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM19,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.11,0 2,-0.9 2,-2L21,5c0,-1.1 -0.89,-2 -2,-2zM17.25,12c0,0.23 -0.02,0.46 -0.05,0.68l1.48,1.16c0.13,0.11 0.17,0.3 0.08,0.45l-1.4,2.42c-0.09,0.15 -0.27,0.21 -0.43,0.15l-1.74,-0.7c-0.36,0.28 -0.76,0.51 -1.18,0.69l-0.26,1.85c-0.03,0.17 -0.18,0.3 -0.35,0.3h-2.8c-0.17,0 -0.32,-0.13 -0.35,-0.29l-0.26,-1.85c-0.43,-0.18 -0.82,-0.41 -1.18,-0.69l-1.74,0.7c-0.16,0.06 -0.34,0 -0.43,-0.15l-1.4,-2.42c-0.09,-0.15 -0.05,-0.34 0.08,-0.45l1.48,-1.16c-0.03,-0.23 -0.05,-0.46 -0.05,-0.69 0,-0.23 0.02,-0.46 0.05,-0.68l-1.48,-1.16c-0.13,-0.11 -0.17,-0.3 -0.08,-0.45l1.4,-2.42c0.09,-0.15 0.27,-0.21 0.43,-0.15l1.74,0.7c0.36,-0.28 0.76,-0.51 1.18,-0.69l0.26,-1.85c0.03,-0.17 0.18,-0.3 0.35,-0.3h2.8c0.17,0 0.32,0.13 0.35,0.29l0.26,1.85c0.43,0.18 0.82,0.41 1.18,0.69l1.74,-0.7c0.16,-0.06 0.34,0 0.43,0.15l1.4,2.42c0.09,0.15 0.05,0.34 -0.08,0.45l-1.48,1.16c0.03,0.23 0.05,0.46 0.05,0.69z"/> <path android:fillColor="?android:textColor" android:pathData="M12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM19,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.11,0 2,-0.9 2,-2L21,5c0,-1.1 -0.89,-2 -2,-2zM17.25,12c0,0.23 -0.02,0.46 -0.05,0.68l1.48,1.16c0.13,0.11 0.17,0.3 0.08,0.45l-1.4,2.42c-0.09,0.15 -0.27,0.21 -0.43,0.15l-1.74,-0.7c-0.36,0.28 -0.76,0.51 -1.18,0.69l-0.26,1.85c-0.03,0.17 -0.18,0.3 -0.35,0.3h-2.8c-0.17,0 -0.32,-0.13 -0.35,-0.29l-0.26,-1.85c-0.43,-0.18 -0.82,-0.41 -1.18,-0.69l-1.74,0.7c-0.16,0.06 -0.34,0 -0.43,-0.15l-1.4,-2.42c-0.09,-0.15 -0.05,-0.34 0.08,-0.45l1.48,-1.16c-0.03,-0.23 -0.05,-0.46 -0.05,-0.69 0,-0.23 0.02,-0.46 0.05,-0.68l-1.48,-1.16c-0.13,-0.11 -0.17,-0.3 -0.08,-0.45l1.4,-2.42c0.09,-0.15 0.27,-0.21 0.43,-0.15l1.74,0.7c0.36,-0.28 0.76,-0.51 1.18,-0.69l0.26,-1.85c0.03,-0.17 0.18,-0.3 0.35,-0.3h2.8c0.17,0 0.32,0.13 0.35,0.29l0.26,1.85c0.43,0.18 0.82,0.41 1.18,0.69l1.74,-0.7c0.16,-0.06 0.34,0 0.43,0.15l1.4,2.42c0.09,0.15 0.05,0.34 -0.08,0.45l-1.48,1.16c0.03,0.23 0.05,0.46 0.05,0.69z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/> <path android:fillColor="?android:textColor" android:pathData="M6,18l8.5,-6L6,6v12zM16,6v12h2V6h-2z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M6,6h2v12L6,18zM9.5,12l8.5,6L18,6z"/> <path android:fillColor="?android:textColor" android:pathData="M6,6h2v12L6,18zM9.5,12l8.5,6L18,6z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M18.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM5,9v6h4l5,5V4L9,9H5z"/> <path android:fillColor="?android:textColor" android:pathData="M18.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM5,9v6h4l5,5V4L9,9H5z"/>
</vector> </vector>

View file

@ -1,5 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp"> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z"/> <path android:fillColor="?android:textColor" android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z"/>
</vector> </vector>

View file

@ -78,6 +78,7 @@
android:id="@+id/list_tabs" android:id="@+id/list_tabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:tabIndicatorColor="?attr/colorAccent"
custom:tabTextColor="?attr/android:textColor" /> custom:tabTextColor="?attr/android:textColor" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>

View file

@ -30,7 +30,8 @@
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
/>
<ImageView <ImageView
android:id="@+id/settings_actions_row_icon_img" android:id="@+id/settings_actions_row_icon_img"
@ -53,5 +54,4 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/settings_actions_row_icon_img" app:layout_constraintStart_toEndOf="@+id/settings_actions_row_icon_img"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<!--android:tint="@color/design_default_color_primary"-->
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -67,10 +67,11 @@
<string name="settings_clock_localized">Lokalisiertes Datumsformat verwenden</string> <string name="settings_clock_localized">Lokalisiertes Datumsformat verwenden</string>
<string name="settings_clock_flip_date_time">Datum und Uhrzeit tauschen</string> <string name="settings_clock_flip_date_time">Datum und Uhrzeit tauschen</string>
<string name="settings_launcher_section_date_time"><![CDATA[Datum & Uhrzeit]]></string> <string name="settings_launcher_section_date_time"><![CDATA[Datum & Uhrzeit]]></string>
<string name="settings_theme_theme">Theme</string> <string name="settings_theme_color_theme">Farbschema</string>
<string-array name="settings_launcher_theme_spinner_items"> <string-array name="settings_theme_color_theme_items">
<item>Standard</item> <item>Standard</item>
<item>Dunkel</item> <item>Dunkel</item>
<!--<item>Hell</item>-->
</string-array> </string-array>
<string name="settings_theme_wallpaper">Hintergrund auswählen</string> <string name="settings_theme_wallpaper">Hintergrund auswählen</string>

View file

@ -65,7 +65,7 @@
<string name="settings_launcher_section_appearance">Apariencia</string> <string name="settings_launcher_section_appearance">Apariencia</string>
<string name="settings_launcher_section_date_time">Formato de fecha</string> <string name="settings_launcher_section_date_time">Formato de fecha</string>
<string-array name="settings_launcher_theme_spinner_items"> <string-array name="settings_theme_color_theme_items">
<item>Normal</item> <item>Normal</item>
<item>Oscuro</item> <item>Oscuro</item>
</string-array> </string-array>

View file

@ -47,8 +47,8 @@
--> -->
<string name="settings_launcher_section_appearance">Apparence</string> <string name="settings_launcher_section_appearance">Apparence</string>
<string name="settings_launcher_section_date_time">Format de date</string> <string name="settings_launcher_section_date_time">Format de date</string>
<string name="settings_theme_theme">Thème</string> <string name="settings_theme_color_theme">Thème</string>
<string-array name="settings_launcher_theme_spinner_items"> <string-array name="settings_theme_color_theme_items">
<item>Défaut</item> <item>Défaut</item>
<item>Noir</item> <item>Noir</item>
</string-array> </string-array>

View file

@ -5,7 +5,7 @@
<string name="ic_menu_alt">更多选项</string> <string name="ic_menu_alt">更多选项</string>
<string name="settings_title">设置</string> <string name="settings_title">设置</string>
<string name="settings_launcher_section_appearance">外观</string> <string name="settings_launcher_section_appearance">外观</string>
<string name="settings_theme_theme">主题</string> <string name="settings_theme_color_theme">主题</string>
<string name="settings_launcher_section_display">显示</string> <string name="settings_launcher_section_display">显示</string>
<string name="list_tab_other">其他</string> <string name="list_tab_other">其他</string>
<string name="settings_gesture_up">上滑</string> <string name="settings_gesture_up">上滑</string>

View file

@ -7,4 +7,9 @@
<color name="darkTheme_background_color">#000</color> <color name="darkTheme_background_color">#000</color>
<color name="darkTheme_accent_color">#444</color> <color name="darkTheme_accent_color">#444</color>
<color name="darkTheme_text_color">#fff</color> <color name="darkTheme_text_color">#fff</color>
<color name="lightTheme_background_color">#fff</color>
<color name="lightTheme_accent_color">#5555ff</color>
<color name="lightTheme_text_color">#000</color>
</resources> </resources>

View file

@ -44,11 +44,26 @@
- Settings : Theme - Settings : Theme
- -
--> -->
<string name="settings_theme_theme_key" translatable="false">theme</string> <string name="settings_theme_color_theme_key" translatable="false">theme.color_theme</string>
<string name="settings_theme_wallpaper_key" translatable="false">settings.theme.wallpaper</string> <string-array name="settings_theme_color_theme_values" translatable="false">
<string name="settings_theme_dominant_key" translatable="false">custom_dominant</string> <item>DEFAULT</item>
<string name="settings_theme_vibrant_key" translatable="false">custom_vibrant</string> <item>DARK</item>
<!--<item>light</item>-->
</string-array>
<string name="settings_theme_background_key" translatable="false">theme.background</string>
<string-array name="settings_theme_background_values" translatable="false">
<item>TRANSPARENT</item>
<item>DIM</item>
<item>BLUR</item>
<item>SOLID</item>
</string-array>
<string name="settings_theme_wallpaper_key" translatable="false">theme.wallpaper</string>
<string name="settings_theme_font_key" translatable="false">theme.font</string>
<string-array name="settings_theme_font_values" translatable="false">
<item>HACK</item>
<item>SYSTEM_DEFAULT</item>
</string-array>
<string name="settings_theme_monochrome_icons_key" translatable="false">theme.monochrome_icons</string>
<!-- <!--
- -
- Settings : Clock - Settings : Clock

View file

@ -63,11 +63,25 @@
<string name="settings_launcher_section_appearance">Appearance</string> <string name="settings_launcher_section_appearance">Appearance</string>
<string name="settings_theme_theme">Theme</string> <string name="settings_theme_color_theme">Color theme</string>
<string-array name="settings_launcher_theme_spinner_items"> <string-array name="settings_theme_color_theme_items">
<item>Default</item> <item>Default</item>
<item>Dark</item> <item>Dark</item>
<!--<item>Light</item>-->
</string-array> </string-array>
<string name="settings_theme_background">Background (app list and setting)</string>
<string-array name="settings_theme_background_items">
<item>Transparent</item>
<item>Dim</item>
<item>Blur</item>
<item>Solid</item>
</string-array>
<string name="settings_theme_font" translatable="false">Font</string>
<string-array name="settings_theme_font_items">
<item>Hack</item>
<item>System default</item>
</string-array>
<string name="settings_theme_monochrome_icons">Monochrome app icons</string>
<string name="settings_theme_dominant">Dominant color</string> <string name="settings_theme_dominant">Dominant color</string>
<string name="settings_theme_vibrant">Vibrant color</string> <string name="settings_theme_vibrant">Vibrant color</string>

View file

@ -1,43 +1,73 @@
<resources> <resources>
<!-- Base theme for Launcher <!-- Base theme for Launcher -->
This does not define the actual style of launcher,
as the style / colors etc are dynamically generated.
This is more like a fallback- theme that may partially be used by older apis.
-->
<style name="launcherBaseTheme" parent="Theme.AppCompat.Light.NoActionBar"> <style name="launcherBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/finnmglasTheme_background_color</item> <item name="colorPrimary">@color/finnmglasTheme_background_color</item>
<item name="colorPrimaryDark">@color/finnmglasTheme_background_color</item> <item name="colorPrimaryDark">@color/finnmglasTheme_background_color</item>
<item name="colorAccent">@color/finnmglasTheme_accent_color</item>
<item name="android:colorBackground">@color/finnmglasTheme_background_color</item> <item name="android:colorBackground">@color/finnmglasTheme_background_color</item>
<item name="android:textColor">@color/finnmglasTheme_text_color</item>
<item name="android:textColorSecondary">?android:textColor</item>
<item name="android:textColorPrimary">?android:textColor</item>
<item name="android:textColorHint">?android:textColor</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
<item name="colorButtonNormal">?colorAccent</item>
<!--<item name="android:popupMenuStyle">@style/PopupMenuCustom</item>-->
<item name="android:windowDisablePreview">true</item>
<item name="android:windowAnimationStyle">@style/WindowFadeTransition</item>
</style>
<style name="colorThemeDark">
<item name="colorPrimary">@color/darkTheme_background_color</item>
<item name="colorPrimaryDark">@color/darkTheme_background_color</item>
<item name="colorAccent">@color/darkTheme_accent_color</item>
<item name="android:colorBackground">@color/darkTheme_background_color</item>
<item name="android:textColor">@color/darkTheme_text_color</item>
</style>
<style name="colorThemeDefault">
<item name="colorPrimary">@color/finnmglasTheme_background_color</item>
<item name="colorPrimaryDark">@color/finnmglasTheme_background_color</item>
<item name="colorAccent">@color/finnmglasTheme_accent_color</item>
<item name="android:colorBackground">@color/finnmglasTheme_background_color</item>
<item name="android:textColor">@color/finnmglasTheme_text_color</item>
</style>
<style name="colorThemeLight">
<item name="colorPrimary">@color/lightTheme_background_color</item>
<item name="colorPrimaryDark">@color/lightTheme_background_color</item>
<item name="colorAccent">@color/lightTheme_accent_color</item>
<item name="android:colorBackground">@color/lightTheme_background_color</item>
<item name="android:textColor">@color/lightTheme_text_color</item>
</style>
<style name="backgroundWallpaper">
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowShowWallpaper">true</item> <item name="android:windowShowWallpaper">true</item>
<item name="colorAccent">#555</item>
<item name="android:textColor">#ffffff</item>
<item name="android:textColorSecondary">@color/finnmglasTheme_text_color</item>
<item name="android:textColorPrimary">@color/finnmglasTheme_text_color</item>
<item name="android:textColorHint">?android:textColor</item>
<item name="android:fontFamily">@font/hack</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
<item name="colorButtonNormal">?colorAccent</item>
<item name="android:popupMenuStyle">@style/PopupMenuCustom</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowAnimationStyle">@style/WindowFadeTransition</item>
</style> </style>
<style name="backgroundSolid">
</style>
<style name="fontSystemDefault">
<!--<item name="android:textSize">18sp</item>-->
</style>
<style name="fontHack">
<item name="android:fontFamily">@font/hack</item>
<!--<item name="android:textSize">18sp</item>-->
</style>
<style name="PopupMenuCustom" parent="@android:style/Widget.PopupMenu"> <style name="PopupMenuCustom" parent="@android:style/Widget.PopupMenu">
<item name="android:popupBackground">#252827</item> <item name="android:popupBackground">#252827</item>

View file

@ -1,25 +1,51 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
<PreferenceCategory > <!-- general --> xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
app:allowDividerAbove="false" > <!-- general -->
<Preference <Preference
android:key="@string/settings_general_choose_home_screen_key" android:key="@string/settings_general_choose_home_screen_key"
android:title="@string/settings_general_choose_home_screen"/> android:title="@string/settings_general_choose_home_screen"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
app:allowDividerAbove="false"
android:title="@string/settings_launcher_section_appearance"> android:title="@string/settings_launcher_section_appearance">
<Preference <Preference
android:key="@string/settings_theme_wallpaper_key" android:key="@string/settings_theme_wallpaper_key"
android:title="@string/settings_theme_wallpaper"/> android:title="@string/settings_theme_wallpaper"/>
<!--<ListPreference <DropDownPreference
android:key="@string/settings_theme_theme_key" android:entries="@array/settings_theme_color_theme_items"
android:title="@string/settings_theme_theme" android:entryValues="@array/settings_theme_color_theme_values"
</ListPreference>--> android:summary="%s"
android:defaultValue="DEFAULT"
android:key="@string/settings_theme_color_theme_key"
android:title="@string/settings_theme_color_theme"/>
<DropDownPreference
android:key="@string/settings_theme_font_key"
android:title="@string/settings_theme_font"
android:entryValues="@array/settings_theme_font_values"
android:entries="@array/settings_theme_font_items"
android:summary="%s"
android:defaultValue="HACK"/>
<DropDownPreference
android:key="@string/settings_theme_background_key"
android:title="@string/settings_theme_background"
android:summary="%s"
android:entries="@array/settings_theme_background_items"
android:entryValues="@array/settings_theme_background_values"
android:defaultValue="BLUR"/>
<SwitchPreference
android:key="@string/settings_theme_monochrome_icons_key"
android:title="@string/settings_theme_monochrome_icons"
android:defaultValue="false" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:title="@string/settings_launcher_section_date_time"> android:title="@string/settings_launcher_section_date_time"
app:allowDividerAbove="false">
<SwitchPreference <SwitchPreference
android:key="@string/settings_clock_localized_key" android:key="@string/settings_clock_localized_key"
android:defaultValue="false" android:defaultValue="false"
@ -39,7 +65,8 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:title="@string/settings_launcher_section_functionality"> android:title="@string/settings_launcher_section_functionality"
app:allowDividerAbove="false">
<SwitchPreference <SwitchPreference
android:key="@string/settings_functionality_search_auto_launch_key" android:key="@string/settings_functionality_search_auto_launch_key"
@ -61,7 +88,8 @@
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:title="@string/settings_launcher_section_display"> android:title="@string/settings_launcher_section_display"
app:allowDividerAbove="false">
<SwitchPreference <SwitchPreference
android:key="@string/settings_display_full_screen_key" android:key="@string/settings_display_full_screen_key"
android:title="@string/settings_display_full_screen"/> android:title="@string/settings_display_full_screen"/>