Permalink
Browse files

Added the header.

  • Loading branch information...
1 parent b1b6e37 commit 8a55c4a0edb4d3db351914f8da2fab685e694148 @kevinmcdonagh committed Oct 8, 2011
@@ -6,7 +6,7 @@
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/Theme.SafeTown">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".SafeRouteActivity"
android:label="@string/app_name"
@@ -16,6 +16,14 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <activity android:name=".Home"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
</application>
</manifest>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:state_pressed="true" android:drawable="@android:color/transparent"/>
+ <item android:state_focused="false" android:state_pressed="true" android:drawable="@android:color/transparent"/>
+ <item android:state_focused="true" android:drawable="@android:color/transparent"/>
+ <item android:state_focused="false" android:state_pressed="false" android:drawable="@android:color/transparent"/>
+</selector>
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/btn_grey_pressed"/>
+ <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/btn_grey_pressed"/>
+ <item android:state_focused="true" android:drawable="@drawable/btn_grey_selected"/>
+ <item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/btn_grey_default"/>
+</selector>
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/header_ic_logo_pressed"/>
+ <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/header_ic_logo_pressed"/>
+ <item android:state_focused="true" android:drawable="@drawable/header_ic_logo_selected"/>
+ <item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/header_ic_logo_default"/>
+</selector>
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/header_ic_search_pressed"/>
+ <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/header_ic_search_pressed"/>
+ <item android:state_focused="true" android:drawable="@drawable/header_ic_search_selected"/>
+ <item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/header_ic_search_default"/>
+</selector>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout style="@style/Fill" xmlns:a="http://schemas.android.com/apk/res/android" >
+ <com.saferoute.HeaderBar style="@style/Fill.Width" a:layout_height="100dp" a:id="@+id/actionbar_div" />
+</LinearLayout>
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<merge xmlns:a="http://schemas.android.com/apk/res/android" >
+ <LinearLayout a:id="@+id/actionbar_div" style="@style/actionbar_div">
+ <ImageView a:id="@+id/actionbar_btn_logo" style="@style/actionbar_btn_logo" />
+
+ <View a:id="@+id/actionbar_spring" style="@style/actionbar_spring" />
+
+ <ImageButton a:id="@+id/actionbar_btn_search" style="@style/actionbar_btn_search" />
+ </LinearLayout>
+</merge>
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="activity_gutter_padding">10dp</dimen>
+ <dimen name="activity_gutter_padding_top">8dp</dimen>
+ <dimen name="activity_gutter_padding_left">14dp</dimen>
+ <dimen name="activity_gutter_padding_right">14dp</dimen>
+</resources>
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="header_height">55dip</dimen>
+ <dimen name="header_quick_action_buton_width">50dip</dimen>
+ <dimen name="header_quick_action_buton_height">58dip</dimen>
+ <dimen name="activity_title_height">55dip</dimen>
+
+ <dimen name="header_navigation_height">70dip</dimen>
+ <dimen name="actionbar_div_height">48dip</dimen>
+</resources>
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="actionbar_div" parent="@style/Fill.Width">
+ <item name="android:layout_height">@dimen/actionbar_div_height</item>
+ <item name="android:orientation">horizontal</item>
+ <item name="android:background">@drawable/bg_header</item>
+ </style>
+
+ <style name="actionbar_btn_logo">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">fill_parent</item>
+ <item name="android:paddingLeft">4dp</item>
+ <item name="android:clickable">true</item>
+ <item name="android:focusable">true</item>
+ <item name="android:src">@drawable/header_ic_logo</item>
+ <item name="android:scaleType">center</item>
+ </style>
+
+ <style name="actionbar_spring">
+ <item name="android:layout_width">0dp</item>
+ <item name="android:layout_height">fill_parent</item>
+ <item name="android:layout_weight">1</item>
+ </style>
+
+ <style name="actionbar_btn_search" parent="@style/actionbar_btn">
+ <item name="android:id">@id/actionbar_btn_search</item>
+ <item name="android:src">@drawable/header_ic_search</item>
+ <item name="android:visibility">visible</item>
+ </style>
+
+ <!-- NOTE: These are gone by default, make them visible as you need them. -->
+ <style name="actionbar_btn">
+ <item name="android:visibility">gone</item>
+ <item name="android:layout_width">@dimen/actionbar_div_height</item>
+ <item name="android:layout_height">fill_parent</item>
+ <item name="android:scaleType">center</item>
+ <item name="android:background">@drawable/bg_selector_default</item>
+ </style>
+</resources>
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+<!--
+STLYING KEY
+
+ _THEME
+ _WIDTH_HEIGHT
+-->
+ <!-- _THEME -->
+ <style name="Theme" parent="android:Theme" />
+ <style name="Theme.SafeTown" parent="android:style/Theme.Light">
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:windowContentOverlay">@null</item>
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
+
+ <!-- Widget Styles -->
+ <style name="Widget">
+ <item name="android:textAppearance">?android:attr/textAppearance</item>
+ </style>
+
+ <style name="Widget.Button" parent="@android:style/Widget.Button">
+ <item name="android:background">@drawable/btn_grey</item>
+ <item name="android:paddingTop">10dp</item>
+ <item name="android:paddingBottom">10dp</item>
+ <item name="android:paddingLeft">10dp</item>
+ <item name="android:paddingRight">10dp</item>
+ <item name="android:focusable">true</item>
+ <item name="android:clickable">true</item>
+ <item name="android:minWidth">140dp</item>
+ <item name="android:minHeight">45dp</item>
+ <item name="android:gravity">center_vertical|center_horizontal</item>
+ <item name="android:textStyle">bold</item>
+ </style>
+
+ <!-- _WIDTH_HEIGHT -->
+ <style name="Fill">
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">fill_parent</item>
+ <item name="android:orientation">vertical</item>
+ </style>
+ <style name="Wrap">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:orientation">vertical</item>
+ </style>
+ <style name="Fill.Wrap" parent="Fill">
+ <item name="android:paddingTop">@dimen/activity_gutter_padding_top</item>
+ <item name="android:paddingLeft">@dimen/activity_gutter_padding_left</item>
+ <item name="android:paddingRight">@dimen/activity_gutter_padding_right</item>
+ </style>
+ <style name="Fill.Height" parent="Fill">
+ <item name="android:layout_width">wrap_content</item>
+ </style>
+ <style name="Fill.Width" parent="Fill">
+ <item name="android:layout_height">wrap_content</item>
+ </style>
+ <style name="Fill.Width.Centre" parent="Fill.Width">
+ <item name="android:gravity">center</item>
+ </style>
+ <style name="Fill.Width.Horizontal" parent="Fill.Width">
+ <item name="android:orientation">horizontal</item>
+ </style>
+ <style name="Fill.Width.Horizontal.Wrap" parent="Fill.Width.Horizontal">
+ <item name="android:paddingLeft">@dimen/activity_gutter_padding</item>
+ <item name="android:paddingRight">@dimen/activity_gutter_padding</item>
+ </style>
+ <style name="Fill.HorizontalOrientation" parent="Fill">
+ <item name="android:orientation">horizontal</item>
+ </style>
+ <style name="Fill.Width.Wrap" parent="Fill.Width">
+ <item name="android:paddingTop">@dimen/activity_gutter_padding_top</item>
+ <item name="android:paddingLeft">@dimen/activity_gutter_padding_left</item>
+ <item name="android:paddingRight">@dimen/activity_gutter_padding_right</item>
+ </style>
+
+</resources>
@@ -0,0 +1,31 @@
+package com.saferoute;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+
+public class HeaderBar extends LinearLayout {
+
+ private Context context;
+
+
+ public HeaderBar(Context context) {
+ super(context);
+ this.context=context;
+ init();
+ }
+
+ public HeaderBar(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ this.context=context;
+ init();
+ }
+
+ private void init(){
+ LayoutInflater inflater = (LayoutInflater)this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ inflater.inflate(R.layout.headerbar, this);
+ }
+
+}
@@ -0,0 +1,13 @@
+package com.saferoute;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class Home extends Activity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.act_home);
+ }
+}

0 comments on commit 8a55c4a

Please sign in to comment.