GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — apply copilot feedback · Goooler/AboutLibraries@5564400

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • sample
    • android/src/main
      • AndroidManifest.xml
      • kotlin/com/mikepenz/aboutlibraries
        • MainActivity.kt
    • ios/iosApp
      • ContentView.swift
    • shared/src
      • commonMain/kotlin/com/mikepenz/aboutlibraries/sample
        • App.kt
        • components
          • ToggleableSetting.kt
          • TopAppBar.kt
        • icon
          • Debug.kt
          • Github.kt
          • OpenSourceInitiative.kt
      • iosMain/kotlin/com/mikepenz/aboutlibraries
        • MainViewController.kt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎sample/android/src/main/AndroidManifest.xml‎

Copy file name to clipboardExpand all lines: sample/android/src/main/AndroidManifest.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
android:supportsRtl="true"
1111
android:theme="@android:style/Theme.Material.Light.NoActionBar">
1212
<activity
13-
android:name="com.mikepenz.markdown.MainActivity"
13+
android:name="com.mikepenz.aboutlibraries.MainActivity"
1414
android:exported="true">
1515
<intent-filter>
1616
<action android:name="android.intent.action.MAIN" />
Collapse file

‎…in/com/mikepenz/markdown/MainActivity.kt‎ ‎…/mikepenz/aboutlibraries/MainActivity.kt‎sample/android/src/main/kotlin/com/mikepenz/markdown/MainActivity.kt renamed to sample/android/src/main/kotlin/com/mikepenz/aboutlibraries/MainActivity.kt sample/android/src/main/kotlin/com/mikepenz/markdown/MainActivity.kt renamed to sample/android/src/main/kotlin/com/mikepenz/aboutlibraries/MainActivity.kt

Copy file name to clipboardExpand all lines: sample/android/src/main/kotlin/com/mikepenz/aboutlibraries/MainActivity.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mikepenz.markdown
1+
package com.mikepenz.aboutlibraries
22

33
import android.os.Bundle
44
import androidx.activity.ComponentActivity
Collapse file

‎sample/ios/iosApp/ContentView.swift‎

