Skip to content

ikd #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 142 commits into
base: 2.00_Integration_Points_and_Error_Cases
Choose a base branch
from
Open

ikd #84

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
cb96ffb
Added empty list view in ForecastFragment
DAGalpin May 24, 2015
da6401d
Added contextual empty view around network status.
DAGalpin May 24, 2015
a8ff5df
Added the LOCATION_STATUS using IntDef.
DAGalpin May 24, 2015
d4c9c26
Added a status for the current location in preferences and tracking f…
DAGalpin May 24, 2015
0577edf
Updated the empty list message with more contextual information---thi…
DAGalpin May 24, 2015
c3375ec
Added state when an invalid query (generating a 404 code) is detected…
DAGalpin May 24, 2015
8975813
Updated settings to show the status of the typed-in location.
DAGalpin May 24, 2015
9fb13bb
Created a custom preference with a custom attribute.
DAGalpin May 24, 2015
cc7184b
Used AlertDialog within EditTextPreference combined with a TextWatche…
DAGalpin May 24, 2015
f03cac2
Fixed some l8n around weather conditions
DAGalpin May 24, 2015
a7e613a
Updated a11y to have more descriptive text and clean up the talkback …
DAGalpin May 25, 2015
e666cf8
Added RTL updates for Sunshine.
DAGalpin May 25, 2015
822d52b
Integrate Glide to load weather art icons from an external source
DAGalpin May 25, 2015
e99968e
Change icon pack based on user preference
DAGalpin May 25, 2015
2ede69c
Adding Google Play Services and checking for Google Play Services bef…
DAGalpin May 25, 2015
4d7e147
Manifest updates for GCM
DAGalpin May 25, 2015
83cfcaf
Checking for registration ID and registering app
DAGalpin May 25, 2015
3a0b035
Better message parsing and notification building
DAGalpin May 25, 2015
c18dcee
Switched to using the Google Developer lingo for project number.
DAGalpin May 25, 2015
09bf411
Merge branch '5.03_Registering_with_GCM' into 5.04_Receiving_a_Message
DAGalpin May 25, 2015
fd3b398
Updates for the start of Material.
DAGalpin May 25, 2015
3ef2dfa
Updated the color constants to match material.
DAGalpin May 25, 2015
7bd1eeb
Switched from using ActionBar to using Toolbar
DAGalpin May 25, 2015
ce3459b
Updated the project with GridLayout and other changes.
DAGalpin May 25, 2015
4ca4e7b
Updated the detail layout to make use of a secondary grid layout.
DAGalpin May 25, 2015
dc24ba7
Updated icons with new correct sizes, added dimensions, updated selec…
DAGalpin May 25, 2015
734aab6
Added licenses to new files.
DAGalpin May 25, 2015
45627b2
Updated forecast layout on phones to match our new design.
DAGalpin May 25, 2015
01cbc9f
Updated the layout and dimensions to get us ready for lots of real es…
DAGalpin May 25, 2015
055a8a9
Updated our tablet portrait view to match the new design.
DAGalpin May 25, 2015
20231d8
Added dimensions and layouts to get us ready for SMRE part 2.
DAGalpin May 25, 2015
26159a5
Updated our landscape layout to be close to where we want it.
DAGalpin May 25, 2015
3bf4a5e
Updated with new twopane layout and dimensions.
DAGalpin May 25, 2015
b081ffb
Updated with cardview!
DAGalpin May 25, 2015
c0501e4
Prep for "Too Little Real Estate"
DAGalpin May 25, 2015
4495e7a
Updated our new landscape main fragment view.
DAGalpin May 25, 2015
dbff5f9
Starting point for RecyclerView.
DAGalpin May 25, 2015
c4d1dff
Updated Sunshine to start using RecyclerView instead of ListView.
DAGalpin May 25, 2015
8ccc514
Updated our RecyclerView to handle onClick and empty view.
DAGalpin May 25, 2015
cf8b67e
Added selection into forecast adapter.
DAGalpin May 25, 2015
350ea7f
Implemented Parallax Scrolling using an onScrollListener for Recycler…
DAGalpin May 25, 2015
be40c17
Added activity transition animations.
DAGalpin May 25, 2015
d9f57fb
Added shared element transitions to Sunshine.
DAGalpin May 25, 2015
77a0325
Added Design Library AppBar Scrolling
DAGalpin May 25, 2015
e7357a9
Added underscroll tracking within ForecastFragment for elevation cont…
DAGalpin May 25, 2015
3ce8bff
Create a 1x1 home screen widget using static data which launches Suns…
DAGalpin May 25, 2015
7ec7108
Load real data into the 1x1 Today widget, moving our work to an Inten…
DAGalpin May 25, 2015
5628b0b
Allow the Today widget to resize horizontally, change the default siz…
DAGalpin May 25, 2015
52efa53
Integrate Detail widget, showing a full list of weather information a…
DAGalpin May 25, 2015
089e1a7
Add a Muzei extension, changing the wallpaper with the weather
DAGalpin May 25, 2015
e1c557e
Revert "Adding Google Play Services and checking for Google Play Serv…
DAGalpin Aug 25, 2015
447189d
Adding required support for Google services and Google Play services
joannasmith Jun 15, 2015
fa5355a
Revert "Manifest updates for GCM"
DAGalpin Aug 25, 2015
5f5eeb7
Adding GCM permissions and class declarations to AndroidManifest
joannasmith Jun 15, 2015
1323b51
Merge branch '5.01_Google_Play_Services' into 5.02_Android_Manifest
DAGalpin Aug 25, 2015
aff5418
Revert "Switched to using the Google Developer lingo for project numb…
DAGalpin Aug 25, 2015
e4d650a
Revert "Checking for registration ID and registering app"
DAGalpin Aug 25, 2015
b139832
Merge branch '5.02_Android_Manifest' into 5.03_Registering_with_GCM
DAGalpin Aug 25, 2015
b6d88a8
Registering the app with GCM
joannasmith Jun 15, 2015
2ed375e
Revert "Better message parsing and notification building"
DAGalpin Aug 25, 2015
7841f9a
Merge branch '5.03_Registering_with_GCM' into 5.04_Receiving_a_Message
DAGalpin Aug 25, 2015
c9d81d9
Merge branch '5.04_Receiving_a_Message' into 6.00_Material_Design
DAGalpin Aug 25, 2015
17bc1a5
Merge branch '6.00_Material_Design' into 6.01_Color_Constants
DAGalpin Aug 25, 2015
56b8daa
Merged from 6.01_Color_Constants
DAGalpin Aug 26, 2015
b34b6fb
Merge branch '6.02_Implementing_Toolbar' into 6.03_Altering_the_Layou…
DAGalpin Aug 26, 2015
9caaf90
Merge branch '6.03_Altering_the_Layout_Start' into 6.04_Altering_the_…
DAGalpin Aug 26, 2015
214e450
Merge branch '6.04_Altering_the_Layout_Finish' into 6.05_Improving_th…
DAGalpin Aug 26, 2015
d1fa2df
"Merged from 6.05_Improving_the_Forecast_View_Start"
DAGalpin Aug 26, 2015
ad59025
"Merged from 6.06_Improving_the_Forecast_View_Finish"
DAGalpin Aug 26, 2015
ffab3f0
"Merged from 6.07_So_Much_Real_Estate_Part_1_Start"
DAGalpin Aug 26, 2015
63c5af3
"Merged from 6.08_So_Much_Real_Estate_Part_1_Finish"
DAGalpin Aug 26, 2015
8b605f9
"Merged from 6.09_So_Much_Real_Estate_Part_2_Start"
DAGalpin Aug 26, 2015
d99dacf
"Merged from 6.10_So_Much_Real_Estate_Part_2_Finish"
DAGalpin Aug 26, 2015
6c74117
"Merged from 6.11_So_Much_Real_Estate_Part_3_Start"
DAGalpin Aug 26, 2015
868364d
"Merged from 6.12_So_Much_Real_Estate_Part_3_Finish"
DAGalpin Aug 26, 2015
f567866
"Merged from 6.13_Too_Little_Real_Estate_Start"
DAGalpin Aug 26, 2015
fdb06ae
"Merged from 6.14_Too_Little_Real_Estate_Finish"
DAGalpin Aug 26, 2015
b69b450
"Merged from 6.15_Starting_RecyclerView_Start"
DAGalpin Aug 26, 2015
9fd92fa
"Merged from 6.16_Starting_RecyclerView_Finish"
DAGalpin Aug 26, 2015
3a212b5
"Merged from 6.17_Improving_our_RecyclerView"
DAGalpin Aug 26, 2015
a59a393
"Merged from 6.18_Bonus_RecyclerView_Code"
DAGalpin Aug 26, 2015
1e7b3a9
"Merged from 6.19_Implement_Parallax_Scrolling"
DAGalpin Aug 26, 2015
4d84fc3
"Merged from 6.20_Animate_Your_Transitions"
DAGalpin Aug 26, 2015
67376ed
"Merged from 6.21_Begin_Sharing_Elements"
DAGalpin Aug 26, 2015
06fd72f
"Merged from 6.22_Implement_AppBar_Scrolling"
DAGalpin Aug 26, 2015
b7d3576
"Merged from 7.00_Building_a_Total_Experience"
DAGalpin Aug 26, 2015
7c67c40
"Merged from 7.01_Sunshines_First_Widget"
DAGalpin Aug 26, 2015
f9ea707
"Merged from 7.02_Get_Real_Data"
DAGalpin Aug 26, 2015
c6e7897
"Merged from 7.03_Choose_Your_Size"
DAGalpin Aug 26, 2015
90ae8a3
"Merged from 7.04_Integrating_the_Detail_Widget"
DAGalpin Aug 26, 2015
d93b5ff
Commented out the GCM sender ID
DAGalpin Aug 26, 2015
87571ae
Merge branch '5.03_Registering_with_GCM' into 5.04_Receiving_a_Message
DAGalpin Aug 26, 2015
a707535
Adding the GCM listener to process downstream messages
joannasmith Jun 15, 2015
c254021
Added a blank sender id and a check for it to keep things compiling.
DAGalpin Aug 26, 2015
29972d8
Added translatable=false to stub string.
DAGalpin Aug 27, 2015
8849a50
Merge branch '5.03_Registering_with_GCM' into 5.04_Receiving_a_Message
DAGalpin Aug 27, 2015
8b5aeaa
Added helper toast if senderId is zero length.
DAGalpin Aug 27, 2015
8d62089
"Merged from 5.04_Receiving_a_Message"
DAGalpin Aug 27, 2015
fc99bde
"Merged from 6.00_Material_Design"
DAGalpin Aug 27, 2015
0a24437
"Merged from 6.01_Color_Constants"
DAGalpin Aug 27, 2015
06ea47d
"Merged from 6.02_Implementing_Toolbar"
DAGalpin Aug 27, 2015
e9741e1
"Merged from 6.03_Altering_the_Layout_Start"
DAGalpin Aug 27, 2015
ccac130
"Merged from 6.04_Altering_the_Layout_Finish"
DAGalpin Aug 27, 2015
b275e6a
"Merged from 6.05_Improving_the_Forecast_View_Start"
DAGalpin Aug 27, 2015
882b35c
"Merged from 6.06_Improving_the_Forecast_View_Finish"
DAGalpin Aug 27, 2015
f483b13
"Merged from 6.07_So_Much_Real_Estate_Part_1_Start"
DAGalpin Aug 27, 2015
81d20ae
"Merged from 6.08_So_Much_Real_Estate_Part_1_Finish"
DAGalpin Aug 27, 2015
b6e66ee
"Merged from 6.09_So_Much_Real_Estate_Part_2_Start"
DAGalpin Aug 27, 2015
62a5c1b
"Merged from 6.10_So_Much_Real_Estate_Part_2_Finish"
DAGalpin Aug 27, 2015
fbe3d43
"Merged from 6.11_So_Much_Real_Estate_Part_3_Start"
DAGalpin Aug 27, 2015
ad46cd9
"Merged from 6.12_So_Much_Real_Estate_Part_3_Finish"
DAGalpin Aug 27, 2015
eb58297
"Merged from 6.13_Too_Little_Real_Estate_Start"
DAGalpin Aug 27, 2015
d2d753f
"Merged from 6.14_Too_Little_Real_Estate_Finish"
DAGalpin Aug 27, 2015
d478cc4
"Merged from 6.15_Starting_RecyclerView_Start"
DAGalpin Aug 27, 2015
4fa4a2e
"Merged from 6.16_Starting_RecyclerView_Finish"
DAGalpin Aug 27, 2015
11e2c85
"Merged from 6.17_Improving_our_RecyclerView"
DAGalpin Aug 27, 2015
556a07e
"Merged from 6.18_Bonus_RecyclerView_Code"
DAGalpin Aug 27, 2015
8ee1f9a
"Merged from 6.19_Implement_Parallax_Scrolling"
DAGalpin Aug 27, 2015
d14996d
"Merged from 6.20_Animate_Your_Transitions"
DAGalpin Aug 27, 2015
03d508f
"Merged from 6.21_Begin_Sharing_Elements"
DAGalpin Aug 27, 2015
02ae9bf
"Merged from 6.22_Implement_AppBar_Scrolling"
DAGalpin Aug 27, 2015
4d4d650
"Merged from 7.00_Building_a_Total_Experience"
DAGalpin Aug 27, 2015
f662d3f
"Merged from 7.01_Sunshines_First_Widget"
DAGalpin Aug 27, 2015
4ff9eaa
"Merged from 7.02_Get_Real_Data"
DAGalpin Aug 27, 2015
638194f
"Merged from 7.03_Choose_Your_Size"
DAGalpin Aug 27, 2015
3adc6bd
"Merged from 7.04_Integrating_the_Detail_Widget"
DAGalpin Aug 27, 2015
6752c12
Creating a new widget layout for the location text preference
joannasmith Jun 16, 2015
5ac9eb2
Setting up the required framework for the PlacePicker integration
joannasmith Jun 16, 2015
cc998e7
Providing the answer for the PlacePicker implementation quiz
joannasmith Jun 17, 2015
fac9721
Updating the syncadapter to use the latlng variable stored in sharedp…
joannasmith Jun 17, 2015
03184fd
Solution to syncadapter quiz
joannasmith Jun 16, 2015
3610a56
Moving the latlng wipe to the correct location
joannasmith Jun 16, 2015
2e8fe23
Adding attributions
joannasmith Jun 16, 2015
e678406
Merge pull request #42 from DAGalpin/8.00_Places_API_Start
cdlei Dec 2, 2015
b1fe6b6
Merge pull request #43 from DAGalpin/8.01_New_Location_Widget_Layout
cdlei Dec 2, 2015
07334f9
Merge pull request #44 from DAGalpin/8.02_PlacePicker_Integration_Fra…
cdlei Dec 2, 2015
d0eed2e
Merge pull request #49 from DAGalpin/8.03_PlacePicker_Implementation_…
cdlei Dec 3, 2015
3b0bf95
Merge pull request #45 from DAGalpin/8.04_Updating_Syncadapter_With_L…
cdlei Dec 3, 2015
f4eb6ec
Merge pull request #46 from DAGalpin/8.05_Updating_SyncAdapter_Solution
cdlei Dec 3, 2015
92291cb
Merge pull request #47 from DAGalpin/8.06_Moving_The_LatLng_Wipe
cdlei Dec 3, 2015
9c5b0a2
Merge pull request #48 from DAGalpin/8.07_Adding_Attributions
cdlei Dec 3, 2015
745380e
Add API Key Parameter to OpenWeatherMap API Call
cdlei Oct 28, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ Pre-requisites
Android SDK 21 or Higher
Build Tools version 21.1.2
Android Support AppCompat 22.2.0
Android Support Annotations 22.2.0
Android Support GridLayout 22.2.0
Android Support CardView 22.2.0
Android Support Design 22.2.0
Android Support RecyclerView 22.2.0
Google Play Services GCM 7.0.0
BumpTech Glide 3.5.2


Getting Started
---------------
Expand Down
15 changes: 14 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 21
Expand All @@ -17,9 +18,21 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildTypes.each {
it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', MyOpenWeatherMapApiKey
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.android.support:gridlayout-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.google.android.apps.muzei:muzei-api:2.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-location:7.5.0'
}
93 changes: 89 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,30 @@
<uses-permission
android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>

<!-- Permissions required to make our UI more friendly -->
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Permissions required for Google Cloud Messaging -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.example.android.sunshine.app.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.android.sunshine.app.permission.C2D_MESSAGE" />

<!-- Permissions required to use the Place Picker -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:theme="@style/ForecastTheme"
android:label="@string/app_name" >
android:label="@string/app_name"
android:theme="@style/AppTheme.Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -46,7 +61,8 @@
<activity
android:name=".DetailActivity"
android:label="@string/title_activity_detail"
android:parentActivityName=".MainActivity" >
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme.Details">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.android.sunshine.app.MainActivity" />
Expand Down Expand Up @@ -88,6 +104,75 @@
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>

<!-- The Google Cloud Messaging receiver and services -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.android.sunshine.app" />
</intent-filter>
</receiver>
<!-- Muzei Extension -->
<service android:name=".muzei.WeatherMuzeiSource"
android:icon="@drawable/ic_muzei"
android:label="@string/app_name"
android:description="@string/muzei_description" >
<intent-filter>
<action android:name="com.google.android.apps.muzei.api.MuzeiArtSource" />
</intent-filter>
<meta-data android:name="color" android:value="@color/primary" />
</service>
<!-- Today Widget -->
<receiver
android:name=".widget.TodayWidgetProvider"
android:label="@string/title_widget_today" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.example.android.sunshine.app.ACTION_DATA_UPDATED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/widget_info_today" />
</receiver>
<service android:name=".widget.TodayWidgetIntentService" />
<!-- Detail Widget -->
<receiver
android:name=".widget.DetailWidgetProvider"
android:label="@string/title_widget_detail"
android:enabled="@bool/widget_detail_enabled" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.example.android.sunshine.app.ACTION_DATA_UPDATED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/widget_info_detail" />
</receiver>
<service
android:name=".widget.DetailWidgetRemoteViewsService"
android:enabled="@bool/widget_detail_enabled"
android:exported="false"
android:permission="android.permission.BIND_REMOTEVIEWS" />
<service
android:name="gcm.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="gcm.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<service
android:name=".gcm.RegistrationIntentService"
android:exported="false" >
</service>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
package com.example.android.sunshine.app;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;


public class DetailActivity extends ActionBarActivity {
public class DetailActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -35,33 +38,17 @@ protected void onCreate(Bundle savedInstanceState) {

Bundle arguments = new Bundle();
arguments.putParcelable(DetailFragment.DETAIL_URI, getIntent().getData());
arguments.putBoolean(DetailFragment.DETAIL_TRANSITION_ANIMATION, true);

DetailFragment fragment = new DetailFragment();
fragment.setArguments(arguments);

getSupportFragmentManager().beginTransaction()
.add(R.id.weather_detail_container, fragment)
.commit();
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.detail, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(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.
int id = item.getItemId();
if (id == R.id.action_settings) {
startActivity(new Intent(this, SettingsActivity.class));
return true;
// Being here means we are in animation mode
supportPostponeEnterTransition();
}
return super.onOptionsItemSelected(item);
}
}
Loading