Skip to content

Commit

Permalink
Merge pull request #567 from nimblehq/release/3.26.0
Browse files Browse the repository at this point in the history
[Release] 3.26.0
  • Loading branch information
ryan-conway authored Dec 6, 2023
2 parents 1958f2a + df2fc0b commit c183baa
Show file tree
Hide file tree
Showing 78 changed files with 183 additions and 155 deletions.
4 changes: 2 additions & 2 deletions sample-compose/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
#-renamesourcefileattribute SourceFile

# Data class
-keepclassmembers class co.nimblehq.sample.compose.data.request.** { *; }
-keepclassmembers class co.nimblehq.sample.compose.data.response.** { *; }
-keepclassmembers class co.nimblehq.sample.compose.data.remote.models.requests.** { *; }
-keepclassmembers class co.nimblehq.sample.compose.data.remote.models.responses.** { *; }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.sample.compose.di.modules

import co.nimblehq.sample.compose.data.service.providers.MoshiBuilderProvider
import co.nimblehq.sample.compose.data.remote.providers.MoshiBuilderProvider
import com.squareup.moshi.Moshi
import dagger.Module
import dagger.Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.preferencesDataStoreFile
import co.nimblehq.sample.compose.data.repository.AppPreferencesRepositoryImpl
import co.nimblehq.sample.compose.domain.repository.AppPreferencesRepository
import co.nimblehq.sample.compose.data.repositories.AppPreferencesRepositoryImpl
import co.nimblehq.sample.compose.domain.repositories.AppPreferencesRepository
import dagger.*
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.nimblehq.sample.compose.di.modules

import co.nimblehq.sample.compose.data.repository.RepositoryImpl
import co.nimblehq.sample.compose.data.service.ApiService
import co.nimblehq.sample.compose.domain.repository.Repository
import co.nimblehq.sample.compose.data.remote.services.ApiService
import co.nimblehq.sample.compose.data.repositories.RepositoryImpl
import co.nimblehq.sample.compose.domain.repositories.Repository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package co.nimblehq.sample.compose.di.modules

import co.nimblehq.sample.compose.BuildConfig
import co.nimblehq.sample.compose.data.service.ApiService
import co.nimblehq.sample.compose.data.service.providers.ApiServiceProvider
import co.nimblehq.sample.compose.data.service.providers.ConverterFactoryProvider
import co.nimblehq.sample.compose.data.service.providers.RetrofitProvider
import co.nimblehq.sample.compose.data.remote.providers.ApiServiceProvider
import co.nimblehq.sample.compose.data.remote.providers.ConverterFactoryProvider
import co.nimblehq.sample.compose.data.remote.providers.RetrofitProvider
import co.nimblehq.sample.compose.data.remote.services.ApiService
import com.squareup.moshi.Moshi
import dagger.Module
import dagger.Provides
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.nimblehq.sample.compose.di.modules

import android.content.Context
import co.nimblehq.sample.compose.data.storage.EncryptedSharedPreferences
import co.nimblehq.sample.compose.data.local.preferences.EncryptedSharedPreferences
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package co.nimblehq.sample.compose.ui

import androidx.navigation.*
import co.nimblehq.sample.compose.model.UiModel
import androidx.navigation.NamedNavArgument
import androidx.navigation.NavType
import androidx.navigation.navArgument
import co.nimblehq.sample.compose.ui.models.UiModel

const val KeyId = "id"
const val KeyModel = "model"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package co.nimblehq.sample.compose.ui

import androidx.compose.runtime.Composable
import androidx.navigation.*
import androidx.navigation.compose.*
import co.nimblehq.sample.compose.model.UiModel
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavDeepLink
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.screens.home.HomeScreen
import co.nimblehq.sample.compose.ui.screens.second.SecondScreen
import co.nimblehq.sample.compose.ui.screens.third.ThirdScreen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.nimblehq.sample.compose.model
package co.nimblehq.sample.compose.ui.models

