Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Kamila/UI fixes #233

Merged
merged 6 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class AuthenticationActivityTest {
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard())
onView(withId(R.id.logIn)).perform(click())
Thread.sleep(1000)
onView(withId(R.id.email)).check(matches(withText("Authentication error")))
onView(withId(R.id.authentication_status)).check(matches(withText("Authentication error")))
}

@Test
Expand All @@ -119,19 +119,19 @@ class AuthenticationActivityTest {
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard())
onView(withId(R.id.createAcc)).perform(click())

onView(withId(R.id.email)).check(matches(withText("Authentication error")))
onView(withId(R.id.authentication_status)).check(matches(withText("Authentication error")))
}

@Test
fun stringValidationEmptyUsername() {
onView(withId(R.id.createAcc)).perform(click())
onView(withId(R.id.email)).check(matches(withText("Empty email or password")))
onView(withId(R.id.authentication_status)).check(matches(withText("Empty email or password")))
}

@Test
fun stringValidationEmptyUPassword() {
onView(withId(R.id.createAcc)).perform(click())
onView(withId(R.id.email)).check(matches(withText("Empty email or password")))
onView(withId(R.id.authentication_status)).check(matches(withText("Empty email or password")))
}

@Test
Expand All @@ -150,7 +150,7 @@ class AuthenticationActivityTest {
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard())
onView(withId(R.id.createAcc)).perform(click())

onView(withId(R.id.email)).check(matches(withText("Not an email")))
onView(withId(R.id.authentication_status)).check(matches(withText("Not an email")))
}

@Test
Expand All @@ -162,7 +162,7 @@ class AuthenticationActivityTest {
onView(withId(R.id.password)).perform(ViewActions.typeText(password), closeSoftKeyboard())
onView(withId(R.id.createAcc)).perform(click())

onView(withId(R.id.email)).check(matches(withText("Password has to be at least 6 symbols")))
onView(withId(R.id.authentication_status)).check(matches(withText("Password has to be at least 6 symbols")))
}


Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.AuthenticationActivity"
android:exported="true" />
android:exported="true"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".activity.WelcomeActivity"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AuthenticationActivity : AppCompatActivity() {

val username = findViewById<EditText>(R.id.username)
val password = findViewById<EditText>(R.id.password)
email = findViewById(R.id.email)
email = findViewById(R.id.authentication_status)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ProfileActivity : AppCompatActivity() {
}

private fun setEditUserNameBtnListener() {
findViewById<Button>(R.id.editUser).setOnClickListener {
findViewById<ImageView>(R.id.editUser).setOnClickListener {
showGeneralDialog(R.id.username, "username")
}
}
Expand Down
Binary file added app/src/main/res/drawable/pencil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/rounded_edittext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:width="2dp" android:color="@color/fade_blue" />
<corners
android:radius = "15dp" />
</shape>
71 changes: 41 additions & 30 deletions app/src/main/res/layout/activity_authentication.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,52 +20,53 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />

<ImageView
android:id="@+id/authentication_logo"
android:layout_width="190dp"
android:layout_height="154dp"
android:layout_marginTop="32dp"
android:contentDescription="@string/app_logo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/logo" />

<TextView
android:id="@+id/email"
android:layout_width="367dp"
android:layout_height="211dp"
android:layout_marginTop="100dp"
android:fontFamily="monospace"
android:text="@string/authentication_noActionDoneYet"
android:id="@+id/authentication_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="Welcome to Vibester"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="25sp"
app:layout_constraintBottom_toTopOf="@+id/scrollView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.636"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/authentication_logo" />

<ScrollView
android:id="@+id/scrollView2"
android:layout_width="409dp"
android:layout_height="530dp"
android:layout_width="407dp"
android:layout_height="390dp"
android:layout_marginStart="1dp"
android:layout_marginEnd="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/email">
app:layout_constraintTop_toBottomOf="@+id/authentication_status">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">

<Button
android:id="@+id/googleBtn"
android:layout_width="200dp"
android:layout_height="48dp"
android:backgroundTint="@color/cg_blue"
android:elevation="10dp"
android:stateListAnimator="@null"
android:text="@string/logInGoogle"
android:translationZ="10dp" />

<Space
android:layout_width="match_parent"
android:layout_height="75dp" />
android:layout_height="62dp" />

<EditText
android:id="@+id/username"
Expand All @@ -92,29 +93,39 @@
android:layout_width="match_parent"
android:layout_height="18dp" />

<Space
android:layout_width="match_parent"
android:layout_height="15dp" />

<Button
android:id="@+id/createAcc"
android:id="@+id/logIn"
android:layout_width="200dp"
android:layout_height="48dp"

android:backgroundTint="@color/cg_blue"
android:elevation="10dp"
android:stateListAnimator="@null"
android:text="@string/createAcc"
android:text="@string/logIn"
android:translationZ="10dp" />

<Space
android:layout_width="match_parent"
android:layout_height="15dp" />
<Button
android:id="@+id/googleBtn"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:backgroundTint="@color/cg_blue"
android:elevation="10dp"
android:stateListAnimator="@null"
android:text="@string/logInGoogle"
android:translationZ="10dp" />

<Button
android:id="@+id/logIn"
android:id="@+id/createAcc"
android:layout_width="200dp"
android:layout_height="48dp"

android:backgroundTint="@color/cg_blue"
android:elevation="10dp"
android:stateListAnimator="@null"
android:text="@string/logIn"
android:text="@string/createAcc"
android:translationZ="10dp" />

</LinearLayout>
Expand Down
75 changes: 37 additions & 38 deletions app/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/floral_white"
tools:context=".profile.ProfileActivity">
tools:context=".activity.ProfileActivity">


<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/profileContent"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="165dp">

<ImageView
android:id="@+id/avatar"
Expand All @@ -28,24 +31,37 @@
app:layout_constraintWidth_max="150dp"
tools:srcCompat="@tools:sample/avatars" />

<TextView
android:id="@+id/username"
android:layout_width="200dp"
android:layout_height="30dp"
android:layout_marginBottom="109dp"
android:fontFamily="monospace"
android:text="@string/authentication_placeholderUsername"
android:textAlignment="center"
android:textColor="#000"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/profileStatistics"

<RelativeLayout
android:layout_width="403dp"
android:layout_height="42dp"
android:layout_weight=".2"
app:layout_constraintBottom_toTopOf="@+id/showQRCode"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.284"
app:layout_constraintRight_toLeftOf="@+id/editUser"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/avatar"
app:layout_constraintVertical_bias="0.678" />
app:layout_constraintTop_toBottomOf="@+id/avatar">

<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_weight=".4"
android:text="@string/authentication_placeholderUsername"
android:textSize="20dp"
android:textStyle="bold" />

<ImageView
android:id="@+id/editUser"
android:layout_width="30dp"
android:layout_height="27dp"
android:layout_centerInParent="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="32dp"
android:layout_toRightOf="@+id/username"
android:src="@drawable/pencil" />

</RelativeLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/profile_returnToMain"
Expand Down Expand Up @@ -179,20 +195,6 @@

</TableLayout>

<Button
android:id="@+id/editUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="36dp"
android:layout_marginBottom="136dp"
android:backgroundTint="@color/cg_blue"
android:elevation="10dp"
android:stateListAnimator="@null"
android:text="Edit"
android:translationZ="10dp"
app:layout_constraintBottom_toTopOf="@+id/profileStatistics"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toRightOf="@+id/username" />

<Button
android:id="@+id/logout"
Expand All @@ -213,18 +215,15 @@
android:id="@+id/showQRCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="66dp"
android:layout_marginBottom="36dp"
android:backgroundTint="@color/cg_blue"
android:text="QR Code"
app:layout_constraintBottom_toTopOf="@+id/profileStatistics"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/username" />
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

<include layout="@layout/display_qr_code" />

Expand Down
21 changes: 14 additions & 7 deletions app/src/main/res/layout/activity_search_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@

<EditText
android:id="@+id/searchUserET"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:autofillHints="Enter username to search">
</EditText>
android:layout_width="305dp"
android:layout_height="40dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="50dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="5dp"
android:autofillHints="Enter username to search"
android:background="@drawable/rounded_edittext"
android:padding="10dp"></EditText>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/searchList"
android:layout_below="@+id/searchUserET"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_below="@+id/searchUserET">

</androidx.recyclerview.widget.RecyclerView>

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<color name="black_overlay">#66000000</color>
<!-- Our Color Palette -->
<color name="cg_blue">#FF227C9D</color>
<color name="fade_blue">#FFA7CBD8</color>

<color name="tiffany_blue">#FF17c3b2</color>
<color name="maximum_yellow_red">#FFFFCB77</color>
<color name="floral_white">#FFFEF9EF</color>
Expand Down