forked from github/szkolny
[App] Remove unneeded profile settings.
This commit is contained in:
parent
549a542879
commit
7a43ef4dee
@ -24,5 +24,5 @@ abstract class SettingsCard(
|
||||
|
||||
protected abstract fun buildCard(): MaterialAboutCard
|
||||
protected abstract fun getItems(): List<MaterialAboutItem>
|
||||
protected abstract fun getItemsMore(): List<MaterialAboutItem>
|
||||
protected open fun getItemsMore(): List<MaterialAboutItem> = listOf()
|
||||
}
|
||||
|
@ -6,10 +6,8 @@ package pl.szczodrzynski.edziennik.ui.modules.settings.cards
|
||||
|
||||
import android.content.Intent
|
||||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
||||
import eu.szkolny.font.SzkolnyFont
|
||||
import pl.szczodrzynski.edziennik.R
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.profile.ProfileConfigDialog
|
||||
import pl.szczodrzynski.edziennik.ui.dialogs.profile.ProfileRemoveDialog
|
||||
import pl.szczodrzynski.edziennik.ui.modules.login.LoginActivity
|
||||
import pl.szczodrzynski.edziennik.ui.modules.settings.MaterialAboutProfileItem
|
||||
import pl.szczodrzynski.edziennik.ui.modules.settings.SettingsCard
|
||||
@ -20,7 +18,7 @@ class SettingsProfileCard(util: SettingsUtil) : SettingsCard(util) {
|
||||
override fun buildCard() = util.createCard(
|
||||
null,
|
||||
items = getItems(),
|
||||
itemsMore = getItemsMore()
|
||||
itemsMore = listOf()
|
||||
)
|
||||
|
||||
private fun getProfileItem(): MaterialAboutProfileItem = util.createProfileItem(
|
||||
@ -45,26 +43,6 @@ class SettingsProfileCard(util: SettingsUtil) : SettingsCard(util) {
|
||||
icon = CommunityMaterial.Icon.cmd_account_plus_outline
|
||||
) {
|
||||
activity.startActivity(Intent(activity, LoginActivity::class.java))
|
||||
},
|
||||
|
||||
util.createActionItem(
|
||||
text = R.string.settings_profile_remove_text,
|
||||
subText = R.string.settings_profile_remove_subtext,
|
||||
icon = SzkolnyFont.Icon.szf_delete_empty_outline
|
||||
) {
|
||||
ProfileRemoveDialog(activity, app.profile.id, app.profile.name, false)
|
||||
}
|
||||
)
|
||||
|
||||
override fun getItemsMore() = listOf(
|
||||
util.createPropertyItem(
|
||||
text = R.string.settings_profile_sync_text,
|
||||
subText = R.string.settings_profile_sync_subtext,
|
||||
icon = CommunityMaterial.Icon.cmd_account_convert,
|
||||
value = app.profile.syncEnabled,
|
||||
) { _, it ->
|
||||
app.profile.syncEnabled = it
|
||||
app.profileSave()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user