Skip to content

Commit

Permalink
[CHORE] Various updates and enhancements:
Browse files Browse the repository at this point in the history
- Bumped multiple library versions, including Compose to RC1 and Gradle to 8.6.0.
- Changed accent color in light theme to SkyBlue.
- Added `CoinInitializer` for Coil library initialization and custom `ThumbnailFetcher` for faster image fetching.
- Refactored `compose-ktx` module to `foundation` and 'api' to 'domain' for better clarity.
- Renamed `preview` package to `viewer`.
[FEAT] Introduced `renderInSharedTransitionScopeOverlay` in `AppTheme` for handling views in shared element transitions.
[FEAT] Added 'MenuItem' & 'Menu' components to `foundation` for easier dynamic menu creation.
  • Loading branch information
iZakirSheikh committed Sep 1, 2024
1 parent 47596ee commit e5c4830
Show file tree
Hide file tree
Showing 83 changed files with 1,209 additions and 593 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId = "com.googol.android.apps.photos"
minSdk = 24
targetSdk = 34
versionCode = 7
versionName = "0.1.0-dev07"
versionCode = 8
versionName = "0.1.0-dev08"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -61,8 +61,6 @@ dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.navigation.compose)
implementation(libs.androidx.koin)
implementation(project(":api"))
implementation(project(":compose-ktx"))
implementation(libs.toolkit.preferences)
implementation(libs.androidx.startup.runtime)
implementation(libs.androidx.core.splashscreen)
Expand All @@ -73,4 +71,8 @@ dependencies {
implementation(libs.firebase.crashlytics.ktx)
implementation(libs.androidx.ui.text.google.fonts)
implementation(libs.saket.zoomable)

implementation(project(":domain"))
implementation(project(":foundation"))
// project modules
}
11 changes: 9 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,26 @@
<meta-data
android:name="com.zs.gallery.impl.KoinInitializer"
android:value="androidx.startup" />

<!--Coil ImageLoader-->
<meta-data
android:name="com.zs.gallery.impl.CoilInitializer"
android:value="androidx.startup" />
</provider>

<!-- Disable FirebaseInitProvider -->
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="${applicationId}.firebaseinitprovider"
android:enabled="false"
tools:node="remove"
android:exported="false"/>
android:exported="false"
tools:node="remove" />

<!--MainActivity-->
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|screenLayout"
android:launchMode="singleTask"
android:exported="true">

<!--The Intent Filters -->
Expand Down
62 changes: 27 additions & 35 deletions app/src/main/java/com/zs/gallery/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,15 @@ import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.scaleIn
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.BottomAppBar
Expand All @@ -57,7 +54,6 @@ import androidx.compose.runtime.movableContentOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand All @@ -70,23 +66,21 @@ import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.rememberMultiplePermissionsState
import com.primex.core.SignalWhite
import com.primex.core.textResource
import com.primex.material2.Label
import com.primex.material2.OutlinedButton
import com.zs.compose_ktx.AppTheme
import com.zs.compose_ktx.ContentPadding
import com.zs.compose_ktx.LocalWindowSize
import com.zs.compose_ktx.None
import com.zs.compose_ktx.Range
import com.zs.compose_ktx.WindowSize
import com.zs.compose_ktx.isPermissionGranted
import com.zs.compose_ktx.adaptive.BottomNavItem
import com.zs.compose_ktx.adaptive.NavRailItem
import com.zs.compose_ktx.adaptive.NavigationItemDefaults
import com.zs.compose_ktx.adaptive.NavigationSuiteScaffold
import com.zs.compose_ktx.thenIf
import com.zs.compose_ktx.toast.ToastHostState
import com.zs.foundation.AppTheme
import com.zs.foundation.LocalWindowSize
import com.zs.foundation.Range
import com.zs.foundation.WindowSize
import com.zs.foundation.isPermissionGranted
import com.zs.foundation.adaptive.BottomNavItem
import com.zs.foundation.adaptive.NavRailItem
import com.zs.foundation.adaptive.NavigationItemDefaults
import com.zs.foundation.adaptive.NavigationSuiteScaffold
import com.zs.foundation.renderInSharedTransitionScopeOverlay
import com.zs.foundation.thenIf
import com.zs.foundation.toast.ToastHostState
import com.zs.gallery.bin.RouteTrash
import com.zs.gallery.bin.Trash
import com.zs.gallery.common.LocalNavController
Expand All @@ -111,8 +105,8 @@ import com.zs.gallery.impl.SettingsViewModel
import com.zs.gallery.impl.TimelineViewModel
import com.zs.gallery.impl.TrashViewModel
import com.zs.gallery.impl.ViewerViewModel
import com.zs.gallery.preview.RouteViewer
import com.zs.gallery.preview.Viewer
import com.zs.gallery.viewer.RouteViewer
import com.zs.gallery.viewer.Viewer
import com.zs.gallery.settings.RouteSettings
import com.zs.gallery.settings.Settings
import org.koin.androidx.compose.koinViewModel
Expand Down Expand Up @@ -325,22 +319,14 @@ private fun NavigationBar(
)

