Commit 6024ee21 by likorn

Added gradient to the main activity, progress bar instead of the timer

parent 0bd68e10
......@@ -54,7 +54,7 @@ class MainActivity : AppCompatActivity() {
private val timer = object : CountDownTimer(4000, 1000) {
override fun onTick(millisUntilFinished: Long) {
tv_time_left.text = (millisUntilFinished / 1000).toString()
// tv_time_left.text = (millisUntilFinished / 1000).toString()
}
override fun onFinish() {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:angle="90"
android:endColor="@color/gradient_dark"
android:startColor="@color/gradient_light"
android:type="linear" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
......@@ -5,16 +5,72 @@
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
android:background="#DADADA"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="200dp"
android:background="@drawable/gradient"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="@+id/layout_progress_bar"
android:layout_width="match_parent"
android:layout_height="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_gravity="center"
android:indeterminate="true"
android:indeterminateTint="#FFFFFF"
android:progressTint="#FF9800"
android:progressTintMode="src_atop" />
</FrameLayout>
<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@android:color/transparent"
android:tint="@android:color/white"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layout_progress_bar"
app:srcCompat="@drawable/ic_back" />
<TextView
android:id="@+id/tv_score"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="Score: 5"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="@+id/imageButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layout_progress_bar" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
android:id="@+id/cv_task"
style="@style/CardView.Light"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_margin="16dp"
app:cardBackgroundColor="#EBF8F8F8"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="4dp"
app:cardElevation="2dp"
app:layout_constraintBottom_toTopOf="@+id/layout_answers"
......@@ -47,7 +103,10 @@
android:id="@+id/layout_answers"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_margin="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -108,18 +167,4 @@
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_time_left"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/circle_button"
android:gravity="center"
android:text="3"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -6,4 +6,6 @@
<color name="colorBackground">#C4BFCC</color>
<color name="colorCorrect">#81C784</color>
<color name="gradient_dark">#FF4A148C</color>
<color name="gradient_light">#FF00BCD4</color>
</resources>
......@@ -16,6 +16,7 @@
<item name="android:focusable">true</item>
<item name="android:foreground">?android:attr/selectableItemBackground</item>
<item name="cardCornerRadius">4dp</item>
<item name="cardBackgroundColor">@android:color/white</item>
</style>
<style name="AnswerCardText">
......
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