Skip to content

Commit 495e04f

Browse files
authored
Fix Some Harcoded Text (#116)
* Update SetupActivity.kt * Update SetupActivity.kt * Update strings.xml
1 parent c2f1a00 commit 495e04f

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

app/src/main/java/com/mrboomdev/awery/ui/mobile/screens/setup/SetupActivity.kt

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class SetupActivity : AppCompatActivity() {
9999

100100
STEP_TEMPLATE -> {
101101
binding.title.setText(R.string.select_template)
102-
binding.message.text = "The content you see through the app. You can select it at any time in Settings."
102+
binding.message.text = getString(R.string.generic_message)
103103

104104
binding.recycler.layoutManager = LinearLayoutManager(this)
105105
binding.recycler.addItemDecoration(RecyclerItemDecoration(dpPx(8f)))
@@ -113,22 +113,13 @@ class SetupActivity : AppCompatActivity() {
113113

114114
STEP_SOURCES -> {
115115
val template = AwerySettings.TABS_TEMPLATE.value
116-
117-
if(template == "dantotsu") {
118-
binding.message.setMarkwon("""
119-
The Dantotsu template requires some extensions to work.
120-
In this beta version, you cannot install extensions directly through the app :(
121-
Currently you can download them on our:
122-
Discord server: https://discord.com/invite/yspVzD4Kbm
123-
Telegram channel: https://t.me/mrboomdev_awery
124-
""".trimIndent())
116+
val discordUrl = getString(R.string.discord_link)
117+
val telegramUrl = getString(R.string.telegram_link)
118+
119+
if (template == "dantotsu") {
120+
binding.message.setMarkwon(getString(R.string.dantotsu_message, discordUrl, telegramUrl))
125121
} else {
126-
binding.message.setMarkwon("""
127-
In this beta version, you cannot install extensions directly through the app :(
128-
Currently you can download them on our:
129-
Discord server: https://discord.com/invite/yspVzD4Kbm
130-
Telegram channel: https://t.me/mrboomdev_awery
131-
""".trimIndent())
122+
binding.message.setMarkwon(getString(R.string.generic_message, discordUrl, telegramUrl))
132123
}
133124

134125
binding.title.setText(R.string.extensions)
@@ -138,14 +129,14 @@ class SetupActivity : AppCompatActivity() {
138129
}
139130

140131
STEP_ANALYTICS -> {
141-
binding.title.text = "Analytics"
142-
binding.message.text = "TODO"
143-
binding.recycler.visibility = View.VISIBLE
144-
145-
binding.recycler.adapter = SingleViewAdapter.fromView(MaterialSwitch(this).apply {
146-
text = "Automatically send crash reports"
147-
isChecked = true
148-
})
132+
binding.title.text = getString(R.string.analytics_title)
133+
binding.message.text = getString(R.string.analytics_message)
134+
binding.recycler.visibility = View.VISIBLE
135+
136+
binding.recycler.adapter = SingleViewAdapter.fromView(MaterialSwitch(this).apply {
137+
text = getString(R.string.automatically_send_reports)
138+
isChecked = true
139+
})
149140
}
150141

151142
STEP_FINISH -> {
@@ -194,14 +185,14 @@ class SetupActivity : AppCompatActivity() {
194185

195186
runOnUiThread {
196187
DialogBuilder(this@SetupActivity)
197-
.setTitle("Existing custom tabs found")
198-
.setMessage("To use an template we have to delete all your custom tabs with feeds. If you don't want that, then simply select \"None\".")
199-
.setOnDismissListener {
200-
if(!didDeleted.get()) {
201-
binding.backButton.isEnabled = true
202-
binding.continueButton.isEnabled = true
203-
}
204-
}
188+
.setTitle(getString(R.string.existing_custom_tabs_title))
189+
.setMessage(getString(R.string.existing_custom_tabs_message))
190+
.setOnDismissListener {
191+
if (!didDeleted.get()) {
192+
binding.backButton.isEnabled = true
193+
binding.continueButton.isEnabled = true
194+
}
195+
}
205196
.setNegativeButton(R.string.cancel) { it.dismiss() }
206197
.setPositiveButton(R.string.delete) { dialog ->
207198
didDeleted.set(true)
@@ -297,4 +288,4 @@ class SetupActivity : AppCompatActivity() {
297288
const val STEP_SOURCES: Int = 4
298289
const val STEP_ANALYTICS: Int = 5
299290
}
300-
}
291+
}

app/src/main/res/values/strings.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,4 +491,14 @@
491491
<string name="rate_limited_detailed">You have exceed the rate limit, please try again later.</string>
492492
<string name="welcome_to_app_description">The perfect app where you can customize everything, with tons of features and a stylish look.</string>
493493
<string name="setup_finished_description">Now you can go watch your favorite shows. We hope you enjoy this app! If you want, you can send us a review with what you liked :)</string>
494-
</resources>
494+
<string name="select_template">Select Template</string>
495+
<string name="dantotsu_message">The Dantotsu template requires some extensions to work.\nIn this beta version, you cannot install extensions directly through the app :(\nCurrently you can download them on our:\nDiscord server: %1$s\nTelegram channel: %2$s</string>
496+
<string name="generic_message">In this beta version, you cannot install extensions directly through the app :(\nCurrently you can download them on our:\nDiscord server: %1$s\nTelegram channel: %2$s</string>
497+
<string name="discord_link" translatable="false">https://discord.com/invite/yspVzD4Kbm</string>
498+
<string name="telegram_link" translatable="false">https://t.me/mrboomdev_awery</string>
499+
<string name="analytics_title">Analytics</string>
500+
<string name="analytics_message">TODO</string>
501+
<string name="automatically_send_reports">Automatically send crash reports</string>
502+
<string name="existing_custom_tabs_title">Existing custom tabs found</string>
503+
<string name="existing_custom_tabs_message">To use a template, we have to delete all your custom tabs with feeds. If you don't want that, then simply select "None".</string>
504+
</resources>

0 commit comments

Comments
 (0)