Code cleanups (#3264)
* Kotlin 1.8.10 https://github.com/JetBrains/kotlin/releases/tag/v1.8.10 * Migrate onActivityCreated to onViewCreated * More final modifiers * Java Cleanups * Kotlin cleanups * More final modifiers * Const value TOOLBAR_HIDE_DELAY_MS * Revert
This commit is contained in:
parent
0baf3fe467
commit
cfea5700b0
24 changed files with 123 additions and 133 deletions
|
|
@ -38,7 +38,7 @@ class ListStatusAccessibilityDelegate(
|
|||
|
||||
private val context: Context get() = recyclerView.context
|
||||
|
||||
private val itemDelegate = object : RecyclerViewAccessibilityDelegate.ItemDelegate(this) {
|
||||
private val itemDelegate = object : ItemDelegate(this) {
|
||||
override fun onInitializeAccessibilityNodeInfo(
|
||||
host: View,
|
||||
info: AccessibilityNodeInfoCompat
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ val Locale.modernLanguageCode: String
|
|||
fun Locale.getTuskyDisplayName(context: Context): String {
|
||||
return context.getString(
|
||||
R.string.language_display_name_format,
|
||||
this?.displayLanguage,
|
||||
this?.getDisplayLanguage(this)
|
||||
displayLanguage,
|
||||
getDisplayLanguage(this)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable
|
|||
import io.reactivex.rxjava3.disposables.Disposable
|
||||
|
||||
open class RxAwareViewModel : ViewModel() {
|
||||
val disposables = CompositeDisposable()
|
||||
private val disposables = CompositeDisposable()
|
||||
|
||||
fun Disposable.autoDispose() = disposables.add(this)
|
||||
|
||||
|
|
|
|||
|
|
@ -147,12 +147,12 @@ fun highlightSpans(text: Spannable, colour: Int) {
|
|||
val length = text.length
|
||||
var start = 0
|
||||
var end = 0
|
||||
while (end >= 0 && end < length && start >= 0) {
|
||||
while (end in 0 until length && start >= 0) {
|
||||
// Search for url first because it can contain the other characters
|
||||
val found = findPattern(string, end)
|
||||
start = found.start
|
||||
end = found.end
|
||||
if (start >= 0 && end > start) {
|
||||
if (start in 0 until end) {
|
||||
text.setSpan(getSpan(found.matchType, string, colour, start, end), start, end, Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
|
||||
start += finders[found.matchType]!!.searchPrefixWidth
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue