diff --git a/android/.gitignore b/android/FucksGiven/.gitignore similarity index 100% rename from android/.gitignore rename to android/FucksGiven/.gitignore diff --git a/android/app/.gitignore b/android/FucksGiven/app/.gitignore similarity index 100% rename from android/app/.gitignore rename to android/FucksGiven/app/.gitignore diff --git a/android/app/build.gradle.kts b/android/FucksGiven/app/build.gradle.kts similarity index 84% rename from android/app/build.gradle.kts rename to android/FucksGiven/app/build.gradle.kts index 2a54c5a..5cabe92 100644 --- a/android/app/build.gradle.kts +++ b/android/FucksGiven/app/build.gradle.kts @@ -9,12 +9,14 @@ android { namespace = "rocks.poopjournal.fucksgiven" compileSdk = 34 + defaultConfig { + applicationId = "rocks.poopjournal.fucksgiven" minSdk = 26 targetSdk = 34 versionCode = 1 - versionName = "1.0" + versionName = "1.0.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -40,6 +42,7 @@ android { } buildFeatures { compose = true + viewBinding = true } composeOptions { kotlinCompilerExtensionVersion = "1.5.1" @@ -62,6 +65,11 @@ dependencies { implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) implementation(libs.androidx.runtime.livedata) + implementation(libs.androidx.glance.appwidget) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.core.splashscreen) + implementation(libs.androidx.appcompat) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) @@ -71,6 +79,7 @@ dependencies { debugImplementation(libs.androidx.ui.test.manifest) implementation("androidx.navigation:navigation-compose:2.7.7") implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2") + implementation ("androidx.work:work-runtime-ktx:2.9.0") // Room @@ -84,8 +93,9 @@ dependencies { kapt("com.google.dagger:hilt-android-compiler:2.48") implementation("androidx.hilt:hilt-navigation-compose:1.0.0") implementation("com.google.accompanist:accompanist-permissions:0.31.0-alpha") - implementation("com.github.jaikeerthick:Composable-Graphs:v1.2.3") implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") + implementation ("androidx.glance:glance-appwidget:1.0.0") + implementation ("androidx.glance:glance-material3:1.0.0") } kapt{ diff --git a/android/FucksGiven/app/lint.xml b/android/FucksGiven/app/lint.xml new file mode 100644 index 0000000..44fac75 --- /dev/null +++ b/android/FucksGiven/app/lint.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/android/app/proguard-rules.pro b/android/FucksGiven/app/proguard-rules.pro similarity index 100% rename from android/app/proguard-rules.pro rename to android/FucksGiven/app/proguard-rules.pro diff --git a/android/app/release/app-release.aab b/android/FucksGiven/app/release/app-release.aab similarity index 100% rename from android/app/release/app-release.aab rename to android/FucksGiven/app/release/app-release.aab diff --git a/android/app/src/androidTest/java/rocks/poopjournal/fucksgiven/ExampleInstrumentedTest.kt b/android/FucksGiven/app/src/androidTest/java/rocks/poopjournal/fucksgiven/ExampleInstrumentedTest.kt similarity index 100% rename from android/app/src/androidTest/java/rocks/poopjournal/fucksgiven/ExampleInstrumentedTest.kt rename to android/FucksGiven/app/src/androidTest/java/rocks/poopjournal/fucksgiven/ExampleInstrumentedTest.kt diff --git a/android/app/src/main/AndroidManifest.xml b/android/FucksGiven/app/src/main/AndroidManifest.xml similarity index 53% rename from android/app/src/main/AndroidManifest.xml rename to android/FucksGiven/app/src/main/AndroidManifest.xml index d48bb31..bff8c14 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/FucksGiven/app/src/main/AndroidManifest.xml @@ -2,10 +2,14 @@ + + - + + tools:targetApi="tiramisu" + android:localeConfig="@xml/local_config"> + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/ic_launcher-playstore.png b/android/FucksGiven/app/src/main/ic_launcher-playstore.png similarity index 100% rename from android/app/src/main/ic_launcher-playstore.png rename to android/FucksGiven/app/src/main/ic_launcher-playstore.png diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/FucksGivenApplication.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/FucksGivenApplication.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/FucksGivenApplication.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/FucksGivenApplication.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/MainActivity.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/MainActivity.kt similarity index 69% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/MainActivity.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/MainActivity.kt index 1a1a72e..4b5b0c3 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/MainActivity.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/MainActivity.kt @@ -1,13 +1,17 @@ package rocks.poopjournal.fucksgiven +import android.app.LocaleConfig +import android.app.LocaleManager +import android.os.Build import android.os.Bundle +import android.os.LocaleList import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.annotation.RequiresApi import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.collectAsState import androidx.navigation.compose.rememberNavController -import com.google.accompanist.permissions.ExperimentalPermissionsApi import dagger.hilt.android.AndroidEntryPoint import rocks.poopjournal.fucksgiven.presentation.navigation.NavGraph import rocks.poopjournal.fucksgiven.presentation.ui.theme.FucksGivenTheme @@ -19,11 +23,21 @@ import javax.inject.Inject class MainActivity : ComponentActivity() { @Inject lateinit var themeSetting: ThemeSetting - @OptIn(ExperimentalPermissionsApi::class) + + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { + val localeManager = applicationContext + .getSystemService(LocaleManager::class.java) + localeManager.overrideLocaleConfig = LocaleConfig( + LocaleList.forLanguageTags("en-US,de,ur,fr") + ) + + val overrideLocaleConfig = localeManager.overrideLocaleConfig + val supportedLocales = overrideLocaleConfig?.supportedLocales + val theme = themeSetting.themeFlow.collectAsState() val useDarkColors = when (theme.value) { AppTheme.LIGHT -> false diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/data/DatabaseBackup.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/DatabaseBackup.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/data/DatabaseBackup.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/DatabaseBackup.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDao.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDao.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDao.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDao.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckData.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckData.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckData.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckData.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDatabase.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDatabase.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDatabase.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckDatabase.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckRepository.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckRepository.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckRepository.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/FuckRepository.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/data/ThemeRepositoryImpl.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/ThemeRepositoryImpl.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/data/ThemeRepositoryImpl.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/data/ThemeRepositoryImpl.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/di/AppModule.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/di/AppModule.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/di/AppModule.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/di/AppModule.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/di/SettingModule.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/di/SettingModule.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/di/SettingModule.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/di/SettingModule.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/BottomBar.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/BottomBar.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/BottomBar.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/BottomBar.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Chart.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Chart.kt similarity index 97% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Chart.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Chart.kt index 603fdc6..1679fec 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Chart.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Chart.kt @@ -1,6 +1,7 @@ package rocks.poopjournal.fucksgiven.presentation.component import android.graphics.Typeface +import android.view.View import android.view.ViewGroup import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -10,9 +11,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.viewinterop.AndroidView import androidx.core.content.res.ResourcesCompat +import androidx.core.text.layoutDirection import com.github.mikephil.charting.charts.LineChart import com.github.mikephil.charting.components.XAxis import com.github.mikephil.charting.data.Entry @@ -22,6 +25,7 @@ import com.github.mikephil.charting.formatter.IndexAxisValueFormatter import com.github.mikephil.charting.formatter.ValueFormatter import rocks.poopjournal.fucksgiven.R import rocks.poopjournal.fucksgiven.presentation.ui.theme.FuckGreen +import java.util.Locale @Composable fun LineChartComposable( diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Horizontal Pager.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Horizontal Pager.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Horizontal Pager.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/Horizontal Pager.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/ThemeChangeDialog.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/ThemeChangeDialog.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/ThemeChangeDialog.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/ThemeChangeDialog.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/TopAppBar.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/TopAppBar.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/TopAppBar.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/component/TopAppBar.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/AppRoutes.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/AppRoutes.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/AppRoutes.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/AppRoutes.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/NavGraph.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/NavGraph.kt similarity index 86% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/NavGraph.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/NavGraph.kt index 434b03a..ab405db 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/NavGraph.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/navigation/NavGraph.kt @@ -1,10 +1,13 @@ package rocks.poopjournal.fucksgiven.presentation.navigation +import android.os.Build +import androidx.annotation.RequiresApi import androidx.compose.runtime.Composable import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable +import rocks.poopjournal.fucksgiven.presentation.screens.AboutScreen import rocks.poopjournal.fucksgiven.presentation.viewmodel.HomeViewModel import rocks.poopjournal.fucksgiven.presentation.screens.HomeScreen import rocks.poopjournal.fucksgiven.presentation.screens.SettingScreen @@ -12,6 +15,7 @@ import rocks.poopjournal.fucksgiven.presentation.screens.StatsScreen import rocks.poopjournal.fucksgiven.presentation.viewmodel.SettingsViewModel import rocks.poopjournal.fucksgiven.presentation.viewmodel.StatsViewModel +@RequiresApi(Build.VERSION_CODES.P) @Composable fun NavGraph(navController: NavHostController){ val viewModel : HomeViewModel = hiltViewModel() @@ -27,11 +31,12 @@ fun NavGraph(navController: NavHostController){ } composable(route = ABOUT_SCREEN){ - + AboutScreen(navController = navController) } composable(route = SETTINGS_SCREEN){ SettingScreen(navController = navController, viewModel = settingsViewModel) } + } } \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/AboutScreen.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/AboutScreen.kt new file mode 100644 index 0000000..0c5c1af --- /dev/null +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/AboutScreen.kt @@ -0,0 +1,456 @@ +package rocks.poopjournal.fucksgiven.presentation.screens + +import android.content.Context +import android.content.Intent +import android.content.pm.PackageManager +import android.net.Uri +import android.os.Build +import androidx.annotation.RequiresApi +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +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.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.text.ClickableText +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material3.Divider +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.core.content.ContextCompat.startActivity +import androidx.navigation.NavHostController +import rocks.poopjournal.fucksgiven.R + +@RequiresApi(Build.VERSION_CODES.P) +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AboutScreen(navController: NavHostController) { + val context = LocalContext.current + val packageManager = context.packageManager + val packageName = context.packageName + val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + packageManager.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0)) + } else { + packageManager.getPackageInfo(packageName, 0) + } + Scaffold( + topBar = { + TopAppBar( + title = { + Text( + text = stringResource(id = R.string.about), + style = MaterialTheme.typography.titleLarge + ) + }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = MaterialTheme.colorScheme.background + ), + navigationIcon = { + IconButton(onClick = { navController.popBackStack() }) { + Icon( + imageVector = Icons.Default.ArrowBack, + contentDescription = null, + tint = MaterialTheme.colorScheme.primary + ) + } + } + ) + } + ) { + Column( + modifier = Modifier + .fillMaxSize() + .padding(it) + .verticalScroll(rememberScrollState()) + ) { + Column( + modifier = Modifier.fillMaxWidth(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + painter = painterResource(id = R.drawable.fucks), + contentDescription = "rounded icon", + modifier = Modifier + .size(96.dp) + .clip(CircleShape) + ) + Text( + text = stringResource(id = R.string.app_name), + style = MaterialTheme.typography.bodyLarge, + ) + val stylizedPoetry = buildAnnotatedString { + withStyle(style = SpanStyle(fontSize = 14.sp, fontWeight = FontWeight.W400)) { + append("v${packageInfo.longVersionCode}") + append("—") + withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) { + append("Apache License 2.0") + addStringAnnotation( + tag = "URL", + annotation = "https://www.apache.org/licenses/LICENSE-2.0", + start = length - "Apache License 2.0".length, + end = length + ) + } + } + } + ClickableText(text = stylizedPoetry, onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + Column(modifier = Modifier.padding(8.dp)) { + MarvinRow(context = context) + + Spacer(modifier = Modifier.height(8.dp)) + Divider(modifier = Modifier.padding(start = 12.dp)) + + MubeenRow(context = context) + } + Column { + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .background(MaterialTheme.colorScheme.secondary), + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = stringResource(id = R.string.contribution), + color = MaterialTheme.colorScheme.primary, + style = MaterialTheme.typography.labelSmall, + modifier = Modifier.padding(start = 8.dp) + ) + } + ContributionRow(context = context) + } + + Column { + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .background(MaterialTheme.colorScheme.secondary), + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = stringResource(id = R.string.open_source), + color = MaterialTheme.colorScheme.primary, + style = MaterialTheme.typography.labelSmall, + modifier = Modifier.padding(start = 8.dp) + ) + } + LicenseRow(context = context) + } + } + } + } +} + +@Composable +fun MarvinRow(context: Context) { + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Row { + Image( + painter = painterResource(id = R.drawable.marvin), + contentDescription = "crazy marvin", + modifier = Modifier + .size(32.dp) + .clip(CircleShape) + ) + Spacer(modifier = Modifier.width(10.dp)) + Column { + Text( + text = stringResource(id = R.string.crazy_marvin), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + Text( + text = stringResource(id = R.string.developer), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onTertiary + ) + + } + } + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Image( + painter = painterResource(id = R.drawable.message), + contentDescription = "message", + modifier = Modifier + .padding(end = 10.dp) + .clickable { + val intent = Intent(Intent.ACTION_SENDTO).apply { + data = + Uri.parse("mailto:marvin@poopjournal.rocks?subject=Fucks%20Given") + } + startActivity(context, intent, null) + } + ) + Image( + painter = painterResource(id = R.drawable.github), + contentDescription = "github", + modifier = Modifier + .padding(end = 10.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://github.com/Crazy-Marvin") + } + startActivity(context, intent, null) + } + ) + Image( + painter = painterResource(id = R.drawable.gmail), + contentDescription = "mail", + modifier = Modifier.clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://fosstodon.org/@CrazyMarvinApps") + } + startActivity(context, intent, null) + } + ) + } + } +} + +@Composable +fun MubeenRow(context: Context) { + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Row { + Image( + painter = painterResource(id = R.drawable.mubeen), + contentDescription = "crazy marvin", + modifier = Modifier + .size(32.dp) + .clip(CircleShape), + contentScale = ContentScale.FillBounds + ) + Spacer(modifier = Modifier.width(10.dp)) + Column { + Text( + text = stringResource(id = R.string.mubeen), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + Text( + text = stringResource(id = R.string.developer), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onTertiary + ) + + } + } + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Image( + painter = painterResource(id = R.drawable.message), + contentDescription = "message", + modifier = Modifier + .padding(end = 10.dp) + .clickable { + val intent = Intent(Intent.ACTION_SENDTO).apply { + data = Uri.parse("mailto:mubeen1519@gmail.com?subject=Fucks%20Given") + } + context.startActivity(intent) + } + ) + Image( + painter = painterResource(id = R.drawable.github), + contentDescription = "github", + modifier = Modifier + .padding(end = 10.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://github.com/mubeen1519") + } + context.startActivity(intent) + } + ) + Image( + painter = painterResource(id = R.drawable.x), + contentDescription = "x", + modifier = Modifier.clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://twitter.com/MubeenA74") + } + context.startActivity(intent) + } + ) + } + } +} + +@Composable +fun ContributionRow(context: Context) { + Column(modifier = Modifier.padding(8.dp)) { + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://hosted.weblate.org/engage/fucks-given/") + } + context.startActivity(intent) + }, verticalAlignment = Alignment.CenterVertically + ) { + Image( + painter = painterResource(id = R.drawable.translate), + contentDescription = "translate", + modifier = Modifier + .size(24.dp) + .clip(CircleShape) + ) + Spacer(modifier = Modifier.width(10.dp)) + Text( + text = stringResource(id = R.string.translate), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + } + Spacer(modifier = Modifier.height(8.dp)) + Divider(modifier = Modifier.padding(start = 8.dp)) + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://github.com/Crazy-Marvin/FucksGiven/issues") + } + context.startActivity(intent) + }, verticalAlignment = Alignment.CenterVertically + ) { + Image( + painter = painterResource(id = R.drawable.report), + contentDescription = "report", + modifier = Modifier + .size(24.dp) + .clip(CircleShape) + ) + Spacer(modifier = Modifier.width(10.dp)) + Text( + text = stringResource(id = R.string.report), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + } + Spacer(modifier = Modifier.height(8.dp)) + Divider(modifier = Modifier.padding(start = 8.dp)) + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://github.com/Crazy-Marvin/FucksGiven") + } + context.startActivity(intent) + }, verticalAlignment = Alignment.CenterVertically + ) { + Image( + painter = painterResource(id = R.drawable.source), + contentDescription = "source", + modifier = Modifier + .size(24.dp) + .clip(CircleShape) + ) + Spacer(modifier = Modifier.width(10.dp)) + Text( + text = stringResource(id = R.string.view_source), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + } + } +} + +@Composable +fun LicenseRow(context: Context) { + Column(modifier = Modifier + .padding(8.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://github.com/feathericons/feather/blob/main/LICENSE") + } + context.startActivity(intent) + }) { + Text( + text = stringResource(id = R.string.feather_icons), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + Text( + text = stringResource(id = R.string.mit_license), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onTertiary + ) + } + Spacer(modifier = Modifier.height(8.dp)) + Divider(modifier = Modifier.padding(start = 8.dp)) + Column(modifier = Modifier + .padding(8.dp) + .clickable { + val intent = Intent(Intent.ACTION_VIEW).apply { + data = Uri.parse("https://github.com/androidx/androidx/blob/androidx-main/LICENSE.txt") + } + context.startActivity(intent) + }) { + Text( + text = stringResource(id = R.string.android_jetpack), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onBackground + ) + Text( + text = stringResource(id = R.string.apache_license), + style = MaterialTheme.typography.bodyLarge, + color = MaterialTheme.colorScheme.onTertiary + ) + } +} diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/HomeScreen.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/HomeScreen.kt similarity index 98% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/HomeScreen.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/HomeScreen.kt index 548fd74..7e43121 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/HomeScreen.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/HomeScreen.kt @@ -152,8 +152,10 @@ fun HomeScreen( fun FucksList( fuckList: List ) { - // Group the fuckList by date - val groupedFucks = fuckList.groupBy { getFormattedDate(it.date) } + val sortedFucks = fuckList.sortedWith(compareBy({ !isToday(getFormattedDate(it.date)) }, { -it.date })) + + // Group the sorted list by date + val groupedFucks = sortedFucks.groupBy { getFormattedDate(it.date) } LazyColumn { groupedFucks.forEach { (date, fucks) -> diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/SettingsScreen.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/SettingsScreen.kt similarity index 83% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/SettingsScreen.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/SettingsScreen.kt index c8ef490..142f49a 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/SettingsScreen.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/SettingsScreen.kt @@ -39,6 +39,7 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController import rocks.poopjournal.fucksgiven.R import rocks.poopjournal.fucksgiven.presentation.component.ThemeContent +import rocks.poopjournal.fucksgiven.presentation.navigation.ABOUT_SCREEN import rocks.poopjournal.fucksgiven.presentation.ui.utils.ThemeSetting import rocks.poopjournal.fucksgiven.presentation.viewmodel.SettingsViewModel @@ -160,40 +161,40 @@ fun SettingScreen(navController: NavHostController, viewModel: SettingsViewModel Text(text = stringResource(id = R.string.restore), style = MaterialTheme.typography.bodyLarge) } } -// Column { -// Row( -// modifier = Modifier -// .fillMaxWidth() -// .height(50.dp) -// .background(MaterialTheme.colorScheme.secondary), -// verticalAlignment = Alignment.CenterVertically -// ) { -// Text( -// text = "About", -// color = MaterialTheme.colorScheme.primary, -// style = MaterialTheme.typography.labelSmall, -// modifier = Modifier.padding(start = 8.dp) -// ) -// } -// -// Row( -// modifier = Modifier -// .fillMaxWidth() -// .height(50.dp) -// .padding(8.dp) -// .clickable { -// navController.navigate(ABOUT_SCREEN) -// }, -// verticalAlignment = Alignment.CenterVertically -// ) { -// Icon( -// painter = painterResource(id = R.drawable.about), -// contentDescription = "backup" -// ) -// Spacer(modifier = Modifier.width(8.dp)) -// Text(text = "About", style = MaterialTheme.typography.bodyLarge) -// } -// } + Column { + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .background(MaterialTheme.colorScheme.secondary), + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = stringResource(id = R.string.about), + color = MaterialTheme.colorScheme.primary, + style = MaterialTheme.typography.labelSmall, + modifier = Modifier.padding(start = 8.dp) + ) + } + + Row( + modifier = Modifier + .fillMaxWidth() + .height(50.dp) + .padding(8.dp) + .clickable { + navController.navigate(ABOUT_SCREEN) + }, + verticalAlignment = Alignment.CenterVertically + ) { + Icon( + painter = painterResource(id = R.drawable.about), + contentDescription = "about" + ) + Spacer(modifier = Modifier.width(8.dp)) + Text(text = stringResource(id = R.string.about), style = MaterialTheme.typography.bodyLarge) + } + } } } } diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/StatsScreen.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/StatsScreen.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/StatsScreen.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/StatsScreen.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Color.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Color.kt similarity index 73% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Color.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Color.kt index 8cc402b..8f926c2 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Color.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Color.kt @@ -7,8 +7,9 @@ val PurpleGrey80 = Color(0xFFCCC2DC) val Pink80 = Color(0xFFEFB8C8) val Purple40 = Color(0xFF6650a4) -val PurpleGrey40 = Color(0xFF625b71) +val PurpleGrey40 = Color(0xFF717184) val Pink40 = Color(0xFF7D5260) val FuckGreen = Color(0xFF29A331) -val FuckSecondary = Color(0xFFEEF8EF) \ No newline at end of file +val FuckSecondary = Color(0xFFEEF8EF) +val WatchGrey = Color(0xFFC8C8D0) \ No newline at end of file diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Theme.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Theme.kt similarity index 84% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Theme.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Theme.kt index f2509de..548d5dd 100644 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Theme.kt +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Theme.kt @@ -12,18 +12,24 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext -private val DarkColorScheme = darkColorScheme( +val DarkColorScheme = darkColorScheme( primary = FuckGreen, secondary = FuckSecondary, tertiary = Pink80, - background = Color.Black + background = Color.Black, + onBackground = Color.White, + onPrimary = WatchGrey, + onTertiary = PurpleGrey40 ) -private val LightColorScheme = lightColorScheme( +val LightColorScheme = lightColorScheme( primary = FuckGreen, secondary = FuckSecondary, + onBackground = Color.Black, tertiary = Pink40, - background = Color.White + background = Color.White, + onPrimary = WatchGrey, + onTertiary = PurpleGrey40 /* Other default colors to override diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Type.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Type.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Type.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/theme/Type.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/Constants.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/Constants.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/Constants.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/Constants.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/ThemeModes.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/ThemeModes.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/ThemeModes.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/ui/utils/ThemeModes.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/HomeViewModel.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/HomeViewModel.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/HomeViewModel.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/HomeViewModel.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/SettingsViewModel.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/SettingsViewModel.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/SettingsViewModel.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/SettingsViewModel.kt diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/StatsViewModel.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/StatsViewModel.kt similarity index 100% rename from android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/StatsViewModel.kt rename to android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/viewmodel/StatsViewModel.kt diff --git a/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/TaskWidgetProvider.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/TaskWidgetProvider.kt new file mode 100644 index 0000000..a43bd1a --- /dev/null +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/TaskWidgetProvider.kt @@ -0,0 +1,167 @@ +package rocks.poopjournal.fucksgiven.presentation.widget + +import android.content.Context +import android.content.Intent +import android.content.Intent.FLAG_ACTIVITY_NEW_TASK +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.unit.dp +import androidx.glance.GlanceId +import androidx.glance.GlanceModifier +import androidx.glance.GlanceTheme +import androidx.glance.ImageProvider +import androidx.glance.appwidget.GlanceAppWidget +import androidx.glance.appwidget.SizeMode +import androidx.glance.appwidget.appWidgetBackground +import androidx.glance.appwidget.components.CircleIconButton +import androidx.glance.appwidget.lazy.LazyColumn +import androidx.glance.appwidget.lazy.items +import androidx.glance.appwidget.provideContent +import androidx.glance.background +import androidx.glance.layout.Alignment +import androidx.glance.layout.Column +import androidx.glance.layout.Row +import androidx.glance.layout.fillMaxSize +import androidx.glance.layout.fillMaxWidth +import androidx.glance.layout.height +import androidx.glance.layout.padding +import androidx.glance.layout.size +import androidx.glance.text.FontFamily +import androidx.glance.text.FontWeight +import androidx.glance.text.Text +import androidx.glance.text.TextStyle +import dagger.hilt.EntryPoint +import dagger.hilt.EntryPoints +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import rocks.poopjournal.fucksgiven.MainActivity +import rocks.poopjournal.fucksgiven.R +import rocks.poopjournal.fucksgiven.presentation.screens.getFormattedDate +import rocks.poopjournal.fucksgiven.presentation.screens.isToday + +class MyAppWidget : GlanceAppWidget() { + override val sizeMode: SizeMode + get() = SizeMode.Exact + override suspend fun provideGlance(context: Context, id: GlanceId) { + val appContext = context.applicationContext + val viewModel = + EntryPoints.get( + appContext, + AppWidgetEntryPoint::class.java, + ).getViewModel() + + provideContent { + WidgetTheme { + val uiState by viewModel.uiState.collectAsState() + val list = uiState.fuckList ?: emptyList() + Column( + modifier = GlanceModifier + .fillMaxSize() + .background(ImageProvider(R.drawable.app_widget_background)) + .appWidgetBackground() + .padding(5.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Row( + modifier = GlanceModifier.fillMaxWidth().padding(10.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalAlignment = Alignment.End + ) { + Text( + text = "Fucks Given", // Replace with a plain string + modifier = GlanceModifier.defaultWeight(), + style = TextStyle( + fontFamily = FontFamily.SansSerif, + fontWeight = FontWeight.Bold + ) + ) + + CircleIconButton( + imageProvider = ImageProvider(R.drawable.baseline_add_24), + onClick = { + Intent(context, MainActivity::class.java).apply { + flags = FLAG_ACTIVITY_NEW_TASK + context.startActivity(this) + } + }, + contentDescription = "", + modifier = GlanceModifier + .size(34.dp) + .background(GlanceTheme.colors.onBackground) + .padding(8.dp), + contentColor = GlanceTheme.colors.tertiary, + backgroundColor = GlanceTheme.colors.onBackground + ) + } + if (list.isNotEmpty()) { + val sortedFucks = list.sortedWith(compareBy({ !isToday(getFormattedDate(it.date)) }, { -it.date })) + + // Group the sorted list by date + val groupedFucks = sortedFucks.groupBy { getFormattedDate(it.date) } + LazyColumn(modifier = GlanceModifier.padding(top = 8.dp)) { + groupedFucks.forEach { (date, fucks) -> + item { + Row( + modifier = GlanceModifier + .fillMaxWidth() + .height(20.dp).background(GlanceTheme.colors.secondary), + verticalAlignment = Alignment.CenterVertically + ) { + val headerText = if (isToday(date)) { + "Today" + } else { + date + } + Text( + text = headerText, + modifier = GlanceModifier.padding(start = 8.dp), + style = TextStyle( + color = GlanceTheme.colors.onBackground, + fontFamily = FontFamily.SansSerif + ) + ) + } + } + items(fucks) { fuck -> + Column( + modifier = GlanceModifier + .fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically + ) { + Row( + modifier = GlanceModifier + .fillMaxWidth() + .height(20.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = fuck.description, + modifier = GlanceModifier.padding(start = 8.dp), + ) + } + } + } + } + } + } else { + Text( + text = "No fucks given", // Replace with a plain string + modifier = GlanceModifier.padding(12.dp) + ) + } + } + } + } + } + + @EntryPoint + @InstallIn(SingletonComponent::class) + interface AppWidgetEntryPoint { + fun getViewModel(): AppWidgetViewModel + } +} + + + + + diff --git a/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/TaskWidgetReceiver.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/TaskWidgetReceiver.kt new file mode 100644 index 0000000..f11e84a --- /dev/null +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/TaskWidgetReceiver.kt @@ -0,0 +1,9 @@ +package rocks.poopjournal.fucksgiven.presentation.widget + +import androidx.glance.appwidget.GlanceAppWidget +import androidx.glance.appwidget.GlanceAppWidgetReceiver + +class MyAppWidgetReceiver : GlanceAppWidgetReceiver() { + override val glanceAppWidget: GlanceAppWidget + get() = MyAppWidget() +} diff --git a/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/WidgetTheme.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/WidgetTheme.kt new file mode 100644 index 0000000..a1f139e --- /dev/null +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/WidgetTheme.kt @@ -0,0 +1,54 @@ +package rocks.poopjournal.fucksgiven.presentation.widget + +import android.R +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import androidx.glance.GlanceTheme +import androidx.glance.LocalContext +import androidx.glance.material3.ColorProviders +import rocks.poopjournal.fucksgiven.presentation.ui.theme.DarkColorScheme +import rocks.poopjournal.fucksgiven.presentation.ui.theme.LightColorScheme + +@Composable +fun WidgetTheme( + content: @Composable () -> Unit, + + ) { + val resources = LocalContext.current.resources + val theme = LocalContext.current.theme + + val lightBackgroundColor = Color(0xfffffbfe) + val darkBackgroundColor = Color(0xff1c1b1f) + val lightTextColor = Color(0xFF29A331) + val darkTextColor = Color(0xFF29A331) + val whiteColor = Color(0xFFFFFFFF) + val rowBackground = Color(0xFFEEF8EF) + + GlanceTheme( + colors = + ColorProviders( + light = + lightColorScheme( + background = lightBackgroundColor, + onBackground = lightTextColor, + tertiary = whiteColor, + secondary = rowBackground + + ), + dark = + darkColorScheme( + background = darkBackgroundColor, + onBackground = darkTextColor, + tertiary = whiteColor, + secondary = rowBackground + ), + ), + content = content, + ) +} \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/WidgetViewModel.kt b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/WidgetViewModel.kt new file mode 100644 index 0000000..40fef1a --- /dev/null +++ b/android/FucksGiven/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/widget/WidgetViewModel.kt @@ -0,0 +1,33 @@ +package rocks.poopjournal.fucksgiven.presentation.widget + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch +import rocks.poopjournal.fucksgiven.data.FuckRepository +import rocks.poopjournal.fucksgiven.presentation.viewmodel.UiState +import javax.inject.Inject + +class AppWidgetViewModel @Inject constructor( + private val fuckRepository: FuckRepository, +) : ViewModel() { + private val _uiState = MutableStateFlow(UiState()) + val uiState = _uiState.asStateFlow() + + + init { + viewModelScope.launch(Dispatchers.IO) { + fuckRepository.getAllFucks().distinctUntilChanged().collect { list -> + _uiState.update { + it.copy( + fuckList = list + ) + } + } + } + } +} \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/drawable-nodpi/example_appwidget_preview.png b/android/FucksGiven/app/src/main/res/drawable-nodpi/example_appwidget_preview.png new file mode 100644 index 0000000..894b069 Binary files /dev/null and b/android/FucksGiven/app/src/main/res/drawable-nodpi/example_appwidget_preview.png differ diff --git a/android/FucksGiven/app/src/main/res/drawable-v21/app_widget_background.xml b/android/FucksGiven/app/src/main/res/drawable-v21/app_widget_background.xml new file mode 100644 index 0000000..567b256 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable-v21/app_widget_background.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/drawable-v21/app_widget_inner_view_background.xml b/android/FucksGiven/app/src/main/res/drawable-v21/app_widget_inner_view_background.xml new file mode 100644 index 0000000..007e287 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable-v21/app_widget_inner_view_background.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/about.xml b/android/FucksGiven/app/src/main/res/drawable/about.xml similarity index 100% rename from android/app/src/main/res/drawable/about.xml rename to android/FucksGiven/app/src/main/res/drawable/about.xml diff --git a/android/app/src/main/res/drawable/backup.xml b/android/FucksGiven/app/src/main/res/drawable/backup.xml similarity index 100% rename from android/app/src/main/res/drawable/backup.xml rename to android/FucksGiven/app/src/main/res/drawable/backup.xml diff --git a/android/FucksGiven/app/src/main/res/drawable/baseline_add_24.xml b/android/FucksGiven/app/src/main/res/drawable/baseline_add_24.xml new file mode 100644 index 0000000..2ae27b8 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/baseline_add_24.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/bg_widget.xml b/android/FucksGiven/app/src/main/res/drawable/bg_widget.xml new file mode 100644 index 0000000..b01c011 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/bg_widget.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/drawable/btn_background.xml b/android/FucksGiven/app/src/main/res/drawable/btn_background.xml new file mode 100644 index 0000000..258ffa8 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/btn_background.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/drawable/fucks.xml b/android/FucksGiven/app/src/main/res/drawable/fucks.xml new file mode 100644 index 0000000..99f5576 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/fucks.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/github.xml b/android/FucksGiven/app/src/main/res/drawable/github.xml new file mode 100644 index 0000000..b8cb70b --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/github.xml @@ -0,0 +1,13 @@ + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/gmail.xml b/android/FucksGiven/app/src/main/res/drawable/gmail.xml new file mode 100644 index 0000000..162414b --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/gmail.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/android/app/src/main/res/drawable/graph.xml b/android/FucksGiven/app/src/main/res/drawable/graph.xml similarity index 100% rename from android/app/src/main/res/drawable/graph.xml rename to android/FucksGiven/app/src/main/res/drawable/graph.xml diff --git a/android/app/src/main/res/drawable/home.xml b/android/FucksGiven/app/src/main/res/drawable/home.xml similarity index 100% rename from android/app/src/main/res/drawable/home.xml rename to android/FucksGiven/app/src/main/res/drawable/home.xml diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/FucksGiven/app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from android/app/src/main/res/drawable/ic_launcher_background.xml rename to android/FucksGiven/app/src/main/res/drawable/ic_launcher_background.xml diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/android/FucksGiven/app/src/main/res/drawable/ic_launcher_foreground.xml similarity index 100% rename from android/app/src/main/res/drawable/ic_launcher_foreground.xml rename to android/FucksGiven/app/src/main/res/drawable/ic_launcher_foreground.xml diff --git a/android/FucksGiven/app/src/main/res/drawable/ic_launcher_monochrome.xml b/android/FucksGiven/app/src/main/res/drawable/ic_launcher_monochrome.xml new file mode 100644 index 0000000..87c01c6 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -0,0 +1,9 @@ + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/marvin.png b/android/FucksGiven/app/src/main/res/drawable/marvin.png new file mode 100644 index 0000000..be84e1c Binary files /dev/null and b/android/FucksGiven/app/src/main/res/drawable/marvin.png differ diff --git a/android/FucksGiven/app/src/main/res/drawable/message.xml b/android/FucksGiven/app/src/main/res/drawable/message.xml new file mode 100644 index 0000000..6c79f6f --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/message.xml @@ -0,0 +1,20 @@ + + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/mubeen.jpg b/android/FucksGiven/app/src/main/res/drawable/mubeen.jpg new file mode 100755 index 0000000..34b04ca Binary files /dev/null and b/android/FucksGiven/app/src/main/res/drawable/mubeen.jpg differ diff --git a/android/FucksGiven/app/src/main/res/drawable/report.xml b/android/FucksGiven/app/src/main/res/drawable/report.xml new file mode 100644 index 0000000..0986191 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/report.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/android/app/src/main/res/drawable/restore.xml b/android/FucksGiven/app/src/main/res/drawable/restore.xml similarity index 100% rename from android/app/src/main/res/drawable/restore.xml rename to android/FucksGiven/app/src/main/res/drawable/restore.xml diff --git a/android/app/src/main/res/drawable/selected_graph.xml b/android/FucksGiven/app/src/main/res/drawable/selected_graph.xml similarity index 100% rename from android/app/src/main/res/drawable/selected_graph.xml rename to android/FucksGiven/app/src/main/res/drawable/selected_graph.xml diff --git a/android/app/src/main/res/drawable/selected_home.xml b/android/FucksGiven/app/src/main/res/drawable/selected_home.xml similarity index 100% rename from android/app/src/main/res/drawable/selected_home.xml rename to android/FucksGiven/app/src/main/res/drawable/selected_home.xml diff --git a/android/app/src/main/res/drawable/settings.xml b/android/FucksGiven/app/src/main/res/drawable/settings.xml similarity index 100% rename from android/app/src/main/res/drawable/settings.xml rename to android/FucksGiven/app/src/main/res/drawable/settings.xml diff --git a/android/FucksGiven/app/src/main/res/drawable/source.xml b/android/FucksGiven/app/src/main/res/drawable/source.xml new file mode 100644 index 0000000..8242b4e --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/source.xml @@ -0,0 +1,20 @@ + + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/splash_icon.xml b/android/FucksGiven/app/src/main/res/drawable/splash_icon.xml new file mode 100644 index 0000000..7874e83 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/splash_icon.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/translate.xml b/android/FucksGiven/app/src/main/res/drawable/translate.xml new file mode 100644 index 0000000..4bd5194 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/translate.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/android/FucksGiven/app/src/main/res/drawable/x.xml b/android/FucksGiven/app/src/main/res/drawable/x.xml new file mode 100644 index 0000000..9394008 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/drawable/x.xml @@ -0,0 +1,17 @@ + + + + diff --git a/android/app/src/main/res/font/opensans_regular.ttf b/android/FucksGiven/app/src/main/res/font/opensans_regular.ttf similarity index 100% rename from android/app/src/main/res/font/opensans_regular.ttf rename to android/FucksGiven/app/src/main/res/font/opensans_regular.ttf diff --git a/android/app/src/main/res/font/ubuntu_bold.ttf b/android/FucksGiven/app/src/main/res/font/ubuntu_bold.ttf similarity index 100% rename from android/app/src/main/res/font/ubuntu_bold.ttf rename to android/FucksGiven/app/src/main/res/font/ubuntu_bold.ttf diff --git a/android/app/src/main/res/font/ubuntu_italic.ttf b/android/FucksGiven/app/src/main/res/font/ubuntu_italic.ttf similarity index 100% rename from android/app/src/main/res/font/ubuntu_italic.ttf rename to android/FucksGiven/app/src/main/res/font/ubuntu_italic.ttf diff --git a/android/app/src/main/res/font/ubuntu_light.ttf b/android/FucksGiven/app/src/main/res/font/ubuntu_light.ttf similarity index 100% rename from android/app/src/main/res/font/ubuntu_light.ttf rename to android/FucksGiven/app/src/main/res/font/ubuntu_light.ttf diff --git a/android/app/src/main/res/font/ubuntu_medium.ttf b/android/FucksGiven/app/src/main/res/font/ubuntu_medium.ttf similarity index 100% rename from android/app/src/main/res/font/ubuntu_medium.ttf rename to android/FucksGiven/app/src/main/res/font/ubuntu_medium.ttf diff --git a/android/app/src/main/res/font/ubuntu_regular.ttf b/android/FucksGiven/app/src/main/res/font/ubuntu_regular.ttf similarity index 100% rename from android/app/src/main/res/font/ubuntu_regular.ttf rename to android/FucksGiven/app/src/main/res/font/ubuntu_regular.ttf diff --git a/android/FucksGiven/app/src/main/res/layout/widget_initial_layout.xml b/android/FucksGiven/app/src/main/res/layout/widget_initial_layout.xml new file mode 100644 index 0000000..607e0b6 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/layout/widget_initial_layout.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/FucksGiven/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 78% rename from android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to android/FucksGiven/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 4ae7d12..32d3639 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/android/FucksGiven/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/FucksGiven/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to android/FucksGiven/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.webp rename to android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.webp b/android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher_background.webp similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher_background.webp rename to android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher_background.webp diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp rename to android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to android/FucksGiven/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.webp rename to android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.webp b/android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher_background.webp similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher_background.webp rename to android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher_background.webp diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp rename to android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to android/FucksGiven/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.webp b/android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher_background.webp similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.webp rename to android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher_background.webp diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp rename to android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to android/FucksGiven/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp b/android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp b/android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to android/FucksGiven/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/android/FucksGiven/app/src/main/res/values-de/strings.xml b/android/FucksGiven/app/src/main/res/values-de/strings.xml new file mode 100644 index 0000000..84a3dd5 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-de/strings.xml @@ -0,0 +1,93 @@ + + Fucks Given + Um + Apache-Lizenz 2.0 + Keine Scheiße gegeben + Hinzufügen + Stornieren + Beschreibung + Datum auswählen + OK + Einstellungen + Allgemein + Aussehen + Daten + Sicherung + Wiederherstellen + Thema wählen + Statistiken + Wöchentlich + Monatlich + Jährlich + Scheiße im Durchschnitt gegeben + Januar-Dezember + M + T + W + TH + F + S + Sie sind + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + J + F + M + A + M + J + J + A + S + Ö + N + D + Lichtthema + Dunkles Thema + Folgen Sie dem System + BEISPIEL + Widget hinzufügen + Dies ist eine Beschreibung des App-Widgets + WearActivity + Crazy Marvin + Entwickler + Mubeen Ali + Beitragen + Translate + Ein Problem melden + Quelltext anzeigen + Open-source Licenses + Feather Icons + MIT License + Android Jetpack + Apache License 2.0 + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-eo/strings.xml b/android/FucksGiven/app/src/main/res/values-eo/strings.xml new file mode 100644 index 0000000..372f18e --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-eo/strings.xml @@ -0,0 +1,93 @@ + + Fikas Donita + Pri + Apache-Licenco 2.0 + Neniu Fiko Donita + Aldoni + Nuligi + Priskribo + Elektu Daton + Bone + Agordoj + Generalo + Aspekto + Datumoj + Rezervo + Restaŭri + Elektu Temon + Statoj + Ĉiusemajne + Monata + Ĉiujare + fikoj donitaj averaĝe + januaro-decembro + M + T + W + TH + F + S + Ili estas + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + J + F + M + A + M + J + J + A + S + O + N + D + Luma Temo + Malhela Temo + Sekvu Sistemon + EKZEMPLO + Aldonu fenestraĵon + Ĉi tio estas priskribo de aplikaĵo + WearActivity + Crazy Marvin + Ellaboranto + Mubeen Ali + Kontribuu + Translate + Raportu problemon + Vidi Fonton + Open-source Licenses + Feather Icons + MIT License + Android Jetpack + Apache License 2.0 + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-fr/strings.xml b/android/FucksGiven/app/src/main/res/values-fr/strings.xml new file mode 100644 index 0000000..4ba6f1d --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-fr/strings.xml @@ -0,0 +1,93 @@ + + Baise donnée + À propos + Licence Apache 2.0 + Pas de baise donnée + Ajouter + Annuler + Description + Sélectionner une date + D\'accord + Paramètres + Général + Apparence + Données + Sauvegarde + Restaurer + Sélectionne un thème + Statistiques + Hebdomadaire + Mensuel + Annuel + baise donnée en moyenne + janvier-décembre + M + T + W + ÈME + F + S + Ils sont + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + J. + F + M + UN + M + J. + J. + UN + S + Ô + N + D + Thème Lumière + Thème sombre + Suivre le système + EXEMPLE + Ajouter un widget + Ceci est une description du widget d\'application + PorterActivité + Crazy Marvin + Développeur + Mubeen Ali + Contribuer + Translate + Signaler un problème + Voir la source + Open-source Licenses + Feather Icons + MIT License + Android Jetpack + Apache License 2.0 + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-night-v31/themes.xml b/android/FucksGiven/app/src/main/res/values-night-v31/themes.xml new file mode 100644 index 0000000..2684851 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-night-v31/themes.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-pt/strings.xml b/android/FucksGiven/app/src/main/res/values-pt/strings.xml new file mode 100644 index 0000000..a6b3dae --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-pt/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-ur/strings.xml b/android/FucksGiven/app/src/main/res/values-ur/strings.xml new file mode 100644 index 0000000..54ec4c5 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-ur/strings.xml @@ -0,0 +1,93 @@ + + Fucks دیا + کے بارے میں + اپاچی لائسنس 2.0 + کوئی fucks دیا + شامل کریں۔ + منسوخ کریں۔ + تفصیل + تاریخ منتخب کریں۔ + ٹھیک ہے + ترتیبات + جنرل + ظہور + ڈیٹا + بیک اپ + بحال کریں۔ + تھیم منتخب کریں۔ + اعدادوشمار + ہفتہ وار + ماہانہ + سالانہ + fucks اوسط پر دیا + جنوری دسمبر + M + T + W + TH + F + S + SU + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + J + F + M + A + M + J + J + A + S + O + N + D + ہلکی تھیم + ڈارک تھیم + سسٹم کو فالو کریں۔ + مثال + ویجیٹ شامل کریں۔ + یہ ایک ایپ ویجیٹ کی تفصیل ہے۔ + WearActivity + Crazy Marvin + ڈویلپر + Mubeen Ali + تعاون کریں۔ + Translate + مسئلے کے بارے میں بتائیے + ماخذ دیکھیں + Open-source Licenses + Feather Icons + MIT License + Android Jetpack + Apache License 2.0 + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-v21/styles.xml b/android/FucksGiven/app/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..c8a22f3 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-v21/styles.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-v31/styles.xml b/android/FucksGiven/app/src/main/res/values-v31/styles.xml new file mode 100644 index 0000000..a03eb72 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-v31/styles.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values-v31/themes.xml b/android/FucksGiven/app/src/main/res/values-v31/themes.xml new file mode 100644 index 0000000..db1ee6b --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values-v31/themes.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values/attrs.xml b/android/FucksGiven/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..7781ac8 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values/attrs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/values/colors.xml b/android/FucksGiven/app/src/main/res/values/colors.xml similarity index 57% rename from android/app/src/main/res/values/colors.xml rename to android/FucksGiven/app/src/main/res/values/colors.xml index f8c6127..61297e3 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/FucksGiven/app/src/main/res/values/colors.xml @@ -7,4 +7,10 @@ #FF018786 #FF000000 #FFFFFFFF + #FF29A331 + #A9AAA9 + #FFE1F5FE + #FF81D4FA + #FF039BE5 + #FF01579B \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values/dimens.xml b/android/FucksGiven/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..4db8c59 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values/dimens.xml @@ -0,0 +1,10 @@ + + + + + 0dp + + \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/FucksGiven/app/src/main/res/values/strings.xml similarity index 74% rename from android/app/src/main/res/values/strings.xml rename to android/FucksGiven/app/src/main/res/values/strings.xml index ccd1356..1607e61 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/FucksGiven/app/src/main/res/values/strings.xml @@ -74,4 +74,20 @@ Light Theme Dark Theme Follow System + EXAMPLE + Add widget + This is an app widget description + WearActivity + Crazy Marvin + Developer + Mubeen Ali + Contribute + Translate + Report a problem + View Source + Open-source Licenses + Feather Icons + MIT License + Android Jetpack + Apache License 2.0 \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values/styles.xml b/android/FucksGiven/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..97ab6f6 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/values/themes.xml b/android/FucksGiven/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..2201671 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/values/themes.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/xml-v31/my_app_widget_info.xml b/android/FucksGiven/app/src/main/res/xml-v31/my_app_widget_info.xml new file mode 100644 index 0000000..7223b4b --- /dev/null +++ b/android/FucksGiven/app/src/main/res/xml-v31/my_app_widget_info.xml @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/android/app/src/main/res/xml/backup_rules.xml b/android/FucksGiven/app/src/main/res/xml/backup_rules.xml similarity index 100% rename from android/app/src/main/res/xml/backup_rules.xml rename to android/FucksGiven/app/src/main/res/xml/backup_rules.xml diff --git a/android/app/src/main/res/xml/data_extraction_rules.xml b/android/FucksGiven/app/src/main/res/xml/data_extraction_rules.xml similarity index 100% rename from android/app/src/main/res/xml/data_extraction_rules.xml rename to android/FucksGiven/app/src/main/res/xml/data_extraction_rules.xml diff --git a/android/FucksGiven/app/src/main/res/xml/local_config.xml b/android/FucksGiven/app/src/main/res/xml/local_config.xml new file mode 100644 index 0000000..5472c2b --- /dev/null +++ b/android/FucksGiven/app/src/main/res/xml/local_config.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/android/FucksGiven/app/src/main/res/xml/my_app_widget_info.xml b/android/FucksGiven/app/src/main/res/xml/my_app_widget_info.xml new file mode 100644 index 0000000..4e816d3 --- /dev/null +++ b/android/FucksGiven/app/src/main/res/xml/my_app_widget_info.xml @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/android/app/src/test/java/rocks/poopjournal/fucksgiven/ExampleUnitTest.kt b/android/FucksGiven/app/src/test/java/rocks/poopjournal/fucksgiven/ExampleUnitTest.kt similarity index 100% rename from android/app/src/test/java/rocks/poopjournal/fucksgiven/ExampleUnitTest.kt rename to android/FucksGiven/app/src/test/java/rocks/poopjournal/fucksgiven/ExampleUnitTest.kt diff --git a/android/build.gradle.kts b/android/FucksGiven/build.gradle.kts similarity index 100% rename from android/build.gradle.kts rename to android/FucksGiven/build.gradle.kts diff --git a/android/gradle.properties b/android/FucksGiven/gradle.properties similarity index 100% rename from android/gradle.properties rename to android/FucksGiven/gradle.properties diff --git a/android/gradle/libs.versions.toml b/android/FucksGiven/gradle/libs.versions.toml similarity index 71% rename from android/gradle/libs.versions.toml rename to android/FucksGiven/gradle/libs.versions.toml index 6a5af0f..ddc6dd8 100644 --- a/android/gradle/libs.versions.toml +++ b/android/FucksGiven/gradle/libs.versions.toml @@ -9,6 +9,11 @@ lifecycleRuntimeKtx = "2.7.0" activityCompose = "1.9.0" composeBom = "2023.08.00" runtimeLivedata = "1.6.7" +glanceAppwidget = "1.1.0" +composeMaterial = "1.2.1" +composeFoundation = "1.2.1" +coreSplashscreen = "1.0.1" +appcompat = "1.7.0" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -26,6 +31,11 @@ androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-man androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } androidx-material3 = { group = "androidx.compose.material3", name = "material3" } androidx-runtime-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata", version.ref = "runtimeLivedata" } +androidx-glance-appwidget = { group = "androidx.glance", name = "glance-appwidget", version.ref = "glanceAppwidget" } +androidx-compose-material = { group = "androidx.wear.compose", name = "compose-material", version.ref = "composeMaterial" } +androidx-compose-foundation = { group = "androidx.wear.compose", name = "compose-foundation", version.ref = "composeFoundation" } +androidx-core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "coreSplashscreen" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/FucksGiven/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.properties rename to android/FucksGiven/gradle/wrapper/gradle-wrapper.properties diff --git a/android/FucksGiven/gradlew b/android/FucksGiven/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/android/FucksGiven/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/android/FucksGiven/gradlew.bat b/android/FucksGiven/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/android/FucksGiven/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/settings.gradle.kts b/android/FucksGiven/settings.gradle.kts similarity index 100% rename from android/settings.gradle.kts rename to android/FucksGiven/settings.gradle.kts diff --git a/android/app-release.aab b/android/app-release.aab new file mode 100644 index 0000000..57d310e Binary files /dev/null and b/android/app-release.aab differ diff --git a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/AboutScreen.kt b/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/AboutScreen.kt deleted file mode 100644 index 3791d59..0000000 --- a/android/app/src/main/java/rocks/poopjournal/fucksgiven/presentation/screens/AboutScreen.kt +++ /dev/null @@ -1,101 +0,0 @@ -package rocks.poopjournal.fucksgiven.presentation.screens - -import android.content.pm.PackageManager -import android.graphics.fonts.FontStyle -import android.os.Build -import androidx.annotation.RequiresApi -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.text.ClickableText -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack -import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.AnnotatedString -import androidx.compose.ui.text.SpanStyle -import androidx.compose.ui.text.buildAnnotatedString -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextDecoration -import androidx.compose.ui.text.withStyle -import androidx.compose.ui.unit.sp -import androidx.navigation.NavHostController -import rocks.poopjournal.fucksgiven.R - -@RequiresApi(Build.VERSION_CODES.P) -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun AboutScreen(navController: NavHostController) { - val context = LocalContext.current - val packageManager = context.packageManager - val packageName = context.packageName - val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - packageManager.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0)) - } else { - packageManager.getPackageInfo(packageName, 0) - } - Scaffold( - topBar = { - TopAppBar( - title = { Text(text = stringResource(id = R.string.about), style = MaterialTheme.typography.titleLarge) }, - navigationIcon = { - IconButton(onClick = { navController.popBackStack() }) { - Icon( - imageVector = Icons.Default.ArrowBack, - contentDescription = null, - tint = MaterialTheme.colorScheme.primary - ) - } - } - ) - } - ) { - Column( - modifier = Modifier - .fillMaxSize() - .padding(it) - ) { - Column(modifier = Modifier.fillMaxWidth(), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally) { - Image( - painter = painterResource(id = R.mipmap.ic_launcher_round), - contentDescription = "rounded icon" - ) - Text( - text = stringResource(id = R.string.app_name), - style = MaterialTheme.typography.bodyLarge, - ) - val stylizedPoetry = buildAnnotatedString { - withStyle(style = SpanStyle(fontSize = 14.sp, fontWeight = FontWeight.W400)) { - append("v${packageInfo.longVersionCode}") - append("-----") - withStyle(style = SpanStyle( color = MaterialTheme.colorScheme.primary)) { - append("Apache License 2.0") - addStringAnnotation( - tag = "URL", - annotation = "https://www.apache.org/licenses/LICENSE-2.0", - start = length - "Apache License 2.0".length, - end = length - ) - } - } - } - ClickableText(text = stylizedPoetry, onClick = {}) - } - } - } -} \ No newline at end of file diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml deleted file mode 100644 index 49bbd74..0000000 --- a/android/app/src/main/res/values/themes.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - + \ No newline at end of file diff --git a/wear/build.gradle.kts b/wear/build.gradle.kts new file mode 100644 index 0000000..01c689a --- /dev/null +++ b/wear/build.gradle.kts @@ -0,0 +1,7 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.jetbrains.kotlin.android) apply false + id("com.google.dagger.hilt.android") version "2.48" apply false + +} \ No newline at end of file diff --git a/wear/gradle.properties b/wear/gradle.properties new file mode 100644 index 0000000..20e2a01 --- /dev/null +++ b/wear/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/wear/gradle/libs.versions.toml b/wear/gradle/libs.versions.toml new file mode 100644 index 0000000..2fafc51 --- /dev/null +++ b/wear/gradle/libs.versions.toml @@ -0,0 +1,33 @@ +[versions] +agp = "8.5.0" +kotlin = "1.9.0" +playServicesWearable = "18.0.0" +composeBom = "2024.04.01" +composeMaterial = "1.2.1" +composeFoundation = "1.2.1" +activityCompose = "1.7.2" +coreSplashscreen = "1.0.1" +material3Android = "1.2.1" +composeUiTooling = "1.3.1" +wearToolingPreview = "1.0.0" + +[libraries] +play-services-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version.ref = "playServicesWearable" } +compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } +ui = { group = "androidx.compose.ui", name = "ui" } +ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } +ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } +ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } +ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } +compose-material = { group = "androidx.wear.compose", name = "compose-material", version.ref = "composeMaterial" } +compose-foundation = { group = "androidx.wear.compose", name = "compose-foundation", version.ref = "composeFoundation" } +activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } +core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "coreSplashscreen" } +material3-android = { group = "androidx.compose.material3", name = "material3-android", version.ref = "material3Android" } +compose-ui-tooling = { group = "androidx.wear.compose", name = "compose-ui-tooling", version.ref = "composeUiTooling" } +wear-tooling-preview = { group = "androidx.wear", name = "wear-tooling-preview", version.ref = "wearToolingPreview" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } + diff --git a/wear/gradle/wrapper/gradle-wrapper.jar b/wear/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/wear/gradle/wrapper/gradle-wrapper.jar differ diff --git a/wear/gradle/wrapper/gradle-wrapper.properties b/wear/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..bf76be2 --- /dev/null +++ b/wear/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat Jul 06 15:00:55 PKT 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/wear/gradlew b/wear/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/wear/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/wear/gradlew.bat b/wear/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/wear/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/wear/settings.gradle.kts b/wear/settings.gradle.kts new file mode 100644 index 0000000..26d85a2 --- /dev/null +++ b/wear/settings.gradle.kts @@ -0,0 +1,24 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "FucksGivenWatch" +include(":app") + \ No newline at end of file