Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
quick_max
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
41503125
authored
Sep 24, 2019
by
likorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated colors in responses
parent
d420f6fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
11 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/example/quickmax/ResponseFragment.kt
app/src/main/res/layout/fragment_response.xml
app/src/main/res/layout/fragment_time_is_over.xml
app/src/main/AndroidManifest.xml
View file @
41503125
...
@@ -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"
/>
...
...
app/src/main/java/com/example/quickmax/ResponseFragment.kt
View file @
41503125
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
{
...
...
app/src/main/res/layout/fragment_response.xml
View file @
41503125
...
@@ -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=
"
80
dp"
android:layout_height=
"
54
dp"
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"
/>
...
...
app/src/main/res/layout/fragment_time_is_over.xml
View file @
41503125
...
@@ -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=
"
60
dp"
android:layout_height=
"
54
dp"
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment