Skip to content

Commit

Permalink
updated the ui
Browse files Browse the repository at this point in the history
  • Loading branch information
raviranjan3570 committed Jul 19, 2020
1 parent c4b195e commit 732a1aa
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 61 deletions.
108 changes: 56 additions & 52 deletions app/src/main/res/layout/activity_list.xml
Original file line number Diff line number Diff line change
@@ -1,74 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
>
<LinearLayout
android:layout_marginEnd="@dimen/layout_leftMargin"
android:padding="@dimen/layout_padding"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal">
<androidx.cardview.widget.CardView
android:layout_width="@dimen/cover_width"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:elevation="10dp"
app:cardCornerRadius="8dp"
>
android:layout_height="?android:listPreferredItemHeightLarge"
android:orientation="horizontal">

<androidx.cardview.widget.CardView
android:layout_width="@dimen/cover_width"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:elevation="10dp"
app:cardCornerRadius="8dp">

<ImageView
android:id="@+id/book_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/todo"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher_background"
android:contentDescription="@string/todo" />
</androidx.cardview.widget.CardView>
android:src="@drawable/ic_launcher_background" />
</androidx.cardview.widget.CardView>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="sans-serif-black"
android:maxLines="1"
android:text="@string/title"
android:textSize="16sp" />

<TextView
android:id="@+id/author_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:fontFamily="cursive"
android:maxLines="1"
android:text="@string/author"
android:textSize="12sp" />

<LinearLayout
android:layout_marginLeft="8dp"
android:padding="6dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_marginTop="4dp"
android:orientation="horizontal">

<TextView
android:id="@+id/title"
android:id="@+id/currency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:text="@string/title"/>
android:layout_marginEnd="4dp"
android:textSize="12sp"
android:text="@string/INR" />

<TextView
android:id="@+id/author_name"
android:fontFamily="cursive"
android:layout_marginEnd="12dp"
android:id="@+id/retails_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/author"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/currency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:text="@string/INR"/>
<TextView
android:id="@+id/retails_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/_1000"/>
</LinearLayout>

android:textSize="12sp"
android:text="@string/_1000" />
</LinearLayout>
</LinearLayout>



</LinearLayout>
</LinearLayout>
21 changes: 12 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">

<ListView
android:orientation="vertical"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:divider="@null"
android:dividerHeight="16dp"
android:orientation="vertical" />
<!--Empty view is only visible when the list has no items.-->
<TextView
android:id="@+id/empty_list"
android:layout_centerInParent="true"
android:gravity="center"
android:layout_height = "wrap_content"
android:layout_width="wrap_content"
/>
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center" />

<ProgressBar
android:id="@+id/loading_spinner"
style="@android:style/Widget.ProgressBar"
android:indeterminateDrawable="@drawable/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
/>
android:indeterminateDrawable="@drawable/progress" />
</RelativeLayout>

0 comments on commit 732a1aa

Please sign in to comment.