Merge remote-tracking branch 'weblate/main'

This commit is contained in:
Kieran W 2024-01-07 20:46:40 +00:00
parent cd776a522c
commit 1c2a161f40
5 changed files with 58 additions and 32 deletions

View File

@ -7,6 +7,21 @@ patch-level version changes can be found in [commit messages](../../commits/mast
## Next_Ver ## Next_Ver
--> -->
## 20231008
- Update Fastlane Metadata
- Update to use API level 34
- Minor tweaks to readme
- Add translations from Weblate (thank you to the following!)
- German
- Ettore Atalan
- French
- J. Lavoie
- Add Android 13 Icon
- Code clean up and `ktlint` check and formatting
- Fix Bug: Keyboard has a transparent background
- Fix Bug where the keyboard forgets last 'Recent' last selected
## 20230828 ## 20230828
- Update app description - Update app description

View File

@ -100,7 +100,7 @@ Follow the steps in the [Building from Source](#building-from-source) section.
This app has been written in Kotlin 1.9.0 with the Android Studio IDE. This app has been written in Kotlin 1.9.0 with the Android Studio IDE.
- The target SDK version is 33 (Android 13) - The target SDK version is 34 (Android 14)
- The minimum SDK version is 26 (Android 8 Oreo) - The minimum SDK version is 26 (Android 8 Oreo)
## Building From Source ## Building From Source

View File

@ -32,7 +32,7 @@ tasks.register("genDocs") {
} }
android { android {
compileSdk = 33 compileSdk = 34
buildToolsVersion = "34.0.0" buildToolsVersion = "34.0.0"
namespace = "com.fredhappyface.ewesticker" namespace = "com.fredhappyface.ewesticker"
@ -47,9 +47,9 @@ android {
defaultConfig { defaultConfig {
applicationId = "com.fredhappyface.ewesticker" applicationId = "com.fredhappyface.ewesticker"
minSdk = 26 minSdk = 26
targetSdk = 33 targetSdk = 34
versionCode = 20230828 versionCode = 20231008
versionName = "20230828" versionName = "20231008"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "$applicationId-$versionName") setProperty("archivesBaseName", "$applicationId-$versionName")
} }
@ -70,10 +70,10 @@ android {
dependencies { dependencies {
dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:1.8.20") dokkaPlugin("org.jetbrains.dokka:android-documentation-plugin:1.8.20")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.0") implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.10")
implementation("androidx.core:core-ktx:1.10.1") implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1") implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0") implementation("com.google.android.material:material:1.10.0")
implementation("androidx.preference:preference-ktx:1.2.1") implementation("androidx.preference:preference-ktx:1.2.1")
implementation("io.coil-kt:coil:2.4.0") implementation("io.coil-kt:coil:2.4.0")
implementation("io.coil-kt:coil-gif:2.4.0") implementation("io.coil-kt:coil-gif:2.4.0")

View File

@ -274,19 +274,20 @@ class ImageKeyboard : InputMethodService(), StickerClickListener {
} }
} }
// Recent // Recent
val recentButton = addPackButton("__recentSticker__") val recentPackName = "__recentSticker__"
val recentButton = addPackButton(recentPackName)
recentButton.load(getDrawable(R.drawable.time)) recentButton.load(getDrawable(R.drawable.time))
recentButton.setOnClickListener { switchPackLayout(it?.tag as String) } recentButton.setOnClickListener { switchPackLayout(recentPackName) }
// Packs // Packs
val sortedPackNames = this.loadedPacks.keys.sorted().toTypedArray() val sortedPackNames = this.loadedPacks.keys.sorted().toTypedArray()
for (sortedPackName in sortedPackNames) { for (sortedPackName in sortedPackNames) {
val packButton = addPackButton(sortedPackName) val packButton = addPackButton(sortedPackName)
packButton.load(this.loadedPacks[sortedPackName]?.thumbSticker) packButton.load(this.loadedPacks[sortedPackName]?.thumbSticker)
packButton.setOnClickListener { switchPackLayout(it?.tag as String) } packButton.setOnClickListener { switchPackLayout(sortedPackName) }
} }
val targetPack = val targetPack =
if (activePack in sortedPackNames) activePack else sortedPackNames.firstOrNull() if (activePack in sortedPackNames + recentPackName) activePack else sortedPackNames.firstOrNull()
if (sortedPackNames.isNotEmpty()) { if (sortedPackNames.isNotEmpty()) {
targetPack?.let { switchPackLayout(it) } targetPack?.let { switchPackLayout(it) }
@ -340,7 +341,7 @@ class ImageKeyboard : InputMethodService(), StickerClickListener {
fSticker.load(sticker) fSticker.load(sticker)
val fText = fullStickerLayout.findViewById<TextView>(R.id.stickerInfo) val fText = fullStickerLayout.findViewById<TextView>(R.id.stickerInfo)
val stickerName = trimString(sticker.name) val stickerName = trimString(sticker.name)
val packName = trimString(sticker.parent.split('/').last()) val packName = trimString(sticker.parent?.split('/')?.last())
fText.text = getString(R.string.sticker_pack_info, stickerName, packName) fText.text = getString(R.string.sticker_pack_info, stickerName, packName)
// Tap to exit popup // Tap to exit popup
@ -352,34 +353,19 @@ class ImageKeyboard : InputMethodService(), StickerClickListener {
internal fun switchToPreviousPack() { internal fun switchToPreviousPack() {
// Get a list of sorted pack names // Get a list of sorted pack names
val sortedPackNames = loadedPacks.keys.sorted() val sortedPackNames = loadedPacks.keys.sorted()
// Find the index of the current active pack // Find the index of the current active pack
val currentIndex = sortedPackNames.indexOf(activePack) val currentIndex = sortedPackNames.indexOf(activePack)
// Calculate the index of the previous pack, considering wrap-around // Calculate the index of the previous pack, considering wrap-around
val previousIndex = if (currentIndex > 0) currentIndex - 1 else sortedPackNames.size - 1 val previousIndex = if (currentIndex > 0) currentIndex - 1 else sortedPackNames.size - 1
// Get the name of the previous pack
val previousPack = sortedPackNames[previousIndex] val previousPack = sortedPackNames[previousIndex]
// Switch to the previous pack layout
switchPackLayout(previousPack) switchPackLayout(previousPack)
} }
internal fun switchToNextPack() { internal fun switchToNextPack() {
// Get a list of sorted pack names
val sortedPackNames = loadedPacks.keys.sorted() val sortedPackNames = loadedPacks.keys.sorted()
// Find the index of the current active pack
val currentIndex = sortedPackNames.indexOf(activePack) val currentIndex = sortedPackNames.indexOf(activePack)
// Calculate the index of the next pack, considering wrap-around
val nextIndex = (currentIndex + 1) % sortedPackNames.size val nextIndex = (currentIndex + 1) % sortedPackNames.size
// Get the name of the next pack
val nextPack = sortedPackNames[nextIndex] val nextPack = sortedPackNames[nextIndex]
// Switch to the next pack layout
switchPackLayout(nextPack) switchPackLayout(nextPack)
} }
@ -389,13 +375,13 @@ class ImageKeyboard : InputMethodService(), StickerClickListener {
} }
override fun onScroll( override fun onScroll(
e1: MotionEvent, e1: MotionEvent?,
e2: MotionEvent, e2: MotionEvent,
velocityX: Float, velocityX: Float,
velocityY: Float, velocityY: Float,
): Boolean { ): Boolean {
val diffX = e2.x - e1.x val diffX = e2.x - (e1?.x ?: 0f)
val diffY = e2.y - e1.y val diffY = e2.y - (e1?.y ?: 0f)
if ( if (
scroll && scroll &&
@ -425,7 +411,10 @@ class ImageKeyboard : InputMethodService(), StickerClickListener {
* @param str: String * @param str: String
* @return String * @return String
*/ */
fun trimString(str: String): String { fun trimString(str: String?): String {
if (str == null){
return "null"
}
if (str.length > 32) { if (str.length > 32) {
return str.substring(0, 32) + "..." return str.substring(0, 32) + "..."
} }

View File

@ -0,0 +1,22 @@
<h2 id="section">20231008</h2>
<ul>
<li>Update Fastlane Metadata</li>
<li>Update to use API level 34
</li>
<li>Minor tweaks to readme</li>
<li>Add translations from Weblate (thank you to the following!)
<ul>
<li>German
<ul>
<li>Ettore Atalan</li>
</ul></li>
<li>French
<ul>
<li>J. Lavoie</li>
</ul></li>
</ul></li>
<li>Add Android 13 Icon</li>
<li>Code clean up and <code>ktlint</code> check and formatting</li>
<li>Fix Bug: Keyboard has a transparent background</li>
<li>Fix Bug where the keyboard forgets last Recent last selected</li>
</ul>