Skip to content

Commit

Permalink
Fix #84 Enhance UI of search activity
Browse files Browse the repository at this point in the history
  • Loading branch information
yashk2000 committed Apr 14, 2020
1 parent d443b2f commit 15c351f
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 69 deletions.
Expand Up @@ -41,6 +41,11 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
client_search_list.layoutManager = LinearLayoutManager(this)

setSupportActionBar(toolbar)
val actionBar = supportActionBar
actionBar?.title = getString(R.string.app_name)



search_btn.setOnClickListener {

Expand Down Expand Up @@ -69,7 +74,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
}
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
/*override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.main, menu)
return true
}
Expand All @@ -79,7 +84,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
R.id.action_settings -> return true
else -> return super.onOptionsItemSelected(item)
}
}
}*/

override fun onNavigationItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
Expand Down
9 changes: 9 additions & 0 deletions visionppi/app/src/main/res/drawable/button_design.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/blueDark"/>
<corners android:radius="15dp" />
</shape>
</item>
</selector>
126 changes: 59 additions & 67 deletions visionppi/app/src/main/res/layout/content_main.xml
@@ -1,83 +1,75 @@
<?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">

<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout

android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/app_bar_main"
tools:context="org.mifos.visionppi.ui.home.MainActivity">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/veryLightGray"
android:padding="@dimen/ll_margin" tools:layout_editor_absoluteY="-62dp"
tools:layout_editor_absoluteX="-16dp">

<TextView
android:text="@string/welcome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/user_profile_text_size"
android:id="@+id/textView"/>

<TextView
android:text="@string/search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView5"
android:layout_marginTop="@dimen/foursp_margin"
android:layout_marginBottom="@dimen/foursp_margin" style="@style/heading_style"/>
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="org.mifos.visionppi.ui.home.MainActivity"
tools:showIn="@layout/app_bar_main">

<TextView
android:text="@string/search_desc"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView6"
style="@style/small_text_style" android:layout_marginBottom="@dimen/ll_margin"/>


<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:background="@drawable/search_bar"
android:layout_gravity="center_vertical"
android:id="@+id/search_query_layout"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:background="@color/veryLightGray"
android:orientation="vertical"
android:padding="@dimen/ll_margin"
tools:layout_editor_absoluteX="-16dp"
tools:layout_editor_absoluteY="-62dp">

<TextView
android:id="@+id/textView5"
style="@style/heading_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/foursp_margin"
android:layout_marginBottom="@dimen/foursp_margin"
android:text="@string/search" />

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/search_query"
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/fontColour"
android:layout_gravity="center_vertical"
android:hint=""/>

</com.google.android.material.textfield.TextInputLayout>

android:layout_marginTop="@dimen/activity_vertical_margin">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/search_query"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search_query" />
</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/search_btn"
style="@style/SearchButton"
android:background="@drawable/button_design"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/ll_margin"
android:layout_marginBottom="@dimen/ll_margin"
android:text="@string/search" />

<Button
android:text="@string/search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/search_btn"
style="@style/Button"
android:layout_marginBottom="@dimen/text_input_spacing"
android:layout_marginTop="@dimen/ll_margin"/>
<TextView
android:id="@+id/listHeading"
style="@style/heading_style2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/foursp_margin"
android:layout_marginBottom="@dimen/foursp_margin"
android:text="@string/search_results" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/client_search_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/client_search_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />


</LinearLayout>
</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
1 change: 1 addition & 0 deletions visionppi/app/src/main/res/values/dimens.xml
Expand Up @@ -9,6 +9,7 @@
<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="client_text_size">27sp</dimen>
<dimen name="foursp_margin">4sp</dimen>
<dimen name="twenty_four_sp">24sp</dimen>
</resources>
2 changes: 2 additions & 0 deletions visionppi/app/src/main/res/values/strings.xml
Expand Up @@ -50,4 +50,6 @@
<string name="analyze_images">Analyze Images</string>
<string name="cant_open_gallery">Cannot open gallery</string>
<string name="cv_logo">cv_logo</string>
<string name="search_query">Enter name/account number of client</string>
<string name="search_results">Client Results</string>
</resources>
8 changes: 8 additions & 0 deletions visionppi/app/src/main/res/values/styles.xml
Expand Up @@ -14,6 +14,10 @@
<item name="android:textColor">@color/fontColour</item>
<item name="android:textStyle">bold</item>
</style>
<style name="SearchButton">
<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 Down Expand Up @@ -50,6 +54,10 @@
<item name="android:textColor">@color/cardview_dark_background</item>
<item name="android:textSize">@dimen/text_input_spacing</item>
</style>
<style name="heading_style2">
<item name="android:textColor">@color/cardview_dark_background</item>
<item name="android:textSize">@dimen/client_text_size</item>
</style>
<style name="question_style">
<item name="android:layout_width">match_parent</item>
<item name="android:background">@color/lightGray</item>
Expand Down

0 comments on commit 15c351f

Please sign in to comment.