Commit c1ccc474 by likorn

Removed Fragment TimeIsOver

parent afc32e00
...@@ -85,8 +85,8 @@ class TaskActivity : AppCompatActivity() { ...@@ -85,8 +85,8 @@ class TaskActivity : AppCompatActivity() {
tv_timer.text = resources.getString(R.string.response_wrong) tv_timer.text = resources.getString(R.string.response_wrong)
answer.card.background.setColorFilter(color(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY) answer.card.background.setColorFilter(color(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY)
btn_next.background.setColorFilter(color(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY) btn_next.background.setColorFilter(color(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY)
btn_next.setTextColor(Color.WHITE)
(answer.card.getChildAt(0) as TextView).setTextColor(Color.WHITE) (answer.card.getChildAt(0) as TextView).setTextColor(Color.WHITE)
} }
} }
...@@ -115,12 +115,11 @@ class TaskActivity : AppCompatActivity() { ...@@ -115,12 +115,11 @@ class TaskActivity : AppCompatActivity() {
} }
override fun onFinish() { override fun onFinish() {
cv_task.elevation = 0f tv_timer.setTextSize(TypedValue.COMPLEX_UNIT_SP, resources.getDimension(R.dimen.response_text_size))
makeButtonsUncheckable() tv_timer.text = resources.getString(R.string.time_is_over)
supportFragmentManager btn_next.background.setColorFilter(color(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY)
.beginTransaction() btn_next.setTextColor(Color.WHITE)
.replace(R.id.main_layout, TimeIsOverFragment.newInstance(), "time_is_over") btn_next.visibility = View.VISIBLE
.commitAllowingStateLoss()
} }
} }
} }
......
package com.example.quickmax
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
class TimeIsOverFragment: Fragment() {
companion object {
fun newInstance(): TimeIsOverFragment {
return TimeIsOverFragment()
}
}
override fun onCreateView(inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_time_is_over, container, false)
view.setOnClickListener { (activity as TaskActivity).reload() }
return view
}
}
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
android:background="@drawable/gradient"> android:background="@drawable/gradient">
<TextView <TextView
android:id="@+id/textView4" android:id="@+id/tv_how_many_digits"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@+id/tv_how_many_digits"
app:layout_constraintEnd_toEndOf="@+id/textView4" app:layout_constraintStart_toStartOf="@+id/tv_how_many_digits"
app:layout_constraintStart_toStartOf="@+id/textView4" app:layout_constraintTop_toBottomOf="@+id/tv_how_many_digits"
app:layout_constraintTop_toBottomOf="@+id/textView4"> app:layout_constraintBottom_toTopOf="@+id/seek_bar">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/card_2_digits" android:id="@+id/card_2_digits"
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
app:layout_constraintEnd_toEndOf="@+id/layout_num_digits" app:layout_constraintEnd_toEndOf="@+id/layout_num_digits"
app:layout_constraintStart_toStartOf="@+id/layout_num_digits" app:layout_constraintStart_toStartOf="@+id/layout_num_digits"
app:layout_constraintTop_toBottomOf="@+id/layout_num_digits" app:layout_constraintTop_toBottomOf="@+id/layout_num_digits"
app:layout_constraintBottom_toTopOf="@+id/seek_bar_value"
app:left_thumb_color="@android:color/white" app:left_thumb_color="@android:color/white"
app:left_thumb_color_pressed="@color/colorPrimary" app:left_thumb_color_pressed="@color/colorPrimary"
app:max_value="10" app:max_value="10"
...@@ -102,6 +103,7 @@ ...@@ -102,6 +103,7 @@
android:text="@string/time_to_solve" android:text="@string/time_to_solve"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption" android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
android:textColor="@android:color/white" android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/layout_num_digits" app:layout_constraintStart_toStartOf="@+id/layout_num_digits"
app:layout_constraintTop_toBottomOf="@+id/seek_bar" /> app:layout_constraintTop_toBottomOf="@+id/seek_bar" />
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
<TextView <TextView
android:id="@+id/tv_timer" android:id="@+id/tv_timer"
style="@style/TextAppearance.MaterialComponents.Headline4"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:gravity="center" android:gravity="center"
android:text="@string/number_digits_3"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="60sp" android:textSize="60sp"
app:layout_constraintBottom_toTopOf="@+id/cv_task" app:layout_constraintBottom_toTopOf="@+id/cv_task"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/gradient">
<ImageView
android:id="@+id/img_view_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="@android:color/white"
app:layout_constraintBottom_toTopOf="@id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
app:srcCompat="@drawable/ic_timer_big" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/time_is_over"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@android:color/white"
app:layout_constraintBottom_toTopOf="@+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/img_view_timer" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:text="@string/tap_to_continue"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="#97000000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="response_text_size">20sp</dimen> <dimen name="response_text_size">14sp</dimen>
</resources> </resources>
\ No newline at end of file
<resources> <resources>
<string name="app_name">QuickMax</string> <string name="app_name">QuickMax</string>
<string name="second_max">Choose the second greatest value</string> <string name="second_max">Choose the second greatest value</string>
<string name="response_correct">CORRECT</string> <string name="response_correct">Correct!</string>
<string name="response_wrong">WRONG</string> <string name="response_wrong">Wrong!</string>
<string name="time_is_over">TIME IS OVER</string> <string name="time_is_over">Time is over!</string>
<string name="number_digits_2">2</string> <string name="number_digits_2">2</string>
<string name="number_digits_3">3</string> <string name="number_digits_3">3</string>
<string name="number_digits_4">4</string> <string name="number_digits_4">4</string>
<string name="how_many_digits">HOW MANY DIGITS?</string> <string name="how_many_digits">How many digits?</string>
<string name="time_to_solve">Time to solve: %1$s seconds</string> <string name="time_to_solve">Time to solve: %1$s seconds</string>
<string name="btn_next">Next</string> <string name="btn_next">Next</string>
<string name="tap_to_continue">Tap anywhere to continue</string> <string name="tap_to_continue">Tap anywhere to continue</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment