Skip to content

Commit

Permalink
Merge pull request #81 from mubeen1519/development
Browse files Browse the repository at this point in the history
Wear OS support and about section
  • Loading branch information
CrazyMarvin authored Jul 17, 2024
2 parents 8c51aa7 + 827e003 commit ed3e032
Show file tree
Hide file tree
Showing 190 changed files with 3,270 additions and 155 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -40,6 +42,7 @@ android {
}
buildFeatures {
compose = true
viewBinding = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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{
Expand Down
8 changes: 8 additions & 0 deletions android/FucksGiven/app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Ignore the IconLocation for the Tile preview images -->
<issue id="IconLocation">
<ignore path="res/drawable/tile_preview.png" />
<ignore path="res/drawable-round/tile_preview.png" />
</issue>
</lint>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.WAKE_LOCK" />


<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:name=".FucksGivenApplication"
Expand All @@ -17,7 +21,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.FucksGiven"
tools:targetApi="31">
tools:targetApi="tiramisu"
android:localeConfig="@xml/local_config">


<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -29,6 +36,27 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver
android:name=".presentation.widget.MyAppWidgetReceiver"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/my_app_widget_info" />
</receiver>
<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"
android:exported="false">
<meta-data
android:name="autoStoreLocales"
android:value="true" />
</service>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
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
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()
Expand All @@ -27,11 +31,12 @@ fun NavGraph(navController: NavHostController){
}

composable(route = ABOUT_SCREEN){

AboutScreen(navController = navController)
}

composable(route = SETTINGS_SCREEN){
SettingScreen(navController = navController, viewModel = settingsViewModel)
}

}
}
Loading

0 comments on commit ed3e032

Please sign in to comment.