Commit 41503125 by likorn

Updated colors in responses

parent d420f6fb
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".MainActivity"> <activity android:name=".MainActivity"
android:theme="@style/Theme.MaterialComponents.Light.NoActionBar">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
......
package com.example.quickmax package com.example.quickmax
import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
...@@ -8,13 +7,11 @@ import android.view.ViewGroup ...@@ -8,13 +7,11 @@ import android.view.ViewGroup
import android.widget.ImageButton import android.widget.ImageButton
import android.widget.TextView import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
class ResponseFragment: Fragment() { class ResponseFragment: Fragment() {
private val greenColor = Color.parseColor("#4CAF50")
private val redColor = Color.parseColor("#F44336")
companion object { companion object {
fun newInstance(): ResponseFragment { fun newInstance(): ResponseFragment {
return ResponseFragment() return ResponseFragment()
...@@ -27,9 +24,9 @@ class ResponseFragment: Fragment() { ...@@ -27,9 +24,9 @@ class ResponseFragment: Fragment() {
val view = inflater.inflate(R.layout.fragment_response, container, false) val view = inflater.inflate(R.layout.fragment_response, container, false)
val correct = arguments!!.getBoolean("correct") val correct = arguments!!.getBoolean("correct")
return if (correct) return if (correct)
view(view, greenColor, R.string.response_correct) view(view, ContextCompat.getColor(activity!!, R.color.gradient_light), R.string.response_correct)
else else
view(view, redColor, R.string.response_wrong) view(view, ContextCompat.getColor(activity!!, R.color.gradient_dark), R.string.response_wrong)
} }
private fun view(view: View, color: Int, responseId: Int): View { private fun view(view: View, color: Int, responseId: Int): View {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/response_layout" android:id="@+id/response_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="54dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent">
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_double_arrow" /> app:srcCompat="@drawable/ic_double_arrow_small" />
<TextView <TextView
android:id="@+id/tv_response" android:id="@+id/tv_response"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/response_layout" android:id="@+id/response_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="54dp"
android:background="@color/white" android:background="@color/white"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
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