Skip to content

Instantly share code, notes, and snippets.

@fatorx
Created June 2, 2015 15:10
Show Gist options
  • Save fatorx/953fa658fa6ecece0ae1 to your computer and use it in GitHub Desktop.
Save fatorx/953fa658fa6ecece0ae1 to your computer and use it in GitHub Desktop.
Estilos para Widgets - Toolbar como exemplo
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".MainActivityFragment">
<include layout="@layout/toolbar_main" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="android:windowActionBar">false</item>
<!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette-->
<!-- colorPrimary is used for the default action bar background -->
</style>
<style name="ToolbarApp">
<item name="android:background">#336699</item>
</style>
</resources>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ToolbarApp"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/abc_ic_commit_search_api_mtrl_alpha"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Acesso"
>
</TextView>
</android.support.v7.widget.Toolbar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment