Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix propagations of Experimental APIs #96

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/src/main/java/com/starry/greenstash/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@ import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.biometric.BiometricManager
import androidx.biometric.BiometricPrompt
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.getValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.core.content.ContextCompat
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
Expand All @@ -51,15 +46,8 @@ import com.starry.greenstash.ui.screens.settings.viewmodels.ThemeMode
import com.starry.greenstash.ui.theme.GreenStashTheme
import com.starry.greenstash.utils.Utils
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.ExperimentalCoroutinesApi
import java.util.concurrent.Executor

@ExperimentalCoroutinesApi
@ExperimentalMaterialApi
@ExperimentalFoundationApi
@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalMaterial3Api
@AndroidEntryPoint
class MainActivity : AppCompatActivity() {

Expand Down
13 changes: 1 addition & 12 deletions app/src/main/java/com/starry/greenstash/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@

package com.starry.greenstash

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.State
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.starry.greenstash.database.goal.GoalDao
Expand All @@ -42,17 +37,11 @@ import com.starry.greenstash.ui.navigation.DrawerScreens
import com.starry.greenstash.ui.navigation.Screens
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import javax.inject.Inject

@ExperimentalCoroutinesApi
@ExperimentalMaterialApi
@ExperimentalFoundationApi
@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalMaterial3Api

@HiltViewModel
class MainViewModel @Inject constructor(
private val welcomeDataStore: WelcomeDataStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,12 @@ import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.ui.ExperimentalComposeUiApi
import com.starry.greenstash.database.core.GoalWithTransactions
import com.starry.greenstash.reminder.receivers.AlarmReceiver
import kotlinx.coroutines.ExperimentalCoroutinesApi
import java.util.Calendar
import java.util.Locale


@ExperimentalCoroutinesApi
@ExperimentalMaterial3Api
@ExperimentalAnimationApi
@ExperimentalComposeUiApi
@ExperimentalFoundationApi
@ExperimentalMaterialApi
class ReminderManager(private val context: Context) {

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.core.app.NotificationCompat
import com.starry.greenstash.MainActivity
import com.starry.greenstash.R
Expand All @@ -44,15 +39,8 @@ import com.starry.greenstash.reminder.receivers.ReminderDismissReceiver
import com.starry.greenstash.utils.GoalTextUtils
import com.starry.greenstash.utils.PreferenceUtil
import com.starry.greenstash.utils.Utils
import kotlinx.coroutines.ExperimentalCoroutinesApi


@ExperimentalCoroutinesApi
@ExperimentalMaterial3Api
@ExperimentalAnimationApi
@ExperimentalComposeUiApi
@ExperimentalFoundationApi
@ExperimentalMaterialApi
class ReminderNotificationSender(
private val context: Context,
private val preferenceUtil: PreferenceUtil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.ui.ExperimentalComposeUiApi
import com.starry.greenstash.database.core.GoalWithTransactions
import com.starry.greenstash.database.goal.GoalDao
import com.starry.greenstash.database.goal.GoalPriority
Expand All @@ -42,19 +37,13 @@ import com.starry.greenstash.reminder.ReminderNotificationSender
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch
import java.time.DayOfWeek
import java.time.LocalDate
import java.time.LocalDateTime
import javax.inject.Inject

@ExperimentalCoroutinesApi
@ExperimentalMaterialApi
@ExperimentalFoundationApi
@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalMaterial3Api

@AndroidEntryPoint
class AlarmReceiver : BroadcastReceiver() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.ui.ExperimentalComposeUiApi
import com.starry.greenstash.database.core.GoalWithTransactions
import com.starry.greenstash.database.goal.GoalDao
import com.starry.greenstash.database.transaction.Transaction
Expand All @@ -45,16 +40,10 @@ import com.starry.greenstash.utils.Utils
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch
import javax.inject.Inject

@ExperimentalCoroutinesApi
@ExperimentalMaterialApi
@ExperimentalFoundationApi
@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalMaterial3Api

@AndroidEntryPoint
class ReminderDepositReceiver : BroadcastReceiver() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,11 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.ui.ExperimentalComposeUiApi
import com.starry.greenstash.reminder.ReminderNotificationSender
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.ExperimentalCoroutinesApi
import javax.inject.Inject

@ExperimentalCoroutinesApi
@ExperimentalMaterialApi
@ExperimentalFoundationApi
@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalMaterial3Api

@AndroidEntryPoint
class ReminderDismissReceiver : BroadcastReceiver() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

@ExperimentalMaterial3Api

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CurrencyPicker(
defaultCurrencyValue: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
package com.starry.greenstash.ui.common

import android.os.Build
import android.widget.Toast
import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.animateFloatAsState
Expand Down Expand Up @@ -66,14 +65,15 @@ import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.content.ContextCompat.getString
import com.starry.greenstash.R
import com.starry.greenstash.ui.theme.greenstashFont
import com.starry.greenstash.utils.toToast

@ExperimentalMaterial3Api
Expand All @@ -82,6 +82,7 @@ fun ExpandableCard(
title: String,
titleFontSize: TextUnit = 16.sp,
titleFontWeight: FontWeight = FontWeight.Bold,
titleFontFamily: FontFamily = greenstashFont,
shape: Shape = RoundedCornerShape(8.dp),
padding: Dp = 12.dp,
expanded: Boolean = false,
Expand Down Expand Up @@ -157,13 +158,15 @@ fun ExpandableTextCard(
title: String,
titleFontSize: TextUnit = 16.sp,
titleFontWeight: FontWeight = FontWeight.Bold,
titleFontFamily: FontFamily = greenstashFont,
description: String,
descriptionFontSize: TextUnit = 14.sp,
descriptionFontWeight: FontWeight = FontWeight.Normal,
descriptionFontFamily: FontFamily = greenstashFont,
descriptionMaxLines: Int = 10,
shape: Shape = RoundedCornerShape(8.dp),
showCopyButton: Boolean = false,
padding: Dp = 12.dp,
showCopyButton: Boolean = false,
) {
val context = LocalContext.current
val clipboardManager = LocalClipboardManager.current
Expand All @@ -172,13 +175,15 @@ fun ExpandableTextCard(
title = title,
titleFontSize = titleFontSize,
titleFontWeight = titleFontWeight,
titleFontFamily = titleFontFamily,
shape = shape,
padding = padding
) {
Text(
text = description,
fontSize = descriptionFontSize,
fontWeight = descriptionFontWeight,
fontFamily = descriptionFontFamily,
maxLines = descriptionMaxLines,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(start = 12.dp, end = 12.dp)
Expand All @@ -188,19 +193,23 @@ fun ExpandableTextCard(
onClick = {
clipboardManager.setText(AnnotatedString(description))
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
getString(context, R.string.info_copy_alert).toToast(context)
context.getString(R.string.info_copy_notes_alert).toToast(context)
}
},
modifier = Modifier.padding(start = 8.dp, top = 8.dp)
) {
Row {
Icon(
Icons.Filled.ContentCopy,
contentDescription = stringResource(R.string.info_copy_icon_description),
contentDescription = stringResource(R.string.info_copy_notes_icon_desc),
modifier = Modifier.size(ButtonDefaults.IconSize)
)
Spacer(Modifier.width(ButtonDefaults.IconSpacing))
Text(text = stringResource(id = R.string.info_copy_button))
Text(
text = stringResource(id = R.string.info_copy_notes_button),
fontFamily = greenstashFont,
fontSize = 14.sp
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,32 @@

package com.starry.greenstash.ui.navigation

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideInHorizontally
import androidx.compose.animation.slideOutHorizontally
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.navArgument
import com.starry.greenstash.ui.screens.backups.BackupScreen
import com.starry.greenstash.ui.screens.dwscreen.composables.DWScreen
import com.starry.greenstash.ui.screens.home.composables.HomeScreen
import com.starry.greenstash.ui.screens.info.composables.GoalInfoScreen
import com.starry.greenstash.ui.screens.input.composables.CongratsScreen
import com.starry.greenstash.ui.screens.input.composables.DWScreen
import com.starry.greenstash.ui.screens.input.composables.InputScreen
import com.starry.greenstash.ui.screens.other.CongratsScreen
import com.starry.greenstash.ui.screens.settings.composables.AboutScreen
import com.starry.greenstash.ui.screens.settings.composables.GoalCardStyle
import com.starry.greenstash.ui.screens.settings.composables.OSLScreen
import com.starry.greenstash.ui.screens.settings.composables.SettingsScreen
import com.starry.greenstash.ui.screens.welcome.composables.WelcomeScreen
import kotlinx.coroutines.ExperimentalCoroutinesApi


private const val NAVIGATION_ANIM_DURATION = 300
Expand Down Expand Up @@ -85,12 +79,7 @@ private fun popExitTransition() = slideOutHorizontally(
)
) + fadeOut(animationSpec = tween(NAVIGATION_ANIM_DURATION))

@ExperimentalCoroutinesApi
@ExperimentalMaterialApi
@ExperimentalFoundationApi
@ExperimentalComposeUiApi
@ExperimentalMaterial3Api
@ExperimentalAnimationApi

@Composable
fun NavGraph(
navController: NavHostController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import java.io.Reader
import java.nio.charset.StandardCharsets


@ExperimentalMaterial3Api
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun BackupScreen(navController: NavController) {
val context = LocalContext.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/


package com.starry.greenstash.ui.screens.input.composables
package com.starry.greenstash.ui.screens.dwscreen.composables

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -100,7 +100,8 @@ import kotlinx.coroutines.withContext
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

@ExperimentalMaterial3Api

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DWScreen(goalId: String, transactionTypeName: String, navController: NavController) {
val context = LocalContext.current
Expand Down
Loading
Loading