Skip to content

Commit

Permalink
Fix #84 Enhance UI of search activity (#87)
Browse files Browse the repository at this point in the history
* Fix #84 Enhance UI of search activity

* Revert unneeded changes
  • Loading branch information
yashk2000 committed Jun 3, 2020
1 parent 002b483 commit c4ac5bf
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 74 deletions.
2 changes: 1 addition & 1 deletion visionppi/.idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion visionppi/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -49,8 +49,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte

setSupportActionBar(toolbar)
val actionBar = supportActionBar
actionBar?.title = "Vision PPI"

actionBar?.title = getString(R.string.app_name)

search_btn.setOnClickListener {

Expand Down Expand Up @@ -109,7 +108,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 @@ -119,7 +118,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
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>
3 changes: 2 additions & 1 deletion visionppi/app/src/main/res/values/dimens.xml
Expand Up @@ -9,7 +9,8 @@
<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">18sp</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 @@ -53,4 +53,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 @@ -19,6 +19,10 @@
<item name="android:textSize">@dimen/ll_margin</item>
<item name="android:textColor">@color/fontColour</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 @@ -55,6 +59,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 c4ac5bf

Please sign in to comment.