android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
- android:theme="@android:style/Theme.Holo" >
+ android:theme="@style/AppTheme" >
<activity
android:name="de.example.exampletdd.WeatherInformationActivity"
- android:label="@string/app_name" >
+ android:uiOptions="splitActionBarWhenNarrow"
+ android:label="@string/app_name"
+ android:hardwareAccelerated="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item
+ android:id="@+id/weather_menu_settings"
+ android:menuCategory="system"
+ android:title="@string/action_settings"
+ android:titleCondensed="@string/action_settings"
+ android:checked="false"
+ android:visible="true"
+ android:checkable="false"
+ android:enabled="true"
+ android:onClick="onMenuSettings"
+ android:showAsAction="ifRoom|withText">
+ </item>
+
+
+</menu>
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
+ <style name="AppBaseTheme" parent="android:Theme.Holo">
<!-- API 11 theme customizations can go here. -->
</style>
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+ <style name="AppBaseTheme" parent="android:Theme.Holo">
<!-- API 14 theme customizations can go here. -->
</style>
<string name="error_dialog_connection_tiemout">Connection error timeout</string>
<string name="error_dialog_generic_error">Impossible to receive weather data.</string>
<string name="icon_weather_description">Icon weather</string>
+ <string name="header_action_bar">Weather Information</string>
</resources>
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
- <style name="AppBaseTheme" parent="android:Theme.Light">
+ <style name="AppBaseTheme" parent="android:Theme.Holo">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
package de.example.exampletdd;
+import android.app.ActionBar;
import android.app.Activity;
import android.app.DialogFragment;
+import android.content.ComponentName;
+import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_main);
+
+ final ActionBar actionBar = getActionBar();
+
+ actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+ actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
+ actionBar.setTitle(getResources().getString(R.string.header_action_bar));
// Better using xml files.
// final WeatherDataFragment weatherDataFragment = new WeatherDataFragment();
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
- final int id = item.getItemId();
- if (id == R.id.action_settings) {
- return true;
+ super.onOptionsItemSelected(item);
+ switch (item.getItemId()) {
+ case R.id.weather_menu_settings:
+ final Intent intent = new Intent("de.example.exampletdd.WEATHERINFO").
+ setComponent(new ComponentName("de.example.exampletdd",
+ "de.example.exampletdd.WeatherInformationSettings"));
+ this.startActivity(intent);
+ return true;
+ default:
+ break;
}
+
return super.onOptionsItemSelected(item);
}
--- /dev/null
+/** Automatically generated file. DO NOT MODIFY */
+package de.example.exampletdd.test;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
\ No newline at end of file
--- /dev/null
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package de.example.exampletdd.test;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int ic_launcher=0x7f020000;
+ }
+ public static final class string {
+ public static final int app_name=0x7f030000;
+ }
+}