Copy file name to clipboardExpand all lines: sample/ios/iosApp/ContentView.swift
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ struct ComposeView: UIViewControllerRepresentable {
1212

1313
struct ContentView: View {
1414
var body: some View {
15-
ComposeView()
16-
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler
15+
ComposeView().ignoresSafeArea(.all)
1716
}
1817
}
1918

Collapse file

‎sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/App.kt‎

Copy file name to clipboardExpand all lines: sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/App.kt
+12-32Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
package com.mikepenz.aboutlibraries.sample
22

33
import androidx.compose.foundation.background
4-
import androidx.compose.foundation.clickable
5-
import androidx.compose.foundation.interaction.MutableInteractionSource
64
import androidx.compose.foundation.isSystemInDarkTheme
7-
import androidx.compose.foundation.layout.Arrangement
85
import androidx.compose.foundation.layout.Column
9-
import androidx.compose.foundation.layout.Row
106
import androidx.compose.foundation.layout.WindowInsets
117
import androidx.compose.foundation.layout.WindowInsetsSides
128
import androidx.compose.foundation.layout.fillMaxSize
@@ -23,12 +19,9 @@ import androidx.compose.material.icons.filled.Build
2319
import androidx.compose.material.icons.filled.Info
2420
import androidx.compose.material.icons.filled.Person
2521
import androidx.compose.material.rememberBottomDrawerState
26-
import androidx.compose.material.ripple
2722
import androidx.compose.material3.ExperimentalMaterial3Api
28-
import androidx.compose.material3.Icon
2923
import androidx.compose.material3.MaterialTheme
3024
import androidx.compose.material3.Scaffold
31-
import androidx.compose.material3.Switch
3225
import androidx.compose.material3.Text
3326
import androidx.compose.runtime.Composable
3427
import androidx.compose.runtime.getValue
@@ -38,9 +31,10 @@ import androidx.compose.runtime.rememberCoroutineScope
3831
import androidx.compose.runtime.setValue
3932
import androidx.compose.ui.Alignment
4033
import androidx.compose.ui.Modifier
41-
import androidx.compose.ui.graphics.vector.ImageVector
4234
import androidx.compose.ui.unit.dp
4335
import com.mikepenz.aboutlibraries.Libs
36+
import com.mikepenz.aboutlibraries.sample.components.ToggleableSetting
37+
import com.mikepenz.aboutlibraries.sample.components.TopAppBar
4438
import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer
4539
import kotlinx.coroutines.launch
4640

@@ -49,7 +43,7 @@ import kotlinx.coroutines.launch
4943
fun App(libs: Libs?) {
5044
val isSystemInDarkMode = isSystemInDarkTheme()
5145
var darkMode by remember { mutableStateOf(isSystemInDarkMode) }
52-
var v3Theme by remember { mutableStateOf(true) }
46+
var useV3 by remember { mutableStateOf(true) }
5347
var showAuthor by remember { mutableStateOf(true) }
5448
var showDescription by remember { mutableStateOf(false) }
5549
var showVersion by remember { mutableStateOf(true) }
@@ -60,7 +54,7 @@ fun App(libs: Libs?) {
6054
val scope = rememberCoroutineScope()
6155

6256

63-
AppTheme(useV3 = v3Theme, useDarkTheme = darkMode) {
57+
AppTheme(useV3 = useV3, useDarkTheme = darkMode) {
6458
BottomDrawer(
6559
gesturesEnabled = bottomDrawerState.isOpen,
6660
drawerState = bottomDrawerState,
@@ -69,30 +63,35 @@ fun App(libs: Libs?) {
6963
modifier = Modifier.windowInsetsPadding(WindowInsets.systemBars.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
7064
) {
7165
ToggleableSetting(
66+
useV3 = useV3,
7267
title = "Show Author",
7368
icon = Icons.Default.Person,
7469
enabled = showAuthor,
7570
onToggled = { showAuthor = it },
7671
)
7772
ToggleableSetting(
73+
useV3 = useV3,
7874
title = "Show Description",
7975
icon = Icons.Default.Person,
8076
enabled = showDescription,
8177
onToggled = { showDescription = it },
8278
)
8379
ToggleableSetting(
80+
useV3 = useV3,
8481
title = "Show Version",
8582
icon = Icons.Default.Build,
8683
enabled = showVersion,
8784
onToggled = { showVersion = it },
8885
)
8986
ToggleableSetting(
87+
useV3 = useV3,
9088
title = "Show License Badges",
9189
icon = Icons.AutoMirrored.Filled.List,
9290
enabled = showLicenseBadges,
9391
onToggled = { showLicenseBadges = it },
9492
)
9593
ToggleableSetting(
94+
useV3 = useV3,
9695
title = "Show Header",
9796
icon = Icons.Default.Info,
9897
enabled = showHeader,
@@ -105,13 +104,13 @@ fun App(libs: Libs?) {
105104
TopAppBar(
106105
useDarkTheme = darkMode,
107106
onThemeToggle = { darkMode = it },
108-
isV3 = v3Theme,
109-
onV3Toggle = { v3Theme = it },
107+
useV3 = useV3,
108+
onV3Toggle = { useV3 = it },
110109
onSettingsClick = { scope.launch { bottomDrawerState.open() } },
111110
)
112111
}
113112
) {
114-
if (v3Theme) {
113+
if (useV3) {
115114
LibrariesContainer(
116115
libraries = libs,
117116
modifier = Modifier.fillMaxSize(),
@@ -167,22 +166,3 @@ fun App(libs: Libs?) {
167166
)
168167
}
169168
}
170-
171-
@Composable
172-
fun ToggleableSetting(title: String, icon: ImageVector, enabled: Boolean, onToggled: (Boolean) -> Unit) {
173-
val interactionSource = remember { MutableInteractionSource() }
174-
Row(
175-
verticalAlignment = Alignment.CenterVertically,
176-
modifier = Modifier
177-
.clickable(interactionSource = interactionSource, onClick = { onToggled(!enabled) }, indication = ripple())
178-
.fillMaxWidth()
179-
.padding(horizontal = 16.dp, vertical = 12.dp),
180-
horizontalArrangement = Arrangement.spacedBy(30.dp)
181-
) {
182-
Icon(icon, contentDescription = title)
183-
Text(text = title, style = MaterialTheme.typography.bodyLarge, modifier = Modifier.weight(1f))
184-
Switch(interactionSource = interactionSource, checked = enabled, onCheckedChange = {
185-
onToggled(!enabled)
186-
})
187-
}
188-
}
Collapse file

‎sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/components/ToggleableSetting.kt‎

Copy file name to clipboard
+52Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.mikepenz.aboutlibraries.sample.components
2+
3+
import androidx.compose.foundation.clickable
4+
import androidx.compose.foundation.interaction.MutableInteractionSource
5+
import androidx.compose.foundation.layout.Arrangement
6+
import androidx.compose.foundation.layout.Row
7+
import androidx.compose.foundation.layout.fillMaxWidth
8+
import androidx.compose.foundation.layout.padding
9+
import androidx.compose.material3.Icon
10+
import androidx.compose.material3.MaterialTheme
11+
import androidx.compose.material3.Switch
12+
import androidx.compose.material3.Text
13+
import androidx.compose.material3.ripple
14+
import androidx.compose.runtime.Composable
15+
import androidx.compose.runtime.remember
16+
import androidx.compose.ui.Alignment
17+
import androidx.compose.ui.Modifier
18+
import androidx.compose.ui.graphics.vector.ImageVector
19+
import androidx.compose.ui.unit.dp
20+
21+
@Composable
22+
fun ToggleableSetting(
23+
useV3: Boolean,
24+
title: String,
25+
icon: ImageVector,
26+
enabled: Boolean,
27+
onToggled: (Boolean) -> Unit,
28+
) {
29+
val interactionSource = remember { MutableInteractionSource() }
30+
Row(
31+
verticalAlignment = Alignment.CenterVertically,
32+
modifier = Modifier
33+
.clickable(interactionSource = interactionSource, onClick = { onToggled(!enabled) }, indication = ripple())
34+
.fillMaxWidth()
35+
.padding(horizontal = 16.dp, vertical = 12.dp),
36+
horizontalArrangement = Arrangement.spacedBy(30.dp)
37+
) {
38+
if (useV3) {
39+
Icon(icon, contentDescription = title)
40+
Text(text = title, style = MaterialTheme.typography.bodyLarge, modifier = Modifier.weight(1f))
41+
Switch(interactionSource = interactionSource, checked = enabled, onCheckedChange = {
42+
onToggled(!enabled)
43+
})
44+
} else {
45+
androidx.compose.material.Icon(icon, contentDescription = title)
46+
androidx.compose.material.Text(text = title, style = MaterialTheme.typography.bodyLarge, modifier = Modifier.weight(1f))
47+
androidx.compose.material.Switch(interactionSource = interactionSource, checked = enabled, onCheckedChange = {
48+
onToggled(!enabled)
49+
})
50+
}
51+
}
52+
}
Collapse file

‎…epenz/aboutlibraries/sample/TopAppBar.kt‎ ‎…libraries/sample/components/TopAppBar.kt‎sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/TopAppBar.kt renamed to sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/components/TopAppBar.kt sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/TopAppBar.kt renamed to sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/components/TopAppBar.kt

Copy file name to clipboardExpand all lines: sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/components/TopAppBar.kt
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mikepenz.aboutlibraries.sample
1+
package com.mikepenz.aboutlibraries.sample.components
22

33
import androidx.compose.foundation.layout.WindowInsets
44
import androidx.compose.foundation.layout.WindowInsetsSides
@@ -17,20 +17,20 @@ import androidx.compose.runtime.Composable
1717
import androidx.compose.ui.Modifier
1818
import androidx.compose.ui.platform.LocalUriHandler
1919
import androidx.compose.ui.unit.dp
20-
import com.mikepenz.markdown.sample.icon.Github
20+
import com.mikepenz.aboutlibraries.sample.icon.Github
2121

2222
@OptIn(ExperimentalMaterial3Api::class)
2323
@Composable
2424
internal fun TopAppBar(
2525
useDarkTheme: Boolean,
2626
onThemeToggle: (Boolean) -> Unit,
27-
isV3: Boolean,
27+
useV3: Boolean,
2828
onV3Toggle: (Boolean) -> Unit,
2929
onSettingsClick: () -> Unit,
3030
) {
3131
val uriHandler = LocalUriHandler.current
3232

33-
if (isV3) {
33+
if (useV3) {
3434
TopAppBar(
3535
title = { Text("AboutLibraries Compose Sample", maxLines = 1) },
3636
actions = {
@@ -40,7 +40,7 @@ internal fun TopAppBar(
4040
modifier = Modifier.padding(end = 16.dp)
4141
)
4242
Switch(
43-
checked = isV3,
43+
checked = useV3,
4444
onCheckedChange = onV3Toggle,
4545
modifier = Modifier.padding(end = 16.dp)
4646
)
@@ -73,7 +73,7 @@ internal fun TopAppBar(
7373
modifier = Modifier.padding(end = 16.dp)
7474
)
7575
androidx.compose.material.Switch(
76-
checked = isV3,
76+
checked = useV3,
7777
onCheckedChange = onV3Toggle,
7878
modifier = Modifier.padding(end = 16.dp)
7979
)
Collapse file

‎sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/icon/Debug.kt‎

Copy file name to clipboardExpand all lines: sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/icon/Debug.kt
-112Lines changed: 0 additions & 112 deletions
This file was deleted.
Collapse file

‎sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/icon/Github.kt‎

Copy file name to clipboardExpand all lines: sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/icon/Github.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mikepenz.markdown.sample.icon
1+
package com.mikepenz.aboutlibraries.sample.icon
22

33
import androidx.compose.ui.graphics.Color
44
import androidx.compose.ui.graphics.PathFillType
Collapse file

‎sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/icon/OpenSourceInitiative.kt‎

Copy file name to clipboardExpand all lines: sample/shared/src/commonMain/kotlin/com/mikepenz/aboutlibraries/sample/icon/OpenSourceInitiative.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mikepenz.markdown.sample.icon
1+
package com.mikepenz.aboutlibraries.sample.icon
22

33
import androidx.compose.ui.graphics.Color
44
import androidx.compose.ui.graphics.PathFillType
Collapse file

‎…/mikepenz/markdown/MainViewController.kt‎ ‎…enz/aboutlibraries/MainViewController.kt‎sample/shared/src/iosMain/kotlin/com/mikepenz/markdown/MainViewController.kt renamed to sample/shared/src/iosMain/kotlin/com/mikepenz/aboutlibraries/MainViewController.kt sample/shared/src/iosMain/kotlin/com/mikepenz/markdown/MainViewController.kt renamed to sample/shared/src/iosMain/kotlin/com/mikepenz/aboutlibraries/MainViewController.kt

Copy file name to clipboardExpand all lines: sample/shared/src/iosMain/kotlin/com/mikepenz/aboutlibraries/MainViewController.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mikepenz.markdown
1+
package com.mikepenz.aboutlibraries
22

33
import androidx.compose.runtime.getValue
44
import androidx.compose.ui.window.ComposeUIViewController

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.