From 7b6ac22006eacedce365801635033e5d0880a772 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Tue, 18 Nov 2014 05:02:34 +0100 Subject: [PATCH] Update layout file names: weather_main_tabs.xml and weather_notification.xml --- .../information/activity/MainTabsActivity.java | 2 +- .../notification/NotificationIntentService.java | 6 +- app/src/main/res/layout/fragment_pager.xml | 29 ----- app/src/main/res/layout/notification.xml | 120 --------------------- app/src/main/res/layout/weather_main_tabs.xml | 29 +++++ app/src/main/res/layout/weather_notification.xml | 120 +++++++++++++++++++++ 6 files changed, 152 insertions(+), 154 deletions(-) delete mode 100644 app/src/main/res/layout/fragment_pager.xml delete mode 100644 app/src/main/res/layout/notification.xml create mode 100644 app/src/main/res/layout/weather_main_tabs.xml create mode 100644 app/src/main/res/layout/weather_notification.xml diff --git a/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java b/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java index d3951cf..3e9956f 100644 --- a/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java +++ b/app/src/main/java/name/gumartinm/weather/information/activity/MainTabsActivity.java @@ -47,7 +47,7 @@ public class MainTabsActivity extends FragmentActivity { @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); - this.setContentView(R.layout.fragment_pager); + this.setContentView(R.layout.weather_main_tabs); this.mPager = (ViewPager)this.findViewById(R.id.pager); this.mPager.setAdapter(new TabsAdapter(this.getSupportFragmentManager())); diff --git a/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java b/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java index 932b49c..59d6637 100644 --- a/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java +++ b/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java @@ -195,7 +195,7 @@ public class NotificationIntentService extends IntentService { final String country = weatherLocation.getCountry(); // 4. Insert data in RemoteViews. - final RemoteViews remoteView = new RemoteViews(this.getApplicationContext().getPackageName(), R.layout.notification); + final RemoteViews remoteView = new RemoteViews(this.getApplicationContext().getPackageName(), R.layout.weather_notification); remoteView.setImageViewBitmap(R.id.weather_notification_image, picture); remoteView.setTextViewText(R.id.weather_notification_temperature_max, tempMax); remoteView.setTextViewText(R.id.weather_notification_temperature_min, tempMin); @@ -204,9 +204,7 @@ public class NotificationIntentService extends IntentService { // 5. Activity launcher. final Intent resultIntent = new Intent(this.getApplicationContext(), MainTabsActivity.class); - // The PendingIntent to launch our activity if the user selects this notification -// final PendingIntent contentIntent = PendingIntent.getActivity( -// this.getApplicationContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT); + // The PendingIntent to launch our activity if the user selects this notification. // The stack builder object will contain an artificial back stack for the started Activity. // This ensures that navigating backward from the Activity leads out of // your application to the Home screen. diff --git a/app/src/main/res/layout/fragment_pager.xml b/app/src/main/res/layout/fragment_pager.xml deleted file mode 100644 index 272fc03..0000000 --- a/app/src/main/res/layout/fragment_pager.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout/notification.xml b/app/src/main/res/layout/notification.xml deleted file mode 100644 index b6a4fba..0000000 --- a/app/src/main/res/layout/notification.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/weather_main_tabs.xml b/app/src/main/res/layout/weather_main_tabs.xml new file mode 100644 index 0000000..272fc03 --- /dev/null +++ b/app/src/main/res/layout/weather_main_tabs.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/app/src/main/res/layout/weather_notification.xml b/app/src/main/res/layout/weather_notification.xml new file mode 100644 index 0000000..b6a4fba --- /dev/null +++ b/app/src/main/res/layout/weather_notification.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.1.4