Last active
December 11, 2015 19:08
-
-
Save omerucel/4646133 to your computer and use it in GitHub Desktop.
Android Toolbar - Screen Shot : http://dl.dropbox.com/u/14113161/screenshot.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<TableLayout | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:layout_alignParentBottom="true" | |
style="@style/CustomToolbarContainer"> | |
<TableRow | |
android:id="@+id/tableRow1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
style="@style/CustomToolbarWrapper" | |
android:padding="0dp"> | |
<Button | |
android:id="@+id/button1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Top Stories" | |
style="@style/CustomToolbarButtonHomepage"/> | |
<Button | |
android:id="@+id/button2" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Notifications" | |
style="@style/CustomToolbarButtonNotification" /> | |
<Button | |
android:id="@+id/button3" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Browse" | |
style="@style/CustomToolbarButtonBrowse" /> | |
<Button | |
android:id="@+id/button4" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="Profile" | |
style="@style/CustomToolbarButtonProfile" /> | |
</TableRow> | |
</TableLayout> | |
</RelativeLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item | |
android:state_pressed="true"> | |
<bitmap android:src="@drawable/dashboard_active" /> | |
</item> | |
<item | |
android:state_focused="false" android:state_pressed="false"> | |
<bitmap android:src="@drawable/dashboard_passive"/> | |
</item> | |
</selector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.navigationstyle; | |
import android.app.Activity; | |
import android.graphics.Typeface; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
public class MainActivity extends Activity implements OnClickListener { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Button btn1 = (Button) findViewById(R.id.button1); | |
Button btn2 = (Button) findViewById(R.id.button2); | |
Button btn3 = (Button) findViewById(R.id.button3); | |
Button btn4 = (Button) findViewById(R.id.button4); | |
Typeface font = Typeface.createFromAsset(getAssets(), | |
"fonts/Roboto-Bold.ttf"); | |
btn1.setTypeface(font); | |
btn2.setTypeface(font); | |
btn3.setTypeface(font); | |
btn4.setTypeface(font); | |
btn1.setPressed(true); | |
btn1.setClickable(false); | |
} | |
@Override | |
public void onClick(View v) { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources xmlns:android="http://schemas.android.com/apk/res/android"> | |
<style name="AppTheme"> | |
<item name="android:background">#FFFFFFFF</item> | |
</style> | |
<style name="CustomToolbarContainer"> | |
<item name="android:background">#FFAAAAAA</item> | |
<item name="android:paddingTop">0.5dp</item> | |
</style> | |
<style name="CustomToolbarWrapper"> | |
<item name="android:stretchColumns">*</item> | |
<item name="android:background">#FFDDDDDD</item> | |
</style> | |
<style name="CustomToolbarButton"> | |
<item name="android:layout_weight">1</item> | |
<item name="android:background">@drawable/custom_toolbar_button</item> | |
<item name="android:textSize">12dp</item> | |
<item name="android:textColor">@color/custom_toolbar_button_text_color</item> | |
</style> | |
<style name="CustomToolbarButtonHomepage" parent="CustomToolbarButton"> | |
<item name="android:drawableTop">@drawable/icon_dashboard</item> | |
</style> | |
<style name="CustomToolbarButtonNotification" parent="CustomToolbarButton"> | |
<item name="android:drawableTop">@drawable/notification</item> | |
</style> | |
<style name="CustomToolbarButtonBrowse" parent="CustomToolbarButton"> | |
<item name="android:drawableTop">@drawable/feeds</item> | |
</style> | |
<style name="CustomToolbarButtonProfile" parent="CustomToolbarButton"> | |
<item name="android:drawableTop">@drawable/settings</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment