-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add open source licenses screen (#338)
Recently, I found a great library that provides open-source licenses for all the project dependencies. Thank you @mikepenz and all the contributors of https://github.com/mikepenz/AboutLibraries.
- Loading branch information
Showing
15 changed files
with
197 additions
and
105 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
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
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
38 changes: 38 additions & 0 deletions
38
features/preference/src/main/java/com/escodro/preference/presentation/OpenSource.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,38 @@ | ||
package com.escodro.preference.presentation | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.escodro.designsystem.components.AlkaaToolbar | ||
import com.mikepenz.aboutlibraries.ui.compose.LibrariesContainer | ||
import com.mikepenz.aboutlibraries.ui.compose.LibraryDefaults | ||
|
||
/** | ||
* Alkaa open source licenses screen. | ||
*/ | ||
@Composable | ||
@OptIn(ExperimentalMaterial3Api::class) | ||
fun OpenSource(onUpPress: () -> Unit) { | ||
Scaffold( | ||
topBar = { AlkaaToolbar(onUpPress = onUpPress) }, | ||
content = { paddingValues -> OpenSourceContent(modifier = Modifier.padding(paddingValues)) } | ||
) | ||
} | ||
|
||
@Composable | ||
private fun OpenSourceContent(modifier: Modifier) { | ||
LibrariesContainer( | ||
modifier = modifier.fillMaxSize(), | ||
colors = LibraryDefaults.libraryColors( | ||
backgroundColor = MaterialTheme.colorScheme.background, | ||
contentColor = MaterialTheme.colorScheme.onBackground, | ||
badgeContentColor = MaterialTheme.colorScheme.onPrimary, | ||
badgeBackgroundColor = MaterialTheme.colorScheme.primary | ||
), | ||
onLibraryClick = {} // Library is not working properly and crashing when clicked | ||
) | ||
} |
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
Oops, something went wrong.