Don't update Android task description

pull/3362/head
Alex Baker 9 months ago
parent 9724590703
commit 80168565d8

@ -407,12 +407,6 @@ class MainActivity : AppCompatActivity() {
} }
logIntent("onCreate") logIntent("onCreate")
handleIntent() handleIntent()
lifecycleScope.launch {
lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) {
updateSystemBars(viewModel.state.value.filter)
}
}
} }
@Deprecated("Deprecated in Java") @Deprecated("Deprecated in Java")
@ -489,18 +483,6 @@ class MainActivity : AppCompatActivity() {
} }
} }
private fun updateSystemBars(filter: Filter) {
with (getFilterColor(filter)) {
applyTaskDescription(this@MainActivity, filter.title ?: getString(R.string.app_name))
}
}
private fun getFilterColor(filter: Filter) =
if (filter.tint != 0)
colorProvider.getThemeColor(filter.tint, true)
else
theme.themeColor
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (currentNightMode != nightMode || currentPro != inventory.hasPro) { if (currentNightMode != nightMode || currentPro != inventory.hasPro) {

@ -4,7 +4,6 @@ import android.app.Activity
import android.content.Context import android.content.Context
import android.graphics.PixelFormat import android.graphics.PixelFormat
import android.view.LayoutInflater import android.view.LayoutInflater
import org.tasks.R
import javax.inject.Inject import javax.inject.Inject
class Theme @Inject constructor( class Theme @Inject constructor(
@ -12,15 +11,12 @@ class Theme @Inject constructor(
val themeColor: ThemeColor, val themeColor: ThemeColor,
private val themeAccent: ThemeAccent private val themeAccent: ThemeAccent
) { ) {
fun withThemeColor(themeColor: ThemeColor) = Theme(themeBase, themeColor, themeAccent)
fun getLayoutInflater(context: Context) = fun getLayoutInflater(context: Context) =
wrap(context).getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater wrap(context).getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
fun applyThemeAndStatusBarColor(activity: Activity) { fun applyThemeAndStatusBarColor(activity: Activity) {
applyTheme(activity) applyTheme(activity)
themeColor.applyToNavigationBar(activity) themeColor.applyToNavigationBar(activity)
themeColor.applyTaskDescription(activity, activity.getString(R.string.app_name))
} }
fun applyTheme(activity: Activity) { fun applyTheme(activity: Activity) {

@ -4,7 +4,6 @@ import static com.todoroo.andlib.utility.AndroidUtilities.atLeastOreo;
import static org.tasks.themes.ColorUtilsKt.calculateContrast; import static org.tasks.themes.ColorUtilsKt.calculateContrast;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Resources; import android.content.res.Resources;
@ -214,11 +213,6 @@ public class ThemeColor implements Pickable {
theme.applyStyle(isDark ? R.style.BlackToolbarTheme : R.style.WhiteToolbarTheme, true); theme.applyStyle(isDark ? R.style.BlackToolbarTheme : R.style.WhiteToolbarTheme, true);
} }
public void applyTaskDescription(Activity activity, String description) {
activity.setTaskDescription(
new ActivityManager.TaskDescription(description, null, getPrimaryColor()));
}
@Override @Override
public int getPickerColor() { public int getPickerColor() {
return colorPrimary; return colorPrimary;

Loading…
Cancel
Save