diff --git a/app/build.gradle b/app/build.gradle
index cd1942a..e38e4be 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -9,8 +9,8 @@ android {
applicationId "jp.ddo.hotmist.unicodepad"
minSdkVersion 16
targetSdkVersion 30
- versionCode 49
- versionName "2.10.2"
+ versionCode 51
+ versionName "2.10.4"
}
compileOptions {
diff --git a/app/src/main/java/jp/ddo/hotmist/unicodepad/CharacterAdapter.kt b/app/src/main/java/jp/ddo/hotmist/unicodepad/CharacterAdapter.kt
index 7a10960..0c6d87f 100644
--- a/app/src/main/java/jp/ddo/hotmist/unicodepad/CharacterAdapter.kt
+++ b/app/src/main/java/jp/ddo/hotmist/unicodepad/CharacterAdapter.kt
@@ -184,8 +184,8 @@ internal class CharacterAdapter(private val activity: UnicodeActivity, private v
hl.isFocusable = true
hl.setOnClickListener { view ->
var j = 0
- while (j < str.length) {
- val code = str.codePointAt(j)
+ while (j < cs.length) {
+ val code = cs.codePointAt(j)
activity.adpPage.onItemClick(null, view, -1, code.toLong())
j += Character.charCount(code)
}
diff --git a/app/src/main/java/jp/ddo/hotmist/unicodepad/EmojiAdapter.kt b/app/src/main/java/jp/ddo/hotmist/unicodepad/EmojiAdapter.kt
index c063457..82c56fd 100644
--- a/app/src/main/java/jp/ddo/hotmist/unicodepad/EmojiAdapter.kt
+++ b/app/src/main/java/jp/ddo/hotmist/unicodepad/EmojiAdapter.kt
@@ -192,6 +192,11 @@ internal class EmojiAdapter(activity: Activity, pref: SharedPreferences, private
}
override fun getItem(i: Int): String {
- return getItemString(i).split(" ").joinToString("") { String(Character.toChars(it.toInt(16))) }
+ return getItemString(i).let {
+ if (it != "")
+ it.split(" ").joinToString("") { String(Character.toChars(it.toInt(16))) }
+ else
+ ""
+ }
}
}
\ No newline at end of file
diff --git a/app/src/main/java/jp/ddo/hotmist/unicodepad/FontChooser.kt b/app/src/main/java/jp/ddo/hotmist/unicodepad/FontChooser.kt
index 983e740..c0e5ed7 100644
--- a/app/src/main/java/jp/ddo/hotmist/unicodepad/FontChooser.kt
+++ b/app/src/main/java/jp/ddo/hotmist/unicodepad/FontChooser.kt
@@ -56,7 +56,7 @@ class FontChooser internal constructor(private val activity: Activity, private v
if (adapter.count < 3) adapter.add(activity.resources.getString(R.string.rem))
// Remove duplicated items
- for (i in fontPaths.indices) {
+ for (i in fontPaths.indices.reversed()) {
if (path != fontPaths[i]) continue
adapter.remove(adapter.getItem(i + 3))
fontPaths.removeAt(i)
diff --git a/app/src/main/java/jp/ddo/hotmist/unicodepad/PageAdapter.kt b/app/src/main/java/jp/ddo/hotmist/unicodepad/PageAdapter.kt
index 7761129..d334895 100644
--- a/app/src/main/java/jp/ddo/hotmist/unicodepad/PageAdapter.kt
+++ b/app/src/main/java/jp/ddo/hotmist/unicodepad/PageAdapter.kt
@@ -144,7 +144,7 @@ class PageAdapter(private val activity: UnicodeActivity, private val pref: Share
return view === `object`
}
- override fun onItemClick(parent: AdapterView<*>?, view: View, position: Int, id: Long) {
+ override fun onItemClick(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
if (parent == null || id != -1L) {
adapterRecent.add(id.toInt())
if (recpage != -1 && page != recpage) views[recpage]?.invalidateViews()
@@ -153,6 +153,9 @@ class PageAdapter(private val activity: UnicodeActivity, private val pref: Share
val end = edit.selectionEnd
if (start == -1) return
edit.editableText.replace(min(start, end), max(start, end), if (parent == null || id != -1L) String(Character.toChars(id.toInt())) else parent.adapter.getItem(position) as String)
+ dlg?.let {
+ if (it.isShowing) it.dismiss()
+ }
}
override fun onItemLongClick(parent: AdapterView<*>, view: View, position: Int, id: Long): Boolean {
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index a26782d..5a71740 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -409,7 +409,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad is licensed under the Apache License, Version2.0
https://github.com/Ryosuke839/UnicodePad
デフォルト (%s)
diff --git a/app/src/main/res/values-ka/strings.xml b/app/src/main/res/values-ka/strings.xml
index e7dbf10..246d01a 100644
--- a/app/src/main/res/values-ka/strings.xml
+++ b/app/src/main/res/values-ka/strings.xml
@@ -96,7 +96,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad არის ლიცენზირებული Apache License, ვერსია2.0-ით
https://github.com/Ryosuke839/UnicodePad
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 1e1b82b..260889a 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -401,7 +401,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad is licensed under the Apache License, Version2.0
https://github.com/Ryosuke839/UnicodePad
기본 (%s)
diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml
index 5fa683b..f2098fa 100644
--- a/app/src/main/res/values-sv/strings.xml
+++ b/app/src/main/res/values-sv/strings.xml
@@ -389,7 +389,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad är licensierad under Apache-licensen, version2.0
https://github.com/Ryosuke839/UnicodePad
Visa inte annonser
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 0899f62..1bb3133 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -412,7 +412,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad 使用 Apache 2.0 许可证
https://github.com/Ryosuke839/UnicodePad
不显示广告
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 2b872e0..08b763c 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -396,7 +396,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad is licensed under the Apache License, Version2.0
https://github.com/Ryosuke839/UnicodePad
預設值 (%s)
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7f468c1..2491bc6 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -458,7 +458,7 @@
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
- UnicodePad 2.10.2
+ UnicodePad 2.10.4
UnicodePad is licensed under the Apache License, Version2.0
https://github.com/Ryosuke839/UnicodePad
\ No newline at end of file