Merge pull request #387 from cyb3rko/android-15-updates

Support Android 15
This commit is contained in:
Jannis Mattheis
2024-12-03 20:57:50 +01:00
committed by GitHub
16 changed files with 35 additions and 33 deletions

View File

@@ -1,2 +1,3 @@
[*.{kt,kts}]
ktlint_code_style = android_studio
ktlint_code_style = android_studio
ktlint_standard_function-expression-body = disabled

View File

@@ -5,16 +5,16 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id("com.android.application")
id("kotlin-android")
id("org.jmailen.kotlinter") version "4.3.0"
id("org.jmailen.kotlinter") version "4.4.1"
}
android {
namespace = "com.github.gotify"
compileSdk = 34
compileSdk = 35
defaultConfig {
applicationId = "com.github.gotify"
minSdk = 23
targetSdk = 34
targetSdk = 35
versionCode = 32
versionName = "2.8.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -75,7 +75,7 @@ if (project.hasProperty("sign")) {
}
dependencies {
val coilVersion = "2.6.0"
val coilVersion = "2.7.0"
val markwonVersion = "4.6.2"
val tinylogVersion = "2.7.0"
implementation(project(":client"))
@@ -87,7 +87,7 @@ dependencies {
implementation("androidx.vectordrawable:vectordrawable:1.2.0")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("com.github.cyb3rko:QuickPermissions-Kotlin:1.1.3")
implementation("com.github.cyb3rko:QuickPermissions-Kotlin:1.1.5")
implementation("io.coil-kt:coil:$coilVersion")
implementation("io.coil-kt:coil-svg:$coilVersion")
implementation("io.noties.markwon:core:$markwonVersion")

View File

@@ -9,7 +9,8 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<application
@@ -27,7 +28,6 @@
<activity
android:name=".init.InitializationActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/AppTheme.SplashScreen"
android:windowSoftInputMode="adjustResize">
<intent-filter>
@@ -40,7 +40,6 @@
android:name=".messages.MessagesActivity"
android:exported="false"
android:launchMode="singleTask"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".login.LoginActivity"

View File

@@ -394,9 +394,8 @@ internal class MessagesActivity :
}
}
private inner class SwipeToDeleteCallback(
private val adapter: ListMessageAdapter
) : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT) {
private inner class SwipeToDeleteCallback(private val adapter: ListMessageAdapter) :
ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT) {
private var icon: Drawable?
private val background: ColorDrawable

View File

@@ -4,9 +4,8 @@ import android.app.Activity
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
internal class MessagesModelFactory(
var modelParameterActivity: Activity
) : ViewModelProvider.Factory {
internal class MessagesModelFactory(var modelParameterActivity: Activity) :
ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
if (modelClass == MessagesModel::class.java) {
@Suppress("UNCHECKED_CAST")

View File

@@ -2,8 +2,4 @@ package com.github.gotify.messages.provider
import com.github.gotify.client.model.Message
internal class MessageDeletion(
val message: Message,
val allPosition: Int,
val appPosition: Int
)
internal class MessageDeletion(val message: Message, val allPosition: Int, val appPosition: Int)

View File

@@ -2,7 +2,4 @@ package com.github.gotify.messages.provider
import com.github.gotify.client.model.Message
internal data class MessageWithImage(
val message: Message,
val image: String?
)
internal data class MessageWithImage(val message: Message, val image: String?)

View File

@@ -23,7 +23,9 @@ import com.github.gotify.Utils
import com.github.gotify.databinding.SettingsActivityBinding
import com.google.android.material.dialog.MaterialAlertDialogBuilder
internal class SettingsActivity : AppCompatActivity(), OnSharedPreferenceChangeListener {
internal class SettingsActivity :
AppCompatActivity(),
OnSharedPreferenceChangeListener {
private lateinit var binding: SettingsActivityBinding
override fun onCreate(savedInstanceState: Bundle?) {

View File

@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
android:fillViewport="true"
android:fitsSystemWindows="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@@ -180,7 +181,6 @@
<ImageButton
android:id="@+id/advanced_settings"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="@string/check_url"
@@ -188,6 +188,7 @@
android:background="@null"
app:layout_constraintEnd_toEndOf="@+id/gotify_url"
app:layout_constraintTop_toTopOf="@+id/checkurl"
app:layout_constraintBottom_toBottomOf="@id/checkurl"
app:srcCompat="@drawable/ic_settings" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View File

@@ -5,6 +5,7 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.coordinatorlayout.widget.CoordinatorLayout
@@ -91,6 +92,7 @@
android:layout_height="match_parent"
android:layout_gravity="start"
android:theme="@style/AppTheme.Nav"
android:fitsSystemWindows="false"
app:headerLayout="@layout/nav_header_drawer"
app:menu="@menu/messages_menu" />

View File

@@ -3,7 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -3,8 +3,8 @@ import java.io.File
import java.net.URI
plugins {
id("com.android.application") version "8.5.0" apply false
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
id("com.android.application") version "8.7.1" apply false
id("org.jetbrains.kotlin.android") version "2.0.20" apply false
id("org.hidetake.swagger.generator") version "2.19.2"
}

Binary file not shown.

View File

@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

5
gradlew vendored
View File

@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

2
gradlew.bat vendored
View File

@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################