Skip to content

Commit

Permalink
Merge pull request #109 from michaelbel/develop
Browse files Browse the repository at this point in the history
1.4.4
  • Loading branch information
michaelbel authored Mar 3, 2023
2 parents 62db492 + 127ab6e commit 47ee06a
Show file tree
Hide file tree
Showing 134 changed files with 1,591 additions and 732 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -707,3 +707,4 @@
/buildSrc/.gradle/7.6/dependencies-accessors/eaf6e422b407037b3630f94e47d7baced32e5a49/sources/org/gradle/accessors/dm/RootProjectAccessor.java
/.gradle/7.6/checksums/sha1-checksums.bin
/buildSrc/.gradle/7.6/checksums/sha1-checksums.bin
/config/movies.jks
5 changes: 2 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import java.io.FileInputStream
import org.apache.commons.io.output.ByteArrayOutputStream
import org.jetbrains.kotlin.konan.properties.Properties
import java.io.FileInputStream

plugins {
id("movies-android-application")
Expand Down Expand Up @@ -143,7 +142,7 @@ android {
}

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

lint {
Expand Down
17 changes: 16 additions & 1 deletion app/src/main/kotlin/org/michaelbel/movies/App.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
package org.michaelbel.movies

import android.app.Application
import android.util.Log
import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
import dagger.hilt.android.HiltAndroidApp
import javax.inject.Inject
import org.michaelbel.moviemade.BuildConfig

@HiltAndroidApp
internal class App: Application()
internal class App: Application(), Configuration.Provider {

@Inject lateinit var workerFactory: HiltWorkerFactory

override fun getWorkManagerConfiguration(): Configuration {
return Configuration.Builder()
.setWorkerFactory(workerFactory)
.setMinimumLoggingLevel(if (BuildConfig.DEBUG) Log.DEBUG else Log.ERROR)
.build()
}
}
17 changes: 17 additions & 0 deletions app/src/main/kotlin/org/michaelbel/movies/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ import androidx.core.view.WindowCompat
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.workDataOf
import dagger.hilt.android.AndroidEntryPoint
import org.michaelbel.movies.common.shortcuts.installShortcuts
import org.michaelbel.movies.domain.workers.MoviesDatabaseWorker
import org.michaelbel.movies.ui.theme.MoviesTheme
import org.michaelbel.movies.ui.theme.model.AppTheme

Expand Down Expand Up @@ -56,5 +60,18 @@ internal class MainActivity: AppCompatActivity() {
}
}
}

prepopulateDatabase()
}

private fun prepopulateDatabase() {
val request = OneTimeWorkRequestBuilder<MoviesDatabaseWorker>()
.setInputData(workDataOf(MoviesDatabaseWorker.KEY_FILENAME to MOVIES_DATA_FILENAME))
.build()
WorkManager.getInstance(this).enqueue(request)
}

private companion object {
private const val MOVIES_DATA_FILENAME = "movies.json"
}
}
2 changes: 1 addition & 1 deletion app/src/main/kotlin/org/michaelbel/movies/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import org.michaelbel.movies.analytics.MoviesAnalytics
import org.michaelbel.movies.domain.interactor.SettingsInteractor
import org.michaelbel.movies.domain.interactor.settings.SettingsInteractor
import org.michaelbel.movies.ui.theme.model.AppTheme

@HiltViewModel
Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.library) apply false
alias(libs.plugins.test) apply false
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.firebase.appdistribution) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.google.services) apply false
Expand All @@ -12,9 +13,9 @@ plugins {
alias(libs.plugins.spotless)
alias(libs.plugins.detekt)

id("com.github.ben-manes.versions") version "0.45.0"
id("com.github.ben-manes.versions") version "0.46.0"
id("nl.littlerobots.version-catalog-update") version "0.7.0"
id("com.palantir.git-version") version "0.15.0"
id("com.palantir.git-version") version "1.0.0"
}

