Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 28 additions & 24 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// SPDX-License-Identifier: MIT
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

buildscript {
ext.kotlin_version = '1.8.20'
ext.nav_version = '2.9.7'
ext.kotlin_version = '2.2.20'
ext.nav_version = '2.9.8'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.6.0'
classpath 'com.android.tools.build:gradle:8.13.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -16,7 +18,7 @@ allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url = "https://jitpack.io" }
}
}

Expand All @@ -26,9 +28,9 @@ apply plugin: 'kotlin-android'
android {
defaultConfig {
applicationId "ru.nsu.bobrofon.easysshfs"
compileSdk 35
compileSdk = 36
minSdkVersion 21
targetSdkVersion 35
targetSdkVersion 36
versionCode 104
versionName "0.5.19-dev"

Expand All @@ -45,12 +47,12 @@ android {
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
shrinkResources = true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig = signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
externalNativeBuild {
Expand All @@ -59,39 +61,41 @@ android {
}
}
buildFeatures {
viewBinding true
buildConfig true
viewBinding = true
buildConfig = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
}
}
namespace 'ru.nsu.bobrofon.easysshfs'
namespace = 'ru.nsu.bobrofon.easysshfs'
packagingOptions {
jniLibs {
useLegacyPackaging true
useLegacyPackaging = true
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.datastore:datastore-preferences:1.0.0"
implementation "androidx.datastore:datastore-preferences:1.1.7"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
implementation "androidx.fragment:fragment-ktx:1.6.0"
implementation "androidx.core:core-ktx:1.10.1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4'
implementation "androidx.fragment:fragment-ktx:1.8.9"
implementation "androidx.core:core-ktx:1.17.0"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

def libsuVersion = '3.2.1'
def libsuVersion = '6.0.0'
// The core module is used by all other components
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
// Optional: APIs for creating root services
Expand Down
2 changes: 1 addition & 1 deletion app/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 27 additions & 0 deletions app/src/main/java/ru/nsu/bobrofon/easysshfs/EasySSHFSActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.widget.Toolbar
import androidx.core.content.ContextCompat
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.NavHostFragment
Expand Down Expand Up @@ -70,6 +73,7 @@ class EasySSHFSActivity : AppCompatActivity() {
setSupportActionBar(toolbar)

val drawerLayout = findViewById<DrawerLayout>(R.id.drawer_layout)
setupDrawerBackHandling(drawerLayout)
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.mountpointFragment,
Expand Down Expand Up @@ -103,6 +107,29 @@ class EasySSHFSActivity : AppCompatActivity() {
}
}

private fun setupDrawerBackHandling(drawerLayout: DrawerLayout) {
val closeDrawerCallback = object : OnBackPressedCallback(false) {
override fun handleOnBackPressed() {
drawerLayout.closeDrawer(GravityCompat.START)
}
}
onBackPressedDispatcher.addCallback(this, closeDrawerCallback)

drawerLayout.addDrawerListener(object : DrawerLayout.SimpleDrawerListener() {
override fun onDrawerOpened(drawerView: View) {
closeDrawerCallback.isEnabled = true
}

override fun onDrawerClosed(drawerView: View) {
closeDrawerCallback.isEnabled = false
}
})
// The drawer may be restored in the open state (e.g. after a configuration change).
drawerLayout.post {
closeDrawerCallback.isEnabled = drawerLayout.isDrawerOpen(GravityCompat.START)
}
}

private fun updateThemeMode(mode: ThemeMode) {
Log.i(TAG, "change app theme mode to '$mode'")

Expand Down
Loading