else -> BottomAppBar(
windowInsets = WindowInsets.None,
backgroundColor = if (colors.isLight) Color(0xFF0E0E0F) else colors.background(1.dp),
contentColor = if (colors.isLight) Color.SignalWhite else colors.onBackground,
elevation = AppTheme.elevation.high,
windowInsets = WindowInsets.navigationBars,
backgroundColor = colors.background(1.dp),
contentColor = colors.onBackground,
elevation = 0.dp,
contentPadding = PaddingValues(
horizontal = AppTheme.padding.normal
),
modifier = modifier
.padding(horizontal = ContentPadding.large)
.navigationBarsPadding()
.shadow(12.dp, BottomNavShape, clip = true)
.thenIf(
!colors.isLight,
Modifier.border(1.dp, Color.White.copy(0.06f), BottomNavShape)
)
.widthIn(max = 400.dp),
modifier = modifier,
content = {
Spacer(modifier = Modifier.weight(1f))
// Display routes at the contre of available space
Expand Down Expand Up @@ -471,7 +457,13 @@ fun Home(toastHostState: ToastHostState) {
hideNavigationBar = hideNavigationBar,
background = AppTheme.colors.background(elevation = 1.dp),
// Set up the navigation bar using the NavBar composable
navBar = { NavigationBar(clazz.navTypeRail, navController) },
navBar = {
NavigationBar(
clazz.navTypeRail,
navController,
Modifier.renderInSharedTransitionScopeOverlay(1f)
)
},
// Display the main content of the app using the NavGraph composable
content = content
)
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/java/com/zs/gallery/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@

package com.zs.gallery

import android.annotation.SuppressLint
import android.content.res.Configuration
import android.os.Bundle
import android.util.Log
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.material.LocalElevationOverlay
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
Expand All @@ -43,15 +41,13 @@ import com.primex.preferences.Key
import com.primex.preferences.Preferences
import com.primex.preferences.observeAsState
import com.primex.preferences.value
import com.zs.compose_ktx.LocalWindowSize
import com.zs.compose_ktx.calculateWindowSizeClass
import com.zs.compose_ktx.toast.ToastHostState
import com.zs.foundation.LocalWindowSize
import com.zs.foundation.calculateWindowSizeClass
import com.zs.foundation.toast.ToastHostState
import com.zs.gallery.common.LocalSystemFacade
import com.zs.gallery.common.NightMode
import com.zs.gallery.common.SystemFacade
import com.zs.gallery.settings.Settings
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.launch
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/com/zs/gallery/bin/Trash.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ import com.primex.material2.TextButton
import com.primex.material2.appbar.LargeTopAppBar
import com.primex.material2.appbar.TopAppBarDefaults
import com.primex.material2.appbar.TopAppBarScrollBehavior
import com.zs.compose_ktx.AppTheme
import com.zs.compose_ktx.LocalWindowSize
import com.zs.compose_ktx.None
import com.zs.compose_ktx.VerticalDivider
import com.zs.compose_ktx.adaptive.TwoPane
import com.zs.compose_ktx.adaptive.VerticalTwoPaneStrategy
import com.zs.compose_ktx.adaptive.contentInsets
import com.zs.foundation.AppTheme
import com.zs.foundation.LocalWindowSize
import com.zs.foundation.None
import com.zs.foundation.VerticalDivider
import com.zs.foundation.adaptive.TwoPane
import com.zs.foundation.adaptive.VerticalTwoPaneStrategy
import com.zs.foundation.adaptive.contentInsets
import com.zs.gallery.R
import com.zs.gallery.common.FloatingActionMenu
import com.zs.gallery.common.LocalNavController
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/zs/gallery/bin/TrashItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ import androidx.compose.ui.util.lerp
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.primex.material2.Label
import com.zs.api.store.Trashed
import com.zs.api.store.isImage
import com.zs.api.store.mediaUri
import com.zs.compose_ktx.AppTheme
import com.zs.compose_ktx.ContentPadding
import com.zs.compose_ktx.Divider
import com.zs.domain.store.Trashed
import com.zs.domain.store.isImage
import com.zs.domain.store.mediaUri
import com.zs.foundation.AppTheme
import com.zs.foundation.ContentPadding
import com.zs.foundation.Divider
import com.zs.gallery.R


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/bin/TrashViewState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package com.zs.gallery.bin

import android.annotation.SuppressLint
import android.app.Activity
import com.zs.api.store.Trashed
import com.zs.domain.store.Trashed
import com.zs.gallery.common.FileActions
import com.zs.gallery.common.Route
import com.zs.gallery.common.SelectionTracker
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/common/FileActions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package com.zs.gallery.common
import android.app.Activity
import android.os.Build
import androidx.annotation.RequiresApi
import com.zs.api.store.MediaFile
import com.zs.domain.store.MediaFile


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
import androidx.compose.ui.unit.dp
import com.zs.compose_ktx.AppTheme
import com.zs.foundation.AppTheme

private val DefaultItemSpace = Arrangement.spacedBy(AppTheme.padding.small)

Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/zs/gallery/common/MediaFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ import androidx.compose.ui.util.lerp
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.primex.material2.Label
import com.zs.api.store.MediaFile
import com.zs.api.store.isImage
import com.zs.api.store.mediaUri
import com.zs.compose_ktx.AppTheme
import com.zs.compose_ktx.ContentPadding
import com.zs.compose_ktx.Divider
import com.zs.domain.store.MediaFile
import com.zs.domain.store.isImage
import com.zs.domain.store.mediaUri
import com.zs.foundation.AppTheme
import com.zs.foundation.ContentPadding
import com.zs.foundation.Divider
import com.zs.gallery.R

private const val TAG = "MediaFile"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/zs/gallery/common/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavGraph
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.zs.compose_ktx.LocalNavAnimatedVisibilityScope
import com.zs.foundation.LocalNavAnimatedVisibilityScope

private val SPLIT_REGEX = Regex("(?=[A-Z])")

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/zs/gallery/common/SystemFacade.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.core.content.res.ResourcesCompat
import com.primex.preferences.Key
import com.zs.compose_ktx.toast.Duration
import com.zs.compose_ktx.toast.Toast
import com.zs.foundation.toast.Duration
import com.zs.foundation.toast.Toast

interface SystemFacade {

Expand Down
Loading

0 comments on commit e5c4830

Please sign in to comment.