@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()));
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);
// 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.
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2014 Gustavo Martin Morcuende
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:padding="4dip"
- android:gravity="center_horizontal"
- android:layout_width="match_parent" android:layout_height="match_parent">
-
- <android.support.v4.view.ViewPager
- android:id="@+id/pager"
- android:layout_width="match_parent"
- android:layout_height="0px"
- android:layout_weight="1">
- </android.support.v4.view.ViewPager>
-
-</LinearLayout>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2014 Gustavo Martin Morcuende
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="fill"
- android:baselineAligned="false"
- android:orientation="horizontal" >
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="start"
- android:contentDescription="@string/icon_weather_description"
- android:orientation="vertical"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
-
-
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="2"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/weather_notification_city"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="Morata de Tajuña"
- android:textAlignment="center"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/weather_notification_country"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="Spain"
- android:textAlignment="center"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textStyle="normal" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/weather_notification_temperature_max"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="12ºC"
- android:textAlignment="center"
- android:textAllCaps="true"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/weather_notification_temperature_min"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:text="5ºC"
- android:textAlignment="center"
- android:textAllCaps="true"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textStyle="normal" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:id="@+id/weather_notification_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="end"
- android:contentDescription="@string/icon_weather_description"
- android:orientation="vertical"
- android:src="@drawable/ic_launcher" />
-
- </LinearLayout>
-
-</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2014 Gustavo Martin Morcuende
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:padding="4dip"
+ android:gravity="center_horizontal"
+ android:layout_width="match_parent" android:layout_height="match_parent">
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/pager"
+ android:layout_width="match_parent"
+ android:layout_height="0px"
+ android:layout_weight="1">
+ </android.support.v4.view.ViewPager>
+
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2014 Gustavo Martin Morcuende
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="fill"
+ android:baselineAligned="false"
+ android:orientation="horizontal" >
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="start"
+ android:contentDescription="@string/icon_weather_description"
+ android:orientation="vertical"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:layout_weight="2"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/weather_notification_city"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="Morata de Tajuña"
+ android:textAlignment="center"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/weather_notification_country"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="Spain"
+ android:textAlignment="center"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textStyle="normal" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/weather_notification_temperature_max"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="12ºC"
+ android:textAlignment="center"
+ android:textAllCaps="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/weather_notification_temperature_min"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="5ºC"
+ android:textAlignment="center"
+ android:textAllCaps="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textStyle="normal" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:id="@+id/weather_notification_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="end"
+ android:contentDescription="@string/icon_weather_description"
+ android:orientation="vertical"
+ android:src="@drawable/ic_launcher" />
+
+ </LinearLayout>
+
+</LinearLayout>