Skip to content

Commit

Permalink
Make the toolbar in the sample a bit prettier
Browse files Browse the repository at this point in the history
Jawnnypoo committed Mar 2, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2644328 commit eff912c
Showing 3 changed files with 22 additions and 16 deletions.
23 changes: 11 additions & 12 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout 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"
android:id="@+id/root"
@@ -15,45 +14,45 @@

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>

android:background="?attr/colorPrimary" />

</android.support.design.widget.AppBarLayout>

<LinearLayout
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="?attr/actionBarSize">
android:layout_marginTop="?attr/actionBarSize"
android:orientation="vertical">

<TextView
android:id="@+id/normal_parent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#99808080"
android:gravity="center"
android:text="Long press here to see default!!!!"
android:background="#99808080"/>
android:text="Long press here to see default!!!!" />

<TextView
android:id="@+id/custom_parent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:background="#99808080"
android:gravity="center"
android:text="Long press here to see a custom configured QuickActionView!!!!"
android:background="#99808080"/>
android:text="Long press here to see a custom configured QuickActionView!!!!" />

<Button
android:id="@+id/button_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="See RecyclerView Example"/>
android:text="See RecyclerView Example" />

</LinearLayout>

8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_recyclerview.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
@@ -10,7 +9,7 @@
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
@@ -19,11 +18,12 @@

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"/>
app:layout_scrollFlags="scroll|enterAlways" />

</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -8,4 +8,11 @@
<item name="colorAccent">@color/colorAccent</item>
</style>

<!--Do this, so that we can have white text in the toolbar-->
<style name="Toolbar">
<item name="android:theme">@style/ToolbarTheme</item>
</style>

<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

</resources>

0 comments on commit eff912c

Please sign in to comment.