Skip to content

Commit

Permalink
Upgrade sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Schubert committed Sep 10, 2023
1 parent e7ae2c7 commit 80820fd
Show file tree
Hide file tree
Showing 21 changed files with 330 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: [SimonSchubert]
github: [ SimonSchubert ]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
name: jar
path: cli/out/linuxcommandlibrary.jar

release:
name: Release APK and JAR
needs: apk
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

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

The app currently has **5055** 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.
The app currently has **5055** 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.

[![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)
[![F-Droid](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/fdroid_badge.png)](https://f-droid.org/en/packages/com.inspiredandroid.linuxcommandbibliotheca/)
Expand Down Expand Up @@ -30,27 +32,37 @@ Execute `gradle :cli:buildJar` to create jar file for Linux, Windows and Mac.

#### Categories

One-liners, System information, System control, Users & Groups, Files & Folders, Input, Printing, JSON, Network, Search & Find, GIT, SSH, Video & Audio, Package manager, Hacking tools, Terminal games, Crypto currencies, VIM Texteditor, Emacs Texteditor, Nano Texteditor, Pico Texteditor, Micro Texteditor
One-liners, System information, System control, Users & Groups, Files & Folders, Input, Printing,
JSON, Network, Search & Find, GIT, SSH, Video & Audio, Package manager, Hacking tools, Terminal
games, Crypto currencies, VIM Texteditor, Emacs Texteditor, Nano Texteditor, Pico Texteditor, Micro
Texteditor

#### Tips

Clear and reset the terminal, List of recent commands, Close a frozen window/application, Tab Completion, Temporary aliases, Permanent aliases, Chain commands, Command syntax, Cursor navigation, Redirection, Special characters in commands, View file permissions, Modify file permissions, Set file permissions via binary references
Clear and reset the terminal, List of recent commands, Close a frozen window/application, Tab
Completion, Temporary aliases, Permanent aliases, Chain commands, Command syntax, Cursor navigation,
Redirection, Special characters in commands, View file permissions, Modify file permissions, Set
file permissions via binary references

### CI/CD

[Github Action](.github/workflows/android.yml) to automatically create a new Github release with APK and JAR and upload an AAB to the Play Store.
[Github Action](.github/workflows/android.yml) to automatically create a new Github release with APK
and JAR and upload an AAB to the Play Store.

### Tests

Android Jetpack Compose screen tests: [ComposeTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeTests.kt)
Android Jetpack Compose screen
tests: [ComposeTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeTests.kt)

Android Jetpack Compose deeplinking tests: [ComposeDeeplinkTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeDeeplinkTests.kt)
Android Jetpack Compose deeplinking
tests: [ComposeDeeplinkTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeDeeplinkTests.kt)

Common code unit tests: [CommonTests.kt](common/src/commonTest/kotlin/CommonTests.kt)

### Licensing

The source code is licensed under the Apache 2.0 license and the copyright of the man pages in the `database.db` file are copyrighted by their respective authors.
The source code is licensed under the Apache 2.0 license and the copyright of the man pages in
the `database.db` file are copyrighted by their respective authors.

### Thanks to

Expand Down
37 changes: 20 additions & 17 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ repositories {
dependencies {
implementation(project(":common"))
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.compose.material:material:1.4.3")
implementation("androidx.navigation:navigation-compose:2.6.0")
implementation("com.google.accompanist:accompanist-appcompat-theme:0.30.1")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.30.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
implementation("androidx.preference:preference:1.2.0")
implementation("androidx.compose.ui:ui-tooling-preview:1.4.3")
implementation("androidx.compose.material:material:1.5.1")
implementation("androidx.navigation:navigation-compose:2.7.2")
implementation("com.google.accompanist:accompanist-appcompat-theme:0.32.0")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.32.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
implementation("androidx.preference:preference:1.2.1")
implementation("androidx.compose.ui:ui-tooling-preview:1.5.1")

implementation("io.insert-koin:koin-core:3.4.2")
implementation("io.insert-koin:koin-android:3.4.2")
implementation("io.insert-koin:koin-androidx-compose:3.4.5")
implementation("androidx.compose.foundation:foundation:1.4.3")
implementation("io.insert-koin:koin-core:3.4.3")
implementation("io.insert-koin:koin-android:3.4.3")
implementation("io.insert-koin:koin-androidx-compose:3.4.6")
implementation("androidx.compose.foundation:foundation:1.5.1")

androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.4.3")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.4.3")
debugImplementation("androidx.compose.ui:ui-tooling:1.4.3")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.1")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.1")
debugImplementation("androidx.compose.ui:ui-tooling:1.5.1")
}

android {
Expand All @@ -37,15 +37,18 @@ android {
applicationId = "com.inspiredandroid.linuxcommandbibliotheca"
minSdk = 24
targetSdk = 34
versionCode = 82
versionCode = 83
versionName = project.version.toString()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
getByName("debug") {
isMinifyEnabled = false
Expand All @@ -59,7 +62,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.8"
kotlinCompilerExtensionVersion = "1.5.3"
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ class ComposeScreenshots {

// Tips
composeTestRule.onNodeWithText("Tips").performClick()
composeTestRule.onNodeWithContentDescription("Scroll").performScrollToNode(hasText("$ [command] --help"))
composeTestRule.onNodeWithContentDescription("Scroll")
.performScrollToNode(hasText("$ [command] --help"))
composeTestRule.takeScreenshot("screen-2$prefix.png")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.linuxcommandlibrary.shared.databaseHelper
import com.linuxcommandlibrary.shared.initDatabase
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import org.junit.Before
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,118 +74,115 @@ class MainActivity : AppCompatActivity() {
LinuxApp()
}
}
}

@Composable
fun LinuxApp() {
val navController = rememberNavController()
val navBackStackEntry = navController.currentBackStackEntryAsState()
val searchTextValue = remember {
mutableStateOf(
TextFieldValue(text = "", selection = TextRange(0))
)
}
val onNavigate: (String) -> Unit = {
navController.navigate(it)
}

LinuxTheme {
Scaffold(
topBar = {
TopBar(navBackStackEntry,
searchTextValue,
preferenceManager,
onNavigateBack = {
navController.popBackStack()
})
},
bottomBar = {
BottomBar(navController)
}) { innerPadding ->
@Composable
fun LinuxApp() {
val navController = rememberNavController()
val navBackStackEntry = navController.currentBackStackEntryAsState()
val searchTextValue = remember {
mutableStateOf(
TextFieldValue(text = "", selection = TextRange(0))
)
}
val onNavigate: (String) -> Unit = {
navController.navigate(it)
}

NavHost(
navController,
startDestination = Screen.Basics.route,
Modifier.padding(innerPadding)
LinuxTheme {
Scaffold(
topBar = {
TopBar(navBackStackEntry,
searchTextValue,
onNavigateBack = {
navController.popBackStack()
})
},
bottomBar = {
BottomBar(navController)
}) { innerPadding ->

NavHost(
navController,
startDestination = Screen.Basics.route,
Modifier.padding(innerPadding)
) {

composable(
Screen.Basics.route,
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/basics" },
navDeepLink { uriPattern = "$deepLinkUri/basics.html" })
) {
BasicCategoriesScreen(onNavigate)
}
composable(
Screen.Commands.route,
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/" },
navDeepLink { uriPattern = "$deepLinkUri/index.html" })
) {
val viewModel = getViewModel<CommandListViewModel>()

composable(
Screen.Basics.route,
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/basics" },
navDeepLink { uriPattern = "$deepLinkUri/basics.html" })
) {
BasicCategoriesScreen(onNavigate)
}
composable(
Screen.Commands.route,
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/" },
navDeepLink { uriPattern = "$deepLinkUri/index.html" })
) {
val viewModel = getViewModel<CommandListViewModel>()

CommandListScreen(
searchTextValue.value.text,
viewModel,
onNavigate
CommandListScreen(
searchTextValue.value.text,
viewModel,
onNavigate
)
}
composable(
Screen.Tips.route,
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/tips" },
navDeepLink { uriPattern = "$deepLinkUri/tips.html" })
) {
TipsScreen(onNavigate)
}
composable(
"basicgroups?categoryId={categoryId}&categoryName={categoryName}",
arguments = listOf(
navArgument("categoryId") { defaultValue = "" },
navArgument("categoryName") {}),
deepLinks = listOf(
navDeepLink {
uriPattern = "$deepLinkUri/basic/{categoryName}.html"
},
navDeepLink { uriPattern = "$deepLinkUri/basic/{categoryName}" })
) { backStackEntry ->
val categoryId = backStackEntry.getCategoryId()
if (categoryId != null) {
val viewModel = getViewModel<BasicGroupsViewModel>(
parameters = { parametersOf(categoryId) }
)
}
composable(
Screen.Tips.route,
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/tips" },
navDeepLink { uriPattern = "$deepLinkUri/tips.html" })
) {
BasicGroupsScreen(onNavigate, viewModel)
} else {
// open tips screen on invalid deeplink parameters
TipsScreen(onNavigate)
}
composable(
"basicgroups?categoryId={categoryId}&categoryName={categoryName}",
arguments = listOf(
navArgument("categoryId") { defaultValue = "" },
navArgument("categoryName") {}),
deepLinks = listOf(
navDeepLink {
uriPattern = "$deepLinkUri/basic/{categoryName}.html"
},
navDeepLink { uriPattern = "$deepLinkUri/basic/{categoryName}" })
) { backStackEntry ->
val categoryId = backStackEntry.getCategoryId()
if (categoryId != null) {
val viewModel = getViewModel<BasicGroupsViewModel>(
parameters = { parametersOf(categoryId) }
)
BasicGroupsScreen(onNavigate, viewModel)
} else {
// open tips screen on invalid deeplink parameters
TipsScreen(onNavigate)
}
}
composable(
"command?commandId={commandId}&commandName={commandName}",
arguments = listOf(
navArgument("commandId") { defaultValue = "" },
navArgument("commandName") {}),
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/man/{commandName}.html" },
navDeepLink { uriPattern = "$deepLinkUri/man/{commandName}" })
) { backStackEntry ->
val commandId = backStackEntry.getCommandId()
if (commandId != null) {
val viewModel = getViewModel<CommandDetailViewModel>(
parameters = { parametersOf(commandId) }
)
CommandDetailScreen(onNavigate, viewModel)
} else {
// open tips screen on invalid deeplink parameters
TipsScreen(onNavigate)
}
}
composable(
"command?commandId={commandId}&commandName={commandName}",
arguments = listOf(
navArgument("commandId") { defaultValue = "" },
navArgument("commandName") {}),
deepLinks = listOf(
navDeepLink { uriPattern = "$deepLinkUri/man/{commandName}.html" },
navDeepLink { uriPattern = "$deepLinkUri/man/{commandName}" })
) { backStackEntry ->
val commandId = backStackEntry.getCommandId()
if (commandId != null) {
val viewModel = getViewModel<CommandDetailViewModel>(
parameters = { parametersOf(commandId) }
)
CommandDetailScreen(onNavigate, viewModel)
} else {
// open tips screen on invalid deeplink parameters
TipsScreen(onNavigate)
}
}
}
}
}


}

sealed class Screen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import com.inspiredandroid.linuxcommandbibliotheca.ui.screens.AppInfoDialog
import com.inspiredandroid.linuxcommandbibliotheca.ui.screens.BookmarkFeedbackDialog
import com.linuxcommandlibrary.shared.databaseHelper
import com.linuxcommandlibrary.shared.getHtmlFileName
import org.koin.java.KoinJavaComponent.inject

/* Copyright 2022 Simon Schubert
*
Expand All @@ -60,10 +61,13 @@ import com.linuxcommandlibrary.shared.getHtmlFileName
fun TopBar(
navBackStackEntry: State<NavBackStackEntry?>,
textFieldValue: MutableState<TextFieldValue>,
bookmarkManager: PreferenceUtil,
onNavigateBack: () -> Unit = {}
) {
val focusRequester = remember { FocusRequester() }
val bookmarkManager = remember {
val preferenceManager by inject<PreferenceUtil>(PreferenceUtil::class.java)
preferenceManager
}

val route = navBackStackEntry.value?.destination?.route
if (route == "commands") {
Expand Down
Loading

0 comments on commit 80820fd

Please sign in to comment.