Trying to implement weather information app. This is hard...
authorgu.martinm@gmail.com <gu.martinm@gmail.com>
Sat, 19 Apr 2014 15:16:31 +0000 (17:16 +0200)
committergu.martinm@gmail.com <gu.martinm@gmail.com>
Sat, 19 Apr 2014 15:16:31 +0000 (17:16 +0200)
80 files changed:
AndroidManifest.xml
project.properties
res/drawable-hdpi/ic_02d.png [deleted file]
res/drawable-hdpi/thermometer.png [new file with mode: 0644]
res/drawable-hdpi/weather_clear.png [new file with mode: 0644]
res/drawable-hdpi/weather_clear_night.png [new file with mode: 0644]
res/drawable-hdpi/weather_few_clouds.png [new file with mode: 0644]
res/drawable-hdpi/weather_few_clouds_night.png [new file with mode: 0644]
res/drawable-hdpi/weather_fog.png [new file with mode: 0644]
res/drawable-hdpi/weather_overcast.png [new file with mode: 0644]
res/drawable-hdpi/weather_severe_alert.png [new file with mode: 0644]
res/drawable-hdpi/weather_showers.png [new file with mode: 0644]
res/drawable-hdpi/weather_showers_scattered.png [new file with mode: 0644]
res/drawable-hdpi/weather_snow.png [new file with mode: 0644]
res/drawable-hdpi/weather_storm.png [new file with mode: 0644]
res/drawable-mdpi/ic_02d.png [deleted file]
res/drawable-mdpi/thermometer.png [new file with mode: 0644]
res/drawable-mdpi/weather_clear.png [new file with mode: 0644]
res/drawable-mdpi/weather_clear_night.png [new file with mode: 0644]
res/drawable-mdpi/weather_few_clouds.png [new file with mode: 0644]
res/drawable-mdpi/weather_few_clouds_night.png [new file with mode: 0644]
res/drawable-mdpi/weather_fog.png [new file with mode: 0644]
res/drawable-mdpi/weather_overcast.png [new file with mode: 0644]
res/drawable-mdpi/weather_severe_alert.png [new file with mode: 0644]
res/drawable-mdpi/weather_showers.png [new file with mode: 0644]
res/drawable-mdpi/weather_showers_scattered.png [new file with mode: 0644]
res/drawable-mdpi/weather_snow.png [new file with mode: 0644]
res/drawable-mdpi/weather_storm.png [new file with mode: 0644]
res/drawable-xhdpi/ic_02d.png [deleted file]
res/drawable-xhdpi/thermometer.png [new file with mode: 0644]
res/drawable-xhdpi/weather_clear.png [new file with mode: 0644]
res/drawable-xhdpi/weather_clear_night.png [new file with mode: 0644]
res/drawable-xhdpi/weather_few_clouds.png [new file with mode: 0644]
res/drawable-xhdpi/weather_few_clouds_night.png [new file with mode: 0644]
res/drawable-xhdpi/weather_fog.png [new file with mode: 0644]
res/drawable-xhdpi/weather_overcast.png [new file with mode: 0644]
res/drawable-xhdpi/weather_severe_alert.png [new file with mode: 0644]
res/drawable-xhdpi/weather_showers.png [new file with mode: 0644]
res/drawable-xhdpi/weather_showers_scattered.png [new file with mode: 0644]
res/drawable-xhdpi/weather_snow.png [new file with mode: 0644]
res/drawable-xhdpi/weather_storm.png [new file with mode: 0644]
res/drawable-xxhdpi/ic_02d.png [deleted file]
res/drawable-xxhdpi/thermometer.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_clear.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_clear_night.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_few_clouds.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_few_clouds_night.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_fog.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_overcast.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_severe_alert.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_showers.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_showers_scattered.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_snow.png [new file with mode: 0644]
res/drawable-xxhdpi/weather_storm.png [new file with mode: 0644]
res/layout/activity_masterdetail_detail.xml [new file with mode: 0644]
res/layout/activity_masterdetail_list.xml [new file with mode: 0644]
res/layout/activity_masterdetail_twopane.xml [new file with mode: 0644]
res/layout/activity_test_scroll.xml [new file with mode: 0644]
res/layout/fragment_masterdetail_detail.xml [new file with mode: 0644]
res/layout/fragment_test_scroll.xml [new file with mode: 0644]
res/layout/weather_main_entry_list.xml
res/menu/test_scroll.xml [new file with mode: 0644]
res/menu/weather_main_menu.xml
res/values-large/refs.xml [new file with mode: 0644]
res/values-sw600dp/refs.xml [new file with mode: 0644]
res/values/strings.xml
res/values/styles.xml
src/de/example/exampletdd/MasterDetailDetailActivity.java [new file with mode: 0644]
src/de/example/exampletdd/MasterDetailDetailFragment.java [new file with mode: 0644]
src/de/example/exampletdd/MasterDetailListActivity.java [new file with mode: 0644]
src/de/example/exampletdd/MasterDetailListFragment.java [new file with mode: 0644]
src/de/example/exampletdd/TestScrollActivity.java [new file with mode: 0644]
src/de/example/exampletdd/WeatherInformationActivity.java
src/de/example/exampletdd/WeatherInformationSpecificDataActivity.java
src/de/example/exampletdd/dummy/DummyContent.java [new file with mode: 0644]
src/de/example/exampletdd/fragment/overview/IconsList.java [new file with mode: 0644]
src/de/example/exampletdd/fragment/overview/WeatherInformationOverviewFragment.java
src/de/example/exampletdd/fragment/overview/WeatherOverviewAdapter.java
src/de/example/exampletdd/fragment/overview/WeatherOverviewEntry.java
src/de/example/exampletdd/fragment/specific/WeatherInformationSpecificDataFragment.java

index 096164b..8b5e56e 100644 (file)
@@ -9,79 +9,99 @@
         android:maxSdkVersion="18"
         android:minSdkVersion="18"
         android:targetSdkVersion="18" />
+
     <uses-feature
         android:glEsVersion="0x00020000"
-        android:required="true"/>
+        android:required="true" />
 
     <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
-    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
-    <!-- The following two permissions are not required to use
-     Google Maps Android API v2, but are recommended. -->
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
-    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <!--
+     The following two permissions are not required to use
+     Google Maps Android API v2, but are recommended.
+    -->
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
 
     <application
         android:allowBackup="true"
         android:icon="@drawable/ic_launcher"
-        android:logo="@drawable/ic_launcher"
         android:label="@string/app_name"
+        android:logo="@drawable/ic_launcher"
         android:theme="@style/AppTheme" >
         <activity
             android:name="de.example.exampletdd.WeatherInformationActivity"
-            android:uiOptions="splitActionBarWhenNarrow"
-            android:hardwareAccelerated="false">
+            android:hardwareAccelerated="false"
+            android:uiOptions="splitActionBarWhenNarrow" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        
         <activity
-            android:name=".WeatherInformationPreferencesActivity" 
-            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity">
-            <intent-filter >
+            android:name="de.example.exampletdd.WeatherInformationPreferencesActivity"
+            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity" >
+            <intent-filter>
                 <action android:name="android.intent.action.WEATHERINFORMATIONSETTINGS" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        
         <activity
-            android:name=".WeatherInformationMapActivity" 
-            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity">
-            <intent-filter >
+            android:name="de.example.exampletdd.WeatherInformationMapActivity"
+            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity" >
+            <intent-filter>
                 <action android:name="android.intent.action.WEATHERINFORMATIONMAP" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        
         <activity
-            android:name=".WeatherInformationSpecificDataActivity" 
-            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity">
-            <intent-filter >
+            android:name="de.example.exampletdd.WeatherInformationSpecificDataActivity"
+            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity" >
+            <intent-filter>
                 <action android:name="android.intent.action.WEATHERINFORMATIONSPECIFICDATA" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        
         <activity
-            android:name=".WeatherInformationCurrentDataActivity" 
-            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity">
-            <intent-filter >
+            android:name="de.example.exampletdd.WeatherInformationCurrentDataActivity"
+            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity" >
+            <intent-filter>
                 <action android:name="android.intent.action.WEATHERINFORMATIONCURRENTDATA" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        
-        
+
         <meta-data
             android:name="com.google.android.maps.v2.API_KEY"
-            android:value=""/>
+            android:value="AIzaSyCPjAbkUGfl1M6gkFxnUzBvO_xfq1pWABE" />
         <meta-data
             android:name="com.google.android.gms.version"
             android:value="@integer/google_play_services_version" />
