Skip to content

Commit

Permalink
* target to android 12 (sdk 31)
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Jun 4, 2022
1 parent a032508 commit 76022e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 29
compileSdk 31
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '1.8'
}
defaultConfig {
applicationId "com.todobom.opennotescanner"
minSdkVersion 21
targetSdkVersion 29
targetSdk 31
versionCode 36
versionName '1.0.36'
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_open_note_scanner"
android:screenOrientation="portrait"
android:exported="true"
android:theme="@style/FullscreenTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -46,6 +47,7 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_gallery"
android:screenOrientation="portrait"
android:exported="true"
android:theme="@style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class Utils(
}

@JvmStatic
fun isPackageInstalled(context: Context, packagename: String?): Boolean {
fun isPackageInstalled(context: Context, packagename: String): Boolean {
val pm = context.packageManager
var app_installed = false
app_installed = try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.todobom.opennotescanner.views

import android.app.Activity
import android.content.res.ColorStateList
import android.media.ExifInterface
import android.os.Bundle
Expand Down Expand Up @@ -62,29 +61,29 @@ class TagEditorFragment : DialogFragment() {
private fun loadTags() {
var exif: ExifInterface? = null
try {
exif = ExifInterface(filePath)
exif = ExifInterface(filePath!!)
} catch (e: IOException) {
e.printStackTrace()
}
val userComment = exif!!.getAttribute("UserComment")
for (i in 0..6) {
stdTagsState[i] = userComment.contains("<" + stdTags[i] + ">")
stdTagsState[i] = userComment!!.contains("<" + stdTags[i] + ">")
}
}

private fun saveTags() {
var exif: ExifInterface? = null
try {
exif = ExifInterface(filePath)
exif = ExifInterface(filePath!!)
} catch (e: IOException) {
e.printStackTrace()
}
var userComment = exif!!.getAttribute("UserComment")
for (i in 0..6) {
if (stdTagsState[i] && !userComment.contains("<" + stdTags[i] + ">")) {
if (stdTagsState[i] && !userComment!!.contains("<" + stdTags[i] + ">")) {
userComment += "<" + stdTags[i] + ">"
} else if (!stdTagsState[i] && userComment.contains("<" + stdTags[i] + ">")) {
userComment.replace("<" + stdTags[i] + ">".toRegex(), "")
} else if (!stdTagsState[i] && userComment!!.contains("<" + stdTags[i] + ">")) {
userComment!!.replace("<" + stdTags[i] + ">".toRegex(), "")
}
}
exif.setAttribute("UserComment", userComment)
Expand Down

0 comments on commit 76022e5

Please sign in to comment.