mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
adding some views to the stopwatch fragment
This commit is contained in:
@ -25,8 +25,21 @@ class StopwatchFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||||
view = (inflater.inflate(R.layout.fragment_stopwatch, container, false) as ViewGroup).apply {
|
view = (inflater.inflate(R.layout.fragment_stopwatch, container, false) as ViewGroup).apply {
|
||||||
stopwatch_time.setOnClickListener { togglePlayPause() }
|
stopwatch_time.setOnClickListener {
|
||||||
stopwatch_play_pause.setOnClickListener { togglePlayPause() }
|
togglePlayPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
stopwatch_play_pause.setOnClickListener {
|
||||||
|
togglePlayPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
stopwatch_reset.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stopwatch_lap.setOnClickListener {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
@ -45,8 +58,8 @@ class StopwatchFragment : Fragment() {
|
|||||||
context!!.apply {
|
context!!.apply {
|
||||||
updateTextColors(view.stopwatch_fragment)
|
updateTextColors(view.stopwatch_fragment)
|
||||||
view.stopwatch_play_pause.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, getAdjustedPrimaryColor())
|
view.stopwatch_play_pause.background = resources.getColoredDrawableWithColor(R.drawable.circle_background_filled, getAdjustedPrimaryColor())
|
||||||
updatePlayPauseIcon()
|
|
||||||
}
|
}
|
||||||
|
updatePlayPauseIcon()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updatePlayPauseIcon() {
|
private fun updatePlayPauseIcon() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<android.support.constraint.ConstraintLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/stopwatch_fragment"
|
android:id="@+id/stopwatch_fragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -8,23 +9,62 @@
|
|||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
android:id="@+id/stopwatch_time"
|
android:id="@+id/stopwatch_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
android:layout_marginTop="@dimen/normal_margin"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:padding="@dimen/activity_margin"
|
android:gravity="center_horizontal"
|
||||||
android:textSize="@dimen/alarm_text_size"
|
android:padding="@dimen/normal_margin"
|
||||||
tools:text="00:00"/>
|
android:textSize="@dimen/stopwatch_text_size"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="00.00"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/stopwatch_reset"
|
||||||
|
style="@style/MyBorderlessBackgroundStyle"
|
||||||
|
android:layout_width="@dimen/stopwatch_button_small_size"
|
||||||
|
android:layout_height="@dimen/stopwatch_button_small_size"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_toLeftOf="@+id/stopwatch_play_pause"
|
||||||
|
android:padding="@dimen/normal_margin"
|
||||||
|
android:src="@drawable/ic_reset"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/stopwatch_play_pause"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/stopwatch_play_pause"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/stopwatch_play_pause"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/stopwatch_play_pause"
|
android:id="@+id/stopwatch_play_pause"
|
||||||
android:layout_width="70dp"
|
android:layout_width="@dimen/stopwatch_button_size"
|
||||||
android:layout_height="70dp"
|
android:layout_height="@dimen/stopwatch_button_size"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginBottom="@dimen/big_margin"
|
android:layout_marginBottom="@dimen/big_margin"
|
||||||
android:padding="@dimen/normal_margin"
|
android:padding="@dimen/normal_margin"
|
||||||
android:src="@drawable/ic_play"/>
|
android:src="@drawable/ic_play"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
<com.simplemobiletools.commons.views.MyTextView
|
||||||
|
android:id="@+id/stopwatch_lap"
|
||||||
|
style="@style/MyBorderlessBackgroundStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/stopwatch_button_small_size"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:letterSpacing="0.1"
|
||||||
|
android:paddingLeft="@dimen/activity_margin"
|
||||||
|
android:paddingRight="@dimen/activity_margin"
|
||||||
|
android:text="@string/lap"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textSize="@dimen/bigger_text_size"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/stopwatch_play_pause"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/stopwatch_play_pause"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/stopwatch_play_pause"/>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<string name="label">Label</string>
|
<string name="label">Label</string>
|
||||||
<string name="no_days_selected">No days selected</string>
|
<string name="no_days_selected">No days selected</string>
|
||||||
<string name="alarm">Alarm</string>
|
<string name="alarm">Alarm</string>
|
||||||
|
<string name="lap">Lap</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="clock_tab">Relógio</string>
|
<string name="clock_tab">Relógio</string>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<string name="label">Štítok</string>
|
<string name="label">Štítok</string>
|
||||||
<string name="no_days_selected">Neboli označené žiadne dni</string>
|
<string name="no_days_selected">Neboli označené žiadne dni</string>
|
||||||
<string name="alarm">Budík</string>
|
<string name="alarm">Budík</string>
|
||||||
|
<string name="lap">Kolo</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="clock_tab">Okno s časom</string>
|
<string name="clock_tab">Okno s časom</string>
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<dimen name="alarm_day_size">38dp</dimen>
|
<dimen name="alarm_day_size">38dp</dimen>
|
||||||
|
<dimen name="stopwatch_button_small_size">60dp</dimen>
|
||||||
|
<dimen name="stopwatch_button_size">64dp</dimen>
|
||||||
|
|
||||||
<dimen name="clock_text_size">70sp</dimen>
|
<dimen name="clock_text_size">70sp</dimen>
|
||||||
<dimen name="alarm_text_size">46sp</dimen>
|
<dimen name="alarm_text_size">46sp</dimen>
|
||||||
|
<dimen name="stopwatch_text_size">60sp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<string name="label">Label</string>
|
<string name="label">Label</string>
|
||||||
<string name="no_days_selected">No days selected</string>
|
<string name="no_days_selected">No days selected</string>
|
||||||
<string name="alarm">Alarm</string>
|
<string name="alarm">Alarm</string>
|
||||||
|
<string name="lap">Lap</string>
|
||||||
|
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
<string name="clock_tab">Clock tab</string>
|
<string name="clock_tab">Clock tab</string>
|
||||||
|
Reference in New Issue
Block a user