Skip to content

Commit

Permalink
Merge branch 'paste_shortcut' into paste_shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryosuke839 authored Sep 17, 2022
2 parents d2c32ca + cfa4eea commit 9ce7c38
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 84 deletions.
29 changes: 19 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
compileSdkVersion 32

defaultConfig {
applicationId "jp.ddo.hotmist.unicodepad"
minSdkVersion 16
targetSdkVersion 30
versionCode 51
versionName "2.10.4"
targetSdkVersion 32
versionCode 52
versionName "2.11.0"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

buildTypes {
release {
shrinkResources true
Expand All @@ -28,6 +36,7 @@ android {
lintOptions {
disable "ResourceType"
disable 'GoogleAppIndexingWarning'
disable 'NullSafeMutableLiveData'
}

flavorDimensions "distribution"
Expand All @@ -45,15 +54,15 @@ android {
}

dependencies {
implementation "androidx.core:core-ktx:1.6.0"
implementation "androidx.core:core-ktx:$kotlin_version"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.emoji:emoji-appcompat:1.1.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.emoji2:emoji2:1.2.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'com.mobeta.android.dslv:library:0.9.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

playImplementation 'com.google.android.gms:play-services-ads-lite:20.3.0'
playImplementation 'com.google.android.gms:play-services-ads-lite:20.6.0'
}
repositories {
mavenCentral()
Expand Down
14 changes: 12 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="jp.ddo.hotmist.unicodepad"
android:installLocation="auto">

Expand Down Expand Up @@ -65,9 +66,9 @@

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<intent-filter android:icon="@mipmap/ic_launcher">
<action android:name="android.intent.action.PROCESS_TEXT" />
<category android:name="android.intent.category.DEFAULTT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
Expand All @@ -79,5 +80,14 @@
<activity android:name="TabsActivity" />

<activity android:name="RestartActivity" />

<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data android:name="androidx.emoji2.text.EmojiCompatInitializer"
tools:node="remove" />
</provider>
</application>
</manifest>
Binary file modified app/src/main/assets/namedb.zip
Binary file not shown.
16 changes: 7 additions & 9 deletions app/src/main/java/jp/ddo/hotmist/unicodepad/CharacterView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import android.text.Spannable
import android.util.AttributeSet
import android.view.View
import androidx.core.graphics.ColorUtils
import androidx.emoji.text.EmojiCompat
import androidx.emoji.text.EmojiSpan
import androidx.emoji2.text.EmojiCompat
import androidx.emoji2.text.EmojiSpan
import java.util.*
import kotlin.math.ceil
import kotlin.math.floor
Expand Down Expand Up @@ -59,13 +59,11 @@ class CharacterView @JvmOverloads constructor(context: Context, attrs: Attribute
span = null
try {
val emojiCompat = EmojiCompat.get()
if (emojiCompat != null) {
val spanned = emojiCompat.process(str)
if (spanned is Spannable) {
val spans = spanned.getSpans(0, str.length, EmojiSpan::class.java)
if (spans.isNotEmpty()) {
span = spans[0]
}
val spanned = emojiCompat.process(str)
if (spanned is Spannable) {
val spans = spanned.getSpans(0, str.length, EmojiSpan::class.java)
if (spans.isNotEmpty()) {
span = spans[0]
}
}
} catch (e: IllegalStateException) {
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/jp/ddo/hotmist/unicodepad/ListAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ internal class ListAdapter(activity: Activity, pref: SharedPreferences, db: Name
if (univer >= 1100) add(0x10D00, 0x10D3F)
add(0x10E60, 0x10E7F)
if (univer >= 1300) add(0x10E80, 0x10EBF)
if (univer >= 1500) add(0x10EC0, 0x10EFF)
if (univer >= 1100) {
add(0x10F00, 0x10F2F)
add(0x10F30, 0x10F6F)
Expand Down Expand Up @@ -376,13 +377,15 @@ internal class ListAdapter(activity: Activity, pref: SharedPreferences, db: Name
if (univer >= 1000) add(0x11A50, 0x11AAF)
if (univer >= 1400) add(0x11AB0, 0x11ABF)
if (univer >= 700) add(0x11AC0, 0x11AFF)
if (univer >= 1500) add(0x11B00, 0x11B5F)
if (univer >= 900) add(0x11C00, 0x11C6F)
if (univer >= 900) add(0x11C70, 0x11CBF)
if (univer >= 1000) add(0x11D00, 0x11D5F)
if (univer >= 1100) {
add(0x11D60, 0x11DAF)
add(0x11EE0, 0x11EFF)
}
if (univer >= 1500) add(0x11F00, 0x11F5F)
if (univer >= 1300) add(0x11FB0, 0x11FBF)
if (univer >= 1200) add(0x11FC0, 0x11FFF)
}
Expand All @@ -391,7 +394,8 @@ internal class ListAdapter(activity: Activity, pref: SharedPreferences, db: Name
if (univer >= 800) add(0x12480, 0x1254F)
if (univer >= 1400) add(0x12F90, 0x12FFF)
add(0x13000, 0x1342F)
if (univer >= 1200) add(0x13430, 0x1343F)
if (univer >= 1500) add(0x13430, 0x1345F)
else if (univer >= 1200) add(0x13430, 0x1343F)
if (univer >= 800) add(0x14400, 0x1467F)
add(0x16800, 0x16A3F)
if (univer >= 700) {
Expand Down Expand Up @@ -423,16 +427,19 @@ internal class ListAdapter(activity: Activity, pref: SharedPreferences, db: Name
add(0x1D000, 0x1D0FF)
add(0x1D100, 0x1D1FF)
add(0x1D200, 0x1D24F)
if (univer >= 1500) add(0x1D2C0, 0x1D2DF)
if (univer >= 1100) add(0x1D2E0, 0x1D2FF)
add(0x1D300, 0x1D35F)
add(0x1D360, 0x1D37F)
add(0x1D400, 0x1D7FF)
if (univer >= 800) add(0x1D800, 0x1DAAF)
if (univer >= 1400) add(0x1DF00, 0x1DFFF)
if (univer >= 900) add(0x1E000, 0x1E02F)
if (univer >= 1500) add(0x1E030, 0x1E08F)
if (univer >= 1200) add(0x1E100, 0x1E14F)
if (univer >= 1400) add(0x1E290, 0x1E2BF)
if (univer >= 1200) add(0x1E2C0, 0x1E2FF)
if (univer >= 1500) add(0x1E4D0, 0x1E4FF)
if (univer >= 1400) add(0x1E7E0, 0x1E7FF)
if (univer >= 700) add(0x1E800, 0x1E8DF)
if (univer >= 900) add(0x1E900, 0x1E95F)
Expand Down Expand Up @@ -462,6 +469,7 @@ internal class ListAdapter(activity: Activity, pref: SharedPreferences, db: Name
if (univer >= 1000) add(0x2CEB0, 0x2EBEF)
add(0x2F800, 0x2FA1F)
if (univer >= 1300) add(0x30000, 0x3134F)
if (univer >= 1500) add(0x31350, 0x323AF)
add(0xE0000, 0xE007F)
add(0xE0100, 0xE01EF)
add(0xF0000, 0xFFFFF)
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/jp/ddo/hotmist/unicodepad/NameDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class NameDatabase(context: Context) {
if (code in 0x187F2..0x187F7) return 1200
if (code in 0x4DB6..0x4DBF || code in 0x9FF0..0x9FFC || code in 0x2A6D7..0x2A6DD || code in 0x30000..0x3134A) return 1300
if (code in 0x9FFD..0x9FFF || code in 0x2A6DE..0x2A6DF || code in 0x2B735..0x2B738) return 1400
if (code == 0x2B739 || code in 0x31350..0x323AF) return 1500
}
return getInt("name_table", code.toString(), column)
}
Expand Down Expand Up @@ -134,11 +135,11 @@ class NameDatabase(context: Context) {
}
db.rawQuery("SELECT COUNT(*) FROM 'name_table';", null).use { cur ->
cur.moveToFirst()
if (cur.getInt(0) != 34634) throw SQLiteException()
if (cur.getInt(0) != 34930) throw SQLiteException()
}
db.rawQuery("SELECT COUNT(*) FROM 'emoji_table';", null).use { cur ->
cur.moveToFirst()
if (cur.getInt(0) != 3624) throw SQLiteException()
if (cur.getInt(0) != 3655) throw SQLiteException()
}
} catch (e: SQLiteException) {
db.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.provider.FontRequest
import androidx.core.view.MenuItemCompat
import androidx.core.view.doOnLayout
import androidx.emoji.text.EmojiCompat
import androidx.emoji.text.EmojiCompat.InitCallback
import androidx.emoji.text.FontRequestEmojiCompatConfig
import androidx.emoji2.text.EmojiCompat
import androidx.emoji2.text.EmojiCompat.InitCallback
import androidx.emoji2.text.FontRequestEmojiCompatConfig
import androidx.preference.PreferenceManager
import androidx.viewpager.widget.ViewPager
import java.io.File
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/main_emojicompat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:layout_weight="1">

<androidx.emoji.widget.EmojiAppCompatEditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -40,7 +40,7 @@
android:maxLines="1">

<requestFocus />
</androidx.emoji.widget.EmojiAppCompatEditText>
</androidx.appcompat.widget.AppCompatEditText>

<ImageButton
android:id="@+id/clear"
Expand Down
17 changes: 11 additions & 6 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
<string name="script_10D00">10D00 ハニーフィー・ロヒンギャ文字</string>
<string name="script_10E60">10E60 ルーミー数字</string>
<string name="script_10E80">10E80 ヤズィーディー文字</string>
<string name="script_10EC0">10EC0 アラビア文字拡張C</string>
<string name="script_10F00">10F00 古代ソグド文字</string>
<string name="script_10F30">10F30 ソグド文字</string>
<string name="script_10F70">10F70 古ウイグル文字</string>
Expand Down Expand Up @@ -275,11 +276,13 @@
<string name="script_11A50">11A50 ソヨンボ文字</string>
<string name="script_11AB0">11AB0 統合カナダ先住民音節拡張A</string>
<string name="script_11AC0">11AC0 パウ・チン・ハウ表語文字</string>
<string name="script_11B00">11B00 デーヴァナーガリー文字拡張A</string>
<string name="script_11C00">11C00 バイクシュキー文字</string>
<string name="script_11C70">11C70 マルチェン文字</string>
<string name="script_11D00">11D00 マサラム・ゴーンディー文字</string>
<string name="script_11D60">11D60 グンジャラ・ゴーンディー文字</string>
<string name="script_11EE0">11EE0 マカサル文字</string>
<string name="script_11F00">11F00 カウィ文字</string>
<string name="script_11FB0">11FB0 リス文字補助</string>
<string name="script_11FC0">11FC0 タミル文字補助</string>
<string name="script_12000">12000 楔形文字</string>
Expand All @@ -291,6 +294,7 @@
<string name="script_14400">14400 アナトリア・ヒエログリフ</string>
<string name="script_16800">16800 バムン文字補助</string>
<string name="script_16A40">16A40 ムロ文字</string>
<string name="script_16A70">16A70 タンサ文字</string>
<string name="script_16AD0">16AD0 バサ文字</string>
<string name="script_16B00">16B00 パハウ・フモン文字</string>
<string name="script_16E40">16E40 メデファイドリン文字</string>
Expand All @@ -307,17 +311,21 @@
<string name="script_1B170">1B170 女書</string>
<string name="script_1BC00">1BC00 デュブロワエ式速記</string>
<string name="script_1BCA0">1BCA0 速記方式制御</string>
<string name="script_1CF00">1CF00 ズナメニ音符記号</string>
<string name="script_1D000">1D000 ビザンチン音楽記号</string>
<string name="script_1D100">1D100 音楽記号</string>
<string name="script_1D200">1D200 古代ギリシア音符記号</string>
<string name="script_1D2C0">1D2C0 カクトビク数字</string>
<string name="script_1D2E0">1D2E0 マヤ数字</string>
<string name="script_1D300">1D300 太玄経記号</string>
<string name="script_1D360">1D360 算木用数字</string>
<string name="script_1D400">1D400 数学用英数字記号</string>
<string name="script_1D800">1D800 サットン手話表記法</string>
<string name="script_1DF00">1DF00 ラテン文字拡張G</string>
<string name="script_1E000">1E000 グラゴル文字補助</string>
<string name="script_1E030">1E030 キリール文字拡張D</string>
<string name="script_1E100">1E100 ニアケン・プアチェ・フモン文字</string>
<string name="script_1E290">1E290 トト文字</string>
<string name="script_1E2C0">1E2C0 ワンチョー文字</string>
<string name="script_1E7E0">1E7E0 エチオピア文字拡張B</string>
<string name="script_1E800">1E800 メンデ文字</string>
Expand Down Expand Up @@ -348,6 +356,7 @@
<string name="script_2CEB0">2CEB0 CJK統合漢字拡張F</string>
<string name="script_2F800">2F800 CJK互換漢字補助</string>
<string name="script_30000">30000 CJK統合漢字拡張G</string>
<string name="script_31350">31350 CJK統合漢字拡張H</string>
<string name="script_E0000">E0000 タグ</string>
<string name="script_E0100">E0100 字形選択子補助</string>
<string name="script_F0000">F0000 私用領域補助A</string>
Expand All @@ -362,7 +371,7 @@

<string name="version_desc">Unicodeのバージョン</string>

<string name="version_latest">最新 (14.0.0)</string>
<string name="version_latest">最新 (15.0.0)</string>

<string name="emojicompat_desc">EmojiCompat を使用して絵文字を表示</string>
<string name="emojicompat_null">使用しない</string>
Expand Down Expand Up @@ -404,14 +413,10 @@
<string name="clear_desc">全削除ボタンを表示</string>
<string name="malformed">ZIP内のファイル名が破損</string>
<string name="legal">法的表記</string>
<string name="legal_uni">Unicode®</string>
<string name="legal_uni2">本アプリケーションはUnicode Data Fileの改変された版を含んでいます。
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.</string>
<string name="legal_app">UnicodePad 2.10.4</string>
<string name="legal_app2">UnicodePad is licensed under the Apache License, Version2.0
https://github.com/Ryosuke839/UnicodePad</string>
<string name="locale_default">デフォルト (%s)</string>
<string name="locale_other">その他…</string>
<string name="locale_title">ロケール</string>
Expand Down
8 changes: 2 additions & 6 deletions app/src/main/res/values-ka/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<string name="version_desc">Unicode-ის ვერსია</string>

<string name="version_latest">უახლესი (14.0.0)</string>
<string name="version_latest">უახლესი (15.0.0)</string>

<string name="emojicompat_desc">EmojiCompat-ის გამოყენება ემოჯების საჩვენებლად</string>
<string name="emojicompat_null">არასდროს</string>
Expand Down Expand Up @@ -91,12 +91,8 @@
<string name="clear_desc">ყოველთვის აჩვენე გასუფთავების ღილაკი</string>
<string name="malformed">ფაილის სახელი არასწორია zip-ში</string>
<string name="legal">იურიდიული</string>
<string name="legal_uni">Unicode®</string>
<string name="legal_uni2">ეს პროგრამა შეიცავს Unicode მონაცემთა ფაილის შეცვლილ ვერსიას.
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.</string>
<string name="legal_app">UnicodePad 2.10.4</string>
<string name="legal_app2">UnicodePad არის ლიცენზირებული Apache License, ვერსია2.0-ით
https://github.com/Ryosuke839/UnicodePad</string>
</resources>
8 changes: 2 additions & 6 deletions app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@

<string name="version_desc">Unicode 버전</string>

<string name="version_latest">최근 (14.0.0)</string>
<string name="version_latest">최근 (15.0.0)</string>

<string name="emojicompat_desc">EmojiCompat으로 이모지 표시</string>
<string name="emojicompat_null">꺼짐</string>
Expand Down Expand Up @@ -396,14 +396,10 @@
<string name="clear_desc">초기화 버튼 보이기</string>
<string name="malformed">ZIP 파일 이름이 잘못됨</string>
<string name="legal">라이선스</string>
<string name="legal_uni">Unicode®</string>
<string name="legal_uni2">This application includes a modified version of Unicode Data File.
Copyright © 1991-2021 Unicode, Inc. All rights reserved.
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.</string>
<string name="legal_app">UnicodePad 2.10.4</string>
<string name="legal_app2">UnicodePad is licensed under the Apache License, Version2.0
https://github.com/Ryosuke839/UnicodePad</string>
<string name="locale_default">기본 (%s)</string>
<string name="locale_other">다른…</string>
<string name="locale_title">로케일</string>
Expand Down
Loading

0 comments on commit 9ce7c38

Please sign in to comment.