Skip to content

Commit 064d86d

Browse files
stefan-niedermannAndyScherzinger
authored andcommitted
chore(deps): AGP 8, Java 17, Kotlin 1.9.22, SSO 1.0.0
Signed-off-by: Stefan Niedermann <info@niedermann.it>
1 parent 7a8d837 commit 064d86d

File tree

17 files changed

+82
-73
lines changed

17 files changed

+82
-73
lines changed

.github/workflows/android.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v4.1.1
18+
- uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: '17'
22+
check-latest: true
23+
cache: 'gradle'
1824
- name: Validate Gradle Wrapper
1925
uses: gradle/wrapper-validation-action@v1
2026

@@ -24,26 +30,44 @@ jobs:
2430
steps:
2531
- name: Checkout
2632
uses: actions/checkout@v4.1.1
33+
- uses: actions/setup-java@v4
34+
with:
35+
distribution: 'temurin'
36+
java-version: '17'
37+
check-latest: true
38+
cache: 'gradle'
2739
- name: Lint
28-
run: bash ./gradlew lintDevDebug --stacktrace
40+
run: bash ./gradlew lintDevDebug --stacktrace --no-configuration-cache
2941

3042
test:
3143
name: Unit tests
3244
runs-on: ubuntu-latest
3345
steps:
3446
- name: Checkout
3547
uses: actions/checkout@v4.1.1
48+
- uses: actions/setup-java@v4
49+
with:
50+
distribution: 'temurin'
51+
java-version: '17'
52+
check-latest: true
53+
cache: 'gradle'
3654
- name: Unit tests
37-
run: bash ./gradlew test --stacktrace
55+
run: bash ./gradlew test --stacktrace --no-configuration-cache
3856

3957
apk:
4058
name: Generate APK
4159
runs-on: ubuntu-latest
4260
steps:
4361
- name: Checkout
4462
uses: actions/checkout@v4.1.1
63+
- uses: actions/setup-java@v4
64+
with:
65+
distribution: 'temurin'
66+
java-version: '17'
67+
check-latest: true
68+
cache: 'gradle'
4569
- name: Build debug APK
46-
run: bash ./gradlew assembleDev --stacktrace
70+
run: bash ./gradlew assembleDev --stacktrace --no-configuration-cache
4771
- name: Upload APK
4872
uses: actions/upload-artifact@v4
4973
with:

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838
- name: Set up JDK 17
3939
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
4040
with:
41-
distribution: "temurin"
42-
java-version: 17
41+
distribution: 'temurin'
42+
java-version: '17'
4343
- name: Assemble
4444
run: |
4545
mkdir -p "$HOME/.gradle"
4646
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
47-
./gradlew assembleDebug
47+
./gradlew assembleDebug --no-configuration-cache
4848
- name: Perform CodeQL Analysis
4949
uses: github/codeql-action/analyze@b374143c1149a9115d881581d29b8390bbcbb59c # v3.22.11

app/build.gradle

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ apply plugin: 'com.android.application'
22
apply plugin: 'org.jetbrains.kotlin.android'
33

