Merge pull request #144 from FunkyMuse/master
refactor: replace divider with our component
This commit is contained in:
commit
2bb6bec073
|
@ -26,7 +26,7 @@ val Context.config: Config get() = Config.newInstance(applicationContext)
|
||||||
internal fun Activity.startAboutActivity(
|
internal fun Activity.startAboutActivity(
|
||||||
appNameId: Int, licenseMask: Long, versionName: String, faqItems: ArrayList<FAQItem>, showFAQBeforeMail: Boolean,
|
appNameId: Int, licenseMask: Long, versionName: String, faqItems: ArrayList<FAQItem>, showFAQBeforeMail: Boolean,
|
||||||
getAppIconIDs: ArrayList<Int> = getAppIconIDs(),
|
getAppIconIDs: ArrayList<Int> = getAppIconIDs(),
|
||||||
getAppLauncherName : String = launcherName()
|
getAppLauncherName: String = launcherName()
|
||||||
) {
|
) {
|
||||||
hideKeyboard()
|
hideKeyboard()
|
||||||
Intent(applicationContext, AboutActivity::class.java).apply {
|
Intent(applicationContext, AboutActivity::class.java).apply {
|
||||||
|
@ -43,18 +43,8 @@ internal fun Activity.startAboutActivity(
|
||||||
|
|
||||||
internal fun Activity.startCustomizationActivity(
|
internal fun Activity.startCustomizationActivity(
|
||||||
getAppIconIDs: ArrayList<Int> = getAppIconIDs(),
|
getAppIconIDs: ArrayList<Int> = getAppIconIDs(),
|
||||||
getAppLauncherName : String = launcherName()
|
getAppLauncherName: String = launcherName()
|
||||||
) {
|
) {
|
||||||
if (!packageName.contains("slootelibomelpmis".reversed(), true)) {
|
|
||||||
if (baseConfig.appRunCount > 100) {
|
|
||||||
val label = "You are using a fake version of the app. For your own safety download the original one from www.simplemobiletools.com. Thanks"
|
|
||||||
ConfirmationDialog(this, label, positive = R.string.ok, negative = 0) {
|
|
||||||
launchViewIntent("https://play.google.com/store/apps/dev?id=9070296388022589266")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent(applicationContext, CustomizationActivity::class.java).apply {
|
Intent(applicationContext, CustomizationActivity::class.java).apply {
|
||||||
putExtra(APP_ICON_IDS, getAppIconIDs)
|
putExtra(APP_ICON_IDS, getAppIconIDs)
|
||||||
putExtra(APP_LAUNCHER_NAME, getAppLauncherName)
|
putExtra(APP_LAUNCHER_NAME, getAppLauncherName)
|
||||||
|
@ -75,22 +65,6 @@ internal fun Activity.launchChangeAppLanguageIntent() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun Activity.checkWhatsNew(releases: List<Release>, currVersion: Int) {
|
|
||||||
if (baseConfig.lastVersion == 0) {
|
|
||||||
baseConfig.lastVersion = currVersion
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
val newReleases = arrayListOf<Release>()
|
|
||||||
releases.filterTo(newReleases) { it.id > baseConfig.lastVersion }
|
|
||||||
|
|
||||||
if (newReleases.isNotEmpty()) {
|
|
||||||
WhatsNewDialog(this, newReleases)
|
|
||||||
}
|
|
||||||
|
|
||||||
baseConfig.lastVersion = currVersion
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getAppIconIDs() = arrayListOf(
|
private fun getAppIconIDs() = arrayListOf(
|
||||||
R.mipmap.ic_launcher_red,
|
R.mipmap.ic_launcher_red,
|
||||||
R.mipmap.ic_launcher_pink,
|
R.mipmap.ic_launcher_pink,
|
||||||
|
|
|
@ -5,10 +5,7 @@ import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import com.simplemobiletools.commons.R
|
import com.simplemobiletools.commons.R
|
||||||
import com.simplemobiletools.commons.compose.extensions.MyDevices
|
import com.simplemobiletools.commons.compose.extensions.MyDevices
|
||||||
import com.simplemobiletools.commons.compose.settings.SettingsCheckBoxComponent
|
import com.simplemobiletools.commons.compose.settings.*
|
||||||
import com.simplemobiletools.commons.compose.settings.SettingsGroup
|
|
||||||
import com.simplemobiletools.commons.compose.settings.SettingsPreferenceComponent
|
|
||||||
import com.simplemobiletools.commons.compose.settings.SettingsTitleTextComponent
|
|
||||||
import com.simplemobiletools.commons.compose.settings.scaffold.SettingsScaffold
|
import com.simplemobiletools.commons.compose.settings.scaffold.SettingsScaffold
|
||||||
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
|
import com.simplemobiletools.commons.compose.theme.AppThemeSurface
|
||||||
import com.simplemobiletools.commons.compose.theme.SimpleTheme
|
import com.simplemobiletools.commons.compose.theme.SimpleTheme
|
||||||
|
@ -36,7 +33,7 @@ internal fun SettingsScreen(
|
||||||
doOnPreferenceClick = customizeColors,
|
doOnPreferenceClick = customizeColors,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
HorizontalDivider(color = divider_grey)
|
SettingsHorizontalDivider()
|
||||||
SettingsGroup(title = {
|
SettingsGroup(title = {
|
||||||
SettingsTitleTextComponent(text = stringResource(id = R.string.general_settings))
|
SettingsTitleTextComponent(text = stringResource(id = R.string.general_settings))
|
||||||
}) {
|
}) {
|
||||||
|
|
Loading…
Reference in New Issue