8000 [pull] main from tasks:main by pull[bot] · Pull Request #18 · hanthor/tasks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pull] main from tasks:main #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ 8000 ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
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
2 changes: 0 additions & 2 deletions app/src/generic/java/org/tasks/analytics/Firebase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class Firebase @Inject constructor(
get() = installCooldown
|| preferences.lastSubscribeRequest + days(28L) > currentTimeMillis()

val nameYourPrice = false

private val installCooldown: Boolean
get() = preferences.installDate + days(7L) > currentTimeMillis()

Expand Down
3 changes: 0 additions & 3 deletions app/src/googleplay/java/org/tasks/analytics/Firebase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ class Firebase @Inject constructor(
get() = installCooldown
|| preferences.lastSubscribeRequest + days("subscribe_cooldown", 30L) > currentTimeMillis()

val nameYourPrice: Boolean
get() = remoteConfig?.getBoolean("name_your_price") ?: false

private fun days(key: String, default: Long): Long =
TimeUnit.DAYS.toMillis(remoteConfig?.getLong(key) ?: default)

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/org/tasks/auth/SignInActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import org.tasks.analytics.Firebase
import org.tasks.billing.Inventory
import org.tasks.billing.PurchaseActivity
import org.tasks.billing.PurchaseActivityViewModel.Companion.EXTRA_GITHUB
import org.tasks.billing.PurchaseActivityViewModel.Companion.EXTRA_NAME_YOUR_PRICE
import org.tasks.compose.ConsentDialog
import org.tasks.compose.SignInDialog
import org.tasks.dialogs.DialogBuilder
Expand Down Expand Up @@ -163,7 +164,8 @@ class SignInActivity : ComponentActivity() {
if (e is HttpException && e.code == 402) {
startActivityForResult(
Intent(this, PurchaseActivity::class.java)
.putExtra(EXTRA_GITHUB, viewModel.authService?.isGitHub ?: IS_GENERIC),
.putExtra(EXTRA_GITHUB, viewModel.authService?.isGitHub ?: IS_GENERIC)
.putExtra(EXTRA_NAME_YOUR_PRICE, false),
RC_PURCHASE
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PurchaseActivityViewModel @Inject constructor(

private val _viewState = MutableStateFlow(
ViewState(
nameYourPrice = savedStateHandle.get<Boolean>(EXTRA_NAME_YOUR_PRICE) ?: firebase.nameYourPrice,
nameYourPrice = savedStateHandle.get<Boolean>(EXTRA_NAME_YOUR_PRICE) ?: true,
isGithub = savedStateHandle.get<Boolean>(EXTRA_GITHUB) ?: false,
)
)
Expand Down Expand Up @@ -113,7 +113,7 @@ class PurchaseActivityViewModel @Inject constructor(
}

fun setNameYourPrice(nameYourPrice: Boolean) {
_viewState.update { it.copy(nameYourPrice = nameYourPrice) }
_viewState.update { it.copy(nameYourPrice = nameYourPrice) }
}

fun dismissError() {
Expand Down
7 changes: 1 addition & 6 deletions app/src/main/java/org/tasks/compose/IconPickerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.billing.Inventory
import org.tasks.billing.PurchaseActivity
import org.tasks.billing.PurchaseActivityViewModel.Companion.EXTRA_NAME_YOUR_PRICE
import org.tasks.compose.pickers.IconPicker
import org.tasks.compose.pickers.IconPickerViewModel
import org.tasks.themes.TasksTheme
Expand Down Expand Up @@ -67,10 +66,7 @@ class IconPickerActivity : AppCompatActivity() {
},
hasPro = hasPro,
subscribe = {
startActivity(
Intent(this, PurchaseActivity::class.java)
.putExtra(EXTRA_NAME_YOUR_PRICE, true)
)
startActivity(Intent(this, PurchaseActivity::class.java))
},
)
}
Expand All @@ -80,7 +76,6 @@ class IconPickerActivity : AppCompatActivity() {

companion object {
const val EXTRA_SELECTED = "extra_selected"
const val EXTRA_ICON = "extra_icon"

fun ComponentActivity.registerForIconPickerResult(callback: (String) -> Unit): ActivityResultLauncher<Intent> {
return registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
Expand Down
Loading
0