mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-02-23 15:17:47 +01:00
add a textview for current time at the Clock fragment
This commit is contained in:
parent
a64b1903cd
commit
ce00e3975b
@ -102,6 +102,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewpager.currentItem = config.lastUsedViewPagerPage
|
viewpager.currentItem = config.lastUsedViewPagerPage
|
||||||
|
viewpager.offscreenPageLimit = 2
|
||||||
main_tabs_holder.onTabSelectionChanged(
|
main_tabs_holder.onTabSelectionChanged(
|
||||||
tabUnselectedAction = {
|
tabUnselectedAction = {
|
||||||
it.icon?.applyColorFilter(config.textColor)
|
it.icon?.applyColorFilter(config.textColor)
|
||||||
|
@ -3,7 +3,12 @@ package com.simplemobiletools.clock.fragments
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.widget.RelativeLayout
|
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) {
|
class AlarmFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
|
||||||
|
override fun onFinishInflate() {
|
||||||
|
super.onFinishInflate()
|
||||||
|
context.updateTextColors(alarm_fragment)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,12 @@ package com.simplemobiletools.clock.fragments
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.widget.RelativeLayout
|
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) {
|
class ClockFragment(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
|
||||||
|
override fun onFinishInflate() {
|
||||||
|
super.onFinishInflate()
|
||||||
|
context.updateTextColors(clock_fragment)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
@ -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) {
|
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.simplemobiletools.clock.fragments.ClockFragment
|
<com.simplemobiletools.clock.fragments.ClockFragment
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/clock_fragment"
|
android:id="@+id/clock_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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>
|
</com.simplemobiletools.clock.fragments.ClockFragment>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-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"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/stopwatch_fragment"
|
android:id="@+id/stopwatch_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
</com.simplemobiletools.clock.fragments.StopwatchkFragment>
|
</com.simplemobiletools.clock.fragments.StopwatchFragment>
|
||||||
|
3
app/src/main/res/values/dimens.xml
Normal file
3
app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<dimen name="clock_text_size">54sp</dimen>
|
||||||
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user