Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ android {

flavorDimensions.add("variants")
productFlavors {
register("core")
register("foss")
register("gplay")
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/foss/res/values/bools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
<resources>
<bool name="default_vibrate_on_press">true</bool>
<bool name="show_donate_in_about">true</bool>
<bool name="hide_google_relations">true</bool>
<bool name="pretend_thank_you_installed">true</bool>
<bool name="is_google_play_build">false</bool>
</resources>
3 changes: 1 addition & 2 deletions app/src/gplay/res/values/bools.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="show_donate_in_about">false</bool>
<bool name="hide_google_relations">false</bool>
<bool name="pretend_thank_you_installed">true</bool>
<bool name="is_google_play_build">true</bool>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class MainActivity : SimpleActivity(), Calculator {
private fun refreshMenuItems() {
binding.mainToolbar.menu.apply {
findItem(R.id.more_apps_from_us).isVisible =
!resources.getBoolean(org.fossify.commons.R.bool.hide_google_relations)
resources.getBoolean(org.fossify.commons.R.bool.is_google_play_build)
}
}

Expand Down Expand Up @@ -226,7 +226,7 @@ class MainActivity : SimpleActivity(), Calculator {
)
)

if (!resources.getBoolean(org.fossify.commons.R.bool.hide_google_relations)) {
if (resources.getBoolean(org.fossify.commons.R.bool.is_google_play_build)) {
faqItems.add(
FAQItem(
title = org.fossify.commons.R.string.faq_2_title_commons,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import org.fossify.commons.activities.CustomizationActivity
import org.fossify.commons.compose.extensions.enableEdgeToEdgeSimple
import org.fossify.commons.compose.extensions.onEventValue
import org.fossify.commons.compose.theme.AppThemeSurface
import org.fossify.commons.compose.theme.getAppIconIds
import org.fossify.commons.compose.theme.getAppLauncherName
import org.fossify.commons.extensions.isOrWasThankYouInstalled
import org.fossify.commons.extensions.launchPurchaseThankYouIntent
import org.fossify.commons.helpers.APP_ICON_IDS
import org.fossify.commons.helpers.APP_LAUNCHER_NAME
import org.fossify.commons.helpers.IS_CUSTOMIZING_COLORS
Expand All @@ -38,7 +34,6 @@ class SettingsActivity : AppCompatActivity() {
enableEdgeToEdgeSimple()
setContent {
AppThemeSurface {
val context = LocalContext.current
val preventPhoneFromSleeping by preferences.preventPhoneFromSleepingFlow
.collectAsStateWithLifecycle(preferences.preventPhoneFromSleeping)
val vibrateOnButtonPressFlow by preferences.vibrateOnButtonPressFlow
Expand All @@ -54,9 +49,6 @@ class SettingsActivity : AppCompatActivity() {
(wasUseEnglishToggledFlow || Locale.getDefault().language != "en") && !isTiramisuPlus()
}
}
val isOrWasThankYouInstalled = onEventValue {
context.isOrWasThankYouInstalled(allowPretend = false)
}
val displayLanguage = remember { Locale.getDefault().displayLanguage }
SettingsScreen(
displayLanguage = displayLanguage,
Expand All @@ -67,8 +59,6 @@ class SettingsActivity : AppCompatActivity() {
onPreventPhoneFromSleeping = preferences::preventPhoneFromSleeping::set,
vibrateOnButtonPressFlow = vibrateOnButtonPressFlow,
onVibrateOnButtonPressFlow = preferences::vibrateOnButtonPress::set,
isOrWasThankYouInstalled = isOrWasThankYouInstalled,
onThankYou = ::launchPurchaseThankYouIntent,
isUseEnglishEnabled = isUseEnglishEnabled,
isUseEnglishChecked = useEnglishFlow,
onUseEnglishPress = { isChecked ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ import android.widget.RemoteViews
import android.widget.SeekBar
import android.widget.TextView
import org.fossify.commons.dialogs.ColorPickerDialog
import org.fossify.commons.dialogs.FeatureLockedDialog
import org.fossify.commons.extensions.adjustAlpha
import org.fossify.commons.extensions.applyColorFilter
import org.fossify.commons.extensions.beVisible
import org.fossify.commons.extensions.getContrastColor
import org.fossify.commons.extensions.getProperPrimaryColor
import org.fossify.commons.extensions.isDynamicTheme
import org.fossify.commons.extensions.isOrWasThankYouInstalled
import org.fossify.commons.extensions.setFillWithStroke
import org.fossify.commons.extensions.viewBinding
import org.fossify.commons.helpers.IS_CUSTOMIZING_COLORS
Expand All @@ -31,7 +29,6 @@ class WidgetConfigureActivity : SimpleActivity() {
private var mBgColor = 0
private var mTextColor = 0
private var mBgColorWithoutTransparency = 0
private var mFeatureLockedDialog: FeatureLockedDialog? = null

private val binding by viewBinding(WidgetConfigBinding::inflate)

Expand All @@ -57,23 +54,11 @@ class WidgetConfigureActivity : SimpleActivity() {

val primaryColor = getProperPrimaryColor()
binding.configBgSeekbar.setColors(mTextColor, primaryColor, primaryColor)

if (!isCustomizingColors && !isOrWasThankYouInstalled()) {
mFeatureLockedDialog = FeatureLockedDialog(this) {
if (!isOrWasThankYouInstalled()) {
finish()
}
}
}
}

override fun onResume() {
super.onResume()
window.decorView.setBackgroundColor(0)

if (mFeatureLockedDialog != null && isOrWasThankYouInstalled()) {
mFeatureLockedDialog?.dismissDialog()
}
}

private fun initVariables() {
Expand Down
12 changes: 2 additions & 10 deletions app/src/main/kotlin/org/fossify/math/compose/SettingsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import org.fossify.commons.compose.extensions.BooleanPreviewParameterProvider
import org.fossify.commons.compose.extensions.MyDevices
import org.fossify.commons.compose.lists.SimpleColumnScaffold
import org.fossify.commons.compose.settings.PurchaseThankYouPreference
import org.fossify.commons.compose.settings.SettingsGroup
import org.fossify.commons.compose.settings.SettingsPreferenceComponent
import org.fossify.commons.compose.settings.SettingsSwitchComponent
Expand All @@ -26,8 +27,6 @@ internal fun SettingsScreen(
onPreventPhoneFromSleeping: (Boolean) -> Unit,
vibrateOnButtonPressFlow: Boolean,
onVibrateOnButtonPressFlow: (Boolean) -> Unit,
isOrWasThankYouInstalled: Boolean,
onThankYou: () -> Unit,
isUseEnglishEnabled: Boolean,
isUseEnglishChecked: Boolean,
onUseEnglishPress: (Boolean) -> Unit,
Expand Down Expand Up @@ -58,12 +57,7 @@ internal fun SettingsScreen(
SettingsGroup(title = {
SettingsTitleTextComponent(text = stringResource(id = org.fossify.commons.R.string.general_settings))
}) {
if (!isOrWasThankYouInstalled) {
SettingsPreferenceComponent(
label = stringResource(id = org.fossify.commons.R.string.purchase_simple_thank_you),
doOnPreferenceClick = onThankYou,
)
}
PurchaseThankYouPreference()
if (isUseEnglishEnabled) {
SettingsSwitchComponent(
label = stringResource(id = org.fossify.commons.R.string.use_english_language),
Expand Down Expand Up @@ -109,8 +103,6 @@ private fun SettingsScreenPreview(
onPreventPhoneFromSleeping = {},
vibrateOnButtonPressFlow = false,
onVibrateOnButtonPressFlow = {},
isOrWasThankYouInstalled = true,
onThankYou = {},
isUseEnglishEnabled = false,
isUseEnglishChecked = false,
onUseEnglishPress = {},
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ evalex = "3.7.0"
#Room
room = "2.8.5"
#Fossify
commons = "6.1.6"
commons = "7.1.0"
#Gradle
gradlePlugins-agp = "9.4.1"
#build
Expand Down
Loading