Skip to content

Commit 5d08f6c

Browse files
author
Simon Schubert
committed
Add see also chips
1 parent acc5f49 commit 5d08f6c

File tree

14 files changed

+101
-52
lines changed

14 files changed

+101
-52
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Icon](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandLibrary/master/art/web_hi_res_144.png)
44

5-
The app currently has **6513** manual pages, **22+** basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
5+
The app currently has **6622** manual pages, **22+** basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
66

77
[![Play Store](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/play_store_badge.png)](https://play.google.com/store/apps/details?id=com.inspiredandroid.linuxcommandbibliotheca)
88
[![F-Droid](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/fdroid_badge.png)](https://f-droid.org/en/packages/com.inspiredandroid.linuxcommandbibliotheca/)

android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939
applicationId = "com.inspiredandroid.linuxcommandbibliotheca"
4040
minSdk = 24
4141
targetSdk = 35
42-
versionCode = 95
42+
versionCode = 96
4343
versionName = project.version.toString()
4444
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4545
}

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/PreferenceUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ class PreferenceUtil(private val context: Context) {
4646
companion object {
4747
const val KEY_BOOKMARKS = "KEY_BOOKMARKS"
4848
const val KEY_DATABASE_VERSION = "DATABASE_VERSION"
49-
const val CURRENT_DATABASE_VERSION = 10
49+
const val CURRENT_DATABASE_VERSION = 11
5050
}
5151
}

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/ui/composables/HighlightedText.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import com.inspiredandroid.linuxcommandbibliotheca.ui.theme.LinuxTheme
2929
@Composable
3030
fun HighlightedText(text: String, pattern: String) {
3131
val highlightColor = MaterialTheme.colors.primary
32-
val annotatedString = remember(pattern, highlightColor) {
32+
val annotatedString = remember(pattern) {
3333
buildAnnotatedString {
3434
val splitText = text.split(pattern, ignoreCase = true)
3535
splitText.forEachIndexed { index, s ->

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/ui/screens/AppInfoDialog.kt

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package com.inspiredandroid.linuxcommandbibliotheca.ui.screens
22

3+
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.clickable
35
import androidx.compose.foundation.layout.Column
46
import androidx.compose.foundation.layout.Row
57
import androidx.compose.foundation.layout.fillMaxSize
8+
import androidx.compose.foundation.layout.fillMaxWidth
69
import androidx.compose.foundation.layout.padding
710
import androidx.compose.foundation.layout.size
811
import androidx.compose.foundation.rememberScrollState
@@ -64,9 +67,13 @@ fun AppInfoDialog(showDialog: MutableState<Boolean>) {
6467
modifier = Modifier.padding(8.dp),
6568
)
6669
Row {
67-
Button(content = { Text("Rate the app") }, onClick = {
68-
uriHandler.openUri("https://play.google.com/store/apps/details?id=com.inspiredandroid.linuxcommandbibliotheca")
69-
}, modifier = Modifier.padding(start = 6.dp))
70+
Button(
71+
modifier = Modifier.padding(start = 6.dp),
72+
content = { Text("Rate the app") },
73+
onClick = {
74+
uriHandler.openUri("https://play.google.com/store/apps/details?id=com.inspiredandroid.linuxcommandbibliotheca")
75+
},
76+
)
7077
IconButton(onClick = {
7178
uriHandler.openUri("https://github.com/SimonSchubert/LinuxCommandLibrary")
7279
}) {
@@ -88,6 +95,18 @@ fun AppInfoDialog(showDialog: MutableState<Boolean>) {
8895
.weight(1f)
8996
.verticalScroll(rememberScrollState()),
9097
) {
98+
Image(
99+
modifier = Modifier
100+
.padding(bottom = 8.dp)
101+
.fillMaxWidth()
102+
.clickable {
103+
val link = "https://linuxcommandlibrary.com/linode-2025"
104+
uriHandler.openUri(link)
105+
},
106+
painter = painterResource(R.mipmap.linode_horizontal),
107+
contentDescription = null,
108+
)
109+
91110
Text("Man pages", style = MaterialTheme.typography.h6)
92111
Text("Licence information about the man page is usually specified in the man detail page under the category Author, Copyright or Licence. If there is no information on the page you can find the information in the man page source file on your linux system. If you have questions or can't find what you need, you can contact me at [email protected].")
93112

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/ui/screens/commandlist/CommandListScreen.kt

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
@file:OptIn(ExperimentalMaterialApi::class, ExperimentalMaterialApi::class)
1+
@file:OptIn(ExperimentalMaterialApi::class, ExperimentalMaterialApi::class,
2+
ExperimentalMaterialApi::class
3+
)
24

35
package com.inspiredandroid.linuxcommandbibliotheca.ui.screens.commandlist
46

@@ -21,6 +23,7 @@ import androidx.compose.ui.text.style.TextOverflow
2123
import androidx.compose.ui.tooling.preview.Preview
2224
import com.inspiredandroid.linuxcommandbibliotheca.R
2325
import com.inspiredandroid.linuxcommandbibliotheca.ui.composables.HighlightedText
26+
import databases.Command
2427
import org.koin.androidx.compose.koinViewModel
2528

2629
/* Copyright 2022 Simon Schubert
@@ -58,48 +61,69 @@ fun CommandListScreen(
5861
items = viewModel.filteredCommands,
5962
key = { it.id },
6063
) { command ->
61-
ListItem(
62-
text = {
63-
if (searchText.isEmpty()) {
64-
Text(
65-
command.name,
66-
maxLines = 1,
67-
softWrap = false,
68-
overflow = TextOverflow.Ellipsis,
69-
)
70-
} else {
71-
HighlightedText(command.name, searchText)
72-
}
73-
},
74-
trailing = {
75-
if (viewModel.hasBookmark(command.id)) {
76-
Icon(
77-
painterResource(R.drawable.ic_bookmark_black_24dp),
78-
contentDescription = stringResource(R.string.bookmarked),
79-
)
80-
}
81-
},
82-
secondaryText = {
83-
if (searchText.isEmpty()) {
84-
Text(
85-
command.description,
86-
maxLines = 1,
87-
softWrap = false,
88-
overflow = TextOverflow.Ellipsis,
89-
)
90-
} else {
91-
HighlightedText(command.description, searchText)
92-
}
93-
},
94-
modifier = Modifier.clickable {
95-
onNavigate("command?commandId=${command.id}&commandName=${command.name}")
96-
},
64+
CommandListItem(
65+
command = command,
66+
searchText = searchText,
67+
onNavigate = onNavigate,
68+
isBookmarked = { id -> viewModel.hasBookmark(id) },
9769
)
9870
}
9971
}
10072
}
10173
}
10274

75+
@Composable
76+
private fun CommandListItem(
77+
command: Command,
78+
searchText: String,
79+
onNavigate: (String) -> Unit,
80+
isBookmarked: (Long) -> Boolean,
81+
) {
82+
ListItem(
83+
text = {
84+
if (searchText.isEmpty()) {
85+
Text(
86+
command.name,
87+
maxLines = 1,
88+
softWrap = false,
89+
overflow = TextOverflow.Ellipsis,
90+
)
91+
} else {
92+
HighlightedText(
93+
text = command.name,
94+
pattern = searchText,
95+
)
96+
}
97+
},
98+
trailing = {
99+
if (isBookmarked(command.id)) {
100+
Icon(
101+
painterResource(R.drawable.ic_bookmark_black_24dp),
102+
contentDescription = stringResource(R.string.bookmarked),
103+
)
104+
}
105+
},
106+
secondaryText = {
107+
if (searchText.isEmpty()) {
108+
Text(
109+
command.description,
110+
maxLines = 1,
111+
softWrap = false,
112+
overflow = TextOverflow.Ellipsis,
113+
)
114+
} else {
115+
HighlightedText(
116+
text = command.description,
117+
pattern = searchText,
118+
)
119+
}
120+
},
121+
modifier = Modifier.clickable {
122+
onNavigate("command?commandId=${command.id}&commandName=${command.name}")
123+
},
124+
)
125+
}
126+
103127
@Preview
104128
@Composable
105129
fun CommandListScreenPreview() {
Binary file not shown.

assets/database.db

0 Bytes
Binary file not shown.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ buildscript {
2020
}
2121

2222
group = "com.inspiredandroid"
23-
version = "3.3.1"
23+
version = "3.3.2"
2424

2525
allprojects {
2626
repositories {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=3.3.1
1+
version=3.3.2

0 commit comments

Comments
 (0)