Skip to content

Commit

Permalink
Fix openMF#36 Enhance UI of client profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
yashk2000 committed Apr 14, 2020
1 parent d443b2f commit 4fc2a38
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 70 deletions.
Expand Up @@ -5,6 +5,7 @@ import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import kotlinx.android.synthetic.main.toolbar.*
import org.mifos.visionppi.R
import org.mifos.visionppi.databinding.ActivityClientProfileBinding
import org.mifos.visionppi.objects.Client
Expand All @@ -31,6 +32,10 @@ class ClientProfileActivity : AppCompatActivity() , ClientProfileMVPView {
startActivity(intent)
}

setSupportActionBar(appToolbar)
val actionBar = supportActionBar
actionBar?.title = "Client Profile"

}
override fun setClientDetails(client : Client) {
binding.clientIdValue.text = client.entityId.toString()
Expand Down
172 changes: 107 additions & 65 deletions visionppi/app/src/main/res/layout/activity_client_profile.xml
@@ -1,134 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<LinearLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

<include layout="@layout/toolbar"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/ll_margin" android:paddingBottom="@dimen/text_input_spacing"
android:clipToPadding="false">
android:layout_margin="@dimen/ll_margin"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingBottom="@dimen/text_input_spacing">

<LinearLayout
android:layout_height="134dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:background="@color/lightGray"
android:layout_marginBottom="@dimen/text_input_spacing">
android:layout_height="94dp"
android:orientation="horizontal">

<ImageView
android:layout_width="146dp"
android:layout_height="145dp"
android:layout_gravity="center_vertical"
app:srcCompat="@drawable/user_profile_logo"
android:id="@+id/client_image"
android:contentDescription="@string/user_profile"
android:layout_width="94dp"
android:layout_height="94dp"
android:layout_gravity="center_vertical"
android:layout_marginTop="@dimen/text_input_spacing"
android:layout_marginBottom="@dimen/text_input_spacing"/>
android:layout_marginBottom="@dimen/text_input_spacing"
android:contentDescription="@string/user_profile"
app:srcCompat="@drawable/user_profile_logo" />

<TextView
android:text=""
android:id="@+id/client_name_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAlignment="center"
android:textSize="@dimen/text_input_spacing"
android:id="@+id/client_name_value"
android:layout_weight="1"/>
android:layout_weight="1"
android:text="TextView"
android:textSize="@dimen/text_input" />

</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#A9A9A9" />

<LinearLayout
android:layout_height="wrap_content"
style="@style/user_profile_row">
style="@style/user_profile_row"
android:layout_marginTop="@dimen/ll_margin"
android:layout_height="wrap_content">

<TextView
android:text="@string/client_id"
android:id="@+id/client_id_key"
style="@style/user_profile_key"/>
style="@style/user_profile_key"
android:text="@string/client_id" />

<TextView
android:text=""
android:id="@+id/client_id_value"
style="@style/user_profile_value"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:text="" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#c0c0c0" />

<LinearLayout
android:layout_height="wrap_content"
style="@style/user_profile_row">
style="@style/user_profile_row"
android:layout_marginTop="@dimen/ll_margin"
android:layout_height="wrap_content">

<TextView
android:text="@string/account_no"
android:id="@+id/account_no_key"
style="@style/user_profile_key"/>
style="@style/user_profile_key"
android:text="@string/account_no" />

<TextView
android:text=""
android:id="@+id/account_no_value"
style="@style/user_profile_value" android:layout_height="match_parent"
/>
style="@style/user_profile_value"
android:layout_height="match_parent"
android:text="" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#c0c0c0" />

<LinearLayout
android:layout_height="wrap_content"
style="@style/user_profile_row">
style="@style/user_profile_row"
android:layout_marginTop="@dimen/ll_margin"
android:layout_height="wrap_content">

<TextView
android:text="@string/mobile_no"
android:id="@+id/mobile_no_key"
style="@style/user_profile_key"/>
style="@style/user_profile_key"
android:text="@string/mobile_no" />

<TextView
android:text=""
android:id="@+id/mobile_no_value"
style="@style/user_profile_value"/>
style="@style/user_profile_value"
android:text="" />
</LinearLayout>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#c0c0c0" />

<LinearLayout
android:layout_height="wrap_content"
style="@style/user_profile_row">
style="@style/user_profile_row"
android:layout_marginTop="@dimen/ll_margin"
android:layout_height="wrap_content">

<TextView
android:text="@string/client_type"
android:id="@+id/client_type_key"
style="@style/user_profile_key"/>
style="@style/user_profile_key"
android:text="@string/client_type" />

<TextView
android:text=""
android:id="@+id/client_type_value"
style="@style/user_profile_value" android:layout_height="match_parent"
/>
style="@style/user_profile_value"
android:layout_height="match_parent"
android:text="" />
</LinearLayout>
<Button
android:text="@string/take_new_survey"
style="@style/Button"

<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/new_survey_btn"
android:layout_marginBottom="@dimen/text_input_spacing"
android:layout_marginLeft="@dimen/text_input_spacing"
android:layout_marginRight="@dimen/text_input_spacing"/>

<Button
android:text="@string/view_previous_surveys"
style="@style/Button"
android:layout_height="1dp"
android:background="#c0c0c0"
android:layout_marginBottom="@dimen/ll_margin"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/prev_survey_btn"
android:layout_marginLeft="@dimen/text_input_spacing"
android:layout_marginRight="@dimen/text_input_spacing"/>
android:layout_marginTop="@dimen/text_input_spacing"
android:orientation="horizontal">

<Button
android:id="@+id/new_survey_btn"
style="@style/Button2"
android:background="@drawable/button_design"
android:padding="7dp"
android:layout_weight="1"
android:layout_width="100dp"
android:layout_marginEnd="@dimen/text_input_spacing"
android:layout_height="wrap_content"
android:text="@string/take_new_survey" />

<Button
android:id="@+id/prev_survey_btn"
style="@style/Button2"
android:layout_width="100dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@drawable/button_design"
android:padding="7dp"
android:text="@string/view_previous_surveys" />

</LinearLayout>
</LinearLayout>

</ScrollView>
Expand Down
1 change: 1 addition & 0 deletions visionppi/app/src/main/res/layout/toolbar.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/appToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blueDark">
Expand Down
10 changes: 9 additions & 1 deletion visionppi/app/src/main/res/values-v21/styles.xml
Expand Up @@ -2,6 +2,14 @@
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
</style>

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/blueDark</item>
<item name="colorPrimaryDark">@color/blueDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion visionppi/app/src/main/res/values/colors.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorPrimaryDark">#108AC0</color>
<color name="colorAccent">#D81B60</color>
<color name="blueDark">#ff0099cc</color>
<color name="fontColour">#FFFFFF</color>
Expand Down
3 changes: 2 additions & 1 deletion visionppi/app/src/main/res/values/dimens.xml
Expand Up @@ -2,13 +2,14 @@
<resources>
<dimen name="ll_margin">16sp</dimen>
<dimen name="text_input_spacing">32sp</dimen>
<dimen name="text_input">27sp</dimen>
<dimen name="large_spacing">48sp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="user_profile_text_size">20sp</dimen>
<dimen name="user_profile_text_size">18sp</dimen>
<dimen name="foursp_margin">4sp</dimen>
<dimen name="twenty_four_sp">24sp</dimen>
</resources>
2 changes: 1 addition & 1 deletion visionppi/app/src/main/res/values/strings.xml
Expand Up @@ -39,7 +39,7 @@
<string name="account_no">Account No.:</string>
<string name="mobile_no">Mobile No.:</string>
<string name="take_new_survey">Take New Survey</string>
<string name="view_previous_surveys">View Previous Surveys</string>
<string name="view_previous_surveys">Previous Surveys</string>
<string name="client_type">Client Type:</string>
<string name="exception">Exception:</string>
<string name="response">Response</string>
Expand Down
7 changes: 6 additions & 1 deletion visionppi/app/src/main/res/values/styles.xml
Expand Up @@ -6,6 +6,7 @@
<item name="colorPrimary">@color/blueDark</item>
<item name="colorPrimaryDark">@color/blueDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
</style>

<style name="Button">
Expand All @@ -14,6 +15,10 @@
<item name="android:textColor">@color/fontColour</item>
<item name="android:textStyle">bold</item>
</style>
<style name="Button2">
<item name="android:textSize">@dimen/ll_margin</item>
<item name="android:textColor">@color/fontColour</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
Expand All @@ -24,7 +29,7 @@
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_marginBottom">@dimen/text_input_spacing</item>
<item name="android:layout_marginBottom">@dimen/ll_margin</item>
</style>
<style name="user_profile_key">
<item name="android:layout_gravity">center_horizontal</item>
Expand Down

0 comments on commit 4fc2a38

Please sign in to comment.