Skip to content

Commit

Permalink
Merge pull request #176 from michaelbel/develop
Browse files Browse the repository at this point in the history
1.5.1
  • Loading branch information
michaelbel authored Nov 5, 2023
2 parents abe7235 + 5c99adc commit 786b865
Show file tree
Hide file tree
Showing 253 changed files with 4,988 additions and 1,160 deletions.
Binary file added .idea/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.firebase.appdistribution)
alias(libs.plugins.firebase.crashlytics)
alias(libs.plugins.palantir.git)
alias(libs.plugins.detekt)
id("movies-android-hilt")
}

Expand Down Expand Up @@ -129,8 +130,10 @@ android {
compose = true
}

dynamicFeatures += setOf(":instant")

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

compileOptions {
Expand Down Expand Up @@ -159,10 +162,9 @@ dependencies {
implementation(project(":feature:account"))
implementation(project(":feature:details"))
implementation(project(":feature:feed"))
implementation(project(":feature:gallery"))
implementation(project(":feature:settings"))

implementation(libs.androidx.profile.installer)

testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext.junit.ktx)
androidTestImplementation(libs.androidx.espresso.core)
Expand Down
24 changes: 17 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<dist:module dist:instant="true" />

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<queries>
<package android:name="org.michaelbel.movies" />
Expand All @@ -25,8 +28,7 @@
android:localeConfig="@xml/locale_config"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/Theme.Movies.Starting"
tools:ignore="UnusedAttribute">
android:theme="@style/Theme.Movies.Starting">

<profileable
android:shell="true"
Expand All @@ -42,19 +44,26 @@
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>

<intent-filter>
<intent-filter
android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="www.themoviedb.org"
android:path="/movie"
android:scheme="http" />

<data
android:host="www.themoviedb.org"
android:path="/movie"
android:scheme="https" />

</intent-filter>

<intent-filter>
<intent-filter
android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
Expand All @@ -65,7 +74,8 @@

</intent-filter>

<intent-filter>
<intent-filter
android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import org.michaelbel.movies.details.detailsGraph
import org.michaelbel.movies.details.navigateToDetails
import org.michaelbel.movies.feed.FeedDestination
import org.michaelbel.movies.feed.feedGraph
import org.michaelbel.movies.gallery.galleryGraph
import org.michaelbel.movies.gallery.navigateToGallery
import org.michaelbel.movies.settings.navigateToSettings
import org.michaelbel.movies.settings.settingsGraph

Expand Down Expand Up @@ -39,6 +41,10 @@ internal fun MainActivityContent(
onStartUpdateFlow = onStartUpdateFlow
)
detailsGraph(
navigateBack = navHostController::popBackStack,
navigateToGallery = navHostController::navigateToGallery
)
galleryGraph(
navigateBack = navHostController::popBackStack
)
settingsGraph(
Expand Down
16 changes: 7 additions & 9 deletions app/src/main/kotlin/org/michaelbel/movies/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import org.michaelbel.moviemade.BuildConfig
import org.michaelbel.movies.analytics.MoviesAnalytics
import org.michaelbel.movies.common.inappupdate.di.InAppUpdate
import org.michaelbel.movies.common.ktx.printlnDebug
import org.michaelbel.movies.common.theme.AppTheme
import org.michaelbel.movies.common.viewmodel.BaseViewModel
import org.michaelbel.movies.domain.interactor.settings.SettingsInteractor
import org.michaelbel.movies.domain.workers.AccountUpdateWorker
import org.michaelbel.movies.domain.workers.MoviesDatabaseWorker
import org.michaelbel.movies.interactor.Interactor
import javax.inject.Inject

@HiltViewModel
internal class MainViewModel @Inject constructor(
private val settingsInteractor: SettingsInteractor,
private val interactor: Interactor,
private val inAppUpdate: InAppUpdate,
private val workManager: WorkManager,
private val analytics: MoviesAnalytics,
private val firebaseMessaging: FirebaseMessaging
): BaseViewModel() {

val currentTheme: StateFlow<AppTheme> = settingsInteractor.currentTheme
val currentTheme: StateFlow<AppTheme> = interactor.currentTheme
.stateIn(
scope = this,
started = SharingStarted.Lazily,
initialValue = AppTheme.FollowSystem
)

val dynamicColors: StateFlow<Boolean> = settingsInteractor.dynamicColors
val dynamicColors: StateFlow<Boolean> = interactor.dynamicColors
.stateIn(
scope = this,
started = SharingStarted.Lazily,
Expand All @@ -61,15 +61,13 @@ internal class MainViewModel @Inject constructor(
}

private fun fetchRemoteConfig() = launch {
settingsInteractor.fetchRemoteConfig()
interactor.fetchRemoteConfig()
}

private fun fetchFirebaseMessagingToken() {
firebaseMessaging.token.addOnCompleteListener { task ->
val token: String = task.result
if (BuildConfig.DEBUG) {
println("firebase messaging token: $token")
}
printlnDebug("firebase messaging token: $token")
}
}

Expand Down
3 changes: 2 additions & 1 deletion benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("com.android.test")
id("org.jetbrains.kotlin.android")
id("kotlin-android")
alias(libs.plugins.detekt)
}

android {
Expand All @@ -15,7 +16,7 @@ android {
}

defaultConfig {
minSdk = 23
minSdk = libs.versions.benchmark.min.sdk.get().toInt()
targetSdk = libs.versions.target.sdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package org.michaelbel.movies.benchmark

import androidx.benchmark.macro.junit4.BaselineProfileRule
import org.junit.Rule
import org.junit.Test

/**
* ./gradlew :benchmark:connectedCheck
*/
internal class BaselineProfileGenerator {
/*internal class BaselineProfileGenerator {
@get:Rule
val baselineProfileRule = BaselineProfileRule()
Expand All @@ -21,4 +17,4 @@ internal class BaselineProfileGenerator {
startActivityAndWait()
device.waitForIdle()
}
}
}*/
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.application) apply false
alias(libs.plugins.library) apply false
alias(libs.plugins.dynamic.feature) apply false
alias(libs.plugins.test) apply false
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.kotlin.ksp) apply false
Expand All @@ -13,4 +14,8 @@ plugins {
alias(libs.plugins.spotless)
alias(libs.plugins.detekt)
alias(libs.plugins.palantir.git)
}

detekt {
config.setFrom("$projectDir/config/detekt/detekt.yml")
}
7 changes: 7 additions & 0 deletions code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Code of Conduct

Diversity and inclusion make our community strong. We encourage participation from the most varied and diverse backgrounds possible and want to be very clear about where we stand.

Our goal is to maintain a safe, helpful and friendly community for everyone, regardless of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other defining characteristic.

This code and related procedures also apply to unacceptable behavior occurring outside the scope of community activities, in all community venues (online and in-person) as well as in all one-on-one communications, and anywhere such behavior has the potential to adversely affect the safety and well-being of community members.
Loading

0 comments on commit 786b865

Please sign in to comment.