44
android {
5-
compileSdkVersion 33
6-
7-
compileOptions {
8-
coreLibraryDesugaringEnabled true
9-
sourceCompatibility JavaVersion.VERSION_11
10-
targetCompatibility JavaVersion.VERSION_11
11-
}
5+
compileSdk 34
6+
namespace 'it.niedermann.owncloud.notes'
127

138
defaultConfig {
149
applicationId "it.niedermann.owncloud.notes"
15-
minSdkVersion 24
16-
targetSdkVersion 33
10+
minSdk 24
11+
targetSdk 34
1712
versionCode 40020000
1813
versionName "4.2.0 Alpha1"
1914
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -24,8 +19,19 @@ android {
2419
}
2520
}
2621

22+
compileOptions {
23+
coreLibraryDesugaringEnabled true
24+
sourceCompatibility JavaVersion.VERSION_17
25+
targetCompatibility JavaVersion.VERSION_17
26+
}
27+
28+
kotlinOptions {
29+
jvmTarget = '17'
30+
}
31+
2732
buildFeatures {
2833
viewBinding true
34+
buildConfig true
2935
}
3036

3137
buildTypes {
@@ -60,25 +66,25 @@ android {
6066
includeAndroidResources true
6167
}
6268
}
63-
lint {
69+
70+
lintOptions {
6471
abortOnError false
6572
disable 'MissingTranslation'
6673
}
67-
namespace 'it.niedermann.owncloud.notes'
6874
}
6975

7076
ext {
7177
glideVersion = '4.16.0'
72-
roomVersion = "2.5.1"
78+
roomVersion = "2.6.1"
7379
}
7480

7581
dependencies {
76-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
82+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
7783

7884
// Nextcloud SSO
79-
implementation 'com.github.nextcloud.android-common:ui:0.12.0'
80-
implementation 'com.github.nextcloud:Android-SingleSignOn:0.8.1'
81-
implementation 'com.github.stefan-niedermann:android-commons:0.2.9'
85+
implementation 'com.github.nextcloud.android-common:ui:0.13.0'
86+
implementation 'com.github.nextcloud:Android-SingleSignOn:1.0.0'
87+
implementation 'com.github.stefan-niedermann:android-commons:0.4.0'
8288
implementation "com.github.stefan-niedermann.nextcloud-commons:sso-glide:$commonsVersion"
8389
implementation "com.github.stefan-niedermann.nextcloud-commons:exception:$commonsVersion"
8490
implementation("com.github.stefan-niedermann.nextcloud-commons:markdown:$commonsVersion") {
@@ -91,16 +97,16 @@ dependencies {
9197

9298
// Android X
9399
implementation 'androidx.appcompat:appcompat:1.6.1'
94-
implementation 'androidx.core:core-ktx:1.10.1'
100+
implementation 'androidx.core:core-ktx:1.12.0'
95101
implementation 'androidx.core:core-splashscreen:1.0.1'
96-
implementation 'androidx.fragment:fragment:1.6.1'
97-
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
102+
implementation 'androidx.fragment:fragment:1.6.2'
103+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0'
98104
implementation 'androidx.preference:preference:1.2.1'
99105
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
100106
implementation 'androidx.recyclerview:recyclerview:1.3.2'
101107
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
102-
implementation 'androidx.work:work-runtime:2.8.1'
103-
implementation 'com.google.android.material:material:1.9.0'
108+
implementation 'androidx.work:work-runtime:2.9.0'
109+
implementation 'com.google.android.material:material:1.11.0'
104110

105111
// Database
106112
implementation "androidx.room:room-runtime:${roomVersion}"

app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected void onStart() {
2020
super.onStart();
2121

2222
final var typedValue = new TypedValue();
23-
getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
23+
getTheme().resolveAttribute(com.google.android.material.R.attr.colorAccent, typedValue, true);
2424
colorAccent = typedValue.data;
2525

2626
readBrandMainColorLiveData(this).observe(this, this::applyBrand);

app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public void onStart() {
2323

2424
final var context = requireContext();
2525
final var typedValue = new TypedValue();
26-
context.getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
26+
context.getTheme().resolveAttribute(com.google.android.material.R.attr.colorAccent, typedValue, true);
2727
colorAccent = typedValue.data;
28-
context.getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
28+
context.getTheme().resolveAttribute(com.google.android.material.R.attr.colorPrimary, typedValue, true);
2929
colorPrimary = typedValue.data;
3030

3131
@ColorInt final int color = BrandingUtil.readBrandMainColor(context);

app/src/main/java/it/niedermann/owncloud/notes/edit/BaseNoteFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
103103
if (accountId > 0) {
104104
/* Switch account if account id has been provided */
105105
this.localAccount = repo.getAccountById(accountId);
106-
SingleAccountHelper.setCurrentAccount(requireContext().getApplicationContext(), localAccount.getAccountName());
106+
SingleAccountHelper.commitCurrentAccount(requireContext().getApplicationContext(), localAccount.getAccountName());
107107
}
108108
isNew = false;
109109
note = originalNote = repo.getNoteById(id);

app/src/main/java/it/niedermann/owncloud/notes/edit/EditNoteActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected void onCreate(final Bundle savedInstanceState) {
7171

7272
try {
7373
if (SingleAccountHelper.getCurrentSingleSignOnAccount(this) == null) {
74-
throw new NoCurrentAccountSelectedException();
74+
throw new NoCurrentAccountSelectedException(this);
7575
}
7676
} catch (NextcloudFilesAppAccountNotFoundException | NoCurrentAccountSelectedException e) {
7777
Toast.makeText(this, R.string.no_account_configured_yet, Toast.LENGTH_LONG).show();

app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ public void onPrepareOptionsMenu(@NonNull Menu menu) {
117117

118118
searchMenuItem.collapseActionView();
119119

120-
final var searchEditFrame = searchView.findViewById(R.id
121-
.search_edit_frame);
120+
final var searchEditFrame = searchView.findViewById(androidx.appcompat.R.id.search_edit_frame);
122121

123122
searchEditFrame.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
124123
int oldVisibility = -1;

app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
8888
AccountImporter.onActivityResult(requestCode, resultCode, data, ImportAccountActivity.this, ssoAccount -> {
8989
runOnUiThread(() -> binding.progressCircular.setVisibility(View.VISIBLE));
9090

91-
SingleAccountHelper.setCurrentAccount(getApplicationContext(), ssoAccount.name);
91+
SingleAccountHelper.commitCurrentAccount(getApplicationContext(), ssoAccount.name);
9292
executor.submit(() -> {
9393
Log.i(TAG, "Added account: " + "name:" + ssoAccount.name + ", " + ssoAccount.url + ", userId" + ssoAccount.userId);
9494
try {
@@ -135,7 +135,7 @@ public void onError(@NonNull Throwable t) {
135135
} catch (Throwable t) {
136136
t.printStackTrace();
137137
ApiProvider.getInstance().invalidateAPICache(ssoAccount);
138-
SingleAccountHelper.setCurrentAccount(this, null);
138+
SingleAccountHelper.commitCurrentAccount(this, null);
139139
runOnUiThread(() -> {
140140
restoreCleanState();
141141
if (t instanceof NextcloudHttpRequestFailedException && ((NextcloudHttpRequestFailedException) t).getStatusCode() == HttpURLConnection.HTTP_UNAVAILABLE) {

app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public LiveData<Account> getCurrentAccount() {
121121
public void postCurrentAccount(@NonNull Account account) {
122122
state.set(KEY_CURRENT_ACCOUNT, account);
123123
BrandingUtil.saveBrandColor(getApplication(), account.getColor());
124-
SingleAccountHelper.setCurrentAccount(getApplication(), account.getAccountName());
124+
SingleAccountHelper.commitCurrentAccount(getApplication(), account.getAccountName());
125125

126126
final var currentAccount = this.currentAccount.getValue();
127127
// If only ETag or colors change, we must not reset the navigation

0 commit comments

Comments
 (0)