mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-04-15 07:52:04 +02:00
adding a FAQ section
This commit is contained in:
parent
c023445b3b
commit
e8696fd29e
@ -88,6 +88,11 @@
|
|||||||
android:label="@string/customize_colors"
|
android:label="@string/customize_colors"
|
||||||
android:parentActivityName=".activities.SettingsActivity"/>
|
android:parentActivityName=".activities.SettingsActivity"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name="com.simplemobiletools.commons.activities.FAQActivity"
|
||||||
|
android:label="@string/frequently_asked_questions"
|
||||||
|
android:parentActivityName="com.simplemobiletools.commons.activities.AboutActivity"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SettingsActivity"
|
android:name=".activities.SettingsActivity"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
|
@ -15,6 +15,7 @@ import com.simplemobiletools.commons.extensions.useEnglishToggled
|
|||||||
import com.simplemobiletools.commons.helpers.LICENSE_GLIDE
|
import com.simplemobiletools.commons.helpers.LICENSE_GLIDE
|
||||||
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
|
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
|
||||||
import com.simplemobiletools.commons.helpers.LICENSE_LEAK_CANARY
|
import com.simplemobiletools.commons.helpers.LICENSE_LEAK_CANARY
|
||||||
|
import com.simplemobiletools.commons.models.FAQItem
|
||||||
import com.simplemobiletools.commons.models.RadioItem
|
import com.simplemobiletools.commons.models.RadioItem
|
||||||
import kotlinx.android.synthetic.main.activity_settings.*
|
import kotlinx.android.synthetic.main.activity_settings.*
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -52,7 +53,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.about -> startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_GLIDE or LICENSE_LEAK_CANARY, BuildConfig.VERSION_NAME)
|
R.id.about -> launchAbout()
|
||||||
else -> super.onOptionsItemSelected(item)
|
else -> super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
@ -74,6 +75,14 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun launchAbout() {
|
||||||
|
val faqItems = arrayListOf(
|
||||||
|
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons)
|
||||||
|
)
|
||||||
|
|
||||||
|
startAboutActivity(R.string.app_name, LICENSE_KOTLIN or LICENSE_GLIDE or LICENSE_LEAK_CANARY, BuildConfig.VERSION_NAME, faqItems)
|
||||||
|
}
|
||||||
|
|
||||||
private fun getLastPart(path: String): String {
|
private fun getLastPart(path: String): String {
|
||||||
val humanized = humanizePath(path)
|
val humanized = humanizePath(path)
|
||||||
return humanized.substringAfterLast("/", humanized)
|
return humanized.substringAfterLast("/", humanized)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user