+
+        <activity
+            android:name="de.example.exampletdd.TestScrollActivity"
+            android:label="@string/title_activity_test_scroll"
+            android:parentActivityName="de.example.exampletdd.WeatherInformationActivity" >
+        </activity>
+        <activity
+            android:name="de.example.exampletdd.MasterDetailListActivity"
+            android:label="@string/title_masterdetail_list" >
+        </activity>
+        <activity
+            android:name="de.example.exampletdd.MasterDetailDetailActivity"
+            android:label="@string/title_masterdetail_detail"
+            android:parentActivityName="de.example.exampletdd.MasterDetailListActivity" >
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value="de.example.exampletdd.MasterDetailListActivity" />
+        </activity>
     </application>
 
 </manifest>
index 2110cdf..7612c3e 100644 (file)
@@ -13,3 +13,4 @@
 # Project target.
 target=android-18
 android.library.reference.1=../../../../android/android-sdk-linux/extras/google/google_play_services/libproject/google-play-services_lib
+android.library=false
diff --git a/res/drawable-hdpi/ic_02d.png b/res/drawable-hdpi/ic_02d.png
deleted file mode 100644 (file)
index 3451b4a..0000000
Binary files a/res/drawable-hdpi/ic_02d.png and /dev/null differ
diff --git a/res/drawable-hdpi/thermometer.png b/res/drawable-hdpi/thermometer.png
new file mode 100644 (file)
index 0000000..89f39a8
Binary files /dev/null and b/res/drawable-hdpi/thermometer.png differ
diff --git a/res/drawable-hdpi/weather_clear.png b/res/drawable-hdpi/weather_clear.png
new file mode 100644 (file)
index 0000000..974da61
Binary files /dev/null and b/res/drawable-hdpi/weather_clear.png differ
diff --git a/res/drawable-hdpi/weather_clear_night.png b/res/drawable-hdpi/weather_clear_night.png
new file mode 100644 (file)
index 0000000..2db4d82
Binary files /dev/null and b/res/drawable-hdpi/weather_clear_night.png differ
diff --git a/res/drawable-hdpi/weather_few_clouds.png b/res/drawable-hdpi/weather_few_clouds.png
new file mode 100644 (file)
index 0000000..ab3e430
Binary files /dev/null and b/res/drawable-hdpi/weather_few_clouds.png differ
diff --git a/res/drawable-hdpi/weather_few_clouds_night.png b/res/drawable-hdpi/weather_few_clouds_night.png
new file mode 100644 (file)
index 0000000..67ee004
Binary files /dev/null and b/res/drawable-hdpi/weather_few_clouds_night.png differ
diff --git a/res/drawable-hdpi/weather_fog.png b/res/drawable-hdpi/weather_fog.png
new file mode 100644 (file)
index 0000000..bc3c429
Binary files /dev/null and b/res/drawable-hdpi/weather_fog.png differ
diff --git a/res/drawable-hdpi/weather_overcast.png b/res/drawable-hdpi/weather_overcast.png
new file mode 100644 (file)
index 0000000..8075b13
Binary files /dev/null and b/res/drawable-hdpi/weather_overcast.png differ
diff --git a/res/drawable-hdpi/weather_severe_alert.png b/res/drawable-hdpi/weather_severe_alert.png
new file mode 100644 (file)
index 0000000..42334e8
Binary files /dev/null and b/res/drawable-hdpi/weather_severe_alert.png differ
diff --git a/res/drawable-hdpi/weather_showers.png b/res/drawable-hdpi/weather_showers.png
new file mode 100644 (file)
index 0000000..d2a456a
Binary files /dev/null and b/res/drawable-hdpi/weather_showers.png differ
diff --git a/res/drawable-hdpi/weather_showers_scattered.png b/res/drawable-hdpi/weather_showers_scattered.png
new file mode 100644 (file)
index 0000000..e58ade9
Binary files /dev/null and b/res/drawable-hdpi/weather_showers_scattered.png differ
diff --git a/res/drawable-hdpi/weather_snow.png b/res/drawable-hdpi/weather_snow.png
new file mode 100644 (file)
index 0000000..4812c8c
Binary files /dev/null and b/res/drawable-hdpi/weather_snow.png differ
diff --git a/res/drawable-hdpi/weather_storm.png b/res/drawable-hdpi/weather_storm.png
new file mode 100644 (file)
index 0000000..b829abf
Binary files /dev/null and b/res/drawable-hdpi/weather_storm.png differ
diff --git a/res/drawable-mdpi/ic_02d.png b/res/drawable-mdpi/ic_02d.png
deleted file mode 100644 (file)
index 482afa3..0000000
Binary files a/res/drawable-mdpi/ic_02d.png and /dev/null differ
diff --git a/res/drawable-mdpi/thermometer.png b/res/drawable-mdpi/thermometer.png
new file mode 100644 (file)
index 0000000..f645657
Binary files /dev/null and b/res/drawable-mdpi/thermometer.png differ
diff --git a/res/drawable-mdpi/weather_clear.png b/res/drawable-mdpi/weather_clear.png
new file mode 100644 (file)
index 0000000..0bdb0da
Binary files /dev/null and b/res/drawable-mdpi/weather_clear.png differ
diff --git a/res/drawable-mdpi/weather_clear_night.png b/res/drawable-mdpi/weather_clear_night.png
new file mode 100644 (file)
index 0000000..2617ec1
Binary files /dev/null and b/res/drawable-mdpi/weather_clear_night.png differ
diff --git a/res/drawable-mdpi/weather_few_clouds.png b/res/drawable-mdpi/weather_few_clouds.png
new file mode 100644 (file)
index 0000000..5a78bd0
Binary files /dev/null and b/res/drawable-mdpi/weather_few_clouds.png differ
diff --git a/res/drawable-mdpi/weather_few_clouds_night.png b/res/drawable-mdpi/weather_few_clouds_night.png
new file mode 100644 (file)
index 0000000..3dcd13f
Binary files /dev/null and b/res/drawable-mdpi/weather_few_clouds_night.png differ
diff --git a/res/drawable-mdpi/weather_fog.png b/res/drawable-mdpi/weather_fog.png
new file mode 100644 (file)
index 0000000..7d99916
Binary files /dev/null and b/res/drawable-mdpi/weather_fog.png differ
diff --git a/res/drawable-mdpi/weather_overcast.png b/res/drawable-mdpi/weather_overcast.png
new file mode 100644 (file)
index 0000000..79303a5
Binary files /dev/null and b/res/drawable-mdpi/weather_overcast.png differ
diff --git a/res/drawable-mdpi/weather_severe_alert.png b/res/drawable-mdpi/weather_severe_alert.png
new file mode 100644 (file)
index 0000000..308931b
Binary files /dev/null and b/res/drawable-mdpi/weather_severe_alert.png differ
diff --git a/res/drawable-mdpi/weather_showers.png b/res/drawable-mdpi/weather_showers.png
new file mode 100644 (file)
index 0000000..6dce4e1
Binary files /dev/null and b/res/drawable-mdpi/weather_showers.png differ
diff --git a/res/drawable-mdpi/weather_showers_scattered.png b/res/drawable-mdpi/weather_showers_scattered.png
new file mode 100644 (file)
index 0000000..0e0b43e
Binary files /dev/null and b/res/drawable-mdpi/weather_showers_scattered.png differ
diff --git a/res/drawable-mdpi/weather_snow.png b/res/drawable-mdpi/weather_snow.png
new file mode 100644 (file)
index 0000000..9364b58
Binary files /dev/null and b/res/drawable-mdpi/weather_snow.png differ
diff --git a/res/drawable-mdpi/weather_storm.png b/res/drawable-mdpi/weather_storm.png
new file mode 100644 (file)
index 0000000..5e37b51
Binary files /dev/null and b/res/drawable-mdpi/weather_storm.png differ
diff --git a/res/drawable-xhdpi/ic_02d.png b/res/drawable-xhdpi/ic_02d.png
deleted file mode 100644 (file)
index 775ee02..0000000
Binary files a/res/drawable-xhdpi/ic_02d.png and /dev/null differ
diff --git a/res/drawable-xhdpi/thermometer.png b/res/drawable-xhdpi/thermometer.png
new file mode 100644 (file)
index 0000000..bd86520
Binary files /dev/null and b/res/drawable-xhdpi/thermometer.png differ
diff --git a/res/drawable-xhdpi/weather_clear.png b/res/drawable-xhdpi/weather_clear.png
new file mode 100644 (file)
index 0000000..42bad9c
Binary files /dev/null and b/res/drawable-xhdpi/weather_clear.png differ
diff --git a/res/drawable-xhdpi/weather_clear_night.png b/res/drawable-xhdpi/weather_clear_night.png
new file mode 100644 (file)
index 0000000..a9ab2dc
Binary files /dev/null and b/res/drawable-xhdpi/weather_clear_night.png differ
diff --git a/res/drawable-xhdpi/weather_few_clouds.png b/res/drawable-xhdpi/weather_few_clouds.png
new file mode 100644 (file)
index 0000000..954a7fd
Binary files /dev/null and b/res/drawable-xhdpi/weather_few_clouds.png differ
diff --git a/res/drawable-xhdpi/weather_few_clouds_night.png b/res/drawable-xhdpi/weather_few_clouds_night.png
new file mode 100644 (file)
index 0000000..be93567
Binary files /dev/null and b/res/drawable-xhdpi/weather_few_clouds_night.png differ
diff --git a/res/drawable-xhdpi/weather_fog.png b/res/drawable-xhdpi/weather_fog.png
new file mode 100644 (file)
index 0000000..bcca0a8
Binary files /dev/null and b/res/drawable-xhdpi/weather_fog.png differ
diff --git a/res/drawable-xhdpi/weather_overcast.png b/res/drawable-xhdpi/weather_overcast.png
new file mode 100644 (file)
index 0000000..5096963
Binary files /dev/null and b/res/drawable-xhdpi/weather_overcast.png differ
diff --git a/res/drawable-xhdpi/weather_severe_alert.png b/res/drawable-xhdpi/weather_severe_alert.png
new file mode 100644 (file)
index 0000000..c074f4e
Binary files /dev/null and b/res/drawable-xhdpi/weather_severe_alert.png differ
diff --git a/res/drawable-xhdpi/weather_showers.png b/res/drawable-xhdpi/weather_showers.png
new file mode 100644 (file)
index 0000000..28264f2
Binary files /dev/null and b/res/drawable-xhdpi/weather_showers.png differ
diff --git a/res/drawable-xhdpi/weather_showers_scattered.png b/res/drawable-xhdpi/weather_showers_scattered.png
new file mode 100644 (file)
index 0000000..f76f4e9
Binary files /dev/null and b/res/drawable-xhdpi/weather_showers_scattered.png differ
diff --git a/res/drawable-xhdpi/weather_snow.png b/res/drawable-xhdpi/weather_snow.png
new file mode 100644 (file)
index 0000000..5226484
Binary files /dev/null and b/res/drawable-xhdpi/weather_snow.png differ
diff --git a/res/drawable-xhdpi/weather_storm.png b/res/drawable-xhdpi/weather_storm.png
new file mode 100644 (file)
index 0000000..7539dee
Binary files /dev/null and b/res/drawable-xhdpi/weather_storm.png differ
diff --git a/res/drawable-xxhdpi/ic_02d.png b/res/drawable-xxhdpi/ic_02d.png
deleted file mode 100644 (file)
index 54649c6..0000000
Binary files a/res/drawable-xxhdpi/ic_02d.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/thermometer.png b/res/drawable-xxhdpi/thermometer.png
new file mode 100644 (file)
index 0000000..37b3747
Binary files /dev/null and b/res/drawable-xxhdpi/thermometer.png differ
diff --git a/res/drawable-xxhdpi/weather_clear.png b/res/drawable-xxhdpi/weather_clear.png
new file mode 100644 (file)
index 0000000..73a5bbd
Binary files /dev/null and b/res/drawable-xxhdpi/weather_clear.png differ
diff --git a/res/drawable-xxhdpi/weather_clear_night.png b/res/drawable-xxhdpi/weather_clear_night.png
new file mode 100644 (file)
index 0000000..2c60054
Binary files /dev/null and b/res/drawable-xxhdpi/weather_clear_night.png differ
diff --git a/res/drawable-xxhdpi/weather_few_clouds.png b/res/drawable-xxhdpi/weather_few_clouds.png
new file mode 100644 (file)
index 0000000..2d38702
Binary files /dev/null and b/res/drawable-xxhdpi/weather_few_clouds.png differ
diff --git a/res/drawable-xxhdpi/weather_few_clouds_night.png b/res/drawable-xxhdpi/weather_few_clouds_night.png
new file mode 100644 (file)
index 0000000..333afa7
Binary files /dev/null and b/res/drawable-xxhdpi/weather_few_clouds_night.png differ
diff --git a/res/drawable-xxhdpi/weather_fog.png b/res/drawable-xxhdpi/weather_fog.png
new file mode 100644 (file)
index 0000000..1bebc54
Binary files /dev/null and b/res/drawable-xxhdpi/weather_fog.png differ
diff --git a/res/drawable-xxhdpi/weather_overcast.png b/res/drawable-xxhdpi/weather_overcast.png
new file mode 100644 (file)
index 0000000..e3101eb
Binary files /dev/null and b/res/drawable-xxhdpi/weather_overcast.png differ
diff --git a/res/drawable-xxhdpi/weather_severe_alert.png b/res/drawable-xxhdpi/weather_severe_alert.png
new file mode 100644 (file)
index 0000000..b0ac4b7
Binary files /dev/null and b/res/drawable-xxhdpi/weather_severe_alert.png differ
diff --git a/res/drawable-xxhdpi/weather_showers.png b/res/drawable-xxhdpi/weather_showers.png
new file mode 100644 (file)
index 0000000..6a1860c
Binary files /dev/null and b/res/drawable-xxhdpi/weather_showers.png differ
diff --git a/res/drawable-xxhdpi/weather_showers_scattered.png b/res/drawable-xxhdpi/weather_showers_scattered.png
new file mode 100644 (file)
index 0000000..97d0f77
Binary files /dev/null and b/res/drawable-xxhdpi/weather_showers_scattered.png differ
diff --git a/res/drawable-xxhdpi/weather_snow.png b/res/drawable-xxhdpi/weather_snow.png
new file mode 100644 (file)
index 0000000..ac714cc
Binary files /dev/null and b/res/drawable-xxhdpi/weather_snow.png differ
diff --git a/res/drawable-xxhdpi/weather_storm.png b/res/drawable-xxhdpi/weather_storm.png
new file mode 100644 (file)
index 0000000..c339221
Binary files /dev/null and b/res/drawable-xxhdpi/weather_storm.png differ
diff --git a/res/layout/activity_masterdetail_detail.xml b/res/layout/activity_masterdetail_detail.xml
new file mode 100644 (file)
index 0000000..d306e79
--- /dev/null
@@ -0,0 +1,7 @@
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/masterdetail_detail_container"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="de.example.exampletdd.MasterDetailDetailActivity"
+    tools:ignore="MergeRootFrame" />
diff --git a/res/layout/activity_masterdetail_list.xml b/res/layout/activity_masterdetail_list.xml
new file mode 100644 (file)
index 0000000..6f7c60c
--- /dev/null
@@ -0,0 +1,10 @@
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/masterdetail_list"
+    android:name="de.example.exampletdd.MasterDetailListFragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:layout_marginLeft="16dp"
+    android:layout_marginRight="16dp"
+    tools:context="de.example.exampletdd.MasterDetailListActivity"
+    tools:layout="@android:layout/list_content" />
diff --git a/res/layout/activity_masterdetail_twopane.xml b/res/layout/activity_masterdetail_twopane.xml
new file mode 100644 (file)
index 0000000..f09e404
--- /dev/null
@@ -0,0 +1,38 @@
+<LinearLayout 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"
+    android:layout_marginLeft="16dp"
+    android:layout_marginRight="16dp"
+    android:baselineAligned="false"
+    android:divider="?android:attr/dividerHorizontal"
+    android:orientation="horizontal"
+    android:showDividers="middle"
+    tools:context="de.example.exampletdd.MasterDetailListActivity" >
+
+    <!--
+    This layout is a two-pane layout for the MasterDetails
+    master/detail flow. See res/values-large/refs.xml and
+    res/values-sw600dp/refs.xml for an example of layout aliases
+    that replace the single-pane version of the layout with
+    this two-pane version.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+
+    <fragment
+        android:id="@+id/masterdetail_list"
+        android:name="de.example.exampletdd.MasterDetailListFragment"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        tools:layout="@android:layout/list_content" />
+
+    <FrameLayout
+        android:id="@+id/masterdetail_detail_container"
+        android:layout_width="0dp"
+        android:layout_height="match_parent"
+        android:layout_weight="3" />
+
+</LinearLayout>
diff --git a/res/layout/activity_test_scroll.xml b/res/layout/activity_test_scroll.xml
new file mode 100644 (file)
index 0000000..5ad3eba
--- /dev/null
@@ -0,0 +1,331 @@
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/container"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="de.example.exampletdd.TestScrollActivity"
+    tools:ignore="MergeRootFrame" >
+  
+    
+  <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_gravity="top|center"
+        android:orientation="horizontal">
+        
+        <ImageView
+        android:id="@+id/weather_current_picture"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="top|center"
+        android:layout_centerHorizontal="true"
+        android:contentDescription="@string/icon_weather_description"
+        android:maxHeight="380dp"
+        android:maxWidth="380dp"
+        android:minHeight="180dp"
+        android:minWidth="180dp"
+        android:src="@drawable/weather_snow" />
+        
+        <!-- Temperature Max-->
+            <TextView
+                android:id="@+id/weather_max_temperature"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="55ºC"
+                android:textAlignment="center"
+                android:layout_toRightOf="@id/weather_current_picture"
+                android:layout_alignTop="@id/weather_current_picture"
+                android:layout_margin="10dp"
+                android:layout_gravity="top|center"
+        android:layout_centerHorizontal="true"
+                android:textAppearance="?android:attr/textAppearanceLarge"
+                android:textStyle="bold" />
+
+            <!-- Temperature Min-->
+            <TextView
+                android:id="@+id/weather_min_temperature"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="55ºC"
+                android:textAlignment="center"
+                android:layout_toRightOf="@id/weather_current_picture"
+                android:layout_below="@+id/weather_max_temperature"
+                android:layout_margin="10dp"
+                android:layout_gravity="top|center"
+                android:layout_centerHorizontal="true"
+                android:textAppearance="?android:attr/textAppearanceMedium" />
+        
+        <!-- Weather description-->
+        <TextView
+            android:id="@+id/weather_description"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:text="Light rain"
+            android:textAlignment="center"
+            android:textColor="@color/weather_time_of_day_color_title"
+            android:layout_below="@+id/weather_current_picture"
+            android:layout_margin="5dp"
+            android:textStyle="bold"
+            android:textAppearance="?android:attr/textAppearanceLarge" />              
+        
+
+   
+   
+        
+      <!-- Humidity -->
+            <TextView
+                android:id="@+id/weather_humidity"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="HUMIDITY"
+                android:gravity="left"
+                android:layout_alignParentLeft="true"
+                android:textAlignment="center"
+                android:layout_below="@+id/weather_description"
+                android:layout_margin="10dp"
+                android:textAppearance="?android:attr/textAppearanceSmall" />
+            
+            <!-- Wind -->
+            <TextView
+                android:id="@+id/weather_wind"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="WIND"
+                android:gravity="right"
+                android:layout_alignParentRight="true"
+                android:layout_below="@+id/weather_description"
+                android:layout_toRightOf="@id/weather_humidity"
+                android:textAlignment="center"
+                android:layout_margin="10dp"
+                android:textAppearance="?android:attr/textAppearanceSmall" />    
+                
+            <!-- Pressure -->
+            <TextView
+                android:id="@+id/weather_pressure"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="PRESSURE"
+                android:gravity="left"
+                android:layout_alignParentLeft="true"
+                android:textAlignment="center"
+                android:layout_below="@+id/weather_humidity"
+                android:layout_margin="10dp"
+                android:textAppearance="?android:attr/textAppearanceSmall" />
+            
+            <!-- Rain -->
+            <TextView
+                android:id="@+id/weather_rain"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="RAIN"
+                android:gravity="right"
+                android:layout_alignParentRight="true"
+                android:layout_below="@+id/weather_wind"
+                android:layout_toRightOf="@id/weather_humidity"
+                android:textAlignment="center"
+                android:layout_margin="10dp"
+                android:textAppearance="?android:attr/textAppearanceSmall" />  
+
+     </RelativeLayout>
+  
+  <HorizontalScrollView
+        android:layout_width="fill_parent"
+        android:layout_gravity="bottom"
+        android:layout_height="150dp" >
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal" >
+
+            
+            <RelativeLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <!-- Thermometer -->
+                <ImageView
+                    android:id="@+id/thermometer"
+                    android:layout_width="wrap_content"
+                    android:layout_height="fill_parent"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_alignParentLeft="true"
+                    android:orientation="vertical"
+                    android:contentDescription="Image"
+                    android:src="@drawable/thermometer"
+                    android:background="?android:attr/activatedBackgroundIndicator"/>
+
+                <!-- Temperature -->
+                <TextView
+                    android:id="@+id/weather_morn_temperature"
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:text="55ºC"
+                    android:textAlignment="center"
+                    android:gravity="center|center_vertical"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_toRightOf="@id/thermometer"
+                    android:layout_alignTop="@id/thermometer"
+                    android:textAppearance="?android:attr/textAppearanceLarge"
+                    android:textStyle="bold" />
+
+                <!-- Time of day -->
+
+                <TextView
+                    android:id="@+id/weather_morn"
+                    android:layout_width="140dp"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentTop="true"
+                    android:gravity="center"
+                    android:selectAllOnFocus="true"
+                    android:text="DAY"
+                    android:textColor="@color/weather_time_of_day_color_title"
+                    android:textAlignment="center"
+                    android:textAppearance="?android:attr/textAppearanceLarge" />
+
+            </RelativeLayout>
+
+
+            <RelativeLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <!-- Thermometer -->
+                <ImageView
+                    android:id="@+id/thermometer"
+                    android:layout_width="wrap_content"
+                    android:layout_height="fill_parent"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_alignParentLeft="true"
+                    android:orientation="vertical"
+                    android:contentDescription="Image"
+                    android:src="@drawable/thermometer"
+                    android:background="?android:attr/activatedBackgroundIndicator"/>
+
+                <!-- Temperature -->
+                <TextView
+                    android:id="@+id/weather_morn_temperature"
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:text="55ºC"
+                    android:textAlignment="center"
+                    android:gravity="center|center_vertical"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_toRightOf="@id/thermometer"
+                    android:layout_alignTop="@id/thermometer"
+                    android:textAppearance="?android:attr/textAppearanceLarge"
+                    android:textStyle="bold" />
+
+                <!-- Time of day -->
+                <TextView
+                    android:id="@+id/weather_morn"
+                    android:layout_width="140dp"
+                    android:layout_height="wrap_content"
+                    android:text="MORNING"
+                    android:textColor="@color/weather_time_of_day_color_title"
+                    android:textAlignment="center"
+                    android:gravity="center"
+                    android:layout_alignParentTop="true"
+                    android:textAppearance="?android:attr/textAppearanceLarge" />
+
+            </RelativeLayout>
+
+
+            <RelativeLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <!-- Thermometer -->
+                <ImageView
+                    android:id="@+id/thermometer"
+                    android:layout_width="wrap_content"
+                    android:layout_height="fill_parent"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_alignParentLeft="true"
+                    android:orientation="vertical"
+                    android:contentDescription="Image"
+                    android:src="@drawable/thermometer"
+                    android:background="?android:attr/activatedBackgroundIndicator"/>
+
+                <!-- Temperature -->
+                <TextView
+                    android:id="@+id/weather_morn_temperature"
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:text="55ºC"
+                    android:textAlignment="center"
+                    android:gravity="center|center_vertical"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_toRightOf="@id/thermometer"
+                    android:layout_alignTop="@id/thermometer"
+                    android:textAppearance="?android:attr/textAppearanceLarge"
+                    android:textStyle="bold" />
+
+                <!-- Time of day -->
+                <TextView
+                    android:id="@+id/weather_morn"
+                    android:layout_width="140dp"
+                    android:layout_height="wrap_content"
+                    android:text="EVENING"
+                    android:textColor="@color/weather_time_of_day_color_title"
+                    android:textAlignment="center"
+                    android:gravity="center"
+                    android:layout_alignParentTop="true"
+                    android:textAppearance="?android:attr/textAppearanceLarge" />
+
+            </RelativeLayout>
+
+
+            <RelativeLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <!-- Thermometer -->
+                <ImageView
+                    android:id="@+id/thermometer"
+                    android:layout_width="wrap_content"
+                    android:layout_height="fill_parent"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_alignParentLeft="true"
+                    android:orientation="vertical"
+                    android:contentDescription="Image"
+                    android:src="@drawable/thermometer"
+                    android:background="?android:attr/activatedBackgroundIndicator"/>
+
+                <!-- Temperature -->
+                <TextView
+                    android:id="@+id/weather_morn_temperature"
+                    android:layout_width="fill_parent"
+                    android:layout_height="fill_parent"
+                    android:text="55ºC"
+                    android:textAlignment="center"
+                    android:gravity="center|center_vertical"
+                    android:layout_below="@+id/weather_morn"
+                    android:layout_toRightOf="@id/thermometer"
+                    android:layout_alignTop="@id/thermometer"
+                    android:textAppearance="?android:attr/textAppearanceLarge"
+                    android:textStyle="bold" />
+
+                <!-- Time of day -->
+                <TextView
+                    android:id="@+id/weather_morn"
+                    android:layout_width="140dp"
+                    android:layout_height="wrap_content"
+                    android:text="NIGHT"
+                    android:textColor="@color/weather_time_of_day_color_title"
+                    android:textAlignment="center"
+                    android:gravity="center"
+                    android:layout_alignParentTop="true"
+                    android:textAppearance="?android:attr/textAppearanceLarge" />
+
+            </RelativeLayout>
+            
+        </LinearLayout>
+    </HorizontalScrollView>
+    
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/fragment_masterdetail_detail.xml b/res/layout/fragment_masterdetail_detail.xml
new file mode 100644 (file)
index 0000000..ea1a39a
--- /dev/null
@@ -0,0 +1,9 @@
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/masterdetail_detail"
+    style="?android:attr/textAppearanceLarge"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="16dp"
+    android:textIsSelectable="true"
+    tools:context="de.example.exampletdd.MasterDetailDetailFragment" />
diff --git a/res/layout/fragment_test_scroll.xml b/res/layout/fragment_test_scroll.xml
new file mode 100644 (file)
index 0000000..cccb845
--- /dev/null
@@ -0,0 +1,16 @@
+<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"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context="de.example.exampletdd.TestScrollActivity$PlaceholderFragment" >
+
+    <TextView
+        android:id="@+id/section_label"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>
index 6802af1..f11a2ac 100644 (file)
@@ -2,31 +2,59 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:padding="15dp"
     android:orientation="vertical" >
 
     <TextView
-        android:id="@+id/weather_main_entry_date"
+        android:id="@+id/weather_main_entry_date_name"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/weather_main_entry_temperature"
+        android:layout_above="@+id/weather_main_entry_date_number"
         android:layout_alignParentLeft="true"
-        android:layout_alignTop="@+id/weather_main_entry_temperature"
-        android:text="Date"
+        android:layout_alignBottom="@+id/weather_main_entry_temperature_max"
+        android:layout_alignTop="@+id/weather_main_entry_temperature_max"
+        android:text="SUN"
         android:textAlignment="center"
         android:textAllCaps="true"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textStyle="bold" />
+    <TextView
+        android:id="@+id/weather_main_entry_date_number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBottom="@+id/weather_main_entry_temperature_min"
+        android:layout_alignParentLeft="true"
+        android:layout_alignTop="@+id/weather_main_entry_temperature_min"
+        android:text="APR 23"
+        android:textAlignment="center"
+        android:textAllCaps="true"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textStyle="normal" />
 
     <TextView
-        android:id="@+id/weather_main_entry_temperature"
+        android:id="@+id/weather_main_entry_temperature_max"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/weather_main_entry_image"
         android:layout_alignTop="@+id/weather_main_entry_image"
         android:layout_centerHorizontal="true"
-        android:text="Temperature"
+        android:text="12ºC"
+        android:textAlignment="center"
+        android:textAllCaps="true"
+        android:textColor="@color/weather_time_of_day_color_title"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textStyle="bold" />
+    
+    <TextView
+        android:id="@+id/weather_main_entry_temperature_min"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/weather_main_entry_temperature_max"
+        android:layout_alignBottom="@+id/weather_main_entry_image"
+        android:layout_centerHorizontal="true"
+        android:text="5ºC"
         android:textAlignment="center"
         android:textAllCaps="true"
+        android:textColor="@color/weather_time_of_day_color_title"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:textStyle="normal" />
     
diff --git a/res/menu/test_scroll.xml b/res/menu/test_scroll.xml
new file mode 100644 (file)
index 0000000..3a15165
--- /dev/null
@@ -0,0 +1,11 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context="de.example.exampletdd.TestScrollActivity" >
+
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:showAsAction="never"
+        android:title="@string/action_settings"/>
+
+</menu>
index f2f40d1..e2c28f0 100644 (file)
@@ -12,7 +12,7 @@
         android:checkable="false"
         android:enabled="true"
         android:icon="@drawable/ic_action_refresh"
-        android:showAsAction="ifRoom|withText">
+        android:showAsAction="ifRoom">
     </item>
     <item
         android:id="@+id/weather_menu_settings"
         android:checkable="false"
         android:enabled="true"
         android:icon="@drawable/ic_action_settings"
-        android:showAsAction="ifRoom|withText">
+        android:showAsAction="ifRoom">
     </item>
     <item
         android:id="@+id/weather_menu_map"
         android:icon="@drawable/ic_action_place"
-        android:showAsAction="ifRoom|withText"
+        android:showAsAction="ifRoom"
         android:visible="true"
         android:checkable="false"
         android:enabled="true"
@@ -47,7 +47,7 @@
         android:checkable="false"
         android:enabled="true"
         android:icon="@drawable/ic_action_import_export"
-        android:showAsAction="ifRoom|withText">
+        android:showAsAction="ifRoom">
     </item>
     
 
diff --git a/res/values-large/refs.xml b/res/values-large/refs.xml
new file mode 100644 (file)
index 0000000..f1ea4e6
--- /dev/null
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+    Layout alias to replace the single-pane version of the layout with a
+    two-pane version on Large screens.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+    <item name="activity_masterdetail_list" type="layout">@layout/activity_masterdetail_twopane</item>
+
+</resources>
diff --git a/res/values-sw600dp/refs.xml b/res/values-sw600dp/refs.xml
new file mode 100644 (file)
index 0000000..f1ea4e6
--- /dev/null
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+    Layout alias to replace the single-pane version of the layout with a
+    two-pane version on Large screens.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+    <item name="activity_masterdetail_list" type="layout">@layout/activity_masterdetail_twopane</item>
+
+</resources>
index e87cdcc..b6355fd 100644 (file)
     <string name="country_not_found">country not found</string>
     <string name="progress_dialog_get_remote_data">Downloading remote data</string>
     <string name="progress_dialog_generic_message">Please wait&#8230;</string>
+    <string name="title_activity_test_scroll">TestScrollActivity</string>
+    <string name="title_section1">Section 1</string>
+    <string name="title_section2">Section 2</string>
+    <string name="title_section3">Section 3</string>
+    <string name="title_masterdetail_list">MasterDetails</string>
+    <string name="title_masterdetail_detail">MasterDetail Detail</string>
 
 </resources>
index a2374b4..0ed23ba 100644 (file)
@@ -16,5 +16,8 @@
     <style name="AppTheme" parent="AppBaseTheme">
         <!-- All customizations that are NOT specific to a particular API-level can go here. -->
     </style>
+    
+
+    <color name="weather_time_of_day_color_title">#48aed4</color>
 
 </resources>
diff --git a/src/de/example/exampletdd/MasterDetailDetailActivity.java b/src/de/example/exampletdd/MasterDetailDetailActivity.java
new file mode 100644 (file)
index 0000000..4700060
--- /dev/null
@@ -0,0 +1,66 @@
+package de.example.exampletdd;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.NavUtils;
+import android.view.MenuItem;
+
+/**
+ * An activity representing a single MasterDetail detail screen. This activity
+ * is only used on handset devices. On tablet-size devices, item details are
+ * presented side-by-side with a list of items in a
+ * {@link MasterDetailListActivity}.
+ * <p>
+ * This activity is mostly just a 'shell' activity containing nothing more than
+ * a {@link MasterDetailDetailFragment}.
+ */
+public class MasterDetailDetailActivity extends FragmentActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_masterdetail_detail);
+
+        // Show the Up button in the action bar.
+        getActionBar().setDisplayHomeAsUpEnabled(true);
+
+        // savedInstanceState is non-null when there is fragment state
+        // saved from previous configurations of this activity
+        // (e.g. when rotating the screen from portrait to landscape).
+        // In this case, the fragment will automatically be re-added
+        // to its container so we don't need to manually add it.
+        // For more information, see the Fragments API guide at:
+        //
+        // http://developer.android.com/guide/components/fragments.html
+        //
+        if (savedInstanceState == null) {
+            // Create the detail fragment and add it to the activity
+            // using a fragment transaction.
+            Bundle arguments = new Bundle();
+            arguments.putString(MasterDetailDetailFragment.ARG_ITEM_ID,
+                    getIntent().getStringExtra(MasterDetailDetailFragment.ARG_ITEM_ID));
+            MasterDetailDetailFragment fragment = new MasterDetailDetailFragment();
+            fragment.setArguments(arguments);
+            getSupportFragmentManager().beginTransaction()
+                    .add(R.id.masterdetail_detail_container, fragment).commit();
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        int id = item.getItemId();
+        if (id == android.R.id.home) {
+            // This ID represents the Home or Up button. In the case of this
+            // activity, the Up button is shown. Use NavUtils to allow users
+            // to navigate up one level in the application structure. For
+            // more details, see the Navigation pattern on Android Design:
+            //
+            // http://developer.android.com/design/patterns/navigation.html#up-vs-back
+            //
+            NavUtils.navigateUpTo(this, new Intent(this, MasterDetailListActivity.class));
+            return true;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+}
diff --git a/src/de/example/exampletdd/MasterDetailDetailFragment.java b/src/de/example/exampletdd/MasterDetailDetailFragment.java
new file mode 100644 (file)
index 0000000..b679c40
--- /dev/null
@@ -0,0 +1,59 @@
+package de.example.exampletdd;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import de.example.exampletdd.dummy.DummyContent;
+
+/**
+ * A fragment representing a single MasterDetail detail screen. This fragment is
+ * either contained in a {@link MasterDetailListActivity} in two-pane mode (on
+ * tablets) or a {@link MasterDetailDetailActivity} on handsets.
+ */
+public class MasterDetailDetailFragment extends Fragment {
+    /**
+     * The fragment argument representing the item ID that this fragment
+     * represents.
+     */
+    public static final String ARG_ITEM_ID = "item_id";
+
+    /**
+     * The dummy content this fragment is presenting.
+     */
+    private DummyContent.DummyItem mItem;
+
+    /**
+     * Mandatory empty constructor for the fragment manager to instantiate the
+     * fragment (e.g. upon screen orientation changes).
+     */
+    public MasterDetailDetailFragment() {
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        if (getArguments().containsKey(ARG_ITEM_ID)) {
+            // Load the dummy content specified by the fragment
+            // arguments. In a real-world scenario, use a Loader
+            // to load content from a content provider.
+            mItem = DummyContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
+        }
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        View rootView = inflater.inflate(R.layout.fragment_masterdetail_detail, container, false);
+
+        // Show the dummy content as text in a TextView.
+        if (mItem != null) {
+            ((TextView) rootView.findViewById(R.id.masterdetail_detail)).setText(mItem.content);
+        }
+
+        return rootView;
+    }
+}
diff --git a/src/de/example/exampletdd/MasterDetailListActivity.java b/src/de/example/exampletdd/MasterDetailListActivity.java
new file mode 100644 (file)
index 0000000..7cf2a57
--- /dev/null
@@ -0,0 +1,78 @@
+package de.example.exampletdd;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.FragmentActivity;
+
+/**
+ * An activity representing a list of MasterDetails. This activity has different
+ * presentations for handset and tablet-size devices. On handsets, the activity
+ * presents a list of items, which when touched, lead to a
+ * {@link MasterDetailDetailActivity} representing item details. On tablets, the
+ * activity presents the list of items and item details side-by-side using two
+ * vertical panes.
+ * <p>
+ * The activity makes heavy use of fragments. The list of items is a
+ * {@link MasterDetailListFragment} and the item details (if present) is a
+ * {@link MasterDetailDetailFragment}.
+ * <p>
+ * This activity also implements the required
+ * {@link MasterDetailListFragment.Callbacks} interface to listen for item
+ * selections.
+ */
+public class MasterDetailListActivity extends FragmentActivity implements
+        MasterDetailListFragment.Callbacks {
+
+    /**
+     * Whether or not the activity is in two-pane mode, i.e. running on a tablet
+     * device.
+     */
+    private boolean mTwoPane;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_masterdetail_list);
+
+        if (findViewById(R.id.masterdetail_detail_container) != null) {
+            // The detail container view will be present only in the
+            // large-screen layouts (res/values-large and
+            // res/values-sw600dp). If this view is present, then the
+            // activity should be in two-pane mode.
+            mTwoPane = true;
+
+            // In two-pane mode, list items should be given the
+            // 'activated' state when touched.
+            ((MasterDetailListFragment) getSupportFragmentManager().findFragmentById(
+                    R.id.masterdetail_list)).setActivateOnItemClick(true);
+        }
+
+        // TODO: If exposing deep links into your app, handle intents here.
+    }
+
+    /**
+     * Callback method from {@link MasterDetailListFragment.Callbacks}
+     * indicating that the item with the given ID was selected.
+     */
+    @Override
+    public void onItemSelected(String id) {
+        if (mTwoPane) {
+            // In two-pane mode, show the detail view in this activity by
+            // adding or replacing the detail fragment using a
+            // fragment transaction.
+            Bundle arguments = new Bundle();
+            arguments.putString(MasterDetailDetailFragment.ARG_ITEM_ID, id);
+            MasterDetailDetailFragment fragment = new MasterDetailDetailFragment();
+            fragment.setArguments(arguments);
+            getSupportFragmentManager().beginTransaction()
+                    .replace(R.id.masterdetail_detail_container, fragment).commit();
+
+        } else {
+            // In single-pane mode, simply start the detail activity
+            // for the selected item ID.
+            Intent detailIntent = new Intent(this, MasterDetailDetailActivity.class);
+            detailIntent.putExtra(MasterDetailDetailFragment.ARG_ITEM_ID, id);
+            startActivity(detailIntent);
+        }
+    }
+}
diff --git a/src/de/example/exampletdd/MasterDetailListFragment.java b/src/de/example/exampletdd/MasterDetailListFragment.java
new file mode 100644 (file)
index 0000000..e81b39b
--- /dev/null
@@ -0,0 +1,147 @@
+package de.example.exampletdd;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.app.ListFragment;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.ListView;
+
+import de.example.exampletdd.dummy.DummyContent;
+
+/**
+ * A list fragment representing a list of MasterDetails. This fragment also
+ * supports tablet devices by allowing list items to be given an 'activated'
+ * state upon selection. This helps indicate which item is currently being
+ * viewed in a {@link MasterDetailDetailFragment}.
+ * <p>
+ * Activities containing this fragment MUST implement the {@link Callbacks}
+ * interface.
+ */
+public class MasterDetailListFragment extends ListFragment {
+
+    /**
+     * The serialization (saved instance state) Bundle key representing the
+     * activated item position. Only used on tablets.
+     */
+    private static final String STATE_ACTIVATED_POSITION = "activated_position";
+
+    /**
+     * The fragment's current callback object, which is notified of list item
+     * clicks.
+     */
+    private Callbacks mCallbacks = sDummyCallbacks;
+
+    /**
+     * The current activated item position. Only used on tablets.
+     */
+    private int mActivatedPosition = ListView.INVALID_POSITION;
+
+    /**
+     * A callback interface that all activities containing this fragment must
+     * implement. This mechanism allows activities to be notified of item
+     * selections.
+     */
+    public interface Callbacks {
+        /**
+         * Callback for when an item has been selected.
+         */
+        public void onItemSelected(String id);
+    }
+
+    /**
+     * A dummy implementation of the {@link Callbacks} interface that does
+     * nothing. Used only when this fragment is not attached to an activity.
+     */
+    private static Callbacks sDummyCallbacks = new Callbacks() {
+        @Override
+        public void onItemSelected(String id) {
+        }
+    };
+
+    /**
+     * Mandatory empty constructor for the fragment manager to instantiate the
+     * fragment (e.g. upon screen orientation changes).
+     */
+    public MasterDetailListFragment() {
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // TODO: replace with a real list adapter.
+        setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(),
+                android.R.layout.simple_list_item_activated_1, android.R.id.text1,
+                DummyContent.ITEMS));
+    }
+
+    @Override
+    public void onViewCreated(View view, Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+
+        // Restore the previously serialized activated item position.
+        if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) {
+            setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION));
+        }
+    }
+
+    @Override
+    public void onAttach(Activity activity) {
+        super.onAttach(activity);
+
+        // Activities containing this fragment must implement its callbacks.
+        if (!(activity instanceof Callbacks)) {
+            throw new IllegalStateException("Activity must implement fragment's callbacks.");
+        }
+
+        mCallbacks = (Callbacks) activity;
+    }
+
+    @Override
+    public void onDetach() {
+        super.onDetach();
+
+        // Reset the active callbacks interface to the dummy implementation.
+        mCallbacks = sDummyCallbacks;
+    }
+
+    @Override
+    public void onListItemClick(ListView listView, View view, int position, long id) {
+        super.onListItemClick(listView, view, position, id);
+
+        // Notify the active callbacks interface (the activity, if the
+        // fragment is attached to one) that an item has been selected.
+        mCallbacks.onItemSelected(DummyContent.ITEMS.get(position).id);
+    }
+
+    @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        if (mActivatedPosition != ListView.INVALID_POSITION) {
+            // Serialize and persist the activated item position.
+            outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);
+        }
+    }
+
+    /**
+     * Turns on activate-on-click mode. When this mode is on, list items will be
+     * given the 'activated' state when touched.
+     */
+    public void setActivateOnItemClick(boolean activateOnItemClick) {
+        // When setting CHOICE_MODE_SINGLE, ListView will automatically
+        // give items the 'activated' state when touched.
+        getListView().setChoiceMode(
+                activateOnItemClick ? ListView.CHOICE_MODE_SINGLE : ListView.CHOICE_MODE_NONE);
+    }
+
+    private void setActivatedPosition(int position) {
+        if (position == ListView.INVALID_POSITION) {
+            getListView().setItemChecked(mActivatedPosition, false);
+        } else {
+            getListView().setItemChecked(position, true);
+        }
+
+        mActivatedPosition = position;
+    }
+}
diff --git a/src/de/example/exampletdd/TestScrollActivity.java b/src/de/example/exampletdd/TestScrollActivity.java
new file mode 100644 (file)
index 0000000..b894a94
--- /dev/null
@@ -0,0 +1,122 @@
+package de.example.exampletdd;
+
+import android.app.ActionBar;
+import android.app.Activity;
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.TextView;
+
+public class TestScrollActivity extends Activity implements ActionBar.OnNavigationListener {
+
+    /**
+     * The serialization (saved instance state) Bundle key representing the
+     * current dropdown position.
+     */
+    private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";
+
+    @Override
+    protected void onCreate(final Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        this.setContentView(R.layout.activity_test_scroll);
+
+        // Set up the action bar to show a dropdown list.
+        final ActionBar actionBar = this.getActionBar();
+        actionBar.setDisplayShowTitleEnabled(false);
+        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
+
+        // Set up the dropdown list navigation in the action bar.
+        actionBar.setListNavigationCallbacks(
+                // Specify a SpinnerAdapter to populate the dropdown list.
+                new ArrayAdapter<String>(actionBar.getThemedContext(),
+                        android.R.layout.simple_list_item_1, android.R.id.text1, new String[] {
+                    this.getString(R.string.title_section1),
+                    this.getString(R.string.title_section2),
+                    this.getString(R.string.title_section3), }), this);
+    }
+
+    @Override
+    public void onRestoreInstanceState(final Bundle savedInstanceState) {
+        // Restore the previously serialized current dropdown position.
+        if (savedInstanceState.containsKey(STATE_SELECTED_NAVIGATION_ITEM)) {
+            this.getActionBar().setSelectedNavigationItem(
+                    savedInstanceState.getInt(STATE_SELECTED_NAVIGATION_ITEM));
+        }
+    }
+
+    @Override
+    public void onSaveInstanceState(final Bundle outState) {
+        // Serialize the current dropdown position.
+        outState.putInt(STATE_SELECTED_NAVIGATION_ITEM, this.getActionBar().getSelectedNavigationIndex());
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(final Menu menu) {
+
+        // Inflate the menu; this adds items to the action bar if it is present.
+        this.getMenuInflater().inflate(R.menu.test_scroll, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(final MenuItem item) {
+        // 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;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
+    public boolean onNavigationItemSelected(final int position, final long id) {
+        // When the given dropdown item is selected, show its contents in the
+        // container view.
+        // getFragmentManager().beginTransaction()
+        // .replace(R.id.container, PlaceholderFragment.newInstance(position +
+        // 1)).commit();
+        return true;
+    }
+
+    /**
+     * A placeholder fragment containing a simple view.
+     */
+    public static class PlaceholderFragment extends Fragment {
+        /**
+         * The fragment argument representing the section number for this
+         * fragment.
+         */
+        private static final String ARG_SECTION_NUMBER = "section_number";
+
+        /**
+         * Returns a new instance of this fragment for the given section number.
+         */
+        public static PlaceholderFragment newInstance(final int sectionNumber) {
+            final PlaceholderFragment fragment = new PlaceholderFragment();
+            final Bundle args = new Bundle();
+            args.putInt(ARG_SECTION_NUMBER, sectionNumber);
+            fragment.setArguments(args);
+            return fragment;
+        }
+
+        public PlaceholderFragment() {
+        }
+
+        @Override
+        public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
+                final Bundle savedInstanceState) {
+            final View rootView = inflater.inflate(R.layout.fragment_test_scroll, container, false);
+            final TextView textView = (TextView) rootView.findViewById(R.id.section_label);
+            textView.setText(Integer.toString(this.getArguments().getInt(ARG_SECTION_NUMBER)));
+            return rootView;
+        }
+    }
+
+}
index c58c3a1..b45a6ff 100644 (file)
@@ -60,30 +60,29 @@ public class WeatherInformationActivity extends Activity {
         super.onOptionsItemSelected(item);
 
         Intent intent;
-        switch (item.getItemId()) {
-        case R.id.weather_menu_settings:
+        final int itemId = item.getItemId();
+        if (itemId == R.id.weather_menu_settings) {
             intent = new Intent("de.example.exampletdd.WEATHERINFO")
             .setComponent(new ComponentName("de.example.exampletdd",
                     "de.example.exampletdd.WeatherInformationPreferencesActivity"));
             this.startActivity(intent);
             return true;
-        case R.id.weather_menu_get:
+        } else if (itemId == R.id.weather_menu_get) {
             this.getWeather();
             return true;
-        case R.id.weather_menu_map:
+        } else if (itemId == R.id.weather_menu_map) {
             intent = new Intent("de.example.exampletdd.WEATHERINFO")
             .setComponent(new ComponentName("de.example.exampletdd",
                     "de.example.exampletdd.WeatherInformationMapActivity"));
             this.startActivity(intent);
             return true;
-        case R.id.weather_menu_current:
+        } else if (itemId == R.id.weather_menu_current) {
             intent = new Intent("de.example.exampletdd.WEATHERINFO")
             .setComponent(new ComponentName("de.example.exampletdd",
-                    "de.example.exampletdd.WeatherInformationCurrentDataActivity"));
+                    "de.example.exampletdd.TestScrollActivity"));
             this.startActivity(intent);
             return true;
-        default:
-            break;
+        } else {
         }
 
         return super.onOptionsItemSelected(item);
index 549b61b..bf56f69 100644 (file)
@@ -35,8 +35,7 @@ public class WeatherInformationSpecificDataActivity extends Activity {
                     .getString(R.string.city_not_found) : geocodingData.getCity();
                     final String country = (geocodingData.getCountry() == null) ? this
                             .getString(R.string.country_not_found) : geocodingData.getCountry();
-                            actionBar.setTitle("Specific weather data information");
-                            actionBar.setSubtitle(city + "," + country);
+                            actionBar.setTitle(city + "," + country);
 
         }
     }
diff --git a/src/de/example/exampletdd/dummy/DummyContent.java b/src/de/example/exampletdd/dummy/DummyContent.java
new file mode 100644 (file)
index 0000000..6c09241
--- /dev/null
@@ -0,0 +1,55 @@
+package de.example.exampletdd.dummy;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Helper class for providing sample content for user interfaces created by
+ * Android template wizards.
+ * <p>
+ * TODO: Replace all uses of this class before publishing your app.
+ */
+public class DummyContent {
+
+    /**
+     * An array of sample (dummy) items.
+     */
+    public static List<DummyItem> ITEMS = new ArrayList<DummyItem>();
+
+    /**
+     * A map of sample (dummy) items, by ID.
+     */
+    public static Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
+
+    static {
+        // Add 3 sample items.
+        addItem(new DummyItem("1", "Item 1"));
+        addItem(new DummyItem("2", "Item 2"));
+        addItem(new DummyItem("3", "Item 3"));
+    }
+
+    private static void addItem(DummyItem item) {
+        ITEMS.add(item);
+        ITEM_MAP.put(item.id, item);
+    }
+
+    /**
+     * A dummy item representing a piece of content.
+     */
+    public static class DummyItem {
+        public String id;
+        public String content;
+
+        public DummyItem(String id, String content) {
+            this.id = id;
+            this.content = content;
+        }
+
+        @Override
+        public String toString() {
+            return content;
+        }
+    }
+}
diff --git a/src/de/example/exampletdd/fragment/overview/IconsList.java b/src/de/example/exampletdd/fragment/overview/IconsList.java
new file mode 100644 (file)
index 0000000..ecfb2e9
--- /dev/null
@@ -0,0 +1,143 @@
+package de.example.exampletdd.fragment.overview;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import de.example.exampletdd.R;
+
+public enum IconsList {
+    ICON_01d("01d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_clear;
+        }
+    },
+    ICON_01n("01n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_clear_night;
+        }
+    },
+    ICON_02d("02d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_few_clouds;
+        }
+    },
+    ICON_02n("02n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_few_clouds_night;
+        }
+    },
+    ICON_03d("03d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_few_clouds;
+        }
+    },
+    ICON_03n("03n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_few_clouds;
+        }
+    },
+    ICON_04d("04d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_overcast;
+        }
+    },
+    ICON_04n("04n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_overcast;
+        }
+    },
+    ICON_09d("09d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_showers;
+        }
+    },
+    ICON_09n("09n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_showers;
+        }
+    },
+    ICON_10d("10d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_showers_scattered;
+        }
+    },
+    ICON_10n("10n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_showers_scattered;
+        }
+    },
+    ICON_11d("11d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_storm;
+        }
+    },
+    ICON_11n("11n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_storm;
+        }
+    },
+    ICON_13d("13d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_snow;
+        }
+    },
+    ICON_13n("13n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_snow;
+        }
+    },
+    ICON_50d("50d") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_fog;
+        }
+    },
+    ICON_50n("50n") {
+        @Override
+        public int getResourceDrawable() {
+            return R.drawable.weather_fog;
+        }
+    };
+
+    private final String icon;
+    // Map with every enum constant. Class variable initializer. JLS§12.4.2
+    // Executed in textual order.
+    private static final Map<String, IconsList> codeMap = new HashMap<String, IconsList>();
+
+    // Static initializer. JLS§12.4.2 Executed in textual order.
+    static {
+        for (final IconsList code : IconsList.values()) {
+            codeMap.put(code.getIcon(), code);
+        }
+    }
+
+    private IconsList(final String icon) {
+        this.icon = icon;
+    }
+
+    public static final IconsList getIcon(final String icon) {
+        return codeMap.get(icon);
+    }
+
+    private String getIcon() {
+        return this.icon;
+    }
+
+    public abstract int getResourceDrawable();
+}
index a3ca249..9d4a579 100644 (file)
@@ -165,11 +165,12 @@ public class WeatherInformationOverviewFragment extends ListFragment implements
         final WeatherOverviewAdapter adapter = new WeatherOverviewAdapter(this.getActivity(),
                 R.layout.weather_main_entry_list);
 
-        final Bitmap picture = BitmapFactory.decodeResource(
-                this.getResources(), R.drawable.ic_02d);
+
         final DecimalFormat tempFormatter = (DecimalFormat) NumberFormat.getNumberInstance(Locale.getDefault());
         tempFormatter.applyPattern("#####.##");
-        final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, MMM d", Locale.getDefault());
+        final SimpleDateFormat dayNameFormatter = new SimpleDateFormat("EEE", Locale.getDefault());
+        final SimpleDateFormat monthAndDayNumberormatter = new SimpleDateFormat("MMM d",
+                Locale.getDefault());
         final double tempUnits = this.mIsFahrenheit ? 0 : 273.15;
         final String symbol = this.mIsFahrenheit ? "ºF" : "ºC";
 
@@ -178,11 +179,24 @@ public class WeatherInformationOverviewFragment extends ListFragment implements
         for (final de.example.exampletdd.model.forecastweather.List forecast : forecastWeatherData
                 .getList()) {
 
+            Bitmap picture;
+
+            if ((forecast.getWeather().size() > 0) &&
+                    (forecast.getWeather().get(0).getIcon() != null) &&
+                    (IconsList.getIcon(forecast.getWeather().get(0).getIcon()) != null)) {
+                final String icon = forecast.getWeather().get(0).getIcon();
+                picture = BitmapFactory.decodeResource(this.getResources(), IconsList.getIcon(icon)
+                        .getResourceDrawable());
+            } else {
+                picture = BitmapFactory.decodeResource(this.getResources(),
+                        R.drawable.weather_severe_alert);
+            }
 
             final Long forecastUNIXDate = (Long) forecast.getDt();
             calendar.setTimeInMillis(forecastUNIXDate * 1000L);
             final Date dayTime = calendar.getTime();
-            final String dayText = dateFormat.format(dayTime);
+            final String dayTextName = dayNameFormatter.format(dayTime);
+            final String monthAndDayNumberText = monthAndDayNumberormatter.format(dayTime);
 
             Double maxTemp = null;
             if (forecast.getTemp().getMax() != null) {
@@ -197,8 +211,9 @@ public class WeatherInformationOverviewFragment extends ListFragment implements
             }
 
             if ((maxTemp != null) && (minTemp != null)) {
-                entries.add(new WeatherOverviewEntry(dayText, tempFormatter.format(maxTemp)
-                        + symbol, tempFormatter.format(minTemp) + symbol, picture));
+                entries.add(new WeatherOverviewEntry(dayTextName, monthAndDayNumberText,
+                        tempFormatter.format(maxTemp) + symbol, tempFormatter.format(minTemp) + symbol,
+                        picture));
             }
         }
 
index e053181..6d2a26d 100644 (file)
@@ -31,10 +31,12 @@ public class WeatherOverviewAdapter extends ArrayAdapter<WeatherOverviewEntry> {
 
 
         // Setting date
-        viewHolder.dateView.setText(entry.getDate());
+        viewHolder.dateNameView.setText(entry.getDateName());
+        viewHolder.dateNumberView.setText(entry.getDateNumber());
 
         // Setting temperature max/min
-        viewHolder.temperatureView.setText(entry.getMaxTemp() + "/" + entry.getMinTemp());
+        viewHolder.temperatureMaxView.setText(entry.getMaxTemp());
+        viewHolder.temperatureMinView.setText(entry.getMinTemp());
 
         // Set image view
         viewHolder.pictureView.setImageBitmap(entry.getPicture());
@@ -71,10 +73,14 @@ public class WeatherOverviewAdapter extends ArrayAdapter<WeatherOverviewEntry> {
         if((null == tag) || !(tag instanceof ViewHolder)) {
             viewHolder = new ViewHolder();
 
-            viewHolder.dateView = (TextView) workingView
-                    .findViewById(R.id.weather_main_entry_date);
-            viewHolder.temperatureView = (TextView) workingView
-                    .findViewById(R.id.weather_main_entry_temperature);
+            viewHolder.dateNameView = (TextView) workingView
+                    .findViewById(R.id.weather_main_entry_date_name);
+            viewHolder.dateNumberView = (TextView) workingView
+                    .findViewById(R.id.weather_main_entry_date_number);
+            viewHolder.temperatureMaxView = (TextView) workingView
+                    .findViewById(R.id.weather_main_entry_temperature_max);
+            viewHolder.temperatureMinView = (TextView) workingView
+                    .findViewById(R.id.weather_main_entry_temperature_min);
             viewHolder.pictureView = (ImageView) workingView
                     .findViewById(R.id.weather_main_entry_image);
 
@@ -92,8 +98,10 @@ public class WeatherOverviewAdapter extends ArrayAdapter<WeatherOverviewEntry> {
      * Since views are recycled, these references will never change
      */
     private static class ViewHolder {
-        public TextView dateView;
-        public TextView temperatureView;
+        public TextView dateNameView;
+        public TextView dateNumberView;
+        public TextView temperatureMaxView;
+        public TextView temperatureMinView;
         public ImageView pictureView;
     }
 
index 3dfd92d..c8d6b05 100644 (file)
@@ -3,21 +3,28 @@ package de.example.exampletdd.fragment.overview;
 import android.graphics.Bitmap;
 
 public class WeatherOverviewEntry {
-    private final String date;
+    private final String dateName;
+    private final String dateNumber;
     private final String maxTemp;
     private final String minTemp;
     private final Bitmap picture;
 
-    public WeatherOverviewEntry(final String date, final String maxTemp, final String minTemp,
+    public WeatherOverviewEntry(final String dateName, final String dateNumber,
+            final String maxTemp, final String minTemp,
             final Bitmap picture) {
-        this.date = date;
+        this.dateName = dateName;
+        this.dateNumber = dateNumber;
         this.maxTemp = maxTemp;
         this.minTemp = minTemp;
         this.picture = picture;
     }
 
-    public String getDate() {
-        return this.date;
+    public String getDateName() {
+        return this.dateName;
+    }
+
+    public String getDateNumber() {
+        return this.dateNumber;
     }
 
     public String getMaxTemp() {
index 5501a7f..aecda8a 100644 (file)
@@ -3,7 +3,10 @@ package de.example.exampletdd.fragment.specific;
 import java.io.IOException;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 
@@ -128,6 +131,13 @@ public class WeatherInformationSpecificDataFragment extends ListFragment impleme
         final de.example.exampletdd.model.forecastweather.List forecast = forecastWeatherData
                 .getList().get((chosenDay));
 
+        final SimpleDateFormat dayFormatter = new SimpleDateFormat("EEEE - MMM d", Locale.getDefault());
+        final Calendar calendar = Calendar.getInstance();
+        final Long forecastUNIXDate = (Long) forecast.getDt();
+        calendar.setTimeInMillis(forecastUNIXDate * 1000L);
+        final Date date = calendar.getTime();
+        this.getActivity().getActionBar().setSubtitle(dayFormatter.format(date).toUpperCase());
+
         if (forecast.getWeather().size() > 0) {
             entries.set(0,
                     new WeatherSpecificDataEntry(this.getString(R.string.text_field_description),