import android.os.Parcelable
import co.nimblehq.sample.compose.domain.model.Model
import co.nimblehq.sample.compose.domain.models.Model
import kotlinx.parcelize.Parcelize

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.extensions.collectAsEffect
import co.nimblehq.sample.compose.extensions.showToast
import co.nimblehq.sample.compose.lib.IsLoading
import co.nimblehq.sample.compose.model.UiModel
import co.nimblehq.sample.compose.ui.AppDestination
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.screens.AppBar
import co.nimblehq.sample.compose.ui.showToast
import co.nimblehq.sample.compose.ui.theme.ComposeTheme
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
package co.nimblehq.sample.compose.ui.screens.home

import androidx.lifecycle.viewModelScope
import co.nimblehq.sample.compose.domain.usecase.GetModelsUseCase
import co.nimblehq.sample.compose.domain.usecase.IsFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.domain.usecase.UpdateFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.model.UiModel
import co.nimblehq.sample.compose.model.toUiModel
import co.nimblehq.sample.compose.domain.usecases.GetModelsUseCase
import co.nimblehq.sample.compose.domain.usecases.IsFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.domain.usecases.UpdateFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.ui.AppDestination
import co.nimblehq.sample.compose.ui.base.BaseViewModel
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.models.toUiModel
import co.nimblehq.sample.compose.util.DispatchersProvider
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import javax.inject.Inject

@HiltViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.model.UiModel
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.theme.*
import co.nimblehq.sample.compose.ui.theme.AppTheme.dimensions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.material.Divider
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import co.nimblehq.sample.compose.model.UiModel
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.theme.ComposeTheme

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.model.UiModel
import co.nimblehq.sample.compose.ui.AppDestination
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.screens.AppBar
import co.nimblehq.sample.compose.ui.theme.ComposeTheme

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.sample.compose.test

import co.nimblehq.sample.compose.domain.model.Model
import co.nimblehq.sample.compose.domain.models.Model

