Skip to content

Commit cf86e02

Browse files
committed
made an xml for toolbar common to all activities and added drop shadow to toolbar to add material design features...removed onClick=true from cardviews in templateActivity because listView was not getting touch as cardView was consuming it..Ripple is working fine as before now also
1 parent 7eed509 commit cf86e02

8 files changed

Lines changed: 32 additions & 37 deletions

File tree

source-code/app/src/main/res/layout-sw600dp/item_template_right.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
android:layout_width="match_parent"
66
android:layout_height="wrap_content"
77
android:minHeight="@dimen/cardview_template_height"
8-
android:clickable="true"
98
android:foreground="?attr/selectableItemBackground"
109
card_view:cardCornerRadius="@dimen/cardview_default_radius"
1110
card_view:cardElevation="@dimen/cardview_default_elevation">

source-code/app/src/main/res/layout/activity_about_buildm_learn.xml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
android:layout_width="match_parent"
4-
android:layout_height="match_parent"
5-
android:orientation="vertical"
6-
tools:context="$activity">
7-
8-
<android.support.v7.widget.Toolbar
9-
android:id="@+id/toolbar"
10-
style="@style/Toolbar.Buildmlearn"
11-
android:layout_width="match_parent"
12-
android:layout_height="?attr/actionBarSize"/>
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical"
6+
tools:context="$activity">
7+
8+
<include layout="@layout/toolbar_layout" />
139

1410
<ScrollView
1511
android:id="@+id/scrollView"
@@ -34,7 +30,7 @@
3430
android:layout_height="wrap_content"
3531
android:layout_gravity="center"
3632
android:padding="5dp"
37-
android:src="@drawable/logo_bg_dark"/>
33+
android:src="@drawable/logo_bg_dark" />
3834

3935
<LinearLayout
4036
android:layout_width="wrap_content"
@@ -48,21 +44,21 @@
4844
android:layout_height="wrap_content"
4945
android:text="@string/main_title"
5046
android:textColor="@color/black_secondary_text"
51-
android:textSize="@dimen/headline"/>
47+
android:textSize="@dimen/headline" />
5248

5349
<TextView
5450
android:layout_width="match_parent"
5551
android:layout_height="wrap_content"
5652
android:text="@string/main_subtitle"
5753
android:textColor="@color/black_secondary_text"
58-
android:textSize="@dimen/title"/>
54+
android:textSize="@dimen/title" />
5955

6056
<TextView
6157
android:id="@+id/app_version"
6258
android:layout_width="match_parent"
6359
android:layout_height="wrap_content"
6460
android:textColor="@color/black_secondary_text"
65-
android:textSize="@dimen/caption"/>
61+
android:textSize="@dimen/caption" />
6662
</LinearLayout>
6763

6864
</LinearLayout>
@@ -72,7 +68,7 @@
7268
android:layout_height="2dp"
7369
android:layout_marginBottom="8dp"
7470
android:layout_marginTop="8dp"
75-
android:background="@color/black_hint_text_disabled"/>
71+
android:background="@color/black_hint_text_disabled" />
7672

7773
<TextView
7874
android:layout_width="match_parent"
@@ -81,7 +77,7 @@
8177
android:layout_marginTop="8dp"
8278
android:text="@string/about_para_1"
8379
android:textColor="@color/black_secondary_text"
84-
android:textSize="@dimen/body"/>
80+
android:textSize="@dimen/body" />
8581

8682
<TextView
8783
android:layout_width="match_parent"
@@ -91,7 +87,7 @@
9187
android:autoLink="web"
9288
android:text="@string/about_para_2"
9389
android:textColor="@color/black_secondary_text"
94-
android:textSize="@dimen/body"/>
90+
android:textSize="@dimen/body" />
9591

9692
<TextView
9793
android:layout_width="match_parent"
@@ -101,7 +97,7 @@
10197
android:autoLink="email"
10298
android:text="@string/about_para_3"
10399
android:textColor="@color/black_secondary_text"
104-
android:textSize="@dimen/body"/>
100+
android:textSize="@dimen/body" />
105101

106102

107103
</LinearLayout>

source-code/app/src/main/res/layout/activity_home.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
android:background="@color/color_primary"
1515
android:orientation="vertical">
1616

17-
<android.support.v7.widget.Toolbar
18-
android:id="@+id/toolbar"
19-
style="@style/Toolbar.Buildmlearn"
20-
android:layout_width="match_parent"
21-
android:layout_height="?attr/actionBarSize" />
17+
<include layout="@layout/toolbar_layout" />
2218

2319
<FrameLayout
2420
android:background="@android:color/white"

source-code/app/src/main/res/layout/activity_template_grid.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
android:layout_height="match_parent"
66
tools:context="org.buildmlearn.toolkit.fragment.TestFragment">
77

8-
<android.support.v7.widget.Toolbar
9-
android:id="@+id/toolbar"
10-
style="@style/Toolbar.Buildmlearn"
11-
android:layout_width="match_parent"
12-
android:layout_height="?attr/actionBarSize" />
8+
<include layout="@layout/toolbar_layout"/>
139

1410
<GridView
1511
android:id="@android:id/list"

source-code/app/src/main/res/layout/activity_template_list.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
android:layout_height="match_parent"
66
tools:context="org.buildmlearn.toolkit.fragment.TestFragment">
77

8-
<android.support.v7.widget.Toolbar
9-
android:id="@+id/toolbar"
10-
style="@style/Toolbar.Buildmlearn"
11-
android:layout_width="match_parent"
12-
android:layout_height="?attr/actionBarSize" />
8+
<include layout="@layout/toolbar_layout"/>
139

1410
<ListView
1511
android:id="@android:id/list"

source-code/app/src/main/res/layout/item_template_left.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
android:id="@+id/card_view"
55
android:layout_width="match_parent"
66
android:layout_height="wrap_content"
7-
android:clickable="true"
87
android:foreground="?attr/selectableItemBackground"
98
android:minHeight="@dimen/cardview_template_height"
109
card_view:cardCornerRadius="@dimen/cardview_default_radius"

source-code/app/src/main/res/layout/item_template_right.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
android:id="@+id/card_view"
55
android:layout_width="match_parent"
66
android:layout_height="wrap_content"
7-
android:clickable="true"
87
android:foreground="?attr/selectableItemBackground"
98
android:minHeight="@dimen/cardview_template_height"
109
card_view:cardCornerRadius="@dimen/cardview_default_radius"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/appbarlayout"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
6+
android:orientation="vertical">
7+
8+
<android.support.v7.widget.Toolbar
9+
android:id="@+id/toolbar"
10+
style="@style/Toolbar.Buildmlearn"
11+
android:layout_width="match_parent"
12+
android:layout_height="?attr/actionBarSize" />
13+
14+
</android.support.design.widget.AppBarLayout>

0 commit comments

Comments
 (0)