Skip to content

Commit 0ead92b

Browse files
chihung93Hung
authored andcommitted
fix(language): fix review code from @tibbi
Signed-off-by: Hung <>
1 parent 177be02 commit 0ead92b

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/activities/SettingsActivity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import com.simplemobiletools.keyboard.extensions.getKeyboardLanguages
1414
import com.simplemobiletools.keyboard.helpers.KEYBOARD_HEIGHT_MULTIPLIER_LARGE
1515
import com.simplemobiletools.keyboard.helpers.KEYBOARD_HEIGHT_MULTIPLIER_MEDIUM
1616
import com.simplemobiletools.keyboard.helpers.KEYBOARD_HEIGHT_MULTIPLIER_SMALL
17-
import com.simplemobiletools.keyboard.helpers.LANGUAGE_VIETNAMESE_TELEX
1817
import kotlinx.android.synthetic.main.activity_settings.*
1918
import java.util.*
2019
import kotlin.system.exitProcess

app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/EmojiHelper.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.json.JSONObject
55
import java.io.InputStream
66

77
private var cachedEmojiData: MutableList<String>? = null
8-
val cachedVNTelexData: HashMap<String,String> = HashMap()
8+
val cachedVNTelexData: HashMap<String, String> = HashMap()
99

1010
/**
1111
* Reads the emoji list at the given [path] and returns an parsed [MutableList]. If the
@@ -64,18 +64,18 @@ fun parseRawEmojiSpecsFile(context: Context, path: String): MutableList<String>
6464
}
6565

6666

67-
fun parseRawJsonSpecsFile(context: Context, path: String): HashMap<String,String> {
67+
fun parseRawJsonSpecsFile(context: Context, path: String): HashMap<String, String> {
6868
if (cachedVNTelexData.isNotEmpty()) {
6969
return cachedVNTelexData
7070
}
7171

7272
try {
73-
val inputStream: InputStream = context.assets.open(path)
74-
val jsonString = inputStream.bufferedReader().use{it.readText()}
73+
val inputStream: InputStream = context.assets.open(path)
74+
val jsonString = inputStream.bufferedReader().use { it.readText() }
7575
val jsonData = JSONObject(jsonString)
7676
val rulesObj = jsonData.getJSONObject("rules")
7777
val ruleKeys = rulesObj.keys()
78-
while (ruleKeys.hasNext()){
78+
while (ruleKeys.hasNext()) {
7979
val key = ruleKeys.next()
8080
val value = rulesObj.getString(key)
8181
cachedVNTelexData[key] = value

app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
188188
val word = fullText.subSequence(lastIndexEmpty, fullText.length).trim().toString()
189189
val wordChars = word.toCharArray()
190190
val predictWord = StringBuilder()
191-
for (char in wordChars.size -1 downTo 0) {
191+
for (char in wordChars.size - 1 downTo 0) {
192192
predictWord.append(wordChars[char])
193193
val shouldChangeText = predictWord.reverse().toString()
194194
if (cachedVNTelexData.containsKey(shouldChangeText)) {
@@ -208,8 +208,6 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
208208
}
209209
}
210210
}
211-
212-
213211
}
214212
}
215213
}

app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
418418
}
419419

420420
setupEmojiPalette(toolbarColor = toolbarColor, backgroundColor = mBackgroundColor, textColor = mTextColor)
421-
if(context.config.keyboardLanguage == LANGUAGE_VIETNAMESE_TELEX){
421+
if (context.config.keyboardLanguage == LANGUAGE_VIETNAMESE_TELEX) {
422422
setupLanguageTelex()
423-
}else{
423+
} else {
424424
cachedVNTelexData.clear()
425425
}
426426
setupStoredClips()

0 commit comments

Comments
 (0)