object MockUtil {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.rule.GrantPermissionRule
import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.domain.usecase.*
import co.nimblehq.sample.compose.domain.usecases.*
import co.nimblehq.sample.compose.test.MockUtil
import co.nimblehq.sample.compose.ui.AppDestination
import co.nimblehq.sample.compose.ui.screens.BaseScreenTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
package co.nimblehq.sample.compose.ui.screens.home

import app.cash.turbine.test
import co.nimblehq.sample.compose.domain.usecase.GetModelsUseCase
import co.nimblehq.sample.compose.domain.usecase.IsFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.domain.usecase.UpdateFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.model.toUiModel
import co.nimblehq.sample.compose.domain.usecases.GetModelsUseCase
import co.nimblehq.sample.compose.domain.usecases.IsFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.domain.usecases.UpdateFirstTimeLaunchPreferencesUseCase
import co.nimblehq.sample.compose.test.CoroutineTestRule
import co.nimblehq.sample.compose.test.MockUtil
import co.nimblehq.sample.compose.ui.AppDestination
import co.nimblehq.sample.compose.ui.models.toUiModel
import co.nimblehq.sample.compose.util.DispatchersProvider
import io.kotest.matchers.shouldBe
import io.mockk.*
import io.mockk.Runs
import io.mockk.coEvery
import io.mockk.coVerify
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
Expand Down
2 changes: 1 addition & 1 deletion sample-compose/buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object Versions {
const val ANDROID_TARGET_SDK_VERSION = 33

const val ANDROID_VERSION_CODE = 1
const val ANDROID_VERSION_NAME = "3.25.0"
const val ANDROID_VERSION_NAME = "3.26.0"

// Dependencies (Alphabet sorted)
const val ACCOMPANIST_PERMISSIONS_VERSION = "0.30.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.nimblehq.sample.compose.data.extensions

import co.nimblehq.sample.compose.data.response.ErrorResponse
import co.nimblehq.sample.compose.data.response.toModel
import co.nimblehq.sample.compose.data.service.providers.MoshiBuilderProvider
import co.nimblehq.sample.compose.data.remote.models.responses.ErrorResponse
import co.nimblehq.sample.compose.data.remote.models.responses.toModel
import co.nimblehq.sample.compose.data.remote.providers.MoshiBuilderProvider
import co.nimblehq.sample.compose.domain.exceptions.ApiException
import co.nimblehq.sample.compose.domain.exceptions.NoConnectivityException
import com.squareup.moshi.JsonDataException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.sample.compose.data.storage
package co.nimblehq.sample.compose.data.local.preferences

import android.content.SharedPreferences

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.storages
package co.nimblehq.sample.compose.data.local.preferences

import android.content.Context
import androidx.security.crypto.EncryptedSharedPreferences
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.storages
package co.nimblehq.sample.compose.data.local.preferences

import android.content.SharedPreferences

Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.sample.compose.data.response
package co.nimblehq.sample.compose.data.remote.models.responses

import co.nimblehq.sample.compose.domain.model.Error
import co.nimblehq.sample.compose.domain.models.Error
import com.squareup.moshi.Json

data class ErrorResponse(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.sample.compose.data.response
package co.nimblehq.sample.compose.data.remote.models.responses

import co.nimblehq.sample.compose.domain.model.Model
import co.nimblehq.sample.compose.domain.models.Model
import com.squareup.moshi.Json

data class Response(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.sample.compose.data.service.providers
package co.nimblehq.sample.compose.data.remote.providers

import co.nimblehq.sample.compose.data.service.ApiService
import co.nimblehq.sample.compose.data.remote.services.ApiService
import retrofit2.Retrofit

object ApiServiceProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.sample.compose.data.service.providers
package co.nimblehq.sample.compose.data.remote.providers

import com.squareup.moshi.Moshi
import retrofit2.Converter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.services.providers
package co.nimblehq.sample.compose.data.remote.providers

import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.sample.compose.data.service.providers
package co.nimblehq.sample.compose.data.remote.providers

import okhttp3.OkHttpClient
import retrofit2.Converter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package co.nimblehq.sample.compose.data.remote.services

import co.nimblehq.sample.compose.data.remote.models.responses.Response
import retrofit2.http.GET

interface ApiService {

@GET("users")
suspend fun getResponses(): List<Response>
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package co.nimblehq.sample.compose.data.repository
package co.nimblehq.sample.compose.data.repositories

import android.util.Log
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.*
import co.nimblehq.sample.compose.domain.repository.AppPreferencesRepository
import kotlinx.coroutines.flow.*
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.emptyPreferences
import co.nimblehq.sample.compose.domain.repositories.AppPreferencesRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.map
import java.io.IOException
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package co.nimblehq.sample.compose.data.repository
package co.nimblehq.sample.compose.data.repositories

import co.nimblehq.sample.compose.data.extensions.flowTransform
import co.nimblehq.sample.compose.data.response.toModels
import co.nimblehq.sample.compose.data.service.ApiService
import co.nimblehq.sample.compose.domain.model.Model
import co.nimblehq.sample.compose.domain.repository.Repository
import co.nimblehq.sample.compose.data.remote.models.responses.toModels
import co.nimblehq.sample.compose.data.remote.services.ApiService
import co.nimblehq.sample.compose.domain.models.Model
import co.nimblehq.sample.compose.domain.repositories.Repository
import kotlinx.coroutines.flow.Flow

class RepositoryImpl constructor(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package co.nimblehq.sample.compose.data.extensions

import co.nimblehq.sample.compose.data.response.toModel
import co.nimblehq.sample.compose.data.remote.models.responses.toModel
import co.nimblehq.sample.compose.data.test.MockUtil
import co.nimblehq.sample.compose.domain.exceptions.ApiException
import co.nimblehq.sample.compose.domain.exceptions.NoConnectivityException
import co.nimblehq.sample.compose.domain.model.Model
import co.nimblehq.sample.compose.domain.models.Model
import io.kotest.matchers.shouldBe
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.catch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package co.nimblehq.sample.compose.data.repository
package co.nimblehq.sample.compose.data.repositories

import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.*
import androidx.datastore.preferences.preferencesDataStoreFile
import androidx.test.core.app.ApplicationProvider
import app.cash.turbine.test
import co.nimblehq.sample.compose.domain.repository.AppPreferencesRepository
import co.nimblehq.sample.compose.domain.repositories.AppPreferencesRepository
import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
Expand Down
Loading

0 comments on commit c183baa

Please sign in to comment.