replace the time zones placeholder with a FAB
This commit is contained in:
parent
2edad88880
commit
cd0c951c8e
|
@ -7,8 +7,6 @@ import com.simplemobiletools.clock.R
|
|||
import com.simplemobiletools.clock.extensions.config
|
||||
import com.simplemobiletools.clock.models.MyTimeZone
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
|
||||
import com.simplemobiletools.commons.extensions.underlineText
|
||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||
import kotlinx.android.synthetic.main.fragment_clock.view.*
|
||||
import java.util.*
|
||||
|
@ -26,21 +24,17 @@ class ClockFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
|
|||
passedSeconds = ((calendar.timeInMillis + offset) / 1000).toInt()
|
||||
updateCurrentTime()
|
||||
updateDate()
|
||||
|
||||
time_zones_placeholder_2.apply {
|
||||
underlineText()
|
||||
setOnClickListener {
|
||||
placeholderClicked()
|
||||
}
|
||||
}
|
||||
|
||||
setupViews()
|
||||
}
|
||||
|
||||
private fun setupViews() {
|
||||
time_zones_holder.beVisibleIf(context.config.displayOtherTimeZones)
|
||||
context.updateTextColors(clock_fragment)
|
||||
time_zones_placeholder_2.setTextColor(context.getAdjustedPrimaryColor())
|
||||
val displayOtherTimeZones = context.config.displayOtherTimeZones
|
||||
time_zones_list.beVisibleIf(displayOtherTimeZones)
|
||||
clock_fab.beVisibleIf(displayOtherTimeZones)
|
||||
clock_fab.setOnClickListener {
|
||||
fabClicked()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCurrentTime() {
|
||||
|
@ -87,7 +81,7 @@ class ClockFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
|
|||
updateHandler.removeCallbacksAndMessages(null)
|
||||
}
|
||||
|
||||
private fun placeholderClicked() {
|
||||
private fun fabClicked() {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.simplemobiletools.clock.fragments
|
||||
|
||||
import android.content.Context
|
||||
import android.support.design.widget.CoordinatorLayout
|
||||
import android.util.AttributeSet
|
||||
import android.widget.RelativeLayout
|
||||
|
||||
abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
|
||||
abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) : CoordinatorLayout(context, attributeSet) {
|
||||
abstract fun onActivityResume()
|
||||
}
|
||||
|
|
|
@ -7,61 +7,48 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/clock_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/big_margin"
|
||||
android:gravity="center_horizontal"
|
||||
android:textSize="@dimen/clock_text_size"
|
||||
tools:text="00:00:00"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/clock_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/clock_time"
|
||||
android:gravity="center_horizontal"
|
||||
android:textSize="@dimen/big_text_size"
|
||||
tools:text="Mon, 1 January"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/time_zones_holder"
|
||||
android:id="@+id/clock_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/clock_date"
|
||||
android:layout_marginTop="@dimen/medium_margin">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/time_zones_placeholder"
|
||||
android:id="@+id/clock_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/activity_margin"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/activity_margin"
|
||||
android:paddingRight="@dimen/activity_margin"
|
||||
android:text="@string/time_zones_placeholder_1"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
android:layout_marginTop="@dimen/big_margin"
|
||||
android:gravity="center_horizontal"
|
||||
android:textSize="@dimen/clock_text_size"
|
||||
tools:text="00:00:00"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/time_zones_placeholder_2"
|
||||
android:id="@+id/clock_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/time_zones_placeholder"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/medium_margin"
|
||||
android:text="@string/time_zones_placeholder_2"
|
||||
android:textSize="@dimen/bigger_text_size"/>
|
||||
android:layout_below="@+id/clock_time"
|
||||
android:gravity="center_horizontal"
|
||||
android:textSize="@dimen/big_text_size"
|
||||
tools:text="Mon, 1 January"/>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
||||
android:id="@+id/time_zones_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/clock_date"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="none"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.simplemobiletools.commons.views.MyFloatingActionButton
|
||||
android:id="@+id/clock_fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/activity_margin"
|
||||
android:src="@drawable/ic_plus"/>
|
||||
|
||||
</com.simplemobiletools.clock.fragments.ClockFragment>
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<string name="app_name">Jednoduché hodinky</string>
|
||||
<string name="app_launcher_name">Hodinky</string>
|
||||
|
||||
<!-- Time zones -->
|
||||
<string name="time_zones_placeholder_1">Zdá sa, že ste nezvolil žiadne dodatočné časové pásma.</string>
|
||||
<string name="time_zones_placeholder_2">Pridať nové časové pásma</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="clock_tab">Okno s časom</string>
|
||||
<string name="alarm_tab">Okno s budíkom</string>
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<string name="app_name">Simple Clock</string>
|
||||
<string name="app_launcher_name">Clock</string>
|
||||
|
||||
<!-- Time zones -->
|
||||
<string name="time_zones_placeholder_1">Seems like you haven\'t selected any extra time zones.</string>
|
||||
<string name="time_zones_placeholder_2">Add new time zones</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string name="clock_tab">Clock tab</string>
|
||||
<string name="alarm_tab">Alarm tab</string>
|
||||
|
|
Loading…
Reference in New Issue