/**
Expand Down
Binary file removed config/screenshots/mockup2.png
Binary file not shown.
Binary file modified config/screenshots/screen1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified config/screenshots/screen2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified config/screenshots/screen3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed config/screenshots/screen4.png
Binary file not shown.
Binary file removed config/screenshots/screen5.png
Binary file not shown.
Binary file removed config/screenshots/screen6.png
Binary file not shown.
1 change: 1 addition & 0 deletions core/analytics-impl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
33 changes: 33 additions & 0 deletions core/analytics-impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
id("movies-android-library")
id("movies-android-hilt")
}

android {
namespace = "org.michaelbel.movies.analytics_impl"

defaultConfig {
minSdk = libs.versions.min.sdk.get().toInt()
compileSdk = libs.versions.compile.sdk.get().toInt()
}

buildTypes {
create("benchmark") {
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
initWith(getByName("release"))
}
}

lint {
quiet = true
abortOnError = false
ignoreWarnings = true
checkDependencies = true
lintConfig = file("${project.rootDir}/config/codestyle/lint.xml")
}
}

dependencies {
implementation(libs.firebase.analytics)
}
2 changes: 2 additions & 0 deletions core/analytics-impl/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest/>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.michaelbel.movies.analytics.model
package org.michaelbel.movies.analytics.constants

import com.google.firebase.analytics.FirebaseAnalytics

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.michaelbel.movies.analytics.model
package org.michaelbel.movies.analytics.constants

import com.google.firebase.analytics.FirebaseAnalytics

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.michaelbel.movies.analytics.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
import org.michaelbel.movies.analytics.MoviesAnalytics
import org.michaelbel.movies.analytics.impl.MoviesAnalyticsImpl

@Module
@InstallIn(SingletonComponent::class)
internal interface MoviesAnalyticsModule {

@Binds
@Singleton
fun provideMoviesAnalytics(analytics: MoviesAnalyticsImpl): MoviesAnalytics
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.constants.MoviesParams

class ChangeDynamicColorsEvent(
enabled: Boolean
): BaseEvent(MoviesEvents.SETTINGS_CHANGE_DYNAMIC_COLORS) {

init {
add(MoviesParams.PARAM_DYNAMIC_COLORS_ENABLED, enabled)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesParams

class ChangeRtlEnabledEvent(
enabled: Boolean
): BaseEvent(MoviesEvents.SETTINGS_CHANGE_RTL_ENABLED) {

init {
add(MoviesParams.PARAM_RTL_ENABLED, enabled)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesParams

class SelectLanguageEvent(
language: String
): BaseEvent(MoviesEvents.SETTINGS_SELECT_LANGUAGE) {

init {
add(MoviesParams.PARAM_SELECTED_LANGUAGE, language)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.constants.MoviesParams

class SelectThemeEvent(
theme: String
): BaseEvent(MoviesEvents.SETTINGS_SELECT_THEME) {

init {
add(MoviesParams.PARAM_SELECTED_THEME, theme)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.michaelbel.movies.analytics.model

import android.os.Bundle
import androidx.core.os.bundleOf

open class BaseEvent(
val name: String
) {
val params: Bundle = bundleOf()

fun add(key: String, value: Any) {
params.putString(key, value.toString())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.michaelbel.movies.analytics.constants

import com.google.firebase.analytics.FirebaseAnalytics

internal object MoviesEvents {
const val SCREEN_VIEW = FirebaseAnalytics.Event.SCREEN_VIEW

const val SETTINGS_SELECT_LANGUAGE = "select_language"
const val SETTINGS_SELECT_THEME = "select_theme"
const val SETTINGS_CHANGE_DYNAMIC_COLORS = "change_dynamic_colors"
const val SETTINGS_CHANGE_RTL_ENABLED = "change_rtl_enabled"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.michaelbel.movies.analytics.constants

import com.google.firebase.analytics.FirebaseAnalytics

internal object MoviesParams {
const val PARAM_DESTINATION = FirebaseAnalytics.Param.SCREEN_NAME
const val PARAM_ARGUMENTS = "destination_arguments"

const val PARAM_SELECTED_LANGUAGE = "selected_language"
const val PARAM_SELECTED_THEME = "selected_theme"
const val PARAM_DYNAMIC_COLORS_ENABLED = "dynamic_colors_enabled"
const val PARAM_RTL_ENABLED = "rtl_enabled"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.model.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.model.MoviesParams
import org.michaelbel.movies.analytics.constants.MoviesParams

class ChangeDynamicColorsEvent(
enabled: Boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.model.MoviesEvents
import org.michaelbel.movies.analytics.model.MoviesParams
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesParams

class ChangeRtlEnabledEvent(
enabled: Boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.model.MoviesEvents
import org.michaelbel.movies.analytics.model.MoviesParams
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesParams

class SelectLanguageEvent(
language: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.michaelbel.movies.analytics.event

import org.michaelbel.movies.analytics.model.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.model.MoviesParams
import org.michaelbel.movies.analytics.constants.MoviesParams

class SelectThemeEvent(
theme: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import androidx.core.os.bundleOf
import com.google.firebase.analytics.FirebaseAnalytics
import javax.inject.Inject
import org.michaelbel.movies.analytics.MoviesAnalytics
import org.michaelbel.movies.analytics.constants.MoviesEvents
import org.michaelbel.movies.analytics.constants.MoviesParams
import org.michaelbel.movies.analytics.model.BaseEvent
import org.michaelbel.movies.analytics.model.MoviesEvents
import org.michaelbel.movies.analytics.model.MoviesParams

internal class MoviesAnalyticsImpl @Inject constructor(
private val firebaseAnalytics: FirebaseAnalytics
Expand Down
2 changes: 1 addition & 1 deletion core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {
}

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

lint {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.michaelbel.movies.common.coroutines
package org.michaelbel.movies.common.coroutines.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import org.michaelbel.movies.common.coroutines.Dispatcher
import org.michaelbel.movies.common.coroutines.MoviesDispatchers

@Module
@InstallIn(SingletonComponent::class)
Expand Down

This file was deleted.

Loading

0 comments on commit 47ee06a

Please sign in to comment.