[RTL] Fix text direction of OTP token

This commit is contained in:
codokie
2025-04-06 14:32:03 +03:00
parent bc51345f0d
commit 47896fcdc9
2 changed files with 7 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ package com.kunzisoft.keepass.adapters
import android.content.Context
import android.content.res.ColorStateList
import android.graphics.Color
import android.os.Build
import android.util.Log
import android.util.TypedValue
import android.view.LayoutInflater
@@ -529,6 +530,9 @@ class NodesAdapter (
holder?.otpToken?.apply {
text = otpElement?.tokenString
setTextSize(mTextSizeUnit, mOtpTokenTextDefaultDimension, mPrefSizeMultiplier)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
textDirection = View.TEXT_DIRECTION_LTR
}
}
holder?.otpContainer?.setOnClickListener {
otpElement?.token?.let { token ->

View File

@@ -179,6 +179,9 @@ class TemplateView @JvmOverloads constructor(context: Context,
otpElement.type.name,
ProtectedString(false, otpElement.token)))
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
textDirection = TEXT_DIRECTION_LTR
}
mLastOtpTokenView = this
mOtpRunnable = Runnable {
if (otpElement.shouldRefreshToken()) {