Accompanist appcompat theme adapter

pull/2233/head
Alex Baker 1 year ago
parent b75be2c5af
commit db82ef7fd6

@ -230,7 +230,6 @@ dependencies {
implementation("androidx.compose.foundation:foundation")
implementation("androidx.compose.material:material")
implementation("androidx.compose.runtime:runtime-livedata")
implementation(libs.compose.theme.adapter)
implementation("androidx.activity:activity-compose:1.7.0")
implementation("androidx.compose.material:material-icons-extended")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
@ -240,6 +239,7 @@ dependencies {
implementation(libs.accompanist.flowlayout)
implementation(libs.accompanist.permissions)
implementation(libs.accompanist.themeadapter)
googleplayImplementation(platform(libs.firebase))
googleplayImplementation("com.google.firebase:firebase-crashlytics")

@ -16,6 +16,7 @@ import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.content.res.AppCompatResources
@ -35,9 +36,9 @@ import androidx.core.widget.addTextChangedListener
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.appbar.AppBarLayout.Behavior.DragCallback
import com.google.android.material.composethemeadapter.MdcTheme
import com.todoroo.andlib.utility.AndroidUtilities
import com.todoroo.andlib.utility.DateUtilities
import com.todoroo.astrid.api.Filter
@ -90,7 +91,6 @@ import java.time.format.FormatStyle
import java.util.*
import javax.inject.Inject
import kotlin.math.abs
import android.view.inputmethod.EditorInfo
@AndroidEntryPoint
class TaskEditFragment : Fragment(), Toolbar.OnMenuItemClickListener {
@ -235,7 +235,7 @@ class TaskEditFragment : Fragment(), Toolbar.OnMenuItemClickListener {
}
}
binding.composeView.setContent {
MdcTheme {
AppCompatTheme {
Column(modifier = Modifier.gesturesDisabled(editViewModel.isReadOnly)) {
taskEditControlSetFragmentManager.displayOrder.forEachIndexed { index, tag ->
if (index < taskEditControlSetFragmentManager.visibleSize) {
@ -296,7 +296,7 @@ class TaskEditFragment : Fragment(), Toolbar.OnMenuItemClickListener {
binding.banner.setContent {
var visible by rememberSaveable { mutableStateOf(true) }
val context = LocalContext.current
MdcTheme {
AppCompatTheme {
BeastModeBanner(
visible,
showSettings = {

@ -37,9 +37,9 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.bottomappbar.BottomAppBar
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.android.material.snackbar.Snackbar
import com.todoroo.andlib.utility.AndroidUtilities
import com.todoroo.andlib.utility.DateUtilities
@ -164,7 +164,7 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
is TaskListEvent.BegForSubscription -> {
binding.banner.setContent {
var showBanner by rememberSaveable { mutableStateOf(true) }
MdcTheme {
AppCompatTheme {
SubscriptionNagBanner(
visible = showBanner,
subscribe = {

@ -13,7 +13,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
@ -48,7 +48,7 @@ class FilesControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
AttachmentRow(
attachments = viewModel.selectedAttachments.collectAsStateLifecycleAware().value,
openAttachment = {

@ -12,7 +12,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import net.fortuna.ical4j.model.Recur
import net.fortuna.ical4j.model.WeekDay
@ -75,7 +75,7 @@ class RepeatControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
RepeatRow(
recurrence = viewModel.recurrence.collectAsStateLifecycleAware().value?.let {
repeatRuleToString.toString(it)

@ -5,7 +5,7 @@ import android.content.Intent
import android.view.View
import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.update
import org.tasks.R
@ -29,7 +29,7 @@ class TagsControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
TagsRow(
tags = viewModel.selectedTags.collectAsStateLifecycleAware().value,
colorProvider = { chipProvider.getColor(it) },

@ -12,7 +12,7 @@ import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.astrid.data.Task
import com.todoroo.astrid.ui.TimeDurationControlSet
import dagger.hilt.android.AndroidEntryPoint
@ -91,7 +91,7 @@ class TimerControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
TimerRow(
started = viewModel.timerStarted.collectAsStateLifecycleAware().value,
estimated = viewModel.estimatedSeconds.collectAsStateLifecycleAware().value,

@ -17,7 +17,7 @@ import androidx.compose.ui.platform.ComposeView
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.PermissionStatus
import com.google.accompanist.permissions.rememberPermissionState
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.utility.AndroidUtilities
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.R
@ -76,7 +76,7 @@ class ReminderControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
val ringMode by remember { this@ReminderControlSet.ringMode }
val notificationPermissions = if (AndroidUtilities.atLeastTiramisu()) {
rememberPermissionState(

@ -8,7 +8,7 @@ import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.utility.DateUtilities
import com.todoroo.andlib.utility.DateUtilities.getTimeString
import dagger.hilt.android.AndroidEntryPoint
@ -48,7 +48,7 @@ class StartDateControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?) =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
val selectedDay = vm.selectedDay.collectAsStateLifecycleAware().value
val selectedTime = vm.selectedTime.collectAsStateLifecycleAware().value
StartDateRow(

@ -28,10 +28,17 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.window.Dialog
import androidx.lifecycle.lifecycleScope
import at.bitfire.dav4jvm.exception.HttpException
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import net.openid.appauth.*
import net.openid.appauth.AuthState
import net.openid.appauth.AuthorizationException
import net.openid.appauth.AuthorizationRequest
import net.openid.appauth.AuthorizationServiceConfiguration
import net.openid.appauth.ClientSecretBasic
import net.openid.appauth.RegistrationRequest
import net.openid.appauth.RegistrationResponse
import net.openid.appauth.ResponseTypeValues
import org.tasks.R
import org.tasks.Tasks.Companion.IS_GENERIC
import org.tasks.analytics.Firebase
@ -98,7 +105,7 @@ class SignInActivity : ComponentActivity() {
var selectedPlatform by rememberSaveable {
mutableStateOf(autoSelect)
}
MdcTheme {
AppCompatTheme {
selectedPlatform
?.let {
Dialog(onDismissRequest = { finish() }) {

@ -8,7 +8,7 @@ import androidx.activity.compose.setContent
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.window.Dialog
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import org.tasks.LocalBroadcastManager
@ -19,7 +19,7 @@ import org.tasks.extensions.Context.toast
import org.tasks.injection.InjectingAppCompatActivity
import org.tasks.preferences.Preferences
import org.tasks.themes.Theme
import java.util.*
import java.util.Locale
import javax.inject.Inject
@AndroidEntryPoint
@ -53,7 +53,7 @@ class PurchaseActivity : InjectingAppCompatActivity(), OnPurchasesUpdated {
}
setContent {
MdcTheme {
AppCompatTheme {
Dialog(onDismissRequest = { finish() }) {
PurchaseText(
nameYourPrice = nameYourPrice,

@ -22,7 +22,7 @@ import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.lifecycleScope
import at.bitfire.dav4jvm.exception.HttpException
import com.franmontiel.persistentcookiejar.persistence.CookiePersistor
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.google.android.material.snackbar.BaseTransientBottomBar
import com.google.android.material.snackbar.Snackbar
import com.todoroo.astrid.data.Task
@ -136,7 +136,7 @@ abstract class BaseCaldavAccountSettingsActivity : ThemedInjectingAppCompatActiv
)
binding.password.setOnFocusChangeListener { _, hasFocus -> onPasswordFocused(hasFocus) }
binding.serverSelector.setContent {
MdcTheme {
AppCompatTheme {
var selected by rememberSaveable { serverType }
ServerSelector(selected) {
serverType.value = it

@ -11,7 +11,7 @@ import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.painterResource
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import org.tasks.R
@ -55,7 +55,7 @@ class CaldavCalendarSettingsActivity : BaseCaldavCalendarSettingsActivity() {
findViewById<ComposeView>(R.id.people)
.apply { isVisible = it.isNotEmpty() }
.setContent {
MdcTheme {
AppCompatTheme {
PrincipalList(it, if (canRemovePrincipals) this::onRemove else null)
}
}
@ -65,7 +65,7 @@ class CaldavCalendarSettingsActivity : BaseCaldavCalendarSettingsActivity() {
findViewById<ComposeView>(R.id.fab)
.apply { isVisible = true }
.setContent {
MdcTheme {
AppCompatTheme {
val openDialog = rememberSaveable { mutableStateOf(false) }
ShareInviteDialog(
openDialog,

@ -9,7 +9,7 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.BuildConfig
import org.tasks.R
import org.tasks.sync.AddAccountDialog.Platform
@ -76,7 +76,7 @@ fun AddAccountDialog(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun AddAccountDialogPreview() {
MdcTheme {
AppCompatTheme {
AddAccountDialog(hasTasksAccount = false, selected = {})
}
}

@ -3,14 +3,31 @@ package org.tasks.compose
import android.content.res.Configuration
import androidx.annotation.StringRes
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.material.AlertDialog
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.RadioButton
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Autorenew
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.ExperimentalComposeUiApi
@ -28,7 +45,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.core.content.res.ResourcesCompat
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.astrid.ui.ReminderControlSetViewModel.ViewState
import kotlinx.coroutines.android.awaitFrame
import org.tasks.R
@ -533,7 +550,7 @@ fun AddAlarmDialog(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddCustomReminderOne() =
MdcTheme {
AppCompatTheme {
AddReminderDialog.AddCustomReminder(
time = remember { mutableStateOf(1) },
units = remember { mutableStateOf(0) },
@ -549,7 +566,7 @@ fun AddCustomReminderOne() =
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddCustomReminder() =
MdcTheme {
AppCompatTheme {
AddReminderDialog.AddCustomReminder(
time = remember { mutableStateOf(15) },
units = remember { mutableStateOf(1) },
@ -565,7 +582,7 @@ fun AddCustomReminder() =
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddRepeatingReminderOne() =
MdcTheme {
AppCompatTheme {
AddReminderDialog.AddRecurringReminder(
openDialog = true,
interval = remember { mutableStateOf(1) },
@ -579,7 +596,7 @@ fun AddRepeatingReminderOne() =
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddRepeatingReminder() =
MdcTheme {
AppCompatTheme {
AddReminderDialog.AddRecurringReminder(
openDialog = true,
interval = remember { mutableStateOf(15) },
@ -593,7 +610,7 @@ fun AddRepeatingReminder() =
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddRandomReminderOne() =
MdcTheme {
AppCompatTheme {
AddReminderDialog.AddRandomReminder(
time = remember { mutableStateOf(1) },
units = remember { mutableStateOf(0) }
@ -605,7 +622,7 @@ fun AddRandomReminderOne() =
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddRandomReminder() =
MdcTheme {
AppCompatTheme {
AddReminderDialog.AddRandomReminder(
time = remember { mutableStateOf(15) },
units = remember { mutableStateOf(1) }
@ -616,7 +633,7 @@ fun AddRandomReminder() =
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AddReminderDialog() =
MdcTheme {
AppCompatTheme {
AddAlarmDialog(
viewState = ViewState(showAddAlarm = true),
existingAlarms = emptyList(),

@ -22,7 +22,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.Tasks
@ -149,7 +149,7 @@ fun BannerTextButton(text: Int, onClick: () -> Unit) {
@Preview(showBackground = true)
@Preview(showBackground = true, backgroundColor = 0x202124, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
private fun BeastModePreview() = MdcTheme {
private fun BeastModePreview() = AppCompatTheme {
BeastModeBanner(visible = true, showSettings = {}, dismiss = {})
}
@ -157,7 +157,7 @@ private fun BeastModePreview() = MdcTheme {
@Preview(showBackground = true)
@Preview(showBackground = true, backgroundColor = 0x202124, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
private fun SubscriptionNagPreview() = MdcTheme {
private fun SubscriptionNagPreview() = AppCompatTheme {
SubscriptionNagBanner(visible = true, subscribe = {}, dismiss = {})
}

@ -20,7 +20,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.themes.CustomIcons
@ -114,7 +114,7 @@ private fun ChipIcon(iconRes: Int?) {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun TasksChipIconAndTextPreview() {
MdcTheme {
AppCompatTheme {
Chip(
text = "Home",
icon = CustomIcons.getIconResId(CustomIcons.LABEL),
@ -128,7 +128,7 @@ fun TasksChipIconAndTextPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun TasksChipIconTextAndClearPreview() {
MdcTheme {
AppCompatTheme {
Chip(
text = "Home",
icon = CustomIcons.getIconResId(CustomIcons.LABEL),
@ -143,7 +143,7 @@ fun TasksChipIconTextAndClearPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun TasksChipIconPreview() {
MdcTheme {
AppCompatTheme {
Chip(
text = null,
icon = CustomIcons.getIconResId(CustomIcons.LABEL),
@ -157,7 +157,7 @@ fun TasksChipIconPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun TasksChipTextPreview() {
MdcTheme {
AppCompatTheme {
Chip(
text = "Home",
icon = null,

@ -25,6 +25,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.Constants.HALF_KEYLINE
import org.tasks.compose.Constants.ICON_ALPHA
@ -52,14 +53,14 @@ private val principals = listOf(
@Preview(showBackground = true)
@Preview(showBackground = true, backgroundColor = 0x202124, uiMode = UI_MODE_NIGHT_YES)
@Composable
private fun Owner() = MaterialTheme {
private fun Owner() = AppCompatTheme {
ListSettingsComposables.PrincipalList(principals) {}
}
@Preview(showBackground = true)
@Preview(showBackground = true, backgroundColor = 0x202124, uiMode = UI_MODE_NIGHT_YES)
@Composable
private fun NotOwner() = MaterialTheme {
private fun NotOwner() = AppCompatTheme {
ListSettingsComposables.PrincipalList(principals, null)
}

@ -18,7 +18,7 @@ import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
@Composable
@ -56,6 +56,6 @@ fun ServerSelector(selected: Int, onSelected: (Int) -> Unit) {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun ServerSelectorPreview() =
MdcTheme {
AppCompatTheme {
ServerSelector(1) {}
}

@ -23,6 +23,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.Constants.TextButton
import org.tasks.compose.Constants.textFieldColors
@ -30,7 +31,7 @@ import org.tasks.compose.ShareInvite.ShareInvite
@Preview(showBackground = true, backgroundColor = 0xFFFFFF)
@Composable
private fun Invite() = MaterialTheme {
private fun Invite() = AppCompatTheme {
ShareInvite(true, remember { mutableStateOf("") })
}
@ -42,7 +43,7 @@ private fun InviteDark() = MaterialTheme(darkColors()) {
@Preview(showBackground = true, backgroundColor = 0xFFFFFF)
@Composable
private fun InviteFilled() = MaterialTheme {
private fun InviteFilled() = AppCompatTheme {
ShareInvite(true, remember { mutableStateOf("user@example.com") })
}

@ -2,7 +2,12 @@ package org.tasks.compose
import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.ContentAlpha
@ -14,7 +19,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.auth.SignInActivity
@ -99,7 +104,7 @@ fun ConsentDialog(
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun SignInDialogPreview() {
MdcTheme {
AppCompatTheme {
SignInDialog(selected = {}, help = {}, cancel = {})
}
}
@ -108,7 +113,7 @@ fun SignInDialogPreview() {
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun DisclosurePreview() {
MdcTheme {
AppCompatTheme {
ConsentDialog(agree = {})
}
}

@ -22,7 +22,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.Constants.HALF_KEYLINE
import org.tasks.compose.Constants.KEYLINE_FIRST
@ -415,7 +415,7 @@ object PurchaseText {
@Preview(showBackground = true, uiMode = UI_MODE_NIGHT_YES)
@Composable
private fun PurchaseDialogPreview() {
MdcTheme {
AppCompatTheme {
PurchaseText { _, _ -> }
}
}
@ -424,7 +424,7 @@ private fun PurchaseDialogPreview() {
@Preview(showBackground = true, uiMode = UI_MODE_NIGHT_YES)
@Composable
private fun PurchaseDialogPreviewSolid() {
MdcTheme {
AppCompatTheme {
PurchaseText(solidButton = true) { _, _ -> }
}
}
@ -433,7 +433,7 @@ private fun PurchaseDialogPreviewSolid() {
@Preview(showBackground = true, uiMode = UI_MODE_NIGHT_YES)
@Composable
private fun PurchaseDialogPreviewBadge() {
MdcTheme {
AppCompatTheme {
PurchaseText(badge = true) { _, _ -> }
}
}

@ -20,7 +20,7 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.PermissionStatus
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.astrid.ui.ReminderControlSetViewModel
import org.tasks.R
import org.tasks.compose.*
@ -203,7 +203,7 @@ private fun AlarmRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoAlarms() {
MdcTheme {
AppCompatTheme {
AlarmRow(
alarms = emptyList(),
ringMode = 0,
@ -223,7 +223,7 @@ fun NoAlarms() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun PermissionDenied() {
MdcTheme {
AppCompatTheme {
AlarmRow(
alarms = emptyList(),
ringMode = 0,

@ -3,15 +3,31 @@ package org.tasks.compose.edit
import android.content.res.Configuration
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Icon
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.*
import androidx.compose.runtime.*
import androidx.compose.material.icons.outlined.Add
import androidx.compose.material.icons.outlined.Cancel
import androidx.compose.material.icons.outlined.Description
import androidx.compose.material.icons.outlined.Image
import androidx.compose.material.icons.outlined.Movie
import androidx.compose.material.icons.outlined.MusicNote
import androidx.compose.material.icons.outlined.PlayCircle
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
@ -34,7 +50,7 @@ import coil.decode.VideoFrameDecoder
import coil.request.CachePolicy
import coil.request.ImageRequest
import com.google.accompanist.flowlayout.FlowRow
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.utility.AndroidUtilities
import org.tasks.R
import org.tasks.compose.DisabledText
@ -239,7 +255,7 @@ fun BoxScope.DeleteAttachment(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoAttachments() {
MdcTheme {
AppCompatTheme {
AttachmentRow(
attachments = emptyList(),
openAttachment = {},
@ -253,7 +269,7 @@ fun NoAttachments() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun AttachmentPreview() {
MdcTheme {
AppCompatTheme {
AttachmentRow(
attachments = listOf(
TaskAttachment(

@ -15,7 +15,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.DisabledText
import org.tasks.compose.TaskEditRow
@ -69,7 +69,7 @@ fun CalendarRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoCalendar() {
MdcTheme {
AppCompatTheme {
CalendarRow(eventUri = null, selectedCalendar = null, onClick = {}, clear = {})
}
}
@ -78,7 +78,7 @@ fun NoCalendar() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NewCalendar() {
MdcTheme {
AppCompatTheme {
CalendarRow(eventUri = null, selectedCalendar = "Personal", onClick = {}, clear = {})
}
}
@ -87,7 +87,7 @@ fun NewCalendar() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun ExistingCalendar() {
MdcTheme {
AppCompatTheme {
CalendarRow(eventUri = "abcd", selectedCalendar = null, onClick = {}, clear = {})
}
}

@ -6,7 +6,13 @@ import android.util.TypedValue
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.EditText
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
@ -14,7 +20,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.widget.addTextChangedListener
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.utility.AndroidUtilities
import org.tasks.R
import org.tasks.compose.TaskEditRow
@ -85,7 +91,7 @@ fun DescriptionRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun EmptyDescriptionPreview() {
MdcTheme {
AppCompatTheme {
DescriptionRow(
text = null,
onChanged = {},
@ -100,7 +106,7 @@ fun EmptyDescriptionPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun DescriptionPreview() {
MdcTheme {
AppCompatTheme {
DescriptionRow(
text = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

@ -11,7 +11,7 @@ import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.DisabledText
import org.tasks.compose.TaskEditRow
@ -59,7 +59,7 @@ fun DueDate(dueDate: String?, overdue: Boolean) {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun DueDatePreview() {
MdcTheme {
AppCompatTheme {
DueDateRow(
dueDate = "Today",
overdue = false,
@ -72,7 +72,7 @@ fun DueDatePreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoDueDatePreview() {
MdcTheme {
AppCompatTheme {
DueDateRow(
dueDate = null,
overdue = false,

@ -10,11 +10,11 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.TaskEditRow
import java.text.SimpleDateFormat
import java.util.*
import java.util.Locale
@Composable
fun InfoRow(
@ -62,7 +62,7 @@ fun InfoRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun InfoPreview() {
MdcTheme {
AppCompatTheme {
InfoRow(
creationDate = 1658727180000,
modificationDate = 1658813557000,

@ -7,7 +7,7 @@ import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.sql.QueryTemplate
import com.todoroo.astrid.api.Filter
import org.tasks.R
@ -46,7 +46,7 @@ fun ListRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun ListPreview() {
MdcTheme {
AppCompatTheme {
ListRow(
list = Filter("Default list", QueryTemplate()),
colorProvider = { -769226 },

@ -17,7 +17,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.DisabledText
import org.tasks.compose.TaskEditRow
@ -92,7 +92,7 @@ fun Location(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoLocation() {
MdcTheme {
AppCompatTheme {
LocationRow(
location = null,
hasPermissions = true,
@ -106,7 +106,7 @@ fun NoLocation() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun SampleLocation() {
MdcTheme {
AppCompatTheme {
LocationRow(
location = Location(
Geofence(),

@ -14,7 +14,7 @@ import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.astrid.data.Task
import org.tasks.R
import org.tasks.compose.TaskEditRow
@ -109,7 +109,7 @@ fun RowScope.PriorityButton(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun PriorityPreview() {
MdcTheme {
AppCompatTheme {
PriorityRow(
priority = Task.Priority.MEDIUM,
onChangePriority = {},
@ -122,7 +122,7 @@ fun PriorityPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun PriorityPreviewNoDesaturate() {
MdcTheme {
AppCompatTheme {
PriorityRow(
priority = Task.Priority.MEDIUM,
onChangePriority = {},
@ -135,7 +135,7 @@ fun PriorityPreviewNoDesaturate() {
@Preview(locale = "de", widthDp = 320, showBackground = true)
@Composable
fun PriorityNarrowWidth() {
MdcTheme {
AppCompatTheme {
PriorityRow(
priority = Task.Priority.MEDIUM,
onChangePriority = {},

@ -2,19 +2,30 @@ package org.tasks.compose.edit
import android.content.res.Configuration
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.DisabledText
import org.tasks.compose.TaskEditRow
@ -101,7 +112,7 @@ fun Repeat(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun RepeatPreview() {
MdcTheme {
AppCompatTheme {
RepeatRow(
recurrence = "Repeats weekly on Mon, Tue, Wed, Thu, Fri",
repeatAfterCompletion = false,
@ -116,7 +127,7 @@ fun RepeatPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoRepeatPreview() {
MdcTheme {
AppCompatTheme {
RepeatRow(
recurrence = null,
repeatAfterCompletion = false,

@ -13,7 +13,7 @@ import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.utility.DateUtilities
import com.todoroo.astrid.ui.StartDateControlSet.Companion.getRelativeDateString
import org.tasks.R
@ -81,7 +81,7 @@ fun StartDate(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoStartDate() {
MdcTheme {
AppCompatTheme {
StartDateRow(
startDate = 0L,
selectedDay = StartDatePicker.NO_DAY,
@ -98,7 +98,7 @@ fun NoStartDate() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun FutureStartDate() {
MdcTheme {
AppCompatTheme {
StartDateRow(
startDate = 1657080392000L,
selectedDay = StartDatePicker.DUE_DATE,
@ -115,7 +115,7 @@ fun FutureStartDate() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun PastStartDate() {
MdcTheme {
AppCompatTheme {
StartDateRow(
startDate = 1657080392000L,
selectedDay = StartDatePicker.DUE_TIME,

@ -3,14 +3,24 @@ package org.tasks.compose.edit
import android.content.res.Configuration
import androidx.compose.foundation.clickable
import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.ContentAlpha
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
@ -23,11 +33,16 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.astrid.api.Filter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.data.Task
import org.tasks.compose.*
import org.tasks.compose.CheckBox
import org.tasks.compose.ClearButton
import org.tasks.compose.DisabledText
import org.tasks.compose.SubtaskChip
import org.tasks.compose.TaskEditIcon
import org.tasks.compose.TaskEditRow
import org.tasks.data.TaskContainer
@Composable
@ -207,7 +222,7 @@ fun ExistingSubtaskRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoSubtasks() {
MdcTheme {
AppCompatTheme {
SubtaskRow(
originalFilter = null,
filter = null,
@ -229,7 +244,7 @@ fun NoSubtasks() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun SubtasksPreview() {
MdcTheme {
AppCompatTheme {
SubtaskRow(
originalFilter = null,
filter = null,

@ -7,7 +7,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.compose.Chip
import org.tasks.compose.ChipGroup
@ -57,7 +57,7 @@ fun TagsRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoTags() {
MdcTheme {
AppCompatTheme {
TagsRow(
tags = emptyList(),
colorProvider = { 0 },
@ -71,7 +71,7 @@ fun NoTags() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun SingleTag() {
MdcTheme {
AppCompatTheme {
TagsRow(
tags = listOf(
TagData("Home").apply {
@ -89,7 +89,7 @@ fun SingleTag() {
@Preview(showBackground = true, widthDp = 320)
@Composable
fun BunchOfTags() {
MdcTheme {
AppCompatTheme {
TagsRow(
tags = listOf(
TagData("One"),
@ -108,7 +108,7 @@ fun BunchOfTags() {
@Preview(showBackground = true, widthDp = 320)
@Composable
fun TagWithReallyLongName() {
MdcTheme {
AppCompatTheme {
TagsRow(
tags = listOf(
TagData("This is a tag with a really really long name").apply {

@ -11,13 +11,18 @@ import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Pause
import androidx.compose.material.icons.outlined.PlayArrow
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import kotlinx.coroutines.delay
import org.tasks.R
import org.tasks.compose.DisabledText
@ -110,7 +115,7 @@ fun TimerRow(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun NoTimer() {
MdcTheme {
AppCompatTheme {
TimerRow(started = 0, estimated = 0, elapsed = 0, timerClicked = {}, onClick = {})
}
}
@ -119,7 +124,7 @@ fun NoTimer() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun RunningTimer() {
MdcTheme {
AppCompatTheme {
TimerRow(started = System.currentTimeMillis(), estimated = 900, elapsed = 400, timerClicked = {}, onClick = {})
}
}

@ -18,7 +18,7 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.rememberMultiplePermissionsState
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import org.tasks.R
import org.tasks.calendars.AndroidCalendar
import org.tasks.calendars.CalendarPickerViewModel
@ -88,7 +88,7 @@ fun CalendarPickerList(
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun CalendarPickerPreview() {
MdcTheme {
AppCompatTheme {
CalendarPickerList(
calendars = listOf(
AndroidCalendar("1", "Home", -765666),
@ -105,7 +105,7 @@ fun CalendarPickerPreview() {
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)
@Composable
fun CalendarPickerNoneSelected() {
MdcTheme {
AppCompatTheme {
CalendarPickerList(
calendars = listOf(
AndroidCalendar("1", "Home", -765666),

@ -7,7 +7,7 @@ import android.widget.ListAdapter
import androidx.appcompat.app.AlertDialog
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.ComposeView
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.google.android.material.dialog.MaterialAlertDialogBuilder
class AlertDialogBuilder internal constructor(private val context: Context) {
@ -79,7 +79,7 @@ class AlertDialogBuilder internal constructor(private val context: Context) {
builder.setView(ComposeView(context)
.apply {
setContent {
MdcTheme {
AppCompatTheme {
content()
}
}

@ -5,7 +5,7 @@ import android.os.Bundle
import androidx.core.os.bundleOf
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.setFragmentResult
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.R
import org.tasks.dialogs.DialogBuilder
@ -35,7 +35,7 @@ class AddAccountDialog : DialogFragment() {
.newDialog()
.setTitle(R.string.choose_synchronization_service)
.setContent {
MdcTheme {
AppCompatTheme {
org.tasks.compose.AddAccountDialog(
hasTasksAccount = hasTasksAccount,
selected = this::selected

@ -12,7 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.unit.dp
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.utility.DateUtilities
import com.todoroo.andlib.utility.DateUtilities.now
import com.todoroo.astrid.api.Filter
@ -31,7 +31,7 @@ import org.tasks.time.DateTimeUtils.startOfDay
import org.tasks.ui.CheckBoxProvider
import org.tasks.ui.ChipProvider
import java.time.format.FormatStyle
import java.util.*
import java.util.Locale
import kotlin.math.max
import kotlin.math.roundToInt
@ -217,7 +217,7 @@ class TaskViewHolder internal constructor(
private fun setupChips(filter: Filter, sortByStartDate: Boolean) {
chipGroup.setContent {
MdcTheme {
AppCompatTheme {
ChipGroup(
modifier = Modifier.padding(
end = 16.dp,

@ -8,7 +8,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Toast.LENGTH_SHORT
import androidx.compose.ui.platform.ComposeView
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.astrid.activity.TaskEditFragment
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.R
@ -45,7 +45,7 @@ class CalendarControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
CalendarRow(
eventUri = viewModel.eventUri.collectAsStateLifecycleAware().value,
selectedCalendar = viewModel.selectedCalendar.collectAsStateLifecycleAware().value?.let {

@ -10,7 +10,7 @@ import androidx.compose.ui.platform.ComposeView
import androidx.core.util.Pair
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.rememberMultiplePermissionsState
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.R
import org.tasks.Strings.isNullOrEmpty
@ -82,7 +82,7 @@ class LocationControlSet : TaskEditControlFragment() {
override fun bind(parent: ViewGroup?): View =
(parent as ComposeView).apply {
setContent {
MdcTheme {
AppCompatTheme {
val hasPermissions =
rememberMultiplePermissionsState(permissions = backgroundPermissions())
.allPermissionsGranted

@ -8,7 +8,7 @@ import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.lifecycleScope
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
import com.todoroo.andlib.sql.Criterion
import com.todoroo.andlib.sql.QueryTemplate
import com.todoroo.andlib.utility.DateUtilities.now
@ -53,7 +53,7 @@ class SubtaskControlSet : TaskEditControlFragment() {
(parent as ComposeView).apply {
listViewModel = ViewModelProvider(requireParentFragment())[TaskListViewModel::class.java]
setContent {
MdcTheme {
AppCompatTheme {
SubtaskRow(
originalFilter = viewModel.originalList,
filter = viewModel.selectedList.collectAsStateLifecycleAware().value,

@ -853,16 +853,6 @@
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 (*)
+| +--- androidx.compose.runtime:runtime:1.4.0 (c)
+| \--- androidx.compose.runtime:runtime-saveable:1.4.0 (c)
++--- com.google.android.material:compose-theme-adapter:1.2.1
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 -> 1.8.10 (*)
+| +--- com.google.android.material:compose-theme-adapter-core:1.0.1
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.8.10 (*)
+| | +--- androidx.core:core-ktx:1.9.0 (*)
+| | +--- androidx.appcompat:appcompat:1.5.1 -> 1.6.1 (*)
+| | +--- com.google.android.material:material:1.7.0 -> 1.8.0 (*)
+| | +--- androidx.compose.runtime:runtime:1.3.1 -> 1.4.0 (*)
+| | \--- androidx.compose.foundation:foundation:1.3.1 -> 1.4.0 (*)
+| \--- androidx.compose.material:material:1.3.1 -> 1.4.0 (*)
++--- androidx.activity:activity-compose:1.7.0
+| +--- androidx.activity:activity-ktx:1.7.0 (*)
+| +--- androidx.compose.runtime:runtime:1.0.1 -> 1.4.0 (*)
@ -963,12 +953,21 @@
+| +--- androidx.compose.ui:ui-util:1.4.0 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10 (*)
+\--- com.google.accompanist:accompanist-permissions:0.30.0
+ +--- androidx.activity:activity-compose:1.5.1 -> 1.7.0 (*)
+ +--- androidx.compose.foundation:foundation:1.4.0 (*)
+ +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*)
+ +--- io.github.aakira:napier:1.4.1
+ | \--- io.github.aakira:napier-android:1.4.1
+ | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 -> 1.8.10 (*)
+ | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32 -> 1.8.10
++--- com.google.accompanist:accompanist-permissions:0.30.0
+| +--- androidx.activity:activity-compose:1.5.1 -> 1.7.0 (*)
+| +--- androidx.compose.foundation:foundation:1.4.0 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*)
+| +--- io.github.aakira:napier:1.4.1
+| | \--- io.github.aakira:napier-android:1.4.1
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 -> 1.8.10 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32 -> 1.8.10
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10 (*)
+\--- com.google.accompanist:accompanist-themeadapter-appcompat:0.30.0
+ +--- com.google.accompanist:accompanist-themeadapter-core:0.30.0
+ | +--- androidx.core:core-ktx:1.8.0 -> 1.9.0 (*)
+ | +--- androidx.compose.foundation:foundation:1.4.0 (*)
+ | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 (*)
+ | +--- androidx.appcompat:appcompat:1.4.2 -> 1.6.1 (*)
+ | \--- com.google.android.material:material:1.8.0 (*)
+ +--- androidx.compose.material:material:1.4.0 (*)
+ \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10 (*)

@ -1010,16 +1010,6 @@
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 (*)
+| +--- androidx.compose.runtime:runtime:1.4.0 (c)
+| \--- androidx.compose.runtime:runtime-saveable:1.4.0 (c)
++--- com.google.android.material:compose-theme-adapter:1.2.1
+| +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20 -> 1.8.10 (*)
+| +--- com.google.android.material:compose-theme-adapter-core:1.0.1
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.20 -> 1.8.10 (*)
+| | +--- androidx.core:core-ktx:1.9.0 (*)
+| | +--- androidx.appcompat:appcompat:1.5.1 -> 1.6.1 (*)
+| | +--- com.google.android.material:material:1.7.0 -> 1.8.0 (*)
+| | +--- androidx.compose.runtime:runtime:1.3.1 -> 1.4.0 (*)
+| | \--- androidx.compose.foundation:foundation:1.3.1 -> 1.4.0 (*)
+| \--- androidx.compose.material:material:1.3.1 -> 1.4.0 (*)
++--- androidx.activity:activity-compose:1.7.0
+| +--- androidx.activity:activity-ktx:1.7.0 (*)
+| +--- androidx.compose.runtime:runtime:1.0.1 -> 1.4.0 (*)
@ -1120,12 +1110,21 @@
+| +--- androidx.compose.ui:ui-util:1.4.0 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*)
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10 (*)
+\--- com.google.accompanist:accompanist-permissions:0.30.0
+ +--- androidx.activity:activity-compose:1.5.1 -> 1.7.0 (*)
+ +--- androidx.compose.foundation:foundation:1.4.0 (*)
+ +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*)
+ +--- io.github.aakira:napier:1.4.1
+ | \--- io.github.aakira:napier-android:1.4.1
+ | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 -> 1.8.10 (*)
+ | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32 -> 1.8.10
++--- com.google.accompanist:accompanist-permissions:0.30.0
+| +--- androidx.activity:activity-compose:1.5.1 -> 1.7.0 (*)
+| +--- androidx.compose.foundation:foundation:1.4.0 (*)
+| +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (*)
+| +--- io.github.aakira:napier:1.4.1
+| | \--- io.github.aakira:napier-android:1.4.1
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 -> 1.8.10 (*)
+| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32 -> 1.8.10
+| \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10 (*)
+\--- com.google.accompanist:accompanist-themeadapter-appcompat:0.30.0
+ +--- com.google.accompanist:accompanist-themeadapter-core:0.30.0
+ | +--- androidx.core:core-ktx:1.8.0 -> 1.9.0 (*)
+ | +--- androidx.compose.foundation:foundation:1.4.0 (*)
+ | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.10 (*)
+ | +--- androidx.appcompat:appcompat:1.4.2 -> 1.6.1 (*)
+ | \--- com.google.android.material:material:1.8.0 (*)
+ +--- androidx.compose.material:material:1.4.0 (*)
+ \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10 (*)

@ -3,7 +3,6 @@ accompanist = "0.30.0"
coil = "2.2.2"
compose = "2023.03.00"
compose-compiler = "1.4.4"
compose-theme-adapter = "1.2.1"
dagger-hilt = "2.45"
firebase = "31.2.3"
flipper = "0.187.0"
@ -25,6 +24,7 @@ androidx-test-runner = "1.5.2"
[libraries]
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
accompanist-themeadapter = { module = "com.google.accompanist:accompanist-themeadapter-appcompat", version.ref = "accompanist" }
androidx-compose = { module = "androidx.compose:compose-bom", version.ref = "compose" }
androidx-hilt-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hilt" }
androidx-hilt-work = { module = "androidx.hilt:hilt-work", version.ref = "hilt" }
@ -41,7 +41,6 @@ coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil" }
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coil" }
coil-video = { module = "io.coil-kt:coil-video", version.ref = "coil" }
compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }
compose-theme-adapter = { module = "com.google.android.material:compose-theme-adapter", version.ref = "compose-theme-adapter" }
dagger-hilt = { module = "com.google.dagger:hilt-android", version.ref = "dagger-hilt" }
dagger-hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "dagger-hilt" }
dagger-hilt-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "dagger-hilt" }

Loading…
Cancel
Save