mirror of
https://github.com/jrpie/Launcher.git
synced 2025-04-06 04:14:37 +02:00
removed support for API < 21
This commit is contained in:
parent
e0a2cdb288
commit
e75c309b34
9 changed files with 17 additions and 51 deletions
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
|
@ -1,4 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
|
|
|
@ -9,7 +9,7 @@ android {
|
|||
defaultConfig {
|
||||
applicationId "de.jrpie.android.launcher"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 35
|
||||
versionCode 13
|
||||
versionName "j-alpha-0.1"
|
||||
|
||||
|
@ -37,5 +37,5 @@ dependencies {
|
|||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
implementation 'androidx.palette:palette:1.0.0'
|
||||
implementation 'androidx.palette:palette-ktx:1.0.0'
|
||||
}
|
||||
|
|
|
@ -552,7 +552,7 @@ fun openSoftKeyboard(context: Context, view: View) {
|
|||
fun setButtonColor(btn: Button, color: Int) {
|
||||
if (Build.VERSION.SDK_INT >= 29)
|
||||
btn.background.colorFilter = BlendModeColorFilter(color, BlendMode.MULTIPLY)
|
||||
else if(Build.VERSION.SDK_INT >= 21) {
|
||||
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)
|
||||
|
@ -564,7 +564,7 @@ fun setSwitchColor(sw: Switch, trackColor: Int) {
|
|||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
sw.trackDrawable.colorFilter = BlendModeColorFilter(trackColor, BlendMode.MULTIPLY)
|
||||
}
|
||||
else if(Build.VERSION.SDK_INT >= 21) {
|
||||
else {
|
||||
sw.trackDrawable.colorFilter = PorterDuffColorFilter(trackColor, PorterDuff.Mode.SRC_ATOP)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import kotlinx.android.synthetic.main.list_apps.*
|
|||
|
||||
var intendedChoosePause = false // know when to close
|
||||
|
||||
// TODO: Better solution for this intercommunication fuctionality (used in list-fragments)
|
||||
// TODO: Better solution for this intercommunication functionality (used in list-fragments)
|
||||
var intention = "view"
|
||||
var forApp = ""
|
||||
|
||||
|
|
|
@ -60,8 +60,6 @@ class SettingsActivity: AppCompatActivity(), UIObject {
|
|||
}
|
||||
|
||||
override fun applyTheme() {
|
||||
// settings_appbar.setBackgroundColor(dominantColor)
|
||||
|
||||
//settings_system.setTextColor(vibrantColor)
|
||||
//settings_close.setTextColor(vibrantColor)
|
||||
settings_tabs.setSelectedTabIndicatorColor(vibrantColor)
|
||||
|
|
|
@ -49,11 +49,7 @@ class SettingsFragmentMeta : Fragment(), UIObject {
|
|||
Uri.parse(String.format("%s?id=%s", url, this.context!!.packageName))
|
||||
)
|
||||
var flags = Intent.FLAG_ACTIVITY_NO_HISTORY or Intent.FLAG_ACTIVITY_MULTIPLE_TASK
|
||||
flags = if (Build.VERSION.SDK_INT >= 21) {
|
||||
flags or Intent.FLAG_ACTIVITY_NEW_DOCUMENT
|
||||
} else {
|
||||
flags or Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
|
||||
}
|
||||
flags = flags or Intent.FLAG_ACTIVITY_NEW_DOCUMENT
|
||||
intent.addFlags(flags)
|
||||
return intent
|
||||
}
|
||||
|
@ -69,36 +65,10 @@ class SettingsFragmentMeta : Fragment(), UIObject {
|
|||
|
||||
override fun setOnClicks() {
|
||||
|
||||
// Button onClicks
|
||||
|
||||
settings_meta_button_select_launcher.setOnClickListener {
|
||||
intendedSettingsPause = true
|
||||
// on newer sdk: choose launcher
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
val callHomeSettingIntent = Intent(Settings.ACTION_HOME_SETTINGS)
|
||||
startActivity(callHomeSettingIntent)
|
||||
}
|
||||
// on older sdk: manage app details
|
||||
else {
|
||||
AlertDialog.Builder(this.context!!, R.style.AlertDialogCustom)
|
||||
.setTitle(getString(R.string.settings_meta_cant_select_launcher))
|
||||
.setMessage(getString(R.string.settings_meta_cant_select_launcher_msg))
|
||||
.setPositiveButton(android.R.string.yes,
|
||||
DialogInterface.OnClickListener { _, _ ->
|
||||
try {
|
||||
openAppSettings(
|
||||
this.context!!.packageName,
|
||||
this.context!!
|
||||
)
|
||||
} catch ( e : ActivityNotFoundException) {
|
||||
val intent = Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS)
|
||||
startActivity(intent)
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.no, null)
|
||||
.setIcon(android.R.drawable.ic_dialog_info)
|
||||
.show()
|
||||
}
|
||||
val callHomeSettingIntent = Intent(Settings.ACTION_HOME_SETTINGS)
|
||||
startActivity(callHomeSettingIntent)
|
||||
}
|
||||
|
||||
settings_meta_button_view_tutorial.setOnClickListener {
|
||||
|
@ -111,12 +81,12 @@ class SettingsFragmentMeta : Fragment(), UIObject {
|
|||
AlertDialog.Builder(this.context!!, R.style.AlertDialogCustom)
|
||||
.setTitle(getString(R.string.settings_meta_reset))
|
||||
.setMessage(getString(R.string.settings_meta_reset_confirm))
|
||||
.setPositiveButton(android.R.string.yes,
|
||||
DialogInterface.OnClickListener { _, _ ->
|
||||
resetSettings(this.context!!)
|
||||
activity!!.finish()
|
||||
})
|
||||
.setNegativeButton(android.R.string.no, null)
|
||||
.setPositiveButton(android.R.string.ok
|
||||
) { _, _ ->
|
||||
resetSettings(this.context!!)
|
||||
activity!!.finish()
|
||||
}
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.show()
|
||||
}
|
||||
|
|
|
@ -99,14 +99,13 @@
|
|||
<string name="settings_meta_reset">Zurücksetzen</string>
|
||||
<string name="settings_meta_reset_confirm">All deine Einstellungen gehen verloren. Weitermachen?</string>
|
||||
|
||||
<string name="settings_meta_link_github">https://github.de.jrpie.android.launcher#de</string>
|
||||
|
||||
<string name="settings_meta_report_bug">Einen Fehler melden</string>
|
||||
|
||||
<string name="settings_meta_discord">Unserem Discord beitreten</string>
|
||||
|
||||
<string name="settings_meta_contact">Entwickler kontaktieren</string>
|
||||
<string name="settings_meta_contact_url">https://www.finnmglas.com/de/kontakt/</string>
|
||||
<string name="settings_meta_fork_contact">Entwickler des Fork kontaktieren</string>
|
||||
|
||||
|
||||
<!--
|
||||
|
|
|
@ -123,12 +123,11 @@
|
|||
<string name="settings_meta_reset">Configuración por defecto</string>
|
||||
<string name="settings_meta_reset_confirm">Todas sus preferencias se eliminarán. Desea continuar?</string>
|
||||
|
||||
<string name="settings_meta_link_github">https://github.de.jrpie.android.launcher#en</string>
|
||||
|
||||
<string name="settings_meta_report_bug">Reportar un error</string>
|
||||
|
||||
<string name="settings_meta_contact">Contactar al desarrollador</string>
|
||||
<string name="settings_meta_contact_url">https://www.finnmglas.com/contact/</string>
|
||||
<string name="settings_meta_fork_contact">Contact the developer of the fork (desgraciadamente no habla español)</string>
|
||||
|
||||
<string name="settings_meta_discord">Unete a nuestro discord!</string>
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
|
||||
<string name="settings_meta_contact">Contacter le développeur</string>
|
||||
<string name="settings_meta_contact_url">https://www.finnmglas.com/fr/contact/</string>
|
||||
<string name="settings_meta_fork_contact">Contact the developer of the fork (malheureusement, il ne parle pas français)</string>
|
||||
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Add table
Reference in a new issue