-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from ultimagz/feat/about-app-oss-licenses
Feat/About App menu Open Source Licenses
- Loading branch information
Showing
10 changed files
with
168 additions
and
22 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
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
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/akexorcist/ruammij/ui/RuamMijAppNavigation.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,16 @@ | ||
package com.akexorcist.ruammij.ui | ||
|
||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
|
||
const val RUAM_MIJ_APP_ROUTE = "ruam_mij_app_route" | ||
|
||
fun NavGraphBuilder.ruamMijApp( | ||
appState: AppState, | ||
) { | ||
composable(route = RUAM_MIJ_APP_ROUTE) { | ||
RuamMijApp( | ||
appState = appState, | ||
) | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
app/src/main/java/com/akexorcist/ruammij/ui/osslicense/OpenSourceLicenseNavigation.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,32 @@ | ||
package com.akexorcist.ruammij.ui.osslicense | ||
|
||
import androidx.compose.animation.AnimatedContentTransitionScope | ||
import androidx.compose.animation.core.tween | ||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.compose.composable | ||
|
||
const val OPEN_SOURCE_LICENSES_ROUTE = "open_source_licenses_route" | ||
|
||
fun NavController.navigateToOpenSourceLicense() = navigate(route = OPEN_SOURCE_LICENSES_ROUTE) { | ||
popUpTo(graph.startDestinationId) | ||
launchSingleTop = true | ||
} | ||
|
||
fun NavGraphBuilder.openSourceLicenseScreen( | ||
navController: NavController, | ||
) { | ||
composable( | ||
route = OPEN_SOURCE_LICENSES_ROUTE, | ||
enterTransition = { | ||
slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Start, tween(350)) | ||
}, | ||
exitTransition = { | ||
slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.End, tween(350)) | ||
}, | ||
) { | ||
OpenSourceLicenseRoute( | ||
navController = navController, | ||
) | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
app/src/main/java/com/akexorcist/ruammij/ui/osslicense/OpenSourceLicenseScreen.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,62 @@ | ||
package com.akexorcist.ruammij.ui.osslicense | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.automirrored.filled.ArrowBack | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TopAppBar | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.navigation.NavController | ||
import com.akexorcist.ruammij.R | ||
import com.mikepenz.aboutlibraries.Libs | ||
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer | ||
import com.mikepenz.aboutlibraries.util.withJson | ||
|
||
@Composable | ||
fun OpenSourceLicenseRoute( | ||
navController: NavController, | ||
) { | ||
OpenSourceLicenseScreen(navController = navController) | ||
} | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
private fun OpenSourceLicenseScreen( | ||
navController: NavController, | ||
) { | ||
Scaffold( | ||
topBar = { | ||
TopAppBar( | ||
title = { | ||
Text( | ||
text = stringResource(R.string.about_app_menu_open_source_licenses), | ||
) | ||
}, | ||
navigationIcon = { | ||
IconButton(onClick = { navController.popBackStack() }) { | ||
Icon( | ||
imageVector = Icons.AutoMirrored.Filled.ArrowBack, | ||
contentDescription = "Back" | ||
) | ||
} | ||
}, | ||
) | ||
} | ||
) { paddingValues -> | ||
LibrariesContainer( | ||
modifier = Modifier.fillMaxSize(), | ||
contentPadding = paddingValues, | ||
librariesBlock = { ctx -> | ||
Libs.Builder() | ||
.withJson(ctx, R.raw.aboutlibraries) | ||
.build() | ||
}, | ||
) | ||
} | ||
} |
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