Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
Research-Project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jayakody J.A.D.K.A - IT19114040
Research-Project
Commits
7365fd04
Commit
7365fd04
authored
May 02, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gender Selection Screen UI Modification
parent
ea360eec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
45 deletions
+101
-45
app/src/main/java/com/anuththara18/attentionassessment/gender/GenderActivity.java
...uththara18/attentionassessment/gender/GenderActivity.java
+86
-7
app/src/main/java/com/anuththara18/attentionassessment/language/LanguageActivity.java
...hara18/attentionassessment/language/LanguageActivity.java
+1
-1
app/src/main/res/layout/activity_gender.xml
app/src/main/res/layout/activity_gender.xml
+14
-37
No files found.
app/src/main/java/com/anuththara18/attentionassessment/gender/GenderActivity.java
View file @
7365fd04
...
...
@@ -3,12 +3,16 @@ package com.anuththara18.attentionassessment.gender;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.media.MediaPlayer
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.view.animation.AccelerateDecelerateInterpolator
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.widget.Button
;
import
android.widget.ImageButton
;
import
android.widget.ImageView
;
...
...
@@ -22,13 +26,14 @@ import com.anuththara18.attentionassessment.language.LanguageSetter;
public
class
GenderActivity
extends
AppCompatActivity
{
ImageButton
toggle_btn
;
ImageButton
toggle_btn
,
next
,
previous
;
ImageView
girl_img
,
boy_img
;
TextView
boy_txt
,
girl_txt
,
next
,
previous
,
selectGender
;
TextView
boy_txt
,
girl_txt
,
selectGender
;
public
static
int
gender
=
2
;
int
click
=
1
;
MediaPlayer
mp
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -42,19 +47,17 @@ public class GenderActivity extends AppCompatActivity {
decorView
.
setSystemUiVisibility
(
uiOptions
);
setContentView
(
R
.
layout
.
activity_gender
);
toggle_btn
=
(
ImageButton
)
findViewById
(
R
.
id
.
toggle_btn
);
//
toggle_btn = (ImageButton)findViewById(R.id.toggle_btn);
girl_img
=
(
ImageView
)
findViewById
(
R
.
id
.
girl_img
);
boy_img
=
(
ImageView
)
findViewById
(
R
.
id
.
boy_img
);
girl_txt
=
(
TextView
)
findViewById
(
R
.
id
.
girl_txt
);
boy_txt
=
(
TextView
)
findViewById
(
R
.
id
.
boy_txt
);
next
=
(
TextView
)
findViewById
(
R
.
id
.
next
);
previous
=
(
TextView
)
findViewById
(
R
.
id
.
previous
);
next
=
(
ImageButton
)
findViewById
(
R
.
id
.
next
);
previous
=
(
ImageButton
)
findViewById
(
R
.
id
.
previous
);
selectGender
=
(
TextView
)
findViewById
(
R
.
id
.
selectGender
);
girl_txt
.
setText
(
LanguageSetter
.
getresources
().
getString
(
R
.
string
.
girl
));
boy_txt
.
setText
(
LanguageSetter
.
getresources
().
getString
(
R
.
string
.
boy
));
next
.
setText
(
LanguageSetter
.
getresources
().
getString
(
R
.
string
.
next
));
previous
.
setText
(
LanguageSetter
.
getresources
().
getString
(
R
.
string
.
previous
));
selectGender
.
setText
(
LanguageSetter
.
getresources
().
getString
(
R
.
string
.
gender
));
// initially
...
...
@@ -63,6 +66,79 @@ public class GenderActivity extends AppCompatActivity {
boy_img
.
setImageAlpha
(
255
);
boy_txt
.
setAlpha
(
1
f
);
final
Handler
handler
=
new
Handler
();
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
Animation
animZoomOut
=
AnimationUtils
.
loadAnimation
(
getApplicationContext
(),
R
.
anim
.
zoom_out
);
next
.
startAnimation
(
animZoomOut
);
handler
.
postDelayed
(
this
,
750
);
}
});
}
},
0
);
girl_img
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
mp
=
MediaPlayer
.
create
(
getApplicationContext
(),
R
.
raw
.
button_click
);
mp
.
start
();
boy_img
.
setImageAlpha
(
127
);
boy_txt
.
setAlpha
(
0.5f
);
girl_img
.
setImageAlpha
(
255
);
girl_txt
.
setAlpha
(
1
f
);
gender
=
1
;
// girl
Log
.
d
(
"gender"
,
String
.
valueOf
(
gender
));
}
});
girl_txt
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
mp
=
MediaPlayer
.
create
(
getApplicationContext
(),
R
.
raw
.
button_click
);
mp
.
start
();
boy_img
.
setImageAlpha
(
127
);
boy_txt
.
setAlpha
(
0.5f
);
girl_img
.
setImageAlpha
(
255
);
girl_txt
.
setAlpha
(
1
f
);
gender
=
1
;
// girl
Log
.
d
(
"gender"
,
String
.
valueOf
(
gender
));
}
});
boy_img
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
mp
=
MediaPlayer
.
create
(
getApplicationContext
(),
R
.
raw
.
button_click
);
mp
.
start
();
girl_img
.
setImageAlpha
(
127
);
girl_txt
.
setAlpha
(
0.5f
);
boy_img
.
setImageAlpha
(
255
);
boy_txt
.
setAlpha
(
1
f
);
gender
=
2
;
// boy
Log
.
d
(
"gender"
,
String
.
valueOf
(
gender
));
}
});
boy_txt
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
mp
=
MediaPlayer
.
create
(
getApplicationContext
(),
R
.
raw
.
button_click
);
mp
.
start
();
girl_img
.
setImageAlpha
(
127
);
girl_txt
.
setAlpha
(
0.5f
);
boy_img
.
setImageAlpha
(
255
);
boy_txt
.
setAlpha
(
1
f
);
gender
=
2
;
// boy
Log
.
d
(
"gender"
,
String
.
valueOf
(
gender
));
}
});
/*
toggle_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
...
...
@@ -91,10 +167,13 @@ public class GenderActivity extends AppCompatActivity {
}
}
});
*/
next
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
finish
();
Intent
intent
=
new
Intent
(
GenderActivity
.
this
,
AgeActivity
.
class
);
startActivity
(
intent
);
}
...
...
app/src/main/java/com/anuththara18/attentionassessment/language/LanguageActivity.java
View file @
7365fd04
...
...
@@ -204,7 +204,7 @@ public class LanguageActivity extends AppCompatActivity {
Toast
.
makeText
(
getApplicationContext
(),
"Please select a language"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
mp
.
pause
();
//
mp.pause();
finish
();
Intent
intent
=
new
Intent
(
LanguageActivity
.
this
,
GenderActivity
.
class
);
startActivity
(
intent
);
...
...
app/src/main/res/layout/activity_gender.xml
View file @
7365fd04
...
...
@@ -7,19 +7,13 @@
android:background=
"@drawable/bg1"
tools:context=
".gender.GenderActivity"
>
<
TextView
<
ImageButton
android:id=
"@+id/previous"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"30dp"
android:drawableStart=
"@drawable/icon_left"
android:drawableTint=
"@color/black"
android:fontFamily=
"@font/poppins_medium"
android:gravity=
"center"
android:paddingLeft=
"30dp"
android:text=
"@string/previous"
android:textColor=
"@color/black"
android:textSize=
"16dp"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/left_btn"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
@@ -40,19 +34,13 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<
TextView
<
ImageButton
android:id=
"@+id/next"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"30dp"
android:drawableEnd=
"@drawable/icon_right"
android:drawableTint=
"@color/black"
android:fontFamily=
"@font/poppins_medium"
android:gravity=
"center"
android:paddingRight=
"30dp"
android:text=
"@string/next"
android:textColor=
"@color/black"
android:textSize=
"16dp"
android:layout_width=
"50dp"
android:layout_height=
"50dp"
android:layout_marginRight=
"20dp"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/right_btn"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
@@ -71,7 +59,7 @@
android:id=
"@+id/boy_img"
android:layout_width=
"150dp"
android:layout_height=
"250dp"
android:layout_marginStart=
"
50
dp"
android:layout_marginStart=
"
65
dp"
android:layout_marginBottom=
"15dp"
android:src=
"@drawable/boy"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
@@ -81,22 +69,11 @@
android:id=
"@+id/girl_img"
android:layout_width=
"190dp"
android:layout_height=
"280dp"
android:layout_marginEnd=
"
50
dp"
android:layout_marginEnd=
"
65
dp"
android:src=
"@drawable/girl"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<ImageButton
android:id=
"@+id/toggle_btn"
android:layout_width=
"150dp"
android:layout_height=
"150dp"
android:background=
"@drawable/toggle_left"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/girl_txt"
android:layout_width=
"wrap_content"
...
...
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