add a textview for current time at the Clock fragment

This commit is contained in:
tibbi 2018-02-28 13:26:15 +01:00
parent a64b1903cd
commit ce00e3975b
8 changed files with 41 additions and 13 deletions

View file

@ -102,6 +102,7 @@ class MainActivity : SimpleActivity() {
}
viewpager.currentItem = config.lastUsedViewPagerPage
viewpager.offscreenPageLimit = 2
main_tabs_holder.onTabSelectionChanged(
tabUnselectedAction = {
it.icon?.applyColorFilter(config.textColor)

View file

@ -3,7 +3,12 @@ package com.simplemobiletools.clock.fragments
import android.content.Context
import android.util.AttributeSet
import android.widget.RelativeLayout
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.fragment_alarm.view.*
class AlarmFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
override fun onFinishInflate() {
super.onFinishInflate()
context.updateTextColors(alarm_fragment)
}
}

View file

@ -3,7 +3,12 @@ package com.simplemobiletools.clock.fragments
import android.content.Context
import android.util.AttributeSet
import android.widget.RelativeLayout
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.fragment_clock.view.*
class ClockFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
override fun onFinishInflate() {
super.onFinishInflate()
context.updateTextColors(clock_fragment)
}
}

View file

@ -0,0 +1,14 @@
package com.simplemobiletools.clock.fragments
import android.content.Context
import android.util.AttributeSet
import android.widget.RelativeLayout
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.fragment_stopwatch.view.*
class StopwatchFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
override fun onFinishInflate() {
super.onFinishInflate()
context.updateTextColors(stopwatch_fragment)
}
}

View file

@ -1,9 +0,0 @@
package com.simplemobiletools.clock.fragments
import android.content.Context
import android.util.AttributeSet
import android.widget.RelativeLayout
class StopwatchkFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
}

View file

@ -1,8 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.clock.fragments.ClockFragment
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/clock_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.simplemobiletools.commons.views.MyTextView
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.clock.fragments.ClockFragment>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.clock.fragments.StopwatchkFragment
<com.simplemobiletools.clock.fragments.StopwatchFragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stopwatch_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.simplemobiletools.clock.fragments.StopwatchkFragment>
</com.simplemobiletools.clock.fragments.StopwatchFragment>

View file

@ -0,0 +1,3 @@
<resources>
<dimen name="clock_text_size">54sp</dimen>
</resources>