-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add action after clean setting (open share menu, copy to clipbo…
…ard) (#172) * chore: Improve app navigation * feat: Add action after clean setting
- Loading branch information
1 parent
37fc267
commit 731c2a5
Showing
26 changed files
with
389 additions
and
154 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
28 changes: 28 additions & 0 deletions
28
app/src/main/kotlin/com/svenjacobs/app/leon/inject/AppContainer.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,28 @@ | ||
/* | ||
* Léon - The URL Cleaner | ||
* Copyright (C) 2023 Sven Jacobs | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.svenjacobs.app.leon.inject | ||
|
||
import com.svenjacobs.app.leon.datastore.AppDataStoreManager | ||
import com.svenjacobs.app.leon.datastore.SanitizerDataStoreManager | ||
|
||
object AppContainer { | ||
|
||
val AppDataStoreManager: AppDataStoreManager by lazy { AppDataStoreManager() } | ||
val SanitizerDataStoreManager: SanitizerDataStoreManager by lazy { SanitizerDataStoreManager() } | ||
} |
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
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
66 changes: 66 additions & 0 deletions
66
app/src/main/kotlin/com/svenjacobs/app/leon/ui/MainRouter.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,66 @@ | ||
/* | ||
* Léon - The URL Cleaner | ||
* Copyright (C) 2023 Sven Jacobs | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.svenjacobs.app.leon.ui | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.State | ||
import androidx.compose.ui.Modifier | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.compose.rememberNavController | ||
import com.svenjacobs.app.leon.ui.screens.main.MainScreen | ||
import com.svenjacobs.app.leon.ui.screens.settings.SettingsLicensesScreen | ||
import com.svenjacobs.app.leon.ui.screens.settings.SettingsSanitizersScreen | ||
|
||
@Composable | ||
fun MainRouter(sourceText: State<String?>, modifier: Modifier = Modifier) { | ||
val navController = rememberNavController() | ||
|
||
NavHost( | ||
modifier = modifier, | ||
navController = navController, | ||
startDestination = Routes.Main, | ||
) { | ||
composable(Routes.Main) { | ||
MainScreen( | ||
sourceText = sourceText, | ||
onNavigateToSettingsSanitizers = { navController.navigate(Routes.SettingsSanitizers) }, | ||
onNavigateToSettingsLicenses = { navController.navigate(Routes.SettingsLicenses) }, | ||
) | ||
} | ||
|
||
composable(Routes.SettingsSanitizers) { | ||
SettingsSanitizersScreen( | ||
onBackClick = { navController.popBackStack() }, | ||
) | ||
} | ||
|
||
composable(Routes.SettingsLicenses) { | ||
SettingsLicensesScreen( | ||
onBackClick = { navController.popBackStack() }, | ||
) | ||
} | ||
} | ||
} | ||
|
||
private object Routes { | ||
const val Main = "main" | ||
const val SettingsSanitizers = "settings_sanitizers" | ||
const val SettingsLicenses = "settings_licenses" | ||
} |
Oops, something went wrong.