Skip to content

Commit a53f3eb

Browse files
Fix lint warnings
1 parent c11bfdf commit a53f3eb

File tree

16 files changed

+21
-42
lines changed

16 files changed

+21
-42
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ tasks.register("jacocoTestReport", JacocoReport) {
109109
}
110110

111111
def fileFilter = ["**/R.class", '**/R$*.class', "**/BuildConfig.*", "**/Manifest*.*", "**/*Test*.*", "android/**/*.*", "**/Icon.*"]
112-
def debugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter)
112+
def debugTree = fileTree(dir: "${layout.buildDirectory}/tmp/kotlin-classes/debug", excludes: fileFilter)
113113
def mainSrc = "${project.projectDir}/src/main/kotlin"
114114

115115
sourceDirectories.from = files([mainSrc])

app/src/main/kotlin/eu/fliegendewurst/triliumdroid/activity/SetupActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package eu.fliegendewurst.triliumdroid.activity
22

3-
import android.app.Activity
43
import android.app.UiModeManager
54
import android.content.Intent
65
import android.os.Build
@@ -136,7 +135,7 @@ class SetupActivity : AppCompatActivity() {
136135

137136
val exportLauncher =
138137
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
139-
if (result.resultCode != Activity.RESULT_OK) {
138+
if (result.resultCode != RESULT_OK) {
140139
return@registerForActivityResult
141140
}
142141
contentResolver.openOutputStream(

app/src/main/kotlin/eu/fliegendewurst/triliumdroid/sync/Sync.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ object Sync {
316316
)
317317
if (outstandingPullCount > 0) {
318318
callbackOutstanding(outstandingPullCount)
319-
runBlocking {
320-
sync(totalSynced, callbackOutstanding, callbackError, callbackDone)
321-
}
319+
sync(totalSynced, callbackOutstanding, callbackError, callbackDone)
322320
} else {
323321
callbackDone(Pair(totalSynced, totalPushed))
324322
}

app/src/main/kotlin/eu/fliegendewurst/triliumdroid/util/CookieJar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CookieJar : CookieJar {
1818
override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>) {
1919
val host = url.host
2020
val cookieStore =
21-
cookieStorage.computeIfAbsent(host, { return@computeIfAbsent mutableListOf() })
21+
cookieStorage.computeIfAbsent(host) { return@computeIfAbsent mutableListOf() }
2222
for (cookie in cookies) {
2323
Log.i(
2424
TAG,

app/src/main/kotlin/eu/fliegendewurst/triliumdroid/widget/NoteWidget.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import android.util.TypedValue
1818
import android.view.View
1919
import android.widget.RemoteViews
2020
import androidx.core.content.res.ResourcesCompat
21+
import androidx.core.graphics.createBitmap
2122
import eu.fliegendewurst.triliumdroid.R
2223
import eu.fliegendewurst.triliumdroid.activity.main.HistoryItem
2324
import eu.fliegendewurst.triliumdroid.activity.main.MainActivity
@@ -207,8 +208,7 @@ private suspend fun updateAppWidget(
207208
}
208209

209210
fun renderIcon(context: Context, width: Float, height: Float, icon: String): Bitmap {
210-
val myBitmap =
211-
Bitmap.createBitmap(width.roundToInt(), height.roundToInt(), Bitmap.Config.ARGB_8888)
211+
val myBitmap = createBitmap(width.roundToInt(), height.roundToInt())
212212
val myCanvas = Canvas(myBitmap)
213213
val paint = Paint()
214214
val typeface = ResourcesCompat.getFont(context, R.font.boxicons)
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
android:layout_width="wrap_content"
45
android:layout_height="wrap_content"
56
android:background="@drawable/border_attribute"
67
android:contentDescription="@string/attribute"
78
android:orientation="horizontal">
89

10+
<!-- "hardcoded" text is always replaced by dynamic values -->
11+
912
<TextView
1013
android:id="@+id/label_attribute_name"
1114
android:layout_width="wrap_content"
1215
android:layout_height="wrap_content"
1316
android:layout_marginStart="2dp"
1417
android:layout_marginEnd="2dp"
1518
android:labelFor="@id/label_attribute_value"
16-
android:text="Name" />
19+
android:text="Name"
20+
tools:ignore="HardcodedText" />
1721

1822
<EditText
1923
android:id="@+id/label_attribute_value"
2024
android:layout_width="wrap_content"
2125
android:layout_height="wrap_content"
2226
android:inputType="text"
2327
android:importantForAutofill="no"
24-
android:text="Value" />
25-
</LinearLayout>
28+
android:text="Value"
29+
tools:ignore="HardcodedText" />
30+
</LinearLayout>

app/src/main/res/layout/item_navigation_button.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
android:background="@color/primary"
2323
android:baselineAligned="false"
2424
android:clickable="true"
25+
android:focusable="true"
2526
android:elevation="2dp"
2627
android:orientation="horizontal"
2728
android:padding="@dimen/medium_margin">

app/src/main/res/values-es/strings.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/src/main/res/values-fr/strings.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/src/main/res/values-v21/styles.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<resources>
1+
<resources xmlns:tools="http://schemas.android.com/tools">
22
<string name="app_name">Trilium Notes</string>
33
<string name="server_placeholder" translatable="false">https://example.trilium.cc</string>
44
<string name="user_placeholder">Username</string>
@@ -148,9 +148,9 @@
148148
<string name="open_note">Open note</string>
149149
<string name="title_trust_sync_server_certificate">Trust sync server certificate?</string>
150150
<string name="snackbar_sync_start">Sync: starting…</string>
151-
<string name="snackbar_sync_progress">Sync: %1$d outstanding…</string>
151+
<string name="snackbar_sync_progress" tools:ignore="PluralsCandidate">Sync: %1$d outstanding…</string>
152152
<string name="snackbar_sync_error">Sync: error!</string>
153-
<string name="snackbar_sync_done">Sync: %1$d pulled, %2$d pushed</string>
153+
<string name="snackbar_sync_done" tools:ignore="PluralsCandidate">Sync: %1$d pulled, %2$d pushed</string>
154154
<string name="sidebar_tab_1">Notes</string>
155155
<string name="sidebar_tab_2">Special</string>
156156
<string name="title_dialog_delete_note">Delete note</string>

app/src/main/res/values/styles.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,7 @@
7070
<item name="android:paddingRight">@dimen/bigger_margin</item>
7171
</style>
7272

73-
<style name="Widget.TriliumDroid.AppWidget.Container" parent="android:Widget">
74-
<item name="android:id">@android:id/background</item>
75-
<item name="android:background">?android:attr/colorBackground</item>
76-
</style>
73+
<style name="Widget.TriliumDroid.AppWidget.Container" parent="android:Widget"></style>
7774

78-
<style name="Widget.TriliumDroid.AppWidget.InnerView" parent="android:Widget">
79-
<item name="android:background">?android:attr/colorPrimary</item>
80-
<item name="android:textColor">?android:attr/textColorPrimary</item>
81-
</style>
75+
<style name="Widget.TriliumDroid.AppWidget.InnerView" parent="android:Widget"></style>
8276
</resources>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:8.9.1'
8+
classpath 'com.android.tools.build:gradle:8.9.2'
99
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20'
1010

1111
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)