chore: addressing SetTextI18n
This commit is contained in:
parent
bbaae2e776
commit
125a95285d
38 changed files with 246 additions and 155 deletions
|
@ -401,7 +401,6 @@ class InputFilterMinMax(
|
|||
return ""
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun isInRange(a: Double, b: Double, c: Double): Boolean {
|
||||
val statusStrings = currContext()!!.resources.getStringArray(R.array.status_manga)[2]
|
||||
|
||||
|
@ -904,9 +903,9 @@ fun copyToClipboard(string: String, toast: Boolean = true) {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun countDown(media: Media, view: ViewGroup) {
|
||||
if (media.anime?.nextAiringEpisode != null && media.anime.nextAiringEpisodeTime != null && (media.anime.nextAiringEpisodeTime!! - System.currentTimeMillis() / 1000) <= 86400 * 28.toLong()) {
|
||||
if (media.anime?.nextAiringEpisode != null && media.anime.nextAiringEpisodeTime != null
|
||||
&& (media.anime.nextAiringEpisodeTime!! - System.currentTimeMillis() / 1000) <= 86400 * 28.toLong()) {
|
||||
val v = ItemCountDownBinding.inflate(LayoutInflater.from(view.context), view, false)
|
||||
view.addView(v.root, 0)
|
||||
v.mediaCountdownText.text =
|
||||
|
@ -1007,6 +1006,10 @@ class EmptyAdapter(private val count: Int) : RecyclerView.Adapter<RecyclerView.V
|
|||
inner class EmptyViewHolder(view: View) : RecyclerView.ViewHolder(view)
|
||||
}
|
||||
|
||||
fun getAppString(res: Int): String {
|
||||
return App.instance?.getString(res) ?: ""
|
||||
}
|
||||
|
||||
fun toast(string: String?) {
|
||||
if (string != null) {
|
||||
Logger.log(string)
|
||||
|
@ -1017,6 +1020,10 @@ fun toast(string: String?) {
|
|||
}
|
||||
}
|
||||
|
||||
fun toast(res: Int) {
|
||||
toast(getAppString(res))
|
||||
}
|
||||
|
||||
fun snackString(s: String?, activity: Activity? = null, clipboard: String? = null): Snackbar? {
|
||||
try { //I have no idea why this sometimes crashes for some people...
|
||||
if (s != null) {
|
||||
|
@ -1057,6 +1064,10 @@ fun snackString(s: String?, activity: Activity? = null, clipboard: String? = nul
|
|||
return null
|
||||
}
|
||||
|
||||
fun snackString(r: Int, activity: Activity? = null, clipboard: String? = null): Snackbar? {
|
||||
return snackString(getAppString(r), activity, clipboard)
|
||||
}
|
||||
|
||||
open class NoPaddingArrayAdapter<T>(context: Context, layoutId: Int, items: List<T>) :
|
||||
ArrayAdapter<T>(context, layoutId, items) {
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue