remove a redundant setting of showing other timezones
This commit is contained in:
parent
b7faad8742
commit
25fd5c5098
|
@ -27,7 +27,6 @@ class SettingsActivity : SimpleActivity() {
|
|||
setupHourFormat()
|
||||
setupSundayFirst()
|
||||
setupShowSeconds()
|
||||
setupDisplayOtherTimeZones()
|
||||
setupAlarmMaxReminder()
|
||||
setupUseSameSnooze()
|
||||
setupSnoozeTime()
|
||||
|
@ -102,14 +101,6 @@ class SettingsActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun setupDisplayOtherTimeZones() {
|
||||
settings_display_other_timezones.isChecked = config.displayOtherTimeZones
|
||||
settings_display_other_timezones_holder.setOnClickListener {
|
||||
settings_display_other_timezones.toggle()
|
||||
config.displayOtherTimeZones = settings_display_other_timezones.isChecked
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupAlarmMaxReminder() {
|
||||
updateAlarmMaxReminderText()
|
||||
settings_alarm_max_reminder_holder.setOnClickListener {
|
||||
|
|
|
@ -26,7 +26,6 @@ class ClockFragment : Fragment() {
|
|||
private val ONE_SECOND = 1000L
|
||||
|
||||
private var passedSeconds = 0
|
||||
private var displayOtherTimeZones = false
|
||||
private var calendar = Calendar.getInstance()
|
||||
private val updateHandler = Handler()
|
||||
|
||||
|
@ -42,7 +41,6 @@ class ClockFragment : Fragment() {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
displayOtherTimeZones = context!!.config.displayOtherTimeZones
|
||||
setupDateTime()
|
||||
|
||||
val configTextColor = context!!.config.textColor
|
||||
|
@ -64,7 +62,6 @@ class ClockFragment : Fragment() {
|
|||
private fun setupDateTime() {
|
||||
calendar = Calendar.getInstance()
|
||||
passedSeconds = getPassedSeconds()
|
||||
displayOtherTimeZones = context!!.config.displayOtherTimeZones
|
||||
updateCurrentTime()
|
||||
updateDate()
|
||||
setupViews()
|
||||
|
@ -73,15 +70,11 @@ class ClockFragment : Fragment() {
|
|||
private fun setupViews() {
|
||||
view.apply {
|
||||
context!!.updateTextColors(clock_fragment)
|
||||
time_zones_list.beVisibleIf(displayOtherTimeZones)
|
||||
clock_fab.beVisibleIf(displayOtherTimeZones)
|
||||
clock_fab.setOnClickListener {
|
||||
fabClicked()
|
||||
}
|
||||
|
||||
if (displayOtherTimeZones) {
|
||||
updateTimeZones()
|
||||
}
|
||||
updateTimeZones()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,9 +93,7 @@ class ClockFragment : Fragment() {
|
|||
updateDate()
|
||||
}
|
||||
|
||||
if (displayOtherTimeZones) {
|
||||
(view.time_zones_list.adapter as? TimeZonesAdapter)?.updateTimes()
|
||||
}
|
||||
(view.time_zones_list.adapter as? TimeZonesAdapter)?.updateTimes()
|
||||
}
|
||||
|
||||
updateHandler.postDelayed({
|
||||
|
@ -115,18 +106,17 @@ class ClockFragment : Fragment() {
|
|||
calendar = Calendar.getInstance()
|
||||
val formattedDate = context!!.getFormattedDate(calendar)
|
||||
view.clock_date.text = formattedDate
|
||||
|
||||
if (displayOtherTimeZones) {
|
||||
(view.time_zones_list.adapter as? TimeZonesAdapter)?.todayDateString = formattedDate
|
||||
}
|
||||
(view.time_zones_list.adapter as? TimeZonesAdapter)?.todayDateString = formattedDate
|
||||
}
|
||||
|
||||
private fun updateTimeZones() {
|
||||
if (!displayOtherTimeZones) {
|
||||
val selectedTimeZones = context!!.config.selectedTimeZones
|
||||
view.time_zones_list.beVisibleIf(selectedTimeZones.isNotEmpty())
|
||||
if (selectedTimeZones.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
val selectedTimeZoneIDs = context!!.config.selectedTimeZones.map { it.toInt() }
|
||||
val selectedTimeZoneIDs = selectedTimeZones.map { it.toInt() }
|
||||
val timeZones = context!!.getAllTimeZonesModified().filter { selectedTimeZoneIDs.contains(it.id) } as ArrayList<MyTimeZone>
|
||||
val currAdapter = view.time_zones_list.adapter
|
||||
if (currAdapter == null) {
|
||||
|
|
|
@ -14,10 +14,6 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
get() = prefs.getBoolean(SHOW_SECONDS, true)
|
||||
set(showSeconds) = prefs.edit().putBoolean(SHOW_SECONDS, showSeconds).apply()
|
||||
|
||||
var displayOtherTimeZones: Boolean
|
||||
get() = prefs.getBoolean(DISPLAY_OTHER_TIME_ZONES, true)
|
||||
set(displayOtherTimeZones) = prefs.edit().putBoolean(DISPLAY_OTHER_TIME_ZONES, displayOtherTimeZones).apply()
|
||||
|
||||
var selectedTimeZones: Set<String>
|
||||
get() = prefs.getStringSet(SELECTED_TIME_ZONES, HashSet())
|
||||
set(selectedTimeZones) = prefs.edit().putStringSet(SELECTED_TIME_ZONES, selectedTimeZones).apply()
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.*
|
|||
|
||||
// shared preferences
|
||||
const val SHOW_SECONDS = "show_seconds"
|
||||
const val DISPLAY_OTHER_TIME_ZONES = "display_other_time_zones"
|
||||
const val SELECTED_TIME_ZONES = "selected_time_zones"
|
||||
const val EDITED_TIME_ZONE_TITLES = "edited_time_zone_titles"
|
||||
const val TIMER_SECONDS = "timer_seconds"
|
||||
|
|
|
@ -189,29 +189,6 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_display_other_timezones_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingBottom="@dimen/activity_margin"
|
||||
android:paddingLeft="@dimen/normal_margin"
|
||||
android:paddingRight="@dimen/normal_margin"
|
||||
android:paddingTop="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/settings_display_other_timezones"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:paddingLeft="@dimen/medium_margin"
|
||||
android:paddingStart="@dimen/medium_margin"
|
||||
android:text="@string/display_other_time_zones"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/alarm_tab_divider"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<string name="stopwatch_tab">Cronómetro</string>
|
||||
<string name="timer_tab">Timer tab</string>
|
||||
<string name="show_seconds">Mostrar segundos</string>
|
||||
<string name="display_other_time_zones">Mostrar outros fusos horários</string>
|
||||
|
||||
<!-- FAQ -->
|
||||
<string name="faq_1_title">How can I change lap sorting at the stopwatch tab?</string>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<string name="stopwatch_tab">Okno so stopkami</string>
|
||||
<string name="timer_tab">Okno s časovačom</string>
|
||||
<string name="show_seconds">Zobraziť sekundy</string>
|
||||
<string name="display_other_time_zones">Povoliť zobrazenie dodatočných časových pásiem</string>
|
||||
|
||||
<!-- FAQ -->
|
||||
<string name="faq_1_title">Ako viem zmeniť poradie kôl na okne so stopkami?</string>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<string name="stopwatch_tab">Stopwatch tab</string>
|
||||
<string name="timer_tab">Timer tab</string>
|
||||
<string name="show_seconds">Show seconds</string>
|
||||
<string name="display_other_time_zones">Allow displaying other time zones</string>
|
||||
|
||||
<!-- FAQ -->
|
||||
<string name="faq_1_title">How can I change lap sorting at the stopwatch tab?</string>
|
||||
|
|
Loading…
Reference in New Issue