Skip to content

Commit

Permalink
Use String format for Style name
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Aug 1, 2024
1 parent dca2118 commit c757f4e
Show file tree
Hide file tree
Showing 36 changed files with 60 additions and 827 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ToastAdapter (

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val model = itemList[holder.bindingAdapterPosition]
holder.binding.styleName.text = appContextLocale.resources.getString(model.title)
holder.binding.styleName.text = model.title
holder.binding.toastContainer.background = ContextCompat.getDrawable(appContext, model.style)
if (model.selected) {
holder.binding.styleName.setTextColor(
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/java/com/drdisagree/iconify/ui/fragments/ToastFrame.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ class ToastFrame : BaseFragment() {
private fun initToastFrameItems(): ToastAdapter {
val selectedStyle = getInt(SELECTED_TOAST_FRAME, -1)
val toastFrameStyle = ArrayList<ToastModel>().apply {
add(ToastModel(R.drawable.toast_frame_style_1, R.string.style_0))
add(ToastModel(R.drawable.toast_frame_style_1, R.string.style_1))
add(ToastModel(R.drawable.toast_frame_style_2, R.string.style_2))
add(ToastModel(R.drawable.toast_frame_style_3, R.string.style_3))
add(ToastModel(R.drawable.toast_frame_style_4, R.string.style_4))
add(ToastModel(R.drawable.toast_frame_style_5, R.string.style_5))
add(ToastModel(R.drawable.toast_frame_style_6, R.string.style_6))
add(ToastModel(R.drawable.toast_frame_style_7, R.string.style_7))
add(ToastModel(R.drawable.toast_frame_style_8, R.string.style_8))
add(ToastModel(R.drawable.toast_frame_style_9, R.string.style_9))
add(ToastModel(R.drawable.toast_frame_style_10, R.string.style_10))
add(ToastModel(R.drawable.toast_frame_style_11, R.string.style_11))
add(ToastModel(R.drawable.toast_frame_style_1, appContextLocale.resources.getString(R.string.style_0)))
add(ToastModel(R.drawable.toast_frame_style_1, String.format(appContextLocale.resources.getString(R.string.style), 1)))
add(ToastModel(R.drawable.toast_frame_style_2, String.format(appContextLocale.resources.getString(R.string.style), 2)))
add(ToastModel(R.drawable.toast_frame_style_3, String.format(appContextLocale.resources.getString(R.string.style), 3)))
add(ToastModel(R.drawable.toast_frame_style_4, String.format(appContextLocale.resources.getString(R.string.style), 4)))
add(ToastModel(R.drawable.toast_frame_style_5, String.format(appContextLocale.resources.getString(R.string.style), 5)))
add(ToastModel(R.drawable.toast_frame_style_6, String.format(appContextLocale.resources.getString(R.string.style), 6)))
add(ToastModel(R.drawable.toast_frame_style_7, String.format(appContextLocale.resources.getString(R.string.style), 7)))
add(ToastModel(R.drawable.toast_frame_style_8, String.format(appContextLocale.resources.getString(R.string.style), 8)))
add(ToastModel(R.drawable.toast_frame_style_9, String.format(appContextLocale.resources.getString(R.string.style), 9)))
add(ToastModel(R.drawable.toast_frame_style_10, String.format(appContextLocale.resources.getString(R.string.style), 10)))
add(ToastModel(R.drawable.toast_frame_style_11, String.format(appContextLocale.resources.getString(R.string.style), 11)))
}

return ToastAdapter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.drdisagree.iconify.Iconify.Companion.appContext
import com.drdisagree.iconify.Iconify.Companion.appContextLocale
import com.drdisagree.iconify.R
import com.drdisagree.iconify.common.Const.SWITCH_ANIMATION_DELAY
import com.drdisagree.iconify.common.Preferences.CHIP_QSSTATUSICONS_STYLE
Expand Down Expand Up @@ -127,26 +128,26 @@ class XposedBackgroundChip : BaseFragment() {

private fun initStatusBarChipStyles(): ArrayList<Array<Any>> {
val statusBarChipStyle = ArrayList<Array<Any>>().apply {
add(arrayOf(R.drawable.chip_status_bar_1, R.string.style_1))
add(arrayOf(R.drawable.chip_status_bar_2, R.string.style_2))
add(arrayOf(R.drawable.chip_status_bar_3, R.string.style_3))
add(arrayOf(R.drawable.chip_status_bar_4, R.string.style_4))
add(arrayOf(R.drawable.chip_status_bar_5, R.string.style_5))
add(arrayOf(R.drawable.chip_status_bar_6, R.string.style_6))
add(arrayOf(R.drawable.chip_status_bar_7, R.string.style_7))
add(arrayOf(R.drawable.chip_status_bar_1, String.format(appContextLocale.resources.getString(R.string.style), 1)))
add(arrayOf(R.drawable.chip_status_bar_2, String.format(appContextLocale.resources.getString(R.string.style), 2)))
add(arrayOf(R.drawable.chip_status_bar_3, String.format(appContextLocale.resources.getString(R.string.style), 3)))
add(arrayOf(R.drawable.chip_status_bar_4, String.format(appContextLocale.resources.getString(R.string.style), 4)))
add(arrayOf(R.drawable.chip_status_bar_5, String.format(appContextLocale.resources.getString(R.string.style), 5)))
add(arrayOf(R.drawable.chip_status_bar_6, String.format(appContextLocale.resources.getString(R.string.style), 6)))
add(arrayOf(R.drawable.chip_status_bar_7, String.format(appContextLocale.resources.getString(R.string.style), 7)))
}

return statusBarChipStyle
}

private fun initStatusIconsChipStyles(): ArrayList<Array<Any>> {
val statusIconsChipStyle = ArrayList<Array<Any>>().apply {
add(arrayOf(R.drawable.chip_status_icons_1, R.string.style_1))
add(arrayOf(R.drawable.chip_status_icons_2, R.string.style_2))
add(arrayOf(R.drawable.chip_status_icons_3, R.string.style_3))
add(arrayOf(R.drawable.chip_status_icons_4, R.string.style_4))
add(arrayOf(R.drawable.chip_status_icons_5, R.string.style_5))
add(arrayOf(R.drawable.chip_status_icons_6, R.string.style_6))
add(arrayOf(R.drawable.chip_status_icons_1, String.format(appContextLocale.resources.getString(R.string.style), 1)))
add(arrayOf(R.drawable.chip_status_icons_2, String.format(appContextLocale.resources.getString(R.string.style), 2)))
add(arrayOf(R.drawable.chip_status_icons_3, String.format(appContextLocale.resources.getString(R.string.style), 3)))
add(arrayOf(R.drawable.chip_status_icons_4, String.format(appContextLocale.resources.getString(R.string.style), 4)))
add(arrayOf(R.drawable.chip_status_icons_5, String.format(appContextLocale.resources.getString(R.string.style), 5)))
add(arrayOf(R.drawable.chip_status_icons_6, String.format(appContextLocale.resources.getString(R.string.style), 6)))
}

return statusIconsChipStyle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package com.drdisagree.iconify.ui.models

class ToastModel (
var style: Int,
var title: Int,
var title: String,
var selected: Boolean = false
)
26 changes: 1 addition & 25 deletions app/src/main/res/values-af-rZA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">Saved settings successfully</string>
<!-- Style List -->
<string name="style_0">None</string>
<string name="style_1">Style 1</string>
<string name="style_2">Style 2</string>
<string name="style_3">Style 3</string>
<string name="style_4">Style 4</string>
<string name="style_5">Style 5</string>
<string name="style_6">Style 6</string>
<string name="style_7">Style 7</string>
<string name="style_8">Style 8</string>
<string name="style_9">Style 9</string>
<string name="style_10">Style 10</string>
<string name="style_11">Style 11</string>
<string name="style_12">Style 12</string>
<string name="style_13">Style 13</string>
<string name="style_14">Style 14</string>
<string name="style_15">Style 15</string>
<string name="style_16">Style 16</string>
<string name="style_17">Style 17</string>
<string name="style_18">Style 18</string>
<string name="style_19">Style 19</string>
<string name="style_20">Style 20</string>
<string name="style_21">Style 21</string>
<string name="style_22">Style 22</string>
<string name="style_23">Style 23</string>
<string name="style_24">Style 24</string>
<string name="style_25">Style 25</string>
<string name="style">Style %d</string>
<!-- Buttons -->
<string name="btn_continue">Continue</string>
<string name="btn_restart">Restart</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-ar-rSA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">تم حفظ الإعدادات بنجاح</string>
<!-- Style List -->
<string name="style_0">لا شيء</string>
<string name="style_1">النمط 1</string>
<string name="style_2">النمط 2</string>
<string name="style_3">النمط 3</string>
<string name="style_4">النمط 4</string>
<string name="style_5">النمط 5</string>
<string name="style_6">النمط 6</string>
<string name="style_7">النمط 7</string>
<string name="style_8">النمط 8</string>
<string name="style_9">النمط 9</string>
<string name="style_10">النمط 10</string>
<string name="style_11">النمط 11</string>
<string name="style_12">النمط 12</string>
<string name="style_13">النمط 13</string>
<string name="style_14">النمط 14</string>
<string name="style_15">النمط 15</string>
<string name="style_16">النمط 16</string>
<string name="style_17">النمط 17</string>
<string name="style_18">النمط 18</string>
<string name="style_19">النمط 19</string>
<string name="style_20">النمط 20</string>
<string name="style_21">النمط 21</string>
<string name="style_22">النمط 22</string>
<string name="style_23">النمط 23</string>
<string name="style_24">النمط 24</string>
<string name="style_25">النمط 25</string>
<string name="style">النمط %d</string>
<!-- Buttons -->
<string name="btn_continue">استمر</string>
<string name="btn_restart">إعداة تشغيل</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-ca-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">Saved settings successfully</string>
<!-- Style List -->
<string name="style_0">None</string>
<string name="style_1">Style 1</string>
<string name="style_2">Style 2</string>
<string name="style_3">Style 3</string>
<string name="style_4">Style 4</string>
<string name="style_5">Style 5</string>
<string name="style_6">Style 6</string>
<string name="style_7">Style 7</string>
<string name="style_8">Style 8</string>
<string name="style_9">Style 9</string>
<string name="style_10">Style 10</string>
<string name="style_11">Style 11</string>
<string name="style_12">Style 12</string>
<string name="style_13">Style 13</string>
<string name="style_14">Style 14</string>
<string name="style_15">Style 15</string>
<string name="style_16">Style 16</string>
<string name="style_17">Style 17</string>
<string name="style_18">Style 18</string>
<string name="style_19">Style 19</string>
<string name="style_20">Style 20</string>
<string name="style_21">Style 21</string>
<string name="style_22">Style 22</string>
<string name="style_23">Style 23</string>
<string name="style_24">Style 24</string>
<string name="style_25">Style 25</string>
<string name="style">Style %d</string>
<!-- Buttons -->
<string name="btn_continue">Continue</string>
<string name="btn_restart">Restart</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">Saved settings successfully</string>
<!-- Style List -->
<string name="style_0">None</string>
<string name="style_1">Style 1</string>
<string name="style_2">Style 2</string>
<string name="style_3">Style 3</string>
<string name="style_4">Style 4</string>
<string name="style_5">Style 5</string>
<string name="style_6">Style 6</string>
<string name="style_7">Style 7</string>
<string name="style_8">Style 8</string>
<string name="style_9">Style 9</string>
<string name="style_10">Style 10</string>
<string name="style_11">Style 11</string>
<string name="style_12">Style 12</string>
<string name="style_13">Style 13</string>
<string name="style_14">Style 14</string>
<string name="style_15">Style 15</string>
<string name="style_16">Style 16</string>
<string name="style_17">Style 17</string>
<string name="style_18">Style 18</string>
<string name="style_19">Style 19</string>
<string name="style_20">Style 20</string>
<string name="style_21">Style 21</string>
<string name="style_22">Style 22</string>
<string name="style_23">Style 23</string>
<string name="style_24">Style 24</string>
<string name="style_25">Style 25</string>
<string name="style">Style %d</string>
<!-- Buttons -->
<string name="btn_continue">Continue</string>
<string name="btn_restart">Restart</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-da-rDK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">Saved settings successfully</string>
<!-- Style List -->
<string name="style_0">None</string>
<string name="style_1">Style 1</string>
<string name="style_2">Style 2</string>
<string name="style_3">Style 3</string>
<string name="style_4">Style 4</string>
<string name="style_5">Style 5</string>
<string name="style_6">Style 6</string>
<string name="style_7">Style 7</string>
<string name="style_8">Style 8</string>
<string name="style_9">Style 9</string>
<string name="style_10">Style 10</string>
<string name="style_11">Style 11</string>
<string name="style_12">Style 12</string>
<string name="style_13">Style 13</string>
<string name="style_14">Style 14</string>
<string name="style_15">Style 15</string>
<string name="style_16">Style 16</string>
<string name="style_17">Style 17</string>
<string name="style_18">Style 18</string>
<string name="style_19">Style 19</string>
<string name="style_20">Style 20</string>
<string name="style_21">Style 21</string>
<string name="style_22">Style 22</string>
<string name="style_23">Style 23</string>
<string name="style_24">Style 24</string>
<string name="style_25">Style 25</string>
<string name="style">Style %d</string>
<!-- Buttons -->
<string name="btn_continue">Continue</string>
<string name="btn_restart">Restart</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -762,31 +762,7 @@ transparent machen</string>
<string name="exported_settings">Einstellungen Speichern erfolgreich</string>
<!-- Style List -->
<string name="style_0">Nichts</string>
<string name="style_1">Stil 1</string>
<string name="style_2">Stil 2</string>
<string name="style_3">Stil 3</string>
<string name="style_4">Stil 4</string>
<string name="style_5">Stil 5</string>
<string name="style_6">Stil 6</string>
<string name="style_7">Stil 7</string>
<string name="style_8">Stil 8</string>
<string name="style_9">Stil 9</string>
<string name="style_10">Stil 10</string>
<string name="style_11">Stil 11</string>
<string name="style_12">Stil 12</string>
<string name="style_13">Stil 13</string>
<string name="style_14">Stil 14</string>
<string name="style_15">Stil 15</string>
<string name="style_16">Stil 16</string>
<string name="style_17">Stil 17</string>
<string name="style_18">Stil 18</string>
<string name="style_19">Stil 19</string>
<string name="style_20">Stil 20</string>
<string name="style_21">Stil 21</string>
<string name="style_22">Stil 22</string>
<string name="style_23">Stil 23</string>
<string name="style_24">Stil 24</string>
<string name="style_25">Stil 25</string>
<string name="style">Stil %d</string>
<!-- Buttons -->
<string name="btn_continue">Weiter</string>
<string name="btn_restart">Neustart</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-el-rGR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">Saved settings successfully</string>
<!-- Style List -->
<string name="style_0">None</string>
<string name="style_1">Style 1</string>
<string name="style_2">Style 2</string>
<string name="style_3">Style 3</string>
<string name="style_4">Style 4</string>
<string name="style_5">Style 5</string>
<string name="style_6">Style 6</string>
<string name="style_7">Style 7</string>
<string name="style_8">Style 8</string>
<string name="style_9">Style 9</string>
<string name="style_10">Style 10</string>
<string name="style_11">Style 11</string>
<string name="style_12">Style 12</string>
<string name="style_13">Style 13</string>
<string name="style_14">Style 14</string>
<string name="style_15">Style 15</string>
<string name="style_16">Style 16</string>
<string name="style_17">Style 17</string>
<string name="style_18">Style 18</string>
<string name="style_19">Style 19</string>
<string name="style_20">Style 20</string>
<string name="style_21">Style 21</string>
<string name="style_22">Style 22</string>
<string name="style_23">Style 23</string>
<string name="style_24">Style 24</string>
<string name="style_25">Style 25</string>
<string name="style">Style %d</string>
<!-- Buttons -->
<string name="btn_continue">Continue</string>
<string name="btn_restart">Restart</string>
Expand Down
26 changes: 1 addition & 25 deletions app/src/main/res/values-es-rES/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -761,31 +761,7 @@
<string name="exported_settings">Configuración guardada con éxito</string>
<!-- Style List -->
<string name="style_0">Ninguno</string>
<string name="style_1">Estilo 1</string>
<string name="style_2">Estilo 2</string>
<string name="style_3">Estilo 3</string>
<string name="style_4">Estilo 4</string>
<string name="style_5">Estilo 5</string>
<string name="style_6">Estilo 6</string>
<string name="style_7">Estilo 7</string>
<string name="style_8">Estilo 8</string>
<string name="style_9">Estilo 9</string>
<string name="style_10">Estilo 10</string>
<string name="style_11">Estilo 11</string>
<string name="style_12">Estilo 12</string>
<string name="style_13">Estilo 13</string>
<string name="style_14">Estilo 14</string>
<string name="style_15">Estilo 15</string>
<string name="style_16">Estilo 16</string>
<string name="style_17">Estilo 17</string>
<string name="style_18">Estilo 18</string>
<string name="style_19">Estilo 19</string>
<string name="style_20">Estilo 20</string>
<string name="style_21">Estilo 21</string>
<string name="style_22">Estilo 22</string>
<string name="style_23">Estilo 23</string>
<string name="style_24">Estilo 24</string>
<string name="style_25">Estilo 25</string>
<string name="style">Estilo %d</string>
<!-- Buttons -->
<string name="btn_continue">CONTINUAR</string>
<string name="btn_restart">Reiniciar</string>
Expand Down
Loading

0 comments on commit c757f4e

Please sign in to comment.