-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better code organization and further improvements to UI and UX!
- Loading branch information
Mihai-Cristian Condrea
committed
Sep 28, 2024
1 parent
c43cdb7
commit 9c2c187
Showing
80 changed files
with
875 additions
and
731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d4rk/cleaner/utils/compose/NonLazyGrid.kt → ...d4rk/cleaner/ui/components/NonLazyGrid.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...se/components/SettingsComposablesUtils.kt → ...d4rk/cleaner/ui/components/Preferences.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...m/d4rk/cleaner/ads/BannerAdsComposable.kt → .../ui/components/ads/BannerAdsComposable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...aner/ui/dialogs/BottomBarStartupDialog.kt → ...ponents/dialogs/BottomBarStartupDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rk/cleaner/ui/dialogs/ErrorAlertDialog.kt → ...ui/components/dialogs/ErrorAlertDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...er/ui/dialogs/LanguageDialogComposable.kt → ...nents/dialogs/LanguageDialogComposable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...leaner/ui/dialogs/RequireRestartDialog.kt → ...omponents/dialogs/RequireRestartDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...aner/ui/dialogs/RescanDialogComposable.kt → ...ponents/dialogs/RescanDialogComposable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...k/cleaner/ui/dialogs/VersionInfoDialog.kt → ...i/components/dialogs/VersionInfoDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
app/src/main/kotlin/com/d4rk/cleaner/ui/components/navigation/BottomNavBar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.d4rk.cleaner.ui.components.navigation | ||
|
||
import android.view.SoundEffectConstants | ||
import android.view.View | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.NavigationBar | ||
import androidx.compose.material3.NavigationBarItem | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.navigation.NavBackStackEntry | ||
import androidx.navigation.NavController | ||
import androidx.navigation.compose.currentBackStackEntryAsState | ||
import com.d4rk.cleaner.ui.components.ads.FullBannerAdsComposable | ||
import com.d4rk.cleaner.data.datastore.DataStore | ||
import com.d4rk.cleaner.data.model.ui.navigation.BottomNavigationScreen | ||
import com.d4rk.cleaner.ui.components.animations.bounceClick | ||
|
||
@Composable | ||
fun BottomNavBar( | ||
navController: NavController , | ||
dataStore: DataStore , | ||
view: View | ||
) { | ||
val bottomBarItems: List<BottomNavigationScreen> = listOf( | ||
BottomNavigationScreen.Home, | ||
BottomNavigationScreen.AppManager, | ||
BottomNavigationScreen.MemoryManager | ||
) | ||
val showLabels: Boolean = | ||
dataStore.getShowBottomBarLabels().collectAsState(initial = true).value | ||
|
||
Column { | ||
FullBannerAdsComposable( | ||
modifier = Modifier.fillMaxWidth() , dataStore = dataStore | ||
) | ||
NavigationBar { | ||
val navBackStackEntry: NavBackStackEntry? by navController.currentBackStackEntryAsState() | ||
val currentRoute: String? = navBackStackEntry?.destination?.route | ||
bottomBarItems.forEach { screen -> | ||
NavigationBarItem(modifier = Modifier.bounceClick(), | ||
icon = { | ||
val iconResource: ImageVector = | ||
if (currentRoute == screen.route) screen.selectedIcon else screen.icon | ||
Icon( | ||
iconResource, | ||
contentDescription = null | ||
) | ||
}, | ||
label = { | ||
if (showLabels) Text( | ||
text = stringResource(id = screen.title) | ||
) | ||
}, | ||
selected = currentRoute == screen.route, | ||
onClick = { | ||
view.playSoundEffect(SoundEffectConstants.CLICK) | ||
navController.navigate(screen.route) { | ||
popUpTo(navController.graph.startDestinationId) | ||
launchSingleTop = true | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.