Material 3 - WIP

pull/3385/head
Alex Baker 10 months ago
parent 759b418dfb
commit ba66deaddc

@ -207,7 +207,9 @@
android:taskAffinity=""
android:theme="@style/TranslucentDialog"/>
<activity android:name=".location.LocationPickerActivity"/>
<activity
android:name=".location.LocationPickerActivity"
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar" />
<activity
android:exported="true"

@ -5,6 +5,7 @@
*/
package com.todoroo.astrid.activity
import android.app.ActivityOptions
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
@ -21,12 +22,13 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.ime
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.material3.DrawerValue
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@ -50,6 +52,8 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.core.content.IntentCompat.getParcelableExtra
@ -64,10 +68,8 @@ import com.todoroo.astrid.adapter.SubheaderClickHandler
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.service.TaskCreator
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import org.tasks.BuildConfig
import org.tasks.R
import org.tasks.TasksApplication
@ -89,10 +91,8 @@ import org.tasks.data.entity.Task
import org.tasks.data.listSettingsClass
import org.tasks.dialogs.NewFilterDialog
import org.tasks.dialogs.WhatsNewDialog
import org.tasks.extensions.Context.findActivity
import org.tasks.extensions.Context.nightMode
import org.tasks.extensions.Context.openUri
import org.tasks.extensions.hideKeyboard
import org.tasks.filters.Filter
import org.tasks.filters.FilterProvider
import org.tasks.filters.FilterProvider.Companion.REQUEST_NEW_LIST
@ -100,6 +100,8 @@ import org.tasks.filters.FilterProvider.Companion.REQUEST_NEW_PLACE
import org.tasks.filters.FilterProvider.Companion.REQUEST_NEW_TAGS
import org.tasks.filters.NavigationDrawerSubheader
import org.tasks.filters.PlaceFilter
import org.tasks.kmp.org.tasks.compose.TouchSlopMultiplier
import org.tasks.kmp.org.tasks.compose.rememberImeState
import org.tasks.location.LocationPickerActivity
import org.tasks.location.LocationPickerActivity.Companion.EXTRA_PLACE
import org.tasks.preferences.DefaultFilterProvider
@ -137,7 +139,7 @@ class MainActivity : AppCompatActivity() {
*/
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
theme.applyTheme(this)
theme.themeBase.set(this)
currentNightMode = nightMode
currentPro = inventory.hasPro
@ -153,8 +155,6 @@ class MainActivity : AppCompatActivity() {
)
setContent {
val windowInsets = WindowInsets.systemBars.asPaddingValues()
TasksTheme(theme = theme.themeBase.index) {
val drawerState = rememberDrawerState(
initialValue = DrawerValue.Closed,
@ -164,9 +164,34 @@ class MainActivity : AppCompatActivity() {
}
)
val state = viewModel.state.collectAsStateWithLifecycle().value
val currentWindowInsets = WindowInsets.systemBars.asPaddingValues()
val windowInsets = remember { mutableStateOf(currentWindowInsets) }
val keyboard = LocalSoftwareKeyboardController.current
LaunchedEffect(currentWindowInsets) {
Timber.d("insets: $currentWindowInsets")
if (currentWindowInsets.calculateTopPadding() != 0.dp || currentWindowInsets.calculateBottomPadding() != 0.dp) {
windowInsets.value = currentWindowInsets
}
}
val navigator = rememberListDetailPaneScaffoldNavigator(
calculatePaneScaffoldDirective(
windowAdaptiveInfo = currentWindowAdaptiveInfo(),
verticalHingePolicy = HingePolicy.AlwaysAvoid,
).copy(
horizontalPartitionSpacerSize = 0.dp,
verticalPartitionSpacerSize = 0.dp,
)
)
val isListVisible =
navigator.scaffoldValue[ListDetailPaneScaffoldRole.List] == PaneAdaptedValue.Expanded
val isDetailVisible =
navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded
TouchSlopMultiplier {
ModalNavigationDrawer(
drawerState = drawerState,
gesturesEnabled = isListVisible,
drawerContent = {
ModalDrawerSheet(
drawerState = drawerState,
@ -176,7 +201,8 @@ class MainActivity : AppCompatActivity() {
val settingsRequest = rememberLauncherForActivityResult(
ActivityResultContracts.StartActivityForResult()
) {
context.findActivity()?.recreate()
// Activity.recreate caused window inset problems
restartActivity()
}
val scope = rememberCoroutineScope()
val bottomSearchBar = atLeastR()
@ -192,11 +218,9 @@ class MainActivity : AppCompatActivity() {
when (it) {
is DrawerItem.Filter -> {
viewModel.setFilter(it.filter)
scope.launch(Dispatchers.Default) {
withContext(Dispatchers.Main) {
context.findActivity()?.hideKeyboard()
}
scope.launch {
drawerState.close()
keyboard?.hide()
}
}
@ -206,7 +230,7 @@ class MainActivity : AppCompatActivity() {
}
},
onAddClick = {
scope.launch(Dispatchers.Default) {
scope.launch {
drawerState.close()
when (it.header.addIntentRc) {
FilterProvider.REQUEST_NEW_FILTER ->
@ -308,20 +332,6 @@ class MainActivity : AppCompatActivity() {
}
}
) {
val navigator = rememberListDetailPaneScaffoldNavigator(
calculatePaneScaffoldDirective(
windowAdaptiveInfo = currentWindowAdaptiveInfo(),
verticalHingePolicy = HingePolicy.AlwaysAvoid,
).copy(
horizontalPartitionSpacerSize = 0.dp,
verticalPartitionSpacerSize = 0.dp,
),
)
val isListVisible =
navigator.scaffoldValue[ListDetailPaneScaffoldRole.List] == PaneAdaptedValue.Expanded
val isDetailVisible =
navigator.scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded
val scope = rememberCoroutineScope()
LaunchedEffect(state.task) {
@ -332,7 +342,7 @@ class MainActivity : AppCompatActivity() {
if (intent.removeTask && intent.broughtToFront) {
moveTaskToBack(true)
}
hideKeyboard()
keyboard?.hide()
navigator.navigateTo(pane = ThreePaneScaffoldRole.Secondary)
}
} else {
@ -360,6 +370,9 @@ class MainActivity : AppCompatActivity() {
LaunchedEffect(state.filter, state.task) {
actionMode?.finish()
actionMode = null
if (state.task == null) {
keyboard?.hide()
}
drawerState.close()
}
ListDetailPaneScaffold(
@ -377,20 +390,30 @@ class MainActivity : AppCompatActivity() {
modifier = Modifier.fillMaxSize(),
) { tlf ->
fragment.value = tlf
tlf.applyInsets(windowInsets.value)
tlf.setNavigationClickListener {
scope.launch { drawerState.open() }
}
}
LaunchedEffect(fragment, windowInsets) {
fragment.value?.applyInsets(windowInsets)
fragment.value?.applyInsets(windowInsets.value)
}
}
},
detailPane = {
val direction = LocalLayoutDirection.current
Box(
modifier = Modifier
.fillMaxSize()
.padding(windowInsets),
.padding(
top = windowInsets.value.calculateTopPadding(),
start = windowInsets.value.calculateStartPadding(direction),
end = windowInsets.value.calculateEndPadding(direction),
bottom = if (rememberImeState().value)
WindowInsets.ime.asPaddingValues().calculateBottomPadding()
else
windowInsets.value.calculateBottomPadding()
),
contentAlignment = Alignment.Center,
) {
if (state.task == null) {
@ -420,6 +443,7 @@ class MainActivity : AppCompatActivity() {
}
}
}
}
logIntent("onCreate")
handleIntent()
}
@ -501,7 +525,7 @@ class MainActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
if (currentNightMode != nightMode || currentPro != inventory.hasPro) {
recreate()
restartActivity()
return
}
if (preferences.getBoolean(R.string.p_just_updated, false)) {
@ -520,6 +544,17 @@ class MainActivity : AppCompatActivity() {
actionMode = mode
}
private fun restartActivity() {
finish()
startActivity(
Intent(this, MainActivity::class.java),
ActivityOptions.makeCustomAnimation(
this@MainActivity,
android.R.anim.fade_in, android.R.anim.fade_out
).toBundle()
)
}
companion object {
/** For indicating the new list screen should be launched at fragment setup time */
const val OPEN_FILTER = "open_filter" // $NON-NLS-1$

@ -69,7 +69,6 @@ class MainActivityViewModel @Inject constructor(
)
private val _drawerOpen = MutableStateFlow(false)
val drawerOpen = _drawerOpen.asStateFlow()
private val _updateFilters = MutableStateFlow(0L)
private val _state = MutableStateFlow(

@ -7,7 +7,9 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
@ -23,7 +25,6 @@ import org.tasks.data.dao.UserActivityDao
import org.tasks.dialogs.DateTimePicker
import org.tasks.dialogs.DialogBuilder
import org.tasks.dialogs.Linkify
import org.tasks.extensions.hideKeyboard
import org.tasks.markdown.MarkdownProvider
import org.tasks.notifications.NotificationManager
import org.tasks.play.PlayServices
@ -63,6 +64,9 @@ class TaskEditFragment : Fragment() {
}
}
val context = LocalContext.current
val keyboard = LocalSoftwareKeyboardController.current
val scope = rememberCoroutineScope()
TaskEditScreen(
editViewModel = editViewModel,
viewState = viewState,
@ -70,9 +74,12 @@ class TaskEditFragment : Fragment() {
.watchComments(viewState.task.uuid)
.collectAsStateWithLifecycle(emptyList())
.value,
save = { lifecycleScope.launch { save() } },
save = {
keyboard?.hide()
lifecycleScope.launch { save() }
},
discard = {
activity?.hideKeyboard()
keyboard?.hide()
if (editViewModel.hasChanges()) {
dialogBuilder
.newDialog(R.string.discard_confirmation)
@ -84,7 +91,7 @@ class TaskEditFragment : Fragment() {
}
},
delete = {
activity?.hideKeyboard()
keyboard?.hide()
dialogBuilder
.newDialog(R.string.DLG_delete_this_task_question)
.setPositiveButton(R.string.ok) { _, _ ->

@ -6,10 +6,12 @@
package com.todoroo.astrid.activity
import android.Manifest
import android.annotation.SuppressLint
import android.app.Activity.RESULT_OK
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.res.ColorStateList
import android.os.Bundle
import android.os.Parcelable
import android.speech.RecognizerIntent
@ -19,6 +21,7 @@ import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup.MarginLayoutParams
import androidx.activity.compose.BackHandler
import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.StringRes
@ -35,7 +38,6 @@ import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.core.app.ShareCompat
import androidx.core.content.IntentCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
@ -273,26 +275,29 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
onClickMenu = onClick
}
@SuppressLint("PrivateResource")
fun applyInsets(windowInsets: PaddingValues) {
val density = resources.displayMetrics.density
val topInset = (windowInsets.calculateTopPadding().value * density).toInt()
val bottomInset = (windowInsets.calculateBottomPadding().value * density).toInt()
if (topInset == 0 && bottomInset == 0) {
Timber.d("$this: Ignoring insets")
return
} else {
Timber.d("$this: applying insets")
}
with(binding.toolbar) {
val actionBarHeight = TypedValue.complexToDimensionPixelSize(
getData(requireContext(), android.R.attr.actionBarSize),
resources.displayMetrics
)
with(binding.toolbar) {
val topInset = (windowInsets.calculateTopPadding().value * density).toInt()
val params = layoutParams
params.height = actionBarHeight + topInset
layoutParams = params
updatePadding(top = topInset)
}
with(binding.bottomAppBar) {
val bottomInset = (windowInsets.calculateBottomPadding().value * density).toInt()
val params = layoutParams
params.height = actionBarHeight + bottomInset
layoutParams = params
updatePadding(bottom = bottomInset)
}
binding.bottomAppBar.updatePadding(bottom = bottomInset)
(binding.fab.layoutParams as MarginLayoutParams).bottomMargin = bottomInset / 2
}
@OptIn(ExperimentalPermissionsApi::class)
@ -300,19 +305,6 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = FragmentTaskListBinding.inflate(inflater, container, false)
ViewCompat.setOnApplyWindowInsetsListener(binding.toolbar) { view, windowInsets ->
val actionBarHeight = TypedValue.complexToDimensionPixelSize(
getData(requireContext(), android.R.attr.actionBarSize),
resources.displayMetrics
)
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
val params = view.layoutParams
params.height = actionBarHeight + insets.top
view.layoutParams = params
view.updatePadding(top = insets.top)
windowInsets
}
filter = getFilter()
val swipeRefreshLayout: SwipeRefreshLayout
val emptyRefreshLayout: SwipeRefreshLayout
@ -354,21 +346,25 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
setupRefresh(swipeRefreshLayout)
setupRefresh(emptyRefreshLayout)
binding.toolbar.title = filter.title
binding.toolbar.setTitleTextAppearance(requireContext(), com.google.android.material.R.style.TextAppearance_Material3_HeadlineSmall)
binding.toolbar.setTitleTextColor(themeColor.primaryColor)
binding.appbarlayout.addOnOffsetChangedListener { _, verticalOffset ->
if (verticalOffset == 0 && binding.bottomAppBar.isScrolledDown) {
binding.bottomAppBar.performShow()
}
}
val toolbar = run {
themeColor.apply(binding.bottomAppBar)
binding.bottomAppBar
with (binding.fab) {
backgroundTintList = ColorStateList.valueOf(themeColor.primaryColor)
imageTintList = ColorStateList.valueOf(themeColor.colorOnPrimary)
}
toolbar.setOnMenuItemClickListener(this)
toolbar.setNavigationOnClickListener {
with (binding.bottomAppBar) {
setOnMenuItemClickListener(this@TaskListFragment)
setNavigationOnClickListener {
activity?.hideKeyboard()
onClickMenu()
}
setupMenu(toolbar)
setupMenu(this)
}
binding.banner.setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
binding.banner.setContent {
val context = LocalContext.current
@ -475,6 +471,7 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
}
}
}
ViewCompat.requestApplyInsets(binding.toolbar)
return binding.root
}
@ -705,10 +702,16 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
private fun makeSnackbar(text: String): Snackbar? = activity?.let {
Snackbar.make(binding.taskListCoordinator, text, 4000)
.setAnchorView(R.id.fab)
.setTextColor(it.getColor(R.color.snackbar_text_color))
.setActionTextColor(it.getColor(R.color.snackbar_action_color))
.setBackgroundTint(it.getColor(R.color.dialog_background))
.setTextColor(it.getColor(R.color.text_primary))
.setActionTextColor(themeColor.primaryColor)
.apply {
view.setBackgroundColor(it.getColor(R.color.snackbar_background))
val offset = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
16f,
context.resources.displayMetrics
)
view.translationY = -offset
}
}
@ -1123,13 +1126,5 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
private const val FRAG_TAG_DATE_TIME_PICKER = "frag_tag_date_time_picker"
private const val FRAG_TAG_PRIORITY_PICKER = "frag_tag_priority_picker"
private const val REQUEST_TAG_TASKS = 10106
fun newTaskListFragment(filter: Filter): TaskListFragment {
val fragment = TaskListFragment()
val bundle = Bundle()
bundle.putParcelable(EXTRA_FILTER, filter)
fragment.arguments = bundle
return fragment
}
}
}

@ -22,7 +22,6 @@ import org.tasks.data.entity.Task
import org.tasks.dialogs.DialogBuilder
import org.tasks.extensions.Context.is24HourFormat
import org.tasks.kmp.org.tasks.time.getTimeString
import org.tasks.themes.Theme
import org.tasks.time.DateTimeUtils2.currentTimeMillis
import org.tasks.ui.TaskEditControlFragment
import javax.inject.Inject
@ -36,7 +35,6 @@ import javax.inject.Inject
class TimerControlSet : TaskEditControlFragment() {
@Inject lateinit var activity: Activity
@Inject lateinit var dialogBuilder: DialogBuilder
@Inject lateinit var theme: Theme
@Inject lateinit var timerPlugin: TimerPlugin
private lateinit var estimated: TimeDurationControlSet
@ -81,8 +79,8 @@ class TimerControlSet : TaskEditControlFragment() {
override fun Content() {
LaunchedEffect(Unit) {
dialogView = activity.layoutInflater.inflate(R.layout.control_set_timers_dialog, null)
estimated = TimeDurationControlSet(activity, dialogView, R.id.estimatedDuration, theme)
elapsed = TimeDurationControlSet(activity, dialogView, R.id.elapsedDuration, theme)
estimated = TimeDurationControlSet(activity, dialogView, R.id.estimatedDuration)
elapsed = TimeDurationControlSet(activity, dialogView, R.id.elapsedDuration)
estimated.setTimeDuration(viewModel.estimatedSeconds.value)
elapsed.setTimeDuration(viewModel.elapsedSeconds.value)
}

@ -11,9 +11,13 @@ import android.view.View
import android.widget.TextView
import com.todoroo.astrid.ui.NNumberPickerDialog.OnNNumberPickedListener
import org.tasks.R
import org.tasks.themes.Theme
class TimeDurationControlSet(private val context: Context, view: View, timeButtonId: Int, private val theme: Theme) : OnNNumberPickedListener, View.OnClickListener {
class TimeDurationControlSet(
private val context: Context,
view: View,
timeButtonId: Int,
) : OnNNumberPickedListener,
View.OnClickListener {
private val timeButton: TextView = view.findViewById(timeButtonId)
var timeDurationInSeconds = 0
private set
@ -64,7 +68,6 @@ class TimeDurationControlSet(private val context: Context, view: View, timeButto
if (initialValues != null) {
dialog!!.setInitialValues(initialValues)
}
theme.applyToContext(dialog!!.context)
dialog!!.show()
}

@ -12,14 +12,12 @@ import org.tasks.dialogs.MyTimePickerDialog
import org.tasks.dialogs.MyTimePickerDialog.Companion.newTimePicker
import org.tasks.dialogs.MyTimePickerDialog.Companion.timeInputMode
import org.tasks.preferences.Preferences
import org.tasks.themes.ThemeAccent
import org.tasks.time.DateTime
import org.tasks.time.DateTimeUtils2.currentTimeMillis
import javax.inject.Inject
@AndroidEntryPoint
class DateAndTimePickerActivity : AppCompatActivity() {
@Inject lateinit var themeAccent: ThemeAccent
@Inject lateinit var preferences: Preferences
private var initial: DateTime? = null
@ -33,7 +31,6 @@ class DateAndTimePickerActivity : AppCompatActivity() {
?.getLong(EXTRA_DATE_SELECTED)
?.takeIf { it > 0 }
?.let { DateTime(it, DateTime.UTC) }
themeAccent.applyStyle(theme)
if (dateSelected != null) {
showTimePicker()
} else {

@ -26,8 +26,6 @@ class PurchaseActivity : AppCompatActivity(), OnPurchasesUpdated {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
theme.applyToContext(this)
setContent {
TasksTheme(theme = theme.themeBase.index) {
BackHandler {

@ -35,7 +35,6 @@ import org.tasks.data.entity.CaldavAccount.Companion.SERVER_TASKS
import org.tasks.data.entity.CaldavCalendar
import org.tasks.data.entity.CaldavCalendar.Companion.ACCESS_OWNER
import org.tasks.themes.TasksTheme
import org.tasks.themes.ThemeAccent
import org.tasks.themes.colorOn
import javax.inject.Inject
@ -43,7 +42,6 @@ import javax.inject.Inject
class CaldavCalendarSettingsActivity : BaseCaldavCalendarSettingsActivity() {
@Inject lateinit var principalDao: PrincipalDao
@Inject lateinit var accent: ThemeAccent
private val viewModel: CaldavCalendarViewModel by viewModels()
@ -81,16 +79,15 @@ class CaldavCalendarSettingsActivity : BaseCaldavCalendarSettingsActivity() {
openDialog.value = false
}
}
val accentColor = Color(accent.accentColor)
FloatingActionButton(
onClick = { openDialog.value = true },
modifier = Modifier.padding(Constants.KEYLINE_FIRST),
containerColor = accentColor
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary,
) {
Icon(
imageVector = Icons.Outlined.PersonAdd,
contentDescription = null,
tint = colorOn(accentColor),
)
}
}

@ -37,7 +37,7 @@ fun TaskEditRow(
enabled = onClick != null,
onClick = { onClick?.invoke() }
)
.background(MaterialTheme.colorScheme.surface),
.background(MaterialTheme.colorScheme.background),
) {
icon()
content()

@ -46,7 +46,7 @@ fun DueDateRow(
} else {
newDateTime(dueDate).endOfDay().isBeforeNow
},
onClick = onClick,
onClick = { onClick() },
)
}

@ -6,10 +6,11 @@ import androidx.activity.compose.BackHandler
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
@ -22,8 +23,10 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.rememberCoroutineScope
@ -116,6 +119,9 @@ fun TaskEditScreen(
Scaffold(
topBar = {
TopAppBar(
colors = TopAppBarDefaults.topAppBarColors().copy(
containerColor = MaterialTheme.colorScheme.background,
),
navigationIcon = {
if (viewState.isReadOnly) {
IconButton(onClick = { onBackPressed() }) {
@ -162,11 +168,10 @@ fun TaskEditScreen(
AndroidFragment<CommentBarFragment>(
modifier = Modifier
.fillMaxWidth()
.navigationBarsPadding()
.padding(WindowInsets.navigationBars.asPaddingValues())
)
}
},
modifier = Modifier.imePadding(),
) { paddingValues ->
Column(
modifier = Modifier

@ -10,10 +10,15 @@ import android.view.ViewGroup
import android.widget.CalendarView
import android.widget.FrameLayout
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.lifecycle.lifecycleScope
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.android.material.button.MaterialButton
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.tasks.R
import org.tasks.extensions.Context.is24HourFormat
import org.tasks.kmp.org.tasks.time.getTimeString
@ -66,9 +71,17 @@ abstract class BaseDateTimePicker : BottomSheetDialogFragment() {
dialog
.findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)
?.let { bottomSheet ->
with (BottomSheetBehavior.from(bottomSheet)) {
state = BottomSheetBehavior.STATE_EXPANDED
skipCollapsed = true
val behavior = BottomSheetBehavior.from(bottomSheet)
behavior.skipCollapsed = true
val insets = ViewCompat.getRootWindowInsets(requireActivity().window.decorView)
if (insets?.isVisible(WindowInsetsCompat.Type.ime()) == true) {
lifecycleScope.launch {
delay(100)
behavior.state = BottomSheetBehavior.STATE_EXPANDED
}
} else {
behavior.state = BottomSheetBehavior.STATE_EXPANDED
}
}

@ -75,7 +75,6 @@ class ColorPalettePicker : DialogFragment() {
palette = requireArguments().getSerializable(EXTRA_PALETTE) as Palette
colors = when (palette) {
Palette.COLORS -> colorProvider.getThemeColors()
Palette.ACCENTS -> colorProvider.getAccentColors()
Palette.LAUNCHERS -> ThemeColor.LAUNCHER_COLORS.map { color ->
ThemeColor(context, requireContext().getColor(color))
}

@ -17,7 +17,6 @@ class ColorPickerAdapter(
enum class Palette {
COLORS,
ACCENTS,
LAUNCHERS,
WIDGET
}

@ -18,7 +18,6 @@ import com.todoroo.andlib.utility.AndroidUtilities.preS
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.R
import org.tasks.billing.Inventory
import org.tasks.themes.ThemeAccent
import org.tasks.themes.ThemeBase
import org.tasks.themes.ThemeBase.EXTRA_THEME_OVERRIDE
import javax.inject.Inject
@ -48,7 +47,6 @@ class ThemePickerDialog : DialogFragment() {
@Inject lateinit var inventory: Inventory
@Inject lateinit var dialogBuilder: DialogBuilder
@Inject lateinit var accent: ThemeAccent
@Inject lateinit var themeBase: ThemeBase
var adapter: ArrayAdapter<String>? = null

@ -6,11 +6,9 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.scopes.ActivityScoped
import org.tasks.R
import org.tasks.billing.Inventory
import org.tasks.preferences.Preferences
import org.tasks.themes.ColorProvider
import org.tasks.themes.ThemeAccent
import org.tasks.themes.ThemeBase
import org.tasks.themes.ThemeColor
@ -27,9 +25,4 @@ class ActivityModule {
@ActivityScoped
fun getThemeColor(colorProvider: ColorProvider, preferences: Preferences): ThemeColor
= colorProvider.getThemeColor(preferences.defaultThemeColor, true)
@Provides
@ActivityScoped
fun getThemeAccent(colorProvider: ColorProvider, preferences: Preferences): ThemeAccent
= colorProvider.getThemeAccent(preferences.getInt(R.string.p_theme_accent, 1))
}

@ -2,11 +2,13 @@ package org.tasks.location
import android.app.Activity
import android.content.Intent
import android.content.res.ColorStateList
import android.content.res.Configuration
import android.os.Bundle
import android.os.Parcelable
import android.view.MenuItem
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.SearchView
@ -89,7 +91,7 @@ class LocationPickerActivity : AppCompatActivity(), Toolbar.OnMenuItemClickListe
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
theme.applyTheme(this)
enableEdgeToEdge()
window.statusBarColor = ContextCompat.getColor(this, android.R.color.transparent)
val binding = ActivityLocationPickerBinding.inflate(layoutInflater)
setContentView(binding.root)
@ -123,8 +125,6 @@ class LocationPickerActivity : AppCompatActivity(), Toolbar.OnMenuItemClickListe
search = menu.findItem(R.id.menu_search)
search.setOnActionExpandListener(this)
toolbar.setOnMenuItemClickListener(this)
val themeColor = theme.themeColor
themeColor.applyToNavigationBar(this)
val dark = theme.themeBase.isDarkTheme(this)
map.init(this, this, dark)
val params = appBarLayout.layoutParams as CoordinatorLayout.LayoutParams
@ -164,7 +164,11 @@ class LocationPickerActivity : AppCompatActivity(), Toolbar.OnMenuItemClickListe
recyclerView.layoutManager = LinearLayoutManager(this)
recyclerView.adapter = if (search.isActionViewExpanded) searchAdapter else recentsAdapter
binding.currentLocation.setOnClickListener { currentLocation() }
with (binding.currentLocation) {
setOnClickListener { currentLocation() }
backgroundTintList = ColorStateList.valueOf(theme.themeColor.primaryColor)
imageTintList = ColorStateList.valueOf(theme.themeColor.colorOnPrimary)
}
binding.selectThisLocation.setOnClickListener { selectLocation() }
}

@ -29,7 +29,6 @@ import org.tasks.injection.InjectingPreferenceFragment
import org.tasks.locale.LocalePickerDialog
import org.tasks.preferences.DefaultFilterProvider
import org.tasks.preferences.Preferences
import org.tasks.themes.ThemeAccent
import org.tasks.themes.ThemeBase
import org.tasks.themes.ThemeBase.DEFAULT_BASE_THEME
import org.tasks.themes.ThemeBase.EXTRA_THEME_OVERRIDE
@ -43,7 +42,6 @@ class LookAndFeel : InjectingPreferenceFragment() {
@Inject lateinit var themeBase: ThemeBase
@Inject lateinit var themeColor: ThemeColor
@Inject lateinit var themeAccent: ThemeAccent
@Inject lateinit var preferences: Preferences
@Inject lateinit var localBroadcastManager: LocalBroadcastManager
@Inject lateinit var defaultFilterProvider: DefaultFilterProvider
@ -102,12 +100,6 @@ class LookAndFeel : InjectingPreferenceFragment() {
ColorPickerAdapter.Palette.COLORS,
REQUEST_COLOR_PICKER
)
setupColorPreference(
R.string.p_theme_accent,
themeAccent.pickerColor,
ColorPickerAdapter.Palette.ACCENTS,
REQUEST_ACCENT_PICKER
)
updateLauncherPreference()
}
@ -170,15 +162,6 @@ class LookAndFeel : InjectingPreferenceFragment() {
}
}
}
REQUEST_ACCENT_PICKER -> {
if (resultCode == RESULT_OK) {
val index = data!!.getIntExtra(ColorPalettePicker.EXTRA_SELECTED, 0)
if (preferences.getInt(R.string.p_theme_accent, -1) != index) {
preferences.setInt(R.string.p_theme_accent, index)
recreate()
}
}
}
REQUEST_LAUNCHER_PICKER -> {
if (resultCode == RESULT_OK) {
val index = data!!.getIntExtra(ColorPalettePicker.EXTRA_SELECTED, 0)
@ -233,7 +216,6 @@ class LookAndFeel : InjectingPreferenceFragment() {
companion object {
private const val REQUEST_THEME_PICKER = 10001
private const val REQUEST_COLOR_PICKER = 10002
private const val REQUEST_ACCENT_PICKER = 10003
private const val REQUEST_LAUNCHER_PICKER = 10004
private const val REQUEST_LOCALE = 10006
private const val REQUEST_PURCHASE = 10007

@ -11,7 +11,6 @@ import org.tasks.data.dao.TaskDao
import org.tasks.intents.TaskIntents
import org.tasks.notifications.NotificationManager
import org.tasks.receivers.CompleteTaskReceiver
import org.tasks.themes.ThemeAccent
import timber.log.Timber
import javax.inject.Inject
@ -19,13 +18,11 @@ import javax.inject.Inject
class NotificationActivity : AppCompatActivity(), NotificationDialog.NotificationHandler {
@Inject lateinit var notificationManager: NotificationManager
@Inject lateinit var taskDao: TaskDao
@Inject lateinit var themeAccent: ThemeAccent
private var taskId: Long = 0
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
themeAccent.applyStyle(theme)
val intent = intent
taskId = intent.getLongExtra(EXTRA_TASK_ID, 0L)
val fragmentManager = supportFragmentManager

@ -14,7 +14,6 @@ import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.launch
import org.tasks.activities.DateAndTimePickerActivity
import org.tasks.dialogs.MyTimePickerDialog
import org.tasks.themes.ThemeAccent
import org.tasks.time.DateTime
import javax.inject.Inject
@ -22,14 +21,12 @@ import javax.inject.Inject
class SnoozeActivity : AppCompatActivity(), SnoozeCallback, DialogInterface.OnCancelListener {
@Inject lateinit var taskDao: TaskDao
@Inject lateinit var alarmService: AlarmService
@Inject lateinit var themeAccent: ThemeAccent
private val taskIds: MutableList<Long> = ArrayList()
private var pickingDateTime = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
themeAccent.applyStyle(theme)
val intent = intent
if (intent.hasExtra(EXTRA_TASK_ID)) {
taskIds.add(intent.getLongExtra(EXTRA_TASK_ID, -1L))

@ -6,7 +6,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import org.tasks.R
import org.tasks.kmp.org.tasks.themes.ColorProvider.priorityColor
import org.tasks.kmp.org.tasks.themes.ColorProvider.saturated
import org.tasks.preferences.Preferences
import javax.inject.Inject
class ColorProvider @Inject constructor(
@ -30,17 +29,9 @@ class ColorProvider @Inject constructor(
isDarkMode = isDark,
)
fun getThemeAccent(index: Int) = ThemeAccent(context, if (isDark) {
ThemeAccent.ACCENTS_DESATURATED[index]
} else {
ThemeAccent.ACCENTS[index]
})
fun getThemeColors(adjust: Boolean = true) = ThemeColor.COLORS.map { c ->
getThemeColor(context.getColor(c), adjust)
}
fun getWidgetColors() = getThemeColors(false)
fun getAccentColors() = ThemeAccent.ACCENTS.indices.map(this@ColorProvider::getThemeAccent)
}

@ -2,17 +2,15 @@ package org.tasks.themes
import android.app.Activity
import android.content.Context
import android.graphics.PixelFormat
import android.view.LayoutInflater
import javax.inject.Inject
class Theme @Inject constructor(
val themeBase: ThemeBase,
val themeColor: ThemeColor,
private val themeAccent: ThemeAccent
) {
fun getLayoutInflater(context: Context) =
wrap(context).getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
fun applyThemeAndStatusBarColor(activity: Activity) {
applyTheme(activity)
@ -21,19 +19,5 @@ class Theme @Inject constructor(
fun applyTheme(activity: Activity) {
themeBase.set(activity)
applyToContext(activity)
activity.window.setFormat(PixelFormat.RGBA_8888)
}
fun applyToContext(context: Context) {
val theme = context.theme
themeColor.applyStyle(theme)
themeAccent.applyStyle(theme)
}
private fun wrap(context: Context): Context {
val wrapper = themeBase.wrap(context)
applyToContext(wrapper)
return wrapper
}
}

@ -1,119 +0,0 @@
package org.tasks.themes;
import android.content.Context;
import android.content.res.Resources;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import org.tasks.R;
import org.tasks.dialogs.ColorPalettePicker.Pickable;
public class ThemeAccent implements Pickable {
public static final int[] ACCENTS =
new int[] {
R.style.BlueGreyAccent,
R.style.RedAccent,
R.style.PinkAccent,
R.style.PurpleAccent,
R.style.DeepPurpleAccent,
R.style.IndigoAccent,
R.style.BlueAccent,
R.style.LightBlueAccent,
R.style.CyanAccent,
R.style.TealAccent,
R.style.GreenAccent,
R.style.LightGreenAccent,
R.style.LimeAccent,
R.style.YellowAccent,
R.style.AmberAccent,
R.style.OrangeAccent,
R.style.DeepOrangeAccent
};
public static final int[] ACCENTS_DESATURATED =
new int[] {
R.style.BlueGreyAccentDesaturated,
R.style.RedAccentDesaturated,
R.style.PinkAccentDesaturated,
R.style.PurpleAccentDesaturated,
R.style.DeepPurpleAccentDesaturated,
R.style.IndigoAccentDesaturated,
R.style.BlueAccentDesaturated,
R.style.LightBlueAccentDesaturated,
R.style.CyanAccentDesaturated,
R.style.TealAccentDesaturated,
R.style.GreenAccentDesaturated,
R.style.LightGreenAccentDesaturated,
R.style.LimeAccentDesaturated,
R.style.YellowAccentDesaturated,
R.style.AmberAccentDesaturated,
R.style.OrangeAccentDesaturated,
R.style.DeepOrangeAccentDesaturated
};
public static final Parcelable.Creator<ThemeAccent> CREATOR =
new Parcelable.Creator<>() {
@Override
public ThemeAccent createFromParcel(Parcel source) {
return new ThemeAccent(source);
}
@Override
public ThemeAccent[] newArray(int size) {
return new ThemeAccent[size];
}
};
private final int style;
@Deprecated private final int accentColor;
public ThemeAccent(Context context, int style) {
this.style = style;
Resources.Theme theme = new ContextThemeWrapper(context, style).getTheme();
this.accentColor = resolveAttribute(theme, com.google.android.material.R.attr.colorSecondary);
}
private ThemeAccent(Parcel source) {
style = source.readInt();
accentColor = source.readInt();
}
private static int resolveAttribute(Resources.Theme theme, int attribute) {
TypedValue typedValue = new TypedValue();
theme.resolveAttribute(attribute, typedValue, true);
return typedValue.data;
}
public void applyStyle(Resources.Theme theme) {
theme.applyStyle(style, true);
}
@Override
public int getPickerColor() {
return accentColor;
}
@Override
public boolean isFree() {
return style == R.style.BlueGreyAccent ||
style == R.style.RedAccent ||
style == R.style.BlueGreyAccentDesaturated ||
style == R.style.RedAccentDesaturated;
}
@Deprecated
public int getAccentColor() {
return accentColor;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(style);
dest.writeInt(accentColor);
}
}

@ -5,8 +5,6 @@ import static org.tasks.themes.ColorUtilsKt.calculateContrast;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Build.VERSION_CODES;
import android.os.Parcel;
import android.os.Parcelable;
@ -16,8 +14,6 @@ import androidx.annotation.ColorInt;
import androidx.annotation.RequiresApi;
import androidx.core.os.ParcelCompat;
import com.google.android.material.bottomappbar.BottomAppBar;
import org.tasks.R;
import org.tasks.dialogs.ColorPalettePicker.Pickable;
@ -209,10 +205,6 @@ public class ThemeColor implements Pickable {
: flag & ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
}
void applyStyle(Resources.Theme theme) {
theme.applyStyle(isDark ? R.style.BlackToolbarTheme : R.style.WhiteToolbarTheme, true);
}
@Override
public int getPickerColor() {
return colorPrimary;
@ -248,10 +240,6 @@ public class ThemeColor implements Pickable {
return isDark;
}
public void apply(BottomAppBar bottomAppBar) {
bottomAppBar.setBackgroundTint(ColorStateList.valueOf(getPrimaryColor()));
}
@Override
public int describeContents() {
return 0;

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 24% opacity -->
<item android:alpha="0.24" android:color="?attr/colorSecondary" android:state_enabled="true" android:state_selected="true"/>
<item android:alpha="0.24" android:color="?attr/colorSecondary" android:state_enabled="true" android:state_checked="true"/>
<!-- 12% of 87% opacity -->
<item android:alpha="0.10" android:color="?attr/colorOnSurface" android:state_enabled="true"/>
<item android:alpha="0.12" android:color="?attr/colorOnSurface"/>
</selector>

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?attr/colorSecondary" android:state_enabled="true" android:state_selected="true"/>
<item android:color="?attr/colorSecondary" android:state_enabled="true" android:state_checked="true"/>
<!-- 87% opacity. -->
<item android:alpha="0.87" android:color="?attr/colorOnSurface" android:state_enabled="true"/>
<!-- 38% of 87% opacity. -->
<item android:alpha="0.33" android:color="?attr/colorOnSurface"/>
</selector>

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?attr/colorSecondary" android:state_focused="true"/>
<!-- 4% overlay over 42% colorOnSurface -->
<item android:alpha="0.46" android:color="?attr/colorOnSurface" android:state_hovered="true"/>
<item android:alpha="0.38" android:color="?attr/colorOnSurface" android:state_enabled="false"/>
<item android:alpha="0.42" android:color="?attr/colorOnSurface"/>
</selector>

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="1.00" android:color="?attr/colorSecondary" android:state_checkable="true" android:state_checked="true" android:state_enabled="true"/>
<item android:alpha="0.60" android:color="?attr/colorOnSurface" android:state_checkable="true" android:state_checked="false" android:state_enabled="true"/>
<item android:alpha="1.00" android:color="?attr/colorSecondary" android:state_enabled="true"/>
<item android:alpha="0.38" android:color="?attr/colorOnSurface"/>
</selector>

@ -19,7 +19,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:theme="@style/ToolbarTheme"
android:theme="@style/LegacyToolbarTheme"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:contentScrim="@color/content_background"
app:statusBarScrim="@color/content_background"
@ -62,7 +62,6 @@
android:layout_gravity="end|bottom"
android:padding="0dp"
android:src="@drawable/ic_outline_gps_fixed_24px"
app:backgroundTint="?attr/colorAccent"
app:borderWidth="0dp"
app:layout_constraintBottom_toBottomOf="@id/map"
app:layout_constraintEnd_toEndOf="@id/map"/>
@ -114,7 +113,7 @@
android:gravity="start|center_vertical"
android:text="@string/pick_this_location"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
android:textColor="@color/text_primary"/>
<TextView
@ -128,7 +127,7 @@
android:gravity="start"
android:text="@string/or_choose_a_location"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
android:textColor="@color/text_primary"/>
</RelativeLayout>
@ -139,7 +138,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/ToolbarTheme"
android:theme="@style/LegacyToolbarTheme"
app:layout_collapseMode="pin"
app:popupTheme="@style/popup_overlay"
app:title="@string/choose_a_location"/>
@ -174,7 +173,7 @@
android:gravity="start"
android:text="@string/TLA_menu_search"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
android:textColor="@color/text_primary"/>
</com.google.android.material.card.MaterialCardView>
@ -188,7 +187,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/window_background"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
tools:listitem="@layout/row_place"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/date_group"
android:layout_width="0dp"

@ -20,7 +20,7 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/url_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/keyline_first"
@ -37,7 +37,7 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/user_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/keyline_first"
@ -54,7 +54,7 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/password_layout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:endIconMode="custom"

@ -16,7 +16,7 @@
android:layout_alignParentTop="true" />
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.TextButton"
style="@style/Widget.Material3.Button.TextButton"
android:textColor="?attr/colorAccent"
android:id="@+id/ok_button"
android:text="@string/ok"
@ -26,7 +26,7 @@
android:layout_alignParentEnd="true" />
<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.TextButton"
style="@style/Widget.Material3.Button.TextButton"
android:textColor="?attr/colorAccent"
android:layout_below="@id/divider"
android:id="@+id/cancel_button"

@ -30,7 +30,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/dismiss_button"
style="@style/Widget.MaterialComponents.Button.TextButton"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/keyline_first"

@ -24,7 +24,7 @@
android:layout_gravity="top"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/content_background"
android:background="?attr/background"
android:theme="@style/ToolbarTheme"
app:hideOnScroll="true"
app:layout_scrollFlags="scroll|enterAlways"
@ -36,7 +36,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/banner"
@ -71,12 +71,11 @@
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
style="@style/Widget.MaterialComponents.BottomAppBar"
style="@style/Widget.Material3.BottomAppBar"
android:theme="@style/ToolbarTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:theme="?attr/overlay_theme"
app:popupTheme="@style/popup_overlay"
app:hideOnScroll="true"
app:navigationIcon="@drawable/ic_outline_menu_24px"/>
@ -85,8 +84,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/action_create_new_task"
app:backgroundTint="?attr/colorAccent"
app:layout_anchor="@id/bottomAppBar"
app:layout_anchorGravity="top|end"
app:srcCompat="@drawable/ic_outline_add_24px"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

@ -42,7 +42,7 @@
android:gravity="start|top"
android:maxLines="2"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"/>
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"/>
<TextView
android:id="@+id/address"
@ -56,7 +56,7 @@
android:ellipsize="end"
android:maxLines="2"
android:visibility="gone"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"/>
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"/>
</RelativeLayout>

@ -26,4 +26,4 @@
android:drawablePadding="@dimen/keyline_second"
android:gravity="center_vertical"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"/>
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"/>

@ -4,7 +4,7 @@
android:id="@+id/header_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
android:foreground="?attr/selectableItemBackground">
<TextView
android:id="@+id/header"

@ -116,7 +116,6 @@
<string name="opacity">التعتيم</string>
<string name="settings_localization">تخصيص اللغة و الجهة</string>
<string name="backup_BAc_export">نسخ احتياطي الآن</string>
<string name="accent">اللون الثانوي</string>
<string name="theme_system_default">افتراضيات النظام</string>
<string name="theme_day_night">صباحي/مسائي</string>
<string name="theme_wallpaper">خلفية</string>

@ -287,7 +287,6 @@
<string name="opacity">Непрозрачност</string>
<string name="theme">Тема</string>
<string name="color">Цвят</string>
<string name="accent">Акцент</string>
<string name="launcher_icon">Икона за стартиране</string>
<string name="theme_black">Черна</string>
<string name="theme_light">Светла</string>

@ -502,5 +502,4 @@
<string name="restart_later">Després</string>
<string name="quiet_hours_in_effect">Les hores tranquil·les són efectives</string>
<string name="opacity_footer">Opacitat del peu</string>
<string name="accent">Accent</string>
</resources>

@ -313,7 +313,6 @@
<string name="url_required">Zadejte URL</string>
<string name="url_host_name_required">Zadejte adresu serveru</string>
<string name="url_invalid_scheme">Musí začínat na http(s)://</string>
<string name="accent">Doplňková barva</string>
<string name="launcher_icon">Ikona na domovské obrazovce</string>
<string name="led_notification">LED upozornění</string>
<string name="hardware_support_required">Je vyžadována hardwarová podpora</string>

@ -259,7 +259,6 @@
<string name="theme_light">Lys</string>
<string name="launcher_icon">App-ikon</string>
<string name="theme_black">Sort</string>
<string name="accent">Fremhævelse</string>
<string name="icon">Ikon</string>
<string name="color">Farve</string>
<string name="theme">Tema</string>

@ -277,7 +277,6 @@
<string name="default_list">Standardliste</string>
<string name="opacity">Deckkraft</string>
<string name="color">Farbe</string>
<string name="accent">Akzent</string>
<string name="launcher_icon">Launcher-Symbol</string>
<string name="theme_black">Schwarz</string>
<string name="theme_light">Hell</string>

@ -596,7 +596,6 @@
<string name="alarm_before_due">%s antaŭ limdato</string>
<string name="no_app_found">Neniu programeto povis pritrakti ĉi tiun peton</string>
<string name="launcher_icon">Lanĉila piktogramo</string>
<string name="accent">Akcento</string>
<string name="caldav_home_set_not_found">Ne trovis hejman aron</string>
<string name="refresh_purchases">Reŝargi aĉetojn</string>
<string name="background_location_permission_required">Tasks kolektas lokan datumon por ebligi lok-bazitajn memorigilojn, eĉ kiam la programeto estas fermita aŭ ne uzata.</string>

@ -299,7 +299,6 @@
<string name="filter">Filtro</string>
<string name="opacity">Opacidad</string>
<string name="theme">Tema</string>
<string name="accent">Acentuado</string>
<string name="launcher_icon">Icono del iniciador</string>
<string name="theme_black">Negro</string>
<string name="theme_light">Claro</string>

@ -425,7 +425,6 @@
<string name="next_sunday">Järgmine P</string>
<string name="next_saturday">Järgmine L</string>
<string name="settings_localization">Kohalikustamine</string>
<string name="accent">Rõhuvärv</string>
<string name="custom_filter_has_reminder">Meeldetuletusega</string>
<string name="privacy">Privaatsus</string>
<string name="TEA_add_subtask">Lisa alamülesanne</string>

@ -288,7 +288,6 @@
<string name="opacity">Opakutasuna</string>
<string name="theme">Azala</string>
<string name="color">Kolorea</string>
<string name="accent">Azentua</string>
<string name="launcher_icon">Abiarazlearen ikonoa</string>
<string name="theme_black">Beltza</string>
<string name="theme_light">Argia</string>

@ -265,7 +265,6 @@
<string name="opacity">Läpinäkyvyys</string>
<string name="theme">Teema</string>
<string name="color">Väri</string>
<string name="accent">Sävy</string>
<string name="theme_black">Musta</string>
<string name="theme_light">Vaalea</string>
<string name="theme_dark">Tumma</string>

@ -401,7 +401,6 @@
<string name="vibrations">Vibrations</string>
<string name="location_radius_meters">%s m</string>
<string name="tags">Étiquettes</string>
<string name="accent">Couleur d\'accentuation</string>
<string name="badges">Badges</string>
<string name="list_separator_with_space">", "</string>
<string name="version_string">Version %s</string>

@ -208,7 +208,6 @@
<string name="opacity">Opacidade</string>
<string name="theme">Tema</string>
<string name="color">Cor</string>
<string name="accent">Resaltado</string>
<string name="theme_black">Negro</string>
<string name="theme_light">Claro</string>
<string name="theme_dark">Escuro</string>

@ -345,7 +345,6 @@
<string name="theme_light">Svjetla</string>
<string name="theme_black">Crna</string>
<string name="launcher_icon">Ikona pokretača</string>
<string name="accent">Isticanje</string>
<string name="icon">Ikona</string>
<string name="color">Boja</string>
<string name="theme">Tema</string>

@ -281,7 +281,6 @@
<string name="opacity">Átlátszóság</string>
<string name="theme">Téma</string>
<string name="color">Szín</string>
<string name="accent">Kiemelés</string>
<string name="launcher_icon">Launcher ikon</string>
<string name="theme_black">Fekete</string>
<string name="theme_light">Világos</string>

@ -219,7 +219,6 @@
<string name="theme">Tema</string>
<string name="color">Warna</string>
<string name="icon">Ikon</string>
<string name="accent">Aksen</string>
<string name="launcher_icon">Ikon peluncur</string>
<string name="theme_black">Hitam</string>
<string name="theme_light">Cerah</string>

@ -296,7 +296,6 @@
<string name="opacity">Opacità</string>
<string name="theme">Tema</string>
<string name="color">Colore</string>
<string name="accent">Colore secondario</string>
<string name="launcher_icon">Icona del launcher</string>
<string name="theme_black">Nero</string>
<string name="theme_light">Chiaro</string>

@ -318,7 +318,6 @@
<string name="opacity">אטימות</string>
<string name="theme">ערכת נושא</string>
<string name="color">צבע</string>
<string name="accent">צבע משני</string>
<string name="launcher_icon">צלמית משגר</string>
<string name="theme_black">שחור</string>
<string name="theme_light">בהיר</string>

@ -283,7 +283,6 @@
<string name="opacity">透明度</string>
<string name="theme">テーマ</string>
<string name="color"></string>
<string name="accent">アクセント</string>
<string name="launcher_icon">ランチャーアイコン</string>
<string name="theme_black"></string>
<string name="theme_light">ライト</string>

@ -280,7 +280,6 @@
<string name="opacity">불투명도</string>
<string name="theme">테마</string>
<string name="color">색상</string>
<string name="accent">강조</string>
<string name="launcher_icon">런처 아이콘</string>
<string name="theme_black">검정</string>
<string name="theme_light">밝게</string>

@ -306,7 +306,6 @@
<string name="opacity">Permatomumas</string>
<string name="theme">Tema</string>
<string name="color">Spalva</string>
<string name="accent">Akcentas</string>
<string name="launcher_icon">Paleidimo piktograma</string>
<string name="theme_black">Juoda</string>
<string name="theme_light">Šviesi</string>

@ -312,7 +312,6 @@
<string name="filter">Filter</string>
<string name="theme">Drakt</string>
<string name="color">Farge</string>
<string name="accent">Aksentfarge</string>
<string name="launcher_icon">Oppstarterfarge</string>
<string name="theme_black">Svart</string>
<string name="theme_light">Lys</string>

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="window_background">@color/md_background_dark</color>
<color name="content_background">@color/md_background_dark</color>
<color name="dialog_background">@color/md_background_dark</color>
<color name="window_background">#FF0F1416</color>
<color name="content_background">#FF0F1416</color>
<color name="dialog_background">#FF1B2023</color>
<color name="widget_background_follow_system">@color/md_background_dark</color>
<color name="icon_tint">@color/icon_tint_dark</color>
<color name="icon_tint_with_alpha">@color/icon_tint_dark_alpha</color>

@ -1,18 +1,29 @@
<resources>
<style name="DayNight" parent="Theme.MaterialComponents.NoActionBar"/>
<style name="DayNight" parent="Theme.Material3.Dark.NoActionBar"/>
<style name="DayNightDialog" parent="Theme.MaterialComponents.Dialog"/>
<style name="DayNightDialog" parent="Theme.Material3.Dark.Dialog"/>
<style name="DayNightAlert" parent="ThemeOverlay.MaterialComponents.Dialog.Alert"/>
<style name="DayNightAlert" parent="ThemeOverlay.Material3.Dialog.Alert"/>
<style name="popup_overlay" parent="ThemeOverlay.MaterialComponents"/>
<style name="ToolbarTheme" parent="ThemeOverlay.Material3.Dark">
<item name="toolbarNavigationButtonStyle">@style/WhiteNavigation</item>
<item name="iconTint">?attr/colorOnSurface</item>
<item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item>
<item name="android:editTextColor">@color/text_primary</item>
<item name="android:textColorHint">@color/text_secondary</item>
</style>
<!-- Location picker -->
<style name="popup_overlay" parent="ThemeOverlay.MaterialComponents.Dark"/>
<style name="ToolbarTheme" parent="@style/ThemeOverlay.MaterialComponents.Dark">
<style name="LegacyToolbarTheme" parent="ThemeOverlay.MaterialComponents.Dark">
<item name="toolbarNavigationButtonStyle">@style/WhiteNavigation</item>
<item name="iconTint">@color/text_primary</item>
<item name="iconTint">?attr/colorOnSurface</item>
<item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item>
<item name="android:editTextColor">@color/text_primary</item>
<item name="android:textColorHint">@color/text_secondary</item>
</style>
<!-- -->
</resources>

@ -380,7 +380,6 @@
<string name="location_radius_meters">%s m</string>
<string name="filters">Filters</string>
<string name="filter">Filter</string>
<string name="accent">Accent</string>
<string name="button_unsubscribe">Abonnement opzeggen</string>
<string name="name_your_price">Bepaal je eigen prijs</string>
<string name="restart_later">Later</string>

@ -296,7 +296,6 @@
<string name="opacity">Nieprzezroczystość</string>
<string name="theme">Motyw</string>
<string name="color">Kolor</string>
<string name="accent">Akcent</string>
<string name="launcher_icon">Ikona programu startowego</string>
<string name="theme_black">Czarny</string>
<string name="theme_light">Jasny</string>

@ -294,7 +294,6 @@
<string name="opacity">Opacidade</string>
<string name="theme">Tema</string>
<string name="color">Cor</string>
<string name="accent">Cor de destaque</string>
<string name="launcher_icon">Ícone do lançador</string>
<string name="theme_black">Preto</string>
<string name="theme_light">Claro</string>

@ -267,7 +267,6 @@
<string name="opacity">Opacidade</string>
<string name="theme">Tema</string>
<string name="color">Cor</string>
<string name="accent">Destaque</string>
<string name="theme_black">Preto</string>
<string name="theme_light">Claro</string>
<string name="theme_dark">Escuro</string>

@ -9,7 +9,6 @@
<string name="email">E-mail</string>
<string name="picker_mode_calendar">Calendar</string>
<string name="compact">Compact</string>
<string name="accent">Accent</string>
<string name="TEA_timer_est">Estim. %s</string>
<string name="TEA_control_gcal">Calendar</string>
<string name="export_toast">Salvat %1$s în %2$s.</string>

@ -298,7 +298,6 @@
<string name="opacity">Непрозрачность</string>
<string name="theme">Цветовая тема</string>
<string name="color">Цвет</string>
<string name="accent">Акцент</string>
<string name="launcher_icon">Иконка запуска</string>
<string name="theme_black">Чёрная</string>
<string name="theme_light">Светлая</string>

@ -394,7 +394,6 @@
<string name="repeats_single">පුනරාවර්තනය %s</string>
<string name="repeats_from">පුනරාවර්තනය වනුයේ</string>
<string name="bundle_notifications">බහු දැනුම්දීම්</string>
<string name="accent">දෙවන වර්ණය</string>
<string name="date_shortcut_must_come_after">%1$s, %2$s ට පසුව පැමිණිය යුතුය</string>
<string name="date_shortcut_must_come_before">%2$s පෙර %1$s පැමිණිය යුතුය</string>
<string name="rmd_EPr_quiet_hours_end_title">නිහඬ කාලය අවසානය</string>

@ -301,7 +301,6 @@
<string name="opacity">Priehľadnosť</string>
<string name="theme">Téma</string>
<string name="color">Farba</string>
<string name="accent">Zvýraznenie </string>
<string name="launcher_icon">Ikona</string>
<string name="theme_black">Čierna</string>
<string name="theme_light">Svetlá</string>

@ -300,7 +300,6 @@
<string name="url_host_name_required">Värddatornamn krävs</string>
<string name="url_invalid_scheme">Måste börja med http(s)://</string>
<string name="filter">Filter</string>
<string name="accent">Accent</string>
<string name="launcher_icon">Hemskärmsikon</string>
<string name="widget_header_settings">Överskriftsinställningar</string>
<string name="widget_row_settings">Radinställningar</string>

@ -303,7 +303,6 @@
<string name="theme_dark">இருள்</string>
<string name="theme_light">ஒளி</string>
<string name="theme_black">கருப்பு</string>
<string name="accent">உச்சரிப்பு</string>
<string name="icon">உருவம்</string>
<string name="color">நிறம்</string>
<string name="theme">பேசும்</string>

@ -287,7 +287,6 @@
<string name="theme_light">แสง</string>
<string name="theme_black">ดำ</string>
<string name="launcher_icon">ไอคอนตัวเปิดใช้</string>
<string name="accent">สำเนียง</string>
<string name="icon">ไอคอน</string>
<string name="color">สี</string>
<string name="theme">หัวข้อ</string>

@ -287,7 +287,6 @@
<string name="opacity">Şeffaflık</string>
<string name="theme">Gövde</string>
<string name="color">Renk</string>
<string name="accent">Ara renk</string>
<string name="launcher_icon">Başlatıcı simgesi</string>
<string name="theme_black">Siyah</string>
<string name="theme_light">ık</string>

@ -298,7 +298,6 @@
<string name="opacity">Прозорість</string>
<string name="theme">Тема</string>
<string name="color">Колір</string>
<string name="accent">Акцент</string>
<string name="launcher_icon">Піктограма запуску</string>
<string name="theme_black">Чорна</string>
<string name="theme_light">Світла</string>

@ -332,7 +332,6 @@
<string name="theme_light">سفید</string>
<string name="theme_black">سیاہ</string>
<string name="launcher_icon">لانچر آئیکن</string>
<string name="accent">ایکسنٹ</string>
<string name="icon">آئیکن</string>
<string name="color">رنگ</string>
<string name="theme">تھیم</string>

@ -338,7 +338,6 @@
<string name="theme_light">Sáng</string>
<string name="theme_black">Đen</string>
<string name="launcher_icon">Biểu tượng trên launcher</string>
<string name="accent">Màu nổi bật</string>
<string name="icon">Biểu tượng</string>
<string name="color">Màu</string>
<string name="theme">Chủ đề</string>

@ -268,7 +268,6 @@
<string name="opacity">不透明度</string>
<string name="theme">主题</string>
<string name="color">颜色</string>
<string name="accent">强调色</string>
<string name="launcher_icon">启动器图标</string>
<string name="theme_black">黑色</string>
<string name="theme_light">亮色</string>

@ -143,7 +143,6 @@
<string name="opacity">透明度</string>
<string name="theme">主題</string>
<string name="color">色彩</string>
<string name="accent">強調色</string>
<string name="language">語言</string>
<string name="restart_required">重新啟動 Tasks以使變更生效</string>
<string name="restart_now">馬上重新啟動</string>

@ -1,140 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AmberAccent" parent="BlackTint">
<item name="colorSecondary">@color/amber_a400</item>
</style>
<style name="BlueAccent" parent="WhiteTint">
<item name="colorSecondary">@color/blue_a400</item>
</style>
<style name="BlueGreyAccent" parent="WhiteTint">
<item name="colorSecondary">@color/blue_grey_400</item>
</style>
<style name="CyanAccent" parent="BlackTint">
<item name="colorSecondary">@color/cyan_a400</item>
</style>
<style name="DeepOrangeAccent" parent="WhiteTint">
<item name="colorSecondary">@color/deep_orange_a400</item>
</style>
<style name="DeepPurpleAccent" parent="WhiteTint">
<item name="colorSecondary">@color/deep_purple_a400</item>
</style>
<style name="GreenAccent" parent="BlackTint">
<item name="colorSecondary">@color/green_a400</item>
</style>
<style name="IndigoAccent" parent="WhiteTint">
<item name="colorSecondary">@color/indigo_a400</item>
</style>
<style name="LightBlueAccent" parent="BlackTint">
<item name="colorSecondary">@color/light_blue_a400</item>
</style>
<style name="LightGreenAccent" parent="BlackTint">
<item name="colorSecondary">@color/light_green_a400</item>
</style>
<style name="LimeAccent" parent="BlackTint">
<item name="colorSecondary">@color/lime_a400</item>
</style>
<style name="OrangeAccent" parent="BlackTint">
<item name="colorSecondary">@color/orange_a400</item>
</style>
<style name="PinkAccent" parent="WhiteTint">
<item name="colorSecondary">@color/pink_a400</item>
</style>
<style name="PurpleAccent" parent="WhiteTint">
<item name="colorSecondary">@color/purple_a400</item>
</style>
<style name="RedAccent" parent="WhiteTint">
<item name="colorSecondary">@color/red_a400</item>
</style>
<style name="TealAccent" parent="BlackTint">
<item name="colorSecondary">@color/teal_a400</item>
</style>
<style name="YellowAccent" parent="BlackTint">
<item name="colorSecondary">@color/yellow_a400</item>
</style>
<style name="AmberAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/amber_a100</item>
</style>
<style name="BlueAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/blue_a100</item>
</style>
<style name="BlueGreyAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/blue_grey_100</item>
</style>
<style name="CyanAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/cyan_a100</item>
</style>
<style name="DeepOrangeAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/deep_orange_a100</item>
</style>
<style name="DeepPurpleAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/deep_purple_a100</item>
</style>
<style name="GreenAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/green_a100</item>
</style>
<style name="IndigoAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/indigo_a100</item>
</style>
<style name="LightBlueAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/light_blue_a100</item>
</style>
<style name="LightGreenAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/light_green_a100</item>
</style>
<style name="LimeAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/lime_a100</item>
</style>
<style name="OrangeAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/orange_a100</item>
</style>
<style name="PinkAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/pink_a100</item>
</style>
<style name="PurpleAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/purple_a100</item>
</style>
<style name="RedAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/red_a100</item>
</style>
<style name="TealAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/teal_a100</item>
</style>
<style name="YellowAccentDesaturated" parent="BlackTint">
<item name="colorSecondary">@color/yellow_a100</item>
</style>
</resources>

@ -37,7 +37,7 @@
<color name="window_background">@color/md_background_light</color>
<color name="content_background">@color/md_background_light</color>
<color name="dialog_background">@color/md_background_light</color>
<color name="dialog_background">#FFEAEFF1</color>
<color name="widget_background_follow_system">@color/md_background_light</color>
<color name="icon_tint">@color/icon_tint_light</color>
<color name="icon_tint_with_alpha">@color/icon_tint_light_alpha</color>

@ -317,7 +317,6 @@
<string name="tasker_locale">Tasker/Locale</string>
<string name="p_theme">theme_style</string>
<string name="p_theme_color">theme_color</string>
<string name="p_theme_accent">theme_accent</string>
<string name="p_theme_launcher">theme_launcher</string>
<string name="p_language">language</string>
<string name="p_led_notification">led_notificatiWCAon</string>

@ -385,7 +385,6 @@ File %1$s contained %2$s.\n\n
<string name="theme">Theme</string>
<string name="color">Color</string>
<string name="icon">Icon</string>
<string name="accent">Accent</string>
<string name="launcher_icon">Launcher icon</string>
<string name="theme_black">Black</string>
<string name="theme_light">Light</string>

@ -1,7 +1,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<style name="popup_overlay" parent="ThemeOverlay.MaterialComponents.Light"/>
<style name="SpinnerNoPadding" parent="Widget.AppCompat.TextView.SpinnerItem">
<item name="android:paddingStart">0dp</item>
<item name="android:paddingEnd">0dp</item>
@ -20,8 +18,6 @@
<item name="materialAlertDialogTheme">@style/TasksDialogAlert</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="materialTimePickerTheme">@style/ClockTheme</item>
<item name="materialCalendarTheme">@style/CalendarTheme</item>
<item name="textInputStyle">@style/OutlinedBox</item>
</style>
@ -33,7 +29,7 @@
<item name="android:windowIsFloating">false</item>
</style>
<style name="ToolbarTheme" parent="ThemeOverlay.MaterialComponents.Light">
<style name="ToolbarTheme" parent="ThemeOverlay.Material3.Light">
<item name="toolbarNavigationButtonStyle">@style/BlackNavigation</item>
<item name="iconTint">@color/text_primary</item>
<item name="android:actionOverflowButtonStyle">@style/BlackOverflow</item>
@ -41,30 +37,6 @@
<item name="android:textColorHint">@color/text_secondary</item>
</style>
<style name="WhiteToolbarTheme">
<item name="overlay_theme">@style/WhiteToolbarOverlay</item>
<item name="iconTint">@color/white_100</item>
<item name="colorOnPrimary">@color/white_100</item>
<item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item>
<item name="toolbarNavigationButtonStyle">@style/WhiteNavigation</item>
</style>
<style name="BlackToolbarTheme">
<item name="overlay_theme">@style/BlackToolbarOverlay</item>
<item name="iconTint">@color/black_87</item>
<item name="colorOnPrimary">@color/black_87</item>
<item name="android:actionOverflowButtonStyle">@style/BlackOverflow</item>
<item name="toolbarNavigationButtonStyle">@style/BlackNavigation</item>
</style>
<style name="WhiteTint">
<item name="colorOnSecondary">@color/white_100</item>
</style>
<style name="BlackTint">
<item name="colorOnSecondary">@color/black_87</item>
</style>
<style name="WhiteNavigation" parent="Widget.AppCompat.Toolbar.Button.Navigation">
<item name="android:tint">@color/white_100</item>
</style>
@ -103,18 +75,6 @@
<item name="android:tint">@color/black_100</item>
</style>
<style name="WhiteToolbarOverlay" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<item name="colorControlNormal">@color/white_100</item>
<item name="android:textColorHint">@color/white_60</item>
<item name="android:editTextColor">@color/white_100</item>
</style>
<style name="BlackToolbarOverlay" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<item name="colorControlNormal">@color/black_87</item>
<item name="android:textColorHint">@color/black_87</item>
<item name="android:editTextColor">@color/black_87</item>
</style>
<style name="TagSettingsRow" parent="Widget.Design.TextInputLayout">
<item name="android:textSize">18sp</item>
<item name="android:clickable">true</item>
@ -134,13 +94,13 @@
<!--================================================== General == -->
<style name="TextAppearance" parent="TextAppearance.MaterialComponents.Body1">
<style name="TextAppearance" parent="TextAppearance.Material3.BodyMedium">
<item name="android:textColor">@color/text_primary</item>
</style>
<style name="DateTimeShortcuts" parent="Widget.MaterialComponents.Button.TextButton">
<style name="DateTimeShortcuts" parent="Widget.Material3.Button.TextButton">
<item name="android:textColor">@color/button_accent_text</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Body1</item>
<item name="android:textAppearance">@style/TextAppearance.Material3.BodyMedium</item>
<item name="android:paddingTop">@dimen/quarter_keyline_first</item>
<item name="android:paddingBottom">@dimen/quarter_keyline_first</item>
<item name="android:layout_width">match_parent</item>
@ -177,7 +137,7 @@
<item name="android:elevation" tools:ignore="NewApi">@dimen/elevation_refresh_indicator</item>
</style>
<style name="AlertButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog.Flush">
<style name="AlertButtonStyle" parent="Widget.Material3.Button.TextButton.Dialog.Flush">
<item name="android:textColor">?attr/colorSecondary</item>
</style>
@ -199,60 +159,23 @@
<item name="android:scaleType">fitCenter</item>
</style>
<style name="ClockTheme" parent="ThemeOverlay.MaterialComponents.TimePicker">
<item name="materialClockStyle">@style/ClockStyle</item>
</style>
<style name="ClockStyle" parent="Widget.MaterialComponents.TimePicker.Clock">
<item name="clockHandColor">?attr/colorSecondary</item>
<item name="clockNumberTextColor">@color/clock_text_color</item>
</style>
<style name="CalendarTheme" parent="@style/ThemeOverlay.MaterialComponents.MaterialCalendar">
<item name="materialCalendarStyle">@style/CalendarStyle</item>
<item name="materialCalendarHeaderLayout">@style/CalendarHeaderLayout</item>
<item name="materialCalendarHeaderDivider">@style/CalendarHeaderDivider</item>
<item name="materialCalendarHeaderTitle">@style/CalendarHeaderTitle</item>
<item name="materialCalendarHeaderSelection">@style/CalendarHeaderSelection</item>
<item name="android:colorControlActivated">?attr/colorSecondary</item>
</style>
<style name="CalendarStyle" parent="@style/Widget.MaterialComponents.MaterialCalendar">
<item name="daySelectedStyle">@style/CalendarDaySelected</item>
<item name="yearSelectedStyle">@style/CalendarYearSelected</item>
<style name="OutlinedBox" parent="Widget.Material3.TextInputLayout.FilledBox">
<item name="boxStrokeColor">?attr/colorSecondary</item>
<item name="hintTextColor">?attr/colorSecondary</item>
</style>
<style name="CalendarHeaderLayout" parent="Widget.MaterialComponents.MaterialCalendar.HeaderLayout">
<item name="android:background">?attr/colorSecondary</item>
</style>
<style name="CalendarHeaderDivider" parent="Widget.MaterialComponents.MaterialCalendar.HeaderDivider">
<item name="android:background">?attr/colorOnSecondary</item>
</style>
<style name="CalendarHeaderTitle" parent="Widget.MaterialComponents.MaterialCalendar.HeaderTitle">
<item name="android:textColor">?attr/colorOnSecondary</item>
</style>
<style name="CalendarHeaderSelection" parent="Widget.MaterialComponents.MaterialCalendar.HeaderSelection">
<item name="android:textColor">?attr/colorOnSecondary</item>
</style>
<!-- Location picker -->
<style name="CalendarDaySelected" parent="Widget.MaterialComponents.MaterialCalendar.Day.Selected">
<item name="itemFillColor">?attr/colorSecondary</item>
<item name="itemTextColor">?attr/colorOnSecondary</item>
</style>
<style name="popup_overlay" parent="ThemeOverlay.MaterialComponents.Light"/>
<style name="CalendarYearSelected" parent="Widget.MaterialComponents.MaterialCalendar.Year.Selected">
<item name="itemFillColor">?attr/colorSecondary</item>
<item name="itemTextColor">?attr/colorOnSecondary</item>
<item name="itemStrokeColor">?attr/colorOnSecondary</item>
<style name="LegacyToolbarTheme" parent="ThemeOverlay.MaterialComponents.Light">
<item name="toolbarNavigationButtonStyle">@style/BlackNavigation</item>
<item name="iconTint">@color/text_primary</item>
<item name="android:actionOverflowButtonStyle">@style/BlackOverflow</item>
<item name="android:editTextColor">@color/text_primary</item>
<item name="android:textColorHint">@color/text_secondary</item>
</style>
<style name="OutlinedBox" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
<item name="boxStrokeColor">?attr/colorSecondary</item>
<item name="hintTextColor">?attr/colorSecondary</item>
</style>
<!---->
</resources>

@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DayNight" parent="Theme.MaterialComponents.Light.NoActionBar" />
<style name="DayNight" parent="Theme.Material3.Light.NoActionBar" />
<style name="DayNightDialog" parent="Theme.MaterialComponents.Light.Dialog" />
<style name="DayNightDialog" parent="Theme.Material3.Light.Dialog" />
<style name="DayNightAlert" parent="ThemeOverlay.MaterialComponents.Dialog.Alert" />
<style name="DayNightAlert" parent="ThemeOverlay.Material3.Dialog.Alert" />
<style name="TasksBase" parent="DayNight">
<item name="android:windowBackground">@color/window_background</item>
<item name="android:colorBackground">@color/content_background</item>
<item name="background">@color/window_background</item>
<item name="colorSurface">@color/content_background</item>
<item name="windowActionModeOverlay">true</item>
<item name="actionModeStyle">@style/ActionModeStyle</item>
<item name="actionBarTheme">@style/ActionModeTheme</item>
@ -24,8 +26,6 @@
<item name="android:textColorSecondary">@color/text_secondary</item>
<item name="android:textColorTertiary">@color/text_tertiary</item>
<item name="horizontal_divider_visibility">2</item> <!-- View.GONE -->
<item name="materialTimePickerTheme">@style/ClockTheme</item>
<item name="materialCalendarTheme">@style/CalendarTheme</item>
<item name="textInputStyle">@style/OutlinedBox</item>
</style>
@ -48,12 +48,16 @@
<style name="ThemeBlack" parent="Tasks">
<item name="android:windowBackground">@android:color/black</item>
<item name="android:colorBackground">@android:color/black</item>
<item name="background">@android:color/black</item>
<item name="colorSurface">@android:color/black</item>
<item name="horizontal_divider_visibility">0</item> <!-- View.VISIBLE -->
</style>
<style name="Wallpaper" parent="Tasks">
<item name="android:windowBackground">@color/black_38</item>
<item name="android:windowBackground">@color/black_60</item>
<item name="android:colorBackground">@color/black_60</item>
<item name="background">@color/black_60</item>
<item name="colorSurface">@color/black_60</item>
<item name="android:windowShowWallpaper">true</item>
</style>

@ -11,10 +11,6 @@
android:key="@string/p_theme_color"
android:title="@string/color" />
<Preference
android:key="@string/p_theme_accent"
android:title="@string/accent" />
<Preference
android:key="@string/p_theme_launcher"
android:title="@string/launcher_icon" />

@ -0,0 +1,26 @@
package org.tasks.kmp.org.tasks.compose
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.ime
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.State
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalDensity
import co.touchlab.kermit.Logger
@Composable
fun rememberImeState(): State<Boolean> {
val density = LocalDensity.current
val ime = WindowInsets.ime
val imeState = remember {
derivedStateOf {
ime.getBottom(density) > 0
}
}
LaunchedEffect(imeState.value) {
Logger.d("imeState") { "keyboardOpen=${imeState.value}" }
}
return imeState
}

@ -0,0 +1,22 @@
package org.tasks.kmp.org.tasks.compose
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.ViewConfiguration
@Composable
fun TouchSlopMultiplier(
multiplier: Float = 3f,
content: @Composable () -> Unit,
) {
val current = LocalViewConfiguration.current
val viewConfiguration = object : ViewConfiguration by current {
override val touchSlop: Float
get() = current.touchSlop * multiplier
}
CompositionLocalProvider(LocalViewConfiguration provides viewConfiguration) {
content()
}
}

@ -24,6 +24,8 @@ import androidx.compose.ui.focus.focusProperties
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp
val SEARCH_BAR_HEIGHT = 56.dp
@Composable
fun SearchBar(
modifier: Modifier = Modifier,
@ -37,7 +39,7 @@ fun SearchBar(
OutlinedTextField(
shape = MaterialTheme.shapes.medium,
modifier = modifier
.height(56.dp)
.height(SEARCH_BAR_HEIGHT)
.focusProperties {
this.canFocus = canFocus
},

@ -12,11 +12,14 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
@ -50,6 +53,7 @@ import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.layout
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import kotlinx.collections.immutable.ImmutableList
@ -58,6 +62,7 @@ import org.tasks.compose.components.Chevron
import org.tasks.compose.components.SearchBar
import org.tasks.compose.components.TasksIcon
import org.tasks.kmp.formatNumber
import org.tasks.kmp.org.tasks.compose.rememberImeState
import tasks.kmp.generated.resources.Res
import tasks.kmp.generated.resources.help_and_feedback
import tasks.kmp.generated.resources.search
@ -65,6 +70,9 @@ import tasks.kmp.generated.resources.settings
import tasks.kmp.generated.resources.subscribe
import kotlin.math.roundToInt
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
private val SEARCH_BAR_BOTTOM_PADDING = androidx.compose.material3.OutlinedTextFieldTopPadding
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TaskListDrawer(
@ -90,7 +98,8 @@ fun TaskListDrawer(
bottomBar = {
if (bottomSearchBar) {
BottomAppBar(
modifier = Modifier.layout { measurable, constraints ->
modifier = Modifier
.layout { measurable, constraints ->
val placeable = measurable.measure(constraints)
bottomAppBarScrollBehavior.state.heightOffsetLimit =
-placeable.height.toFloat()
@ -122,10 +131,14 @@ fun TaskListDrawer(
)
}
}
) { paddingValues ->
) { contentPadding ->
val keyboardOpen = rememberImeState().value
LazyColumn(
modifier = Modifier.fillMaxSize().imePadding(),
contentPadding = paddingValues,
modifier = Modifier.fillMaxSize(),
contentPadding = if (keyboardOpen)
contentPadding
else
WindowInsets.systemBars.asPaddingValues(),
verticalArrangement = arrangement,
) {
items(items = filters, key = { it.key() }) {
@ -275,6 +288,7 @@ fun RowScope.MenuSearchBar(
query: String,
onQueryChange: (String) -> Unit,
) {
val density = LocalDensity.current
var hasFocus by remember { mutableStateOf(false) }
SearchBar(
modifier = Modifier
@ -282,7 +296,7 @@ fun RowScope.MenuSearchBar(
.padding(
start = 8.dp,
end = if (hasFocus) 8.dp else 0.dp,
bottom = 4.dp
bottom = with(density) { SEARCH_BAR_BOTTOM_PADDING.toDp() }
)
.weight(1f)
.animateContentSize(

@ -1,31 +1,26 @@
package org.tasks.themes
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.luminance
import androidx.compose.ui.graphics.toArgb
import org.tasks.kmp.org.tasks.themes.ColorProvider.saturated
const val BLUE = -14575885
const val WHITE = -1
@Composable
fun ColorScheme.isDark() = this.background.luminance() <= 0.5
private val lightColorScheme = lightColorScheme(
surface = Color.White,
surface = Color(0xFFEAEFF1),
background = Color.White,
)
private val darkColorScheme = darkColorScheme(
surface = Color(0xFF202124),
background = Color(0xFF202124),
surface = Color(0xFF1B2023),
background = Color(0xFF0F1416),
)
private val blackColorScheme = darkColorScheme.copy(

Loading…
Cancel
Save