File tree Expand file tree Collapse file tree
src/main/kotlin/com/theapache64/stackzy/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ import androidx.compose.material.MaterialTheme
77import androidx.compose.material.Text
88import androidx.compose.ui.Alignment
99import androidx.compose.ui.Modifier
10+ import androidx.compose.ui.input.key.Key
11+ import androidx.compose.ui.input.key.KeyEventType
12+ import androidx.compose.ui.input.key.key
13+ import androidx.compose.ui.input.key.type
1014import androidx.compose.ui.res.painterResource
1115import androidx.compose.ui.unit.dp
1216import androidx.compose.ui.window.Window
@@ -70,6 +74,14 @@ class MainActivity : Activity() {
7074 width = (screenSize.width * 0.9 ).dp,
7175 height = (screenSize.height * 0.8 ).dp
7276 ),
77+ onKeyEvent = {
78+ if (it.type == KeyEventType .KeyUp && it.key.keyCode == Key .Escape .keyCode) {
79+ root.onEscapePressed()
80+ true
81+ } else {
82+ false
83+ }
84+ }
7385 ) {
7486
7587 if (OsCheck .operatingSystemType == OSType .MacOS ) {
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ import com.theapache64.stackzy.ui.common.Selectable
2424import com.theapache64.stackzy.ui.common.loading.LoadingAnimation
2525import com.theapache64.stackzy.util.R
2626
27-
2827@Composable
2928fun LibraryListScreen (
3029 viewModel : LibraryListViewModel ,
@@ -87,7 +86,7 @@ fun LibraryListScreen(
8786
8887 if (libraries.isNotEmpty()) {
8988 LazyVerticalGrid (
90- cells = GridCells .Fixed (4 )
89+ cells = GridCells .Fixed (4 ),
9190 ) {
9291 items(libraries) { library ->
9392 Column {
Original file line number Diff line number Diff line change @@ -138,6 +138,11 @@ class NavHostComponent(
138138 router.push(Config .LibraryDetail (libraryWrapper))
139139 }
140140
141+ fun onEscapePressed () {
142+ if (router.state.value.backStack.isNotEmpty()) {
143+ router.pop()
144+ }
145+ }
141146
142147 @OptIn(ExperimentalDecomposeApi ::class )
143148 @Composable
@@ -244,6 +249,11 @@ class NavHostComponent(
244249 androidApp = androidAppWrapper
245250 )
246251 )*/
252+
253+ // Temp
254+ val playStoreUrl =
255+ URI (" https://play.google.com/store/apps/details?id=${androidAppWrapper.androidApp.appPackage.name} " )
256+ Desktop .getDesktop().browse(playStoreUrl)
247257 }
248258
249259 /* *
You canβt perform that action at this time.
0 commit comments