├── DinnerApp_BEGIN
├── .gitignore
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ └── vcs.xml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ ├── Dinner.java
│ │ │ ├── MainActivity.java
│ │ │ ├── OrderDinnerActivity.java
│ │ │ ├── RemoveMealActivity.java
│ │ │ ├── ShowDinnerActivity.java
│ │ │ ├── ShowRecipeActivity.java
│ │ │ ├── UseInfoBoxFragment.java
│ │ │ └── Utility.java
│ │ └── res
│ │ ├── drawable
│ │ ├── button_solid_rounded_corners.xml
│ │ ├── dinner_row.xml
│ │ ├── rectangle.xml
│ │ └── rectangle_solid.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── show_dinner_suggestion.xml
│ │ └── show_info.xml
│ │ ├── menu
│ │ ├── food_prefs_menu.xml
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── DinnerApp_FINAL
├── .gitignore
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── dictionaries
│ │ └── googleudacity.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ └── vcs.xml
├── DinnerApp_FINAL.iml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ ├── Dinner.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyApplication.java
│ │ │ ├── OrderDinnerActivity.java
│ │ │ ├── RemoveMealActivity.java
│ │ │ ├── ShowAllDinnersActivity.java
│ │ │ ├── ShowDailySpecialActivity.java
│ │ │ ├── ShowDinnerActivity.java
│ │ │ ├── ShowRecipeActivity.java
│ │ │ ├── UseInfoBoxFragment.java
│ │ │ └── Utility.java
│ │ └── res
│ │ ├── drawable
│ │ ├── button_solid_rounded_corners.xml
│ │ ├── dinner_row.xml
│ │ ├── rectangle.xml
│ │ └── rectangle_solid.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── list_all_dinners.xml
│ │ ├── order_dinner.xml
│ │ ├── show_daily_special.xml
│ │ ├── show_dinner_in_row.xml
│ │ ├── show_dinner_suggestion.xml
│ │ └── show_info.xml
│ │ ├── menu
│ │ ├── food_prefs_menu.xml
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── raw
│ │ └── gtm_default
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ ├── values
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── track_app.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── DinnerApp_part2_start
├── .gitignore
├── .idea
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── dictionaries
│ │ └── googleudacity.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ └── vcs.xml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ ├── Dinner.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyApplication.java
│ │ │ ├── OrderDinnerActivity.java
│ │ │ ├── RemoveMealActivity.java
│ │ │ ├── ShowDinnerActivity.java
│ │ │ ├── ShowRecipeActivity.java
│ │ │ ├── UseInfoBoxFragment.java
│ │ │ └── Utility.java
│ │ └── res
│ │ ├── drawable
│ │ ├── button_solid_rounded_corners.xml
│ │ ├── dinner_row.xml
│ │ ├── rectangle.xml
│ │ └── rectangle_solid.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── show_dinner_suggestion.xml
│ │ └── show_info.xml
│ │ ├── menu
│ │ ├── food_prefs_menu.xml
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ ├── values
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── track_app.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── DinnerApp_part3_start
├── .gitignore
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── dictionaries
│ │ └── googleudacity.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ └── vcs.xml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ ├── Dinner.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyApplication.java
│ │ │ ├── OrderDinnerActivity.java
│ │ │ ├── RemoveMealActivity.java
│ │ │ ├── ShowAllDinnersActivity.java
│ │ │ ├── ShowDinnerActivity.java
│ │ │ ├── ShowRecipeActivity.java
│ │ │ ├── UseInfoBoxFragment.java
│ │ │ └── Utility.java
│ │ └── res
│ │ ├── drawable
│ │ ├── button_solid_rounded_corners.xml
│ │ ├── dinner_row.xml
│ │ ├── rectangle.xml
│ │ └── rectangle_solid.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── list_all_dinners.xml
│ │ ├── order_dinner.xml
│ │ ├── show_dinner_in_row.xml
│ │ ├── show_dinner_suggestion.xml
│ │ └── show_info.xml
│ │ ├── menu
│ │ ├── food_prefs_menu.xml
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ ├── values
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── track_app.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── DinnerApp_part4_start
├── .gitignore
├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── dictionaries
│ │ └── googleudacity.xml
│ ├── encodings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ └── vcs.xml
├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── android
│ │ │ └── dinnerapp
│ │ │ ├── Dinner.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyApplication.java
│ │ │ ├── OrderDinnerActivity.java
│ │ │ ├── RemoveMealActivity.java
│ │ │ ├── ShowAllDinnersActivity.java
│ │ │ ├── ShowDailySpecialActivity.java
│ │ │ ├── ShowDinnerActivity.java
│ │ │ ├── ShowRecipeActivity.java
│ │ │ ├── UseInfoBoxFragment.java
│ │ │ └── Utility.java
│ │ └── res
│ │ ├── drawable
│ │ ├── button_solid_rounded_corners.xml
│ │ ├── dinner_row.xml
│ │ ├── rectangle.xml
│ │ └── rectangle_solid.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── list_all_dinners.xml
│ │ ├── order_dinner.xml
│ │ ├── show_daily_special.xml
│ │ ├── show_dinner_in_row.xml
│ │ ├── show_dinner_suggestion.xml
│ │ └── show_info.xml
│ │ ├── menu
│ │ ├── food_prefs_menu.xml
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── raw
│ │ └── gtm_default
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ ├── values
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ │ └── xml
│ │ └── track_app.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
└── README.md
/DinnerApp_BEGIN/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/.name:
--------------------------------------------------------------------------------
1 | DinnerApp
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.android.dinnerapp"
9 | minSdkVersion 18
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:21.0.3'
25 | compile 'com.google.android.gms:play-services:6.5.+'
26 | }
27 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jocelyn/AndroidSDK/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/androidTest/java/com/example/android/dinnerapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.example.android.dinnerapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
29 |
30 |
34 |
37 |
38 |
39 |
43 |
46 |
47 |
48 |
52 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/java/com/example/android/dinnerapp/OrderDinnerActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class OrderDinnerActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.order_online_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 |
43 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
44 | tv.setText("This is where you will order the selected dinner: \n\n" +
45 | dinner);
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/java/com/example/android/dinnerapp/RemoveMealActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class RemoveMealActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.dislike_dinner_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
43 | tv.setText(dinner + " \n\n" + getResources().getText(R.string.dislike_dinner));
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/java/com/example/android/dinnerapp/ShowRecipeActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class ShowRecipeActivity extends Activity {
25 |
26 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.show_info);
32 |
33 | }
34 |
35 | protected void onStart() {
36 | super.onStart();
37 |
38 | // Set the heading
39 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
40 | heading_tv.setText(getResources().getText(R.string.show_recipe_heading));
41 |
42 | // Set the text
43 | TextView tv = (TextView) findViewById(R.id.textView_info);
44 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
45 | tv.setText(dinner + "\n\n" + getResources().getText(R.string.recipe));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/java/com/example/android/dinnerapp/UseInfoBoxFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.app.Fragment;
24 |
25 | /**
26 | * Created by jocelyn on 3/12/15.
27 | */
28 |
29 | /*
30 | * This fragment displays an info box with a solid heading
31 | */
32 | public class UseInfoBoxFragment extends Fragment{
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
35 | Bundle savedInstanceState) {
36 | // Inflate the layout for this fragment
37 | return inflater.inflate(R.layout.show_info, container, false);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/java/com/example/android/dinnerapp/Utility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.content.Context;
20 | import android.widget.Toast;
21 |
22 | /**
23 | * Created by jocelyn on 12/10/14.
24 | */
25 | public class Utility {
26 |
27 | public static void showMyToast (String toastText, Context appContext) {
28 |
29 | // Show a toast with tonights dinner
30 | // Context context = getApplicationContext();
31 | // CharSequence text = "Hello toast!";
32 | int duration = Toast.LENGTH_SHORT;
33 |
34 | Toast toast = Toast.makeText(appContext, toastText, duration);
35 | toast.show();
36 |
37 | }
38 |
39 | public static String[] combine(String[] a, String[] b){
40 | int length = a.length + b.length;
41 | String[] result = new String[length];
42 | System.arraycopy(a, 0, result, 0, a.length);
43 | System.arraycopy(b, 0, result, a.length, b.length);
44 | return result;
45 | }
46 |
47 | public static String[] combine(String[] a, String[] b, String[] c, String[] d){
48 | return combine(combine(a, b), combine(c, d));
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/drawable/button_solid_rounded_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/drawable/dinner_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/drawable/rectangle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/drawable/rectangle_solid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/layout/show_dinner_suggestion.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
33 |
34 |
38 |
39 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/layout/show_info.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
19 |
20 |
39 |
40 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/menu/food_prefs_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_BEGIN/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_BEGIN/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_BEGIN/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_BEGIN/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - "Mushroom omelette and fried snow peas"
6 | - "Egg and tomato salad"
7 |
8 |
9 |
10 | - "Sweet corn and lentil soup"
11 | - "Tofu and coriander salad"
12 | - "Eggplant and apple lasagne"
13 |
14 |
15 |
16 | - "Roast beef with yorkshire pudding"
17 | - "Chicken kebabs with french fries"
18 | - "Lamb curry with braised carrots"
19 |
20 |
21 |
22 | - "Baked cod with miso sauce"
23 | - "Smoked salmon and brie salad"
24 | - "Crispy calamari with olives and grapes"
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - #FF33B5E5
5 | - #FFAA66CC
6 | - #85C787
7 | - #FFFFBB33
8 | - #FFFF4444
9 | - #BCDAF7
10 | - #FF0099CC
11 | - #FF9933CC
12 | - #466B47
13 | - #FFFF8800
14 | - #FFCC0000
15 | - #FFFFFF
16 |
17 | - @color/blue
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | What\'s for Dinner?
3 |
4 | Hello world!
5 | Settings
6 |
7 |
8 | selectedDinner
9 |
10 |
11 | May we suggest...
12 | And the recipe is ...
13 | Order Dinner
14 | Sorry about that!
15 |
16 |
17 | This is where you will order your dinner online ...
18 | The recipe will appear here, with ingredient list and
19 | everything ...
20 | We\'re sorry you didn\'t like that suggestion.
21 | We have eradicated it forever, you will never be bothered by it again. \n\n\nAt least
22 | that will be true when the eradication functionality has been implemented.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
17 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_BEGIN/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/DinnerApp_BEGIN/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/.name:
--------------------------------------------------------------------------------
1 | DinnerApp_FINAL
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/dictionaries/googleudacity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/DinnerApp_FINAL.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.android.dinnerapp"
9 | minSdkVersion 18
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:21.0.3'
25 | compile 'com.google.android.gms:play-services:6.5.+'
26 | }
27 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jocelyn/AndroidSDK/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/androidTest/java/com/example/android/dinnerapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.example.android.dinnerapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/java/com/example/android/dinnerapp/RemoveMealActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class RemoveMealActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.dislike_dinner_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
43 | tv.setText(dinner + " \n\n" + getResources().getText(R.string.dislike_dinner));
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/java/com/example/android/dinnerapp/ShowRecipeActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 | import com.google.android.gms.analytics.Tracker;
24 | import com.google.android.gms.analytics.HitBuilders;
25 |
26 |
27 |
28 | public class ShowRecipeActivity extends Activity {
29 |
30 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.show_info);
36 | }
37 |
38 | protected void onStart() {
39 | super.onStart();
40 |
41 | // Get tracker.
42 | Tracker tracker = ((MyApplication) getApplication()).getTracker();
43 |
44 | // Set screen name.
45 | tracker.setScreenName("Show recipe screen");
46 |
47 | // Send a screen view.
48 | tracker.send(new HitBuilders.ScreenViewBuilder()
49 | .build());
50 |
51 | // Set the heading
52 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
53 | heading_tv.setText(getResources().getText(R.string.show_recipe_heading));
54 |
55 | // Set the text
56 | TextView tv = (TextView) findViewById(R.id.textView_info);
57 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
58 | tv.setText(dinner + "\n\n" + getResources().getText(R.string.recipe));
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/java/com/example/android/dinnerapp/UseInfoBoxFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.app.Fragment;
24 |
25 | /**
26 | * Created by jocelyn on 3/12/15.
27 | */
28 |
29 | /*
30 | * This fragment displays an info box with a solid heading
31 | */
32 | public class UseInfoBoxFragment extends Fragment{
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
35 | Bundle savedInstanceState) {
36 | // Inflate the layout for this fragment
37 | return inflater.inflate(R.layout.show_info, container, false);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/java/com/example/android/dinnerapp/Utility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.content.Context;
20 | import android.widget.Toast;
21 |
22 | import java.util.Date;
23 | import java.text.SimpleDateFormat;
24 |
25 | /**
26 | * Created by jocelyn on 12/10/14.
27 | */
28 | public class Utility {
29 |
30 | public static void showMyToast (String toastText, Context appContext) {
31 |
32 | // Show a toast
33 | // Context context = getApplicationContext();
34 | // CharSequence text = "Hello toast!";
35 | int duration = Toast.LENGTH_SHORT;
36 |
37 | Toast toast = Toast.makeText(appContext, toastText, duration);
38 | toast.show();
39 |
40 | }
41 |
42 | public static String[] combine(String[] a, String[] b){
43 | int length = a.length + b.length;
44 | String[] result = new String[length];
45 | System.arraycopy(a, 0, result, 0, a.length);
46 | System.arraycopy(b, 0, result, a.length, b.length);
47 | return result;
48 | }
49 |
50 | public static String[] combine(String[] a, String[] b, String[] c, String[] d){
51 | return combine(combine(a, b), combine(c, d));
52 | }
53 |
54 | // The ID of a dinner is encoded in the first two characters
55 | public static String getDinnerId (String dinner) {
56 |
57 | return dinner.substring(0,2);
58 | }
59 |
60 | // Gets the current time as a String
61 | public static String getCurrentTime () {
62 | Date curDate = new Date();
63 | SimpleDateFormat format = format = new SimpleDateFormat("dd-M hh:mm:ss");
64 | return format.format(curDate);
65 | }
66 |
67 | public static String getUniqueTransactionId (String productId) {
68 | return ("T-" + getCurrentTime() + productId );
69 | }
70 |
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/drawable/button_solid_rounded_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/drawable/dinner_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/drawable/rectangle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/drawable/rectangle_solid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/list_all_dinners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
19 |
23 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/order_dinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
30 |
31 |
36 |
37 |
43 |
44 |
50 |
51 |
57 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/show_daily_special.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/show_dinner_in_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/show_dinner_suggestion.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
33 |
34 |
38 |
39 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/layout/show_info.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
19 |
20 |
39 |
40 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/menu/food_prefs_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_FINAL/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_FINAL/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_FINAL/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_FINAL/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/raw/gtm_default:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_FINAL/app/src/main/res/raw/gtm_default
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - "01 Mushroom omelette and fried snow peas"
5 | - "02 Egg and tomato salad"
6 |
7 |
8 |
9 | - "03 Sweet corn and lentil soup"
10 | - "04 Tofu and coriander salad"
11 | - "05 Eggplant and apple lasagne"
12 |
13 |
14 |
15 | - "06 Roast beef with yorkshire pudding"
16 | - "07 Chicken kebabs with french fries"
17 | - "08 Lamb curry with braised carrots"
18 |
19 |
20 |
21 | - "09 Baked cod with miso sauce"
22 | - "10 Smoked salmon and brie salad"
23 | - "11 Crispy calamari with olives and grapes"
24 | - "12 Mussels with stir fried seaweed"
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - #FF33B5E5
5 | - #FFAA66CC
6 | - #85C787
7 | - #FFFFBB33
8 | - #FFFF4444
9 | - #BCDAF7
10 | - #FF0099CC
11 | - #FF9933CC
12 | - #466B47
13 | - #FFFF8800
14 | - #FFCC0000
15 | - #FFFFFF
16 |
17 | - @color/blue
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | What\'s for Dinner 4?
3 |
4 | Hello world!
5 | Settings
6 |
7 |
8 | selectedDinner
9 |
10 |
11 | May we suggest...
12 | And the recipe is ...
13 | Order Dinner
14 | Sorry about that!
15 |
16 |
17 | This is where you will order your dinner online ...
18 | The recipe will appear here, with ingredient list and
19 | everything ...
20 | We\'re sorry you didn\'t like that suggestion.
21 | We have eradicated it forever, you will never be bothered by it again. \n\n\nAt least
22 | that will be true when the eradication functionality has been implemented.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
17 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/app/src/main/res/xml/track_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | UA-XXXXXXXX-1
4 | false
5 |
6 | Main screen
7 |
8 |
9 | Order dinner
10 |
11 |
12 | Eradicate dinner
13 |
14 |
15 | Show dinner
16 |
17 |
18 | Show recipe
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/DinnerApp_FINAL/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_FINAL/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/DinnerApp_FINAL/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/DinnerApp_FINAL/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/dictionaries/googleudacity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.android.dinnerapp"
9 | minSdkVersion 18
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:21.0.3'
25 | compile 'com.google.android.gms:play-services:6.5.+'
26 | }
27 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jocelyn/AndroidSDK/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
31 |
32 |
36 |
39 |
40 |
41 |
45 |
48 |
49 |
50 |
54 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/java/com/example/android/dinnerapp/MyApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Application;
20 |
21 | import com.google.android.gms.analytics.GoogleAnalytics;
22 | import com.google.android.gms.analytics.Tracker;
23 | import com.google.android.gms.analytics.Logger;
24 |
25 |
26 | public class MyApplication extends Application {
27 | public Tracker mTracker;
28 |
29 | // Get the tracker associated with this app
30 | public void startTracking() {
31 |
32 | // Initialize an Analytics tracker using a Google Analytics property ID.
33 |
34 | // Does the Tracker already exist?
35 | // If not, create it
36 |
37 | if (mTracker == null) {
38 | GoogleAnalytics ga = GoogleAnalytics.getInstance(this);
39 |
40 | // Get the config data for the tracker
41 | mTracker = ga.newTracker(R.xml.track_app);
42 |
43 | // Enable tracking of activities
44 | ga.enableAutoActivityReports(this);
45 |
46 | // Set the log level to verbose.
47 | ga.getLogger()
48 | .setLogLevel(Logger.LogLevel.VERBOSE);
49 | }
50 | }
51 |
52 | public Tracker getTracker() {
53 | // Make sure the tracker exists
54 | startTracking();
55 |
56 | // Then return the tracker
57 | return mTracker;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/java/com/example/android/dinnerapp/OrderDinnerActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class OrderDinnerActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.order_online_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 |
43 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
44 | tv.setText("This is where you will order the selected dinner: \n\n" +
45 | dinner);
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/java/com/example/android/dinnerapp/RemoveMealActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class RemoveMealActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.dislike_dinner_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
43 | tv.setText(dinner + " \n\n" + getResources().getText(R.string.dislike_dinner));
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/java/com/example/android/dinnerapp/ShowRecipeActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class ShowRecipeActivity extends Activity {
25 |
26 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.show_info);
32 |
33 | }
34 |
35 | protected void onStart() {
36 | super.onStart();
37 |
38 | // Set the heading
39 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
40 | heading_tv.setText(getResources().getText(R.string.show_recipe_heading));
41 |
42 | // Set the text
43 | TextView tv = (TextView) findViewById(R.id.textView_info);
44 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
45 | tv.setText(dinner + "\n\n" + getResources().getText(R.string.recipe));
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/java/com/example/android/dinnerapp/UseInfoBoxFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.app.Fragment;
24 |
25 | /**
26 | * Created by jocelyn on 3/12/15.
27 | */
28 |
29 | /*
30 | * This fragment displays an info box with a solid heading
31 | */
32 | public class UseInfoBoxFragment extends Fragment{
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
35 | Bundle savedInstanceState) {
36 | // Inflate the layout for this fragment
37 | return inflater.inflate(R.layout.show_info, container, false);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/java/com/example/android/dinnerapp/Utility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.content.Context;
20 | import android.widget.Toast;
21 |
22 | /**
23 | * Created by jocelyn on 12/10/14.
24 | */
25 | public class Utility {
26 |
27 | public static void showMyToast (String toastText, Context appContext) {
28 |
29 | // Show a toast with tonights dinner
30 | // Context context = getApplicationContext();
31 | // CharSequence text = "Hello toast!";
32 | int duration = Toast.LENGTH_SHORT;
33 |
34 | Toast toast = Toast.makeText(appContext, toastText, duration);
35 | toast.show();
36 |
37 | }
38 |
39 | public static String[] combine(String[] a, String[] b){
40 | int length = a.length + b.length;
41 | String[] result = new String[length];
42 | System.arraycopy(a, 0, result, 0, a.length);
43 | System.arraycopy(b, 0, result, a.length, b.length);
44 | return result;
45 | }
46 |
47 | public static String[] combine(String[] a, String[] b, String[] c, String[] d){
48 | return combine(combine(a, b), combine(c, d));
49 | }
50 |
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/drawable/button_solid_rounded_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/drawable/dinner_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/drawable/rectangle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/drawable/rectangle_solid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/layout/show_dinner_suggestion.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
33 |
34 |
38 |
39 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/layout/show_info.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
19 |
20 |
39 |
40 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/menu/food_prefs_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part2_start/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part2_start/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part2_start/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part2_start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - "Mushroom omelette and fried snow peas"
6 | - "Egg and tomato salad"
7 |
8 |
9 |
10 | - "Sweet corn and lentil soup"
11 | - "Tofu and coriander salad"
12 | - "Eggplant and apple lasagne"
13 |
14 |
15 |
16 | - "Roast beef with yorkshire pudding"
17 | - "Chicken kebabs with french fries"
18 | - "Lamb curry with braised carrots"
19 |
20 |
21 |
22 | - "Baked cod with miso sauce"
23 | - "Smoked salmon and brie salad"
24 | - "Crispy calamari with olives and grapes"
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - #FF33B5E5
5 | - #FFAA66CC
6 | - #85C787
7 | - #FFFFBB33
8 | - #FFFF4444
9 | - #BCDAF7
10 | - #FF0099CC
11 | - #FF9933CC
12 | - #466B47
13 | - #FFFF8800
14 | - #FFCC0000
15 | - #FFFFFF
16 |
17 | - @color/blue
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | What\'s for Dinner?
3 |
4 | Hello world!
5 | Settings
6 |
7 |
8 | selectedDinner
9 |
10 |
11 | May we suggest...
12 | And the recipe is ...
13 | Order Dinner
14 | Sorry about that!
15 |
16 |
17 | This is where you will order your dinner online ...
18 | The recipe will appear here, with ingredient list and
19 | everything ...
20 | We\'re sorry you didn\'t like that suggestion.
21 | We have eradicated it forever, you will never be bothered by it again. \n\n\nAt least
22 | that will be true when the eradication functionality has been implemented.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/app/src/main/res/xml/track_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | UA-XXXXXXXX-1
4 | true
5 |
6 | Main screen
7 |
8 |
9 | Order dinner
10 |
11 |
12 | Eradicate dinner
13 |
14 |
15 | Show dinner
16 |
17 |
18 | Show recipe
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/DinnerApp_part2_start/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part2_start/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/DinnerApp_part2_start/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/DinnerApp_part2_start/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/.name:
--------------------------------------------------------------------------------
1 | DinnerApp
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/dictionaries/googleudacity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.android.dinnerapp"
9 | minSdkVersion 18
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:21.0.3'
25 | compile 'com.google.android.gms:play-services:6.5.+'
26 | }
27 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jocelyn/AndroidSDK/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/androidTest/java/com/example/android/dinnerapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.example.android.dinnerapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/java/com/example/android/dinnerapp/MyApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Application;
20 |
21 | import com.google.android.gms.analytics.GoogleAnalytics;
22 | import com.google.android.gms.analytics.Tracker;
23 | import com.google.android.gms.analytics.Logger;
24 |
25 |
26 | public class MyApplication extends Application {
27 | public Tracker mTracker;
28 |
29 | // Get the tracker associated with this app
30 | public void startTracking() {
31 |
32 | // Initialize an Analytics tracker using a Google Analytics property ID.
33 |
34 | // Does the Tracker already exist?
35 | // If not, create it
36 |
37 | if (mTracker == null) {
38 | GoogleAnalytics ga = GoogleAnalytics.getInstance(this);
39 |
40 | // Get the config data for the tracker
41 | mTracker = ga.newTracker(R.xml.track_app);
42 |
43 | // Enable tracking of activities
44 | ga.enableAutoActivityReports(this);
45 |
46 | // Set the log level to verbose.
47 | ga.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
48 | }
49 | }
50 |
51 |
52 | public Tracker getTracker() {
53 | // Make sure the tracker exists
54 | startTracking();
55 |
56 | // Then return the tracker
57 | return mTracker;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/java/com/example/android/dinnerapp/RemoveMealActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class RemoveMealActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.dislike_dinner_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
43 | tv.setText(dinner + " \n\n" + getResources().getText(R.string.dislike_dinner));
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/java/com/example/android/dinnerapp/ShowRecipeActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 | import com.google.android.gms.analytics.Tracker;
24 | import com.google.android.gms.analytics.HitBuilders;
25 |
26 | public class ShowRecipeActivity extends Activity {
27 |
28 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.show_info);
34 | }
35 |
36 | protected void onStart() {
37 | super.onStart();
38 |
39 | // Get tracker.
40 | Tracker tracker = ((MyApplication) getApplication()).getTracker();
41 |
42 | // Set screen name.
43 | tracker.setScreenName("Show recipe screen");
44 |
45 | // Send a screen view.
46 | tracker.send(new HitBuilders.ScreenViewBuilder()
47 | .build());
48 |
49 | // Set the heading
50 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
51 | heading_tv.setText(getResources().getText(R.string.show_recipe_heading));
52 |
53 | // Set the text
54 | TextView tv = (TextView) findViewById(R.id.textView_info);
55 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
56 | tv.setText(dinner + "\n\n" + getResources().getText(R.string.recipe));
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/java/com/example/android/dinnerapp/UseInfoBoxFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.app.Fragment;
24 |
25 | /**
26 | * Created by jocelyn on 3/12/15.
27 | */
28 |
29 | /*
30 | * This fragment displays an info box with a solid heading
31 | */
32 | public class UseInfoBoxFragment extends Fragment{
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
35 | Bundle savedInstanceState) {
36 | // Inflate the layout for this fragment
37 | return inflater.inflate(R.layout.show_info, container, false);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/java/com/example/android/dinnerapp/Utility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.content.Context;
20 | import android.widget.Toast;
21 |
22 | import java.util.Date;
23 | import java.text.SimpleDateFormat;
24 |
25 | /**
26 | * Created by jocelyn on 12/10/14.
27 | */
28 | public class Utility {
29 |
30 | public static void showMyToast (String toastText, Context appContext) {
31 |
32 | // Show a toast
33 | // Context context = getApplicationContext();
34 | // CharSequence text = "Hello toast!";
35 | int duration = Toast.LENGTH_SHORT;
36 |
37 | Toast toast = Toast.makeText(appContext, toastText, duration);
38 | toast.show();
39 |
40 | }
41 |
42 | public static String[] combine(String[] a, String[] b){
43 | int length = a.length + b.length;
44 | String[] result = new String[length];
45 | System.arraycopy(a, 0, result, 0, a.length);
46 | System.arraycopy(b, 0, result, a.length, b.length);
47 | return result;
48 | }
49 |
50 | public static String[] combine(String[] a, String[] b, String[] c, String[] d){
51 | return combine(combine(a, b), combine(c, d));
52 | }
53 |
54 | // The ID of a dinner is encoded in the first two characters
55 | public static String getDinnerId (String dinner) {
56 |
57 | return dinner.substring(0,2);
58 | }
59 |
60 | // Gets the current time as a String
61 | public static String getCurrentTime () {
62 | Date curDate = new Date();
63 | SimpleDateFormat format = format = new SimpleDateFormat("dd-M hh:mm:ss");
64 | return format.format(curDate);
65 | }
66 |
67 | public static String getUniqueTransactionId (String productId) {
68 | return ("T-" + getCurrentTime() + productId );
69 | }
70 |
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/drawable/button_solid_rounded_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/drawable/dinner_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/drawable/rectangle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/drawable/rectangle_solid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/layout/list_all_dinners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
19 |
23 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/layout/order_dinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
30 |
31 |
36 |
37 |
43 |
44 |
50 |
51 |
57 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/layout/show_dinner_in_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/layout/show_dinner_suggestion.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
33 |
34 |
38 |
39 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/layout/show_info.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
19 |
20 |
39 |
40 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/menu/food_prefs_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part3_start/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part3_start/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part3_start/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part3_start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - "01 Mushroom omelette and fried snow peas"
5 | - "02 Egg and tomato salad"
6 |
7 |
8 |
9 | - "03 Sweet corn and lentil soup"
10 | - "04 Tofu and coriander salad"
11 | - "05 Eggplant and apple lasagne"
12 |
13 |
14 |
15 | - "06 Roast beef with yorkshire pudding"
16 | - "07 Chicken kebabs with french fries"
17 | - "08 Lamb curry with braised carrots"
18 |
19 |
20 |
21 | - "09 Baked cod with miso sauce"
22 | - "10 Smoked salmon and brie salad"
23 | - "11 Crispy calamari with olives and grapes"
24 | - "12 Mussels with stir fried seaweed"
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - #FF33B5E5
5 | - #FFAA66CC
6 | - #85C787
7 | - #FFFFBB33
8 | - #FFFF4444
9 | - #BCDAF7
10 | - #FF0099CC
11 | - #FF9933CC
12 | - #466B47
13 | - #FFFF8800
14 | - #FFCC0000
15 | - #FFFFFF
16 |
17 | - @color/blue
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | What\'s for Dinner?
3 |
4 | Hello world!
5 | Settings
6 |
7 |
8 | selectedDinner
9 |
10 |
11 | May we suggest...
12 | And the recipe is ...
13 | Order Dinner
14 | Sorry about that!
15 |
16 |
17 | This is where you will order your dinner online ...
18 | The recipe will appear here, with ingredient list and
19 | everything ...
20 | We\'re sorry you didn\'t like that suggestion.
21 | We have eradicated it forever, you will never be bothered by it again. \n\n\nAt least
22 | that will be true when the eradication functionality has been implemented.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
17 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/app/src/main/res/xml/track_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | UA-XXXXXXX-1
4 | false
5 |
6 | Main screen
7 |
8 |
9 | Order dinner
10 |
11 |
12 | Eradicate dinner
13 |
14 |
15 | Show dinner
16 |
17 |
18 | Show recipe
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/DinnerApp_part3_start/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part3_start/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/DinnerApp_part3_start/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/DinnerApp_part3_start/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/.name:
--------------------------------------------------------------------------------
1 | DinnerApp
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/dictionaries/googleudacity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.example.android.dinnerapp"
9 | minSdkVersion 18
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:21.0.3'
25 | compile 'com.google.android.gms:play-services:6.5.+'
26 | }
27 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/jocelyn/AndroidSDK/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/androidTest/java/com/example/android/dinnerapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.example.android.dinnerapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/java/com/example/android/dinnerapp/RemoveMealActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 |
24 | public class RemoveMealActivity extends Activity {
25 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.show_info);
31 | }
32 |
33 | protected void onStart() {
34 | super.onStart();
35 |
36 | // Set the heading
37 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
38 | heading_tv.setText(getResources().getText(R.string.dislike_dinner_heading));
39 |
40 | // Set the text
41 | TextView tv = (TextView) findViewById(R.id.textView_info);
42 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
43 | tv.setText(dinner + " \n\n" + getResources().getText(R.string.dislike_dinner));
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/java/com/example/android/dinnerapp/ShowRecipeActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 | import android.widget.TextView;
22 |
23 | import com.google.android.gms.analytics.Tracker;
24 | import com.google.android.gms.analytics.HitBuilders;
25 |
26 | public class ShowRecipeActivity extends Activity {
27 |
28 | String selectedDinnerExtrasKey = String.valueOf(R.string.selected_dinner);
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.show_info);
34 | }
35 |
36 | protected void onStart() {
37 | super.onStart();
38 |
39 | // Get tracker.
40 | Tracker tracker = ((MyApplication) getApplication()).getTracker();
41 |
42 | // Set screen name.
43 | tracker.setScreenName("Show recipe screen");
44 |
45 | // Send a screen view.
46 | tracker.send(new HitBuilders.ScreenViewBuilder()
47 | .build());
48 |
49 | // Set the heading
50 | TextView heading_tv = (TextView) findViewById(R.id.textView_info_heading);
51 | heading_tv.setText(getResources().getText(R.string.show_recipe_heading));
52 |
53 | // Set the text
54 | TextView tv = (TextView) findViewById(R.id.textView_info);
55 | String dinner = getIntent().getStringExtra(selectedDinnerExtrasKey);
56 | tv.setText(dinner + "\n\n" + getResources().getText(R.string.recipe));
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/java/com/example/android/dinnerapp/UseInfoBoxFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Google Inc. All Rights Reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.android.dinnerapp;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.app.Fragment;
24 |
25 | /**
26 | * Created by jocelyn on 3/12/15.
27 | */
28 |
29 | /*
30 | * This fragment displays an info box with a solid heading
31 | */
32 | public class UseInfoBoxFragment extends Fragment{
33 | @Override
34 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
35 | Bundle savedInstanceState) {
36 | // Inflate the layout for this fragment
37 | return inflater.inflate(R.layout.show_info, container, false);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/java/com/example/android/dinnerapp/Utility.java:
--------------------------------------------------------------------------------
1 | package com.example.android.dinnerapp;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | import java.util.Date;
7 | import java.text.SimpleDateFormat;
8 |
9 | /**
10 | * Created by jocelyn on 12/10/14.
11 | */
12 | public class Utility {
13 |
14 | public static void showMyToast (String toastText, Context appContext) {
15 |
16 | // Show a toast
17 | // Context context = getApplicationContext();
18 | // CharSequence text = "Hello toast!";
19 | int duration = Toast.LENGTH_SHORT;
20 |
21 | Toast toast = Toast.makeText(appContext, toastText, duration);
22 | toast.show();
23 |
24 | }
25 |
26 | public static String[] combine(String[] a, String[] b){
27 | int length = a.length + b.length;
28 | String[] result = new String[length];
29 | System.arraycopy(a, 0, result, 0, a.length);
30 | System.arraycopy(b, 0, result, a.length, b.length);
31 | return result;
32 | }
33 |
34 | public static String[] combine(String[] a, String[] b, String[] c, String[] d){
35 | return combine(combine(a, b), combine(c, d));
36 | }
37 |
38 | // The ID of a dinner is encoded in the first two characters
39 | public static String getDinnerId (String dinner) {
40 |
41 | return dinner.substring(0,2);
42 | }
43 |
44 | // Gets the current time as a String
45 | public static String getCurrentTime () {
46 | Date curDate = new Date();
47 | SimpleDateFormat format = format = new SimpleDateFormat("dd-M hh:mm:ss");
48 | return format.format(curDate);
49 | }
50 |
51 | public static String getUniqueTransactionId (String productId) {
52 | return ("T-" + getCurrentTime() + productId );
53 | }
54 |
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/drawable/button_solid_rounded_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/drawable/dinner_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/drawable/rectangle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/drawable/rectangle_solid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/list_all_dinners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
19 |
23 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/order_dinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
30 |
31 |
36 |
37 |
43 |
44 |
50 |
51 |
57 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/show_daily_special.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
21 |
22 |
29 |
30 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/show_dinner_in_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/show_dinner_suggestion.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
22 |
28 |
29 |
33 |
34 |
38 |
39 |
43 |
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/layout/show_info.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
19 |
20 |
39 |
40 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/menu/food_prefs_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part4_start/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part4_start/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part4_start/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part4_start/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/raw/gtm_default:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part4_start/app/src/main/res/raw/gtm_default
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - "01 Mushroom omelette and fried snow peas"
5 | - "02 Egg and tomato salad"
6 |
7 |
8 |
9 | - "03 Sweet corn and lentil soup"
10 | - "04 Tofu and coriander salad"
11 | - "05 Eggplant and apple lasagne"
12 |
13 |
14 |
15 | - "06 Roast beef with yorkshire pudding"
16 | - "07 Chicken kebabs with french fries"
17 | - "08 Lamb curry with braised carrots"
18 |
19 |
20 |
21 | - "09 Baked cod with miso sauce"
22 | - "10 Smoked salmon and brie salad"
23 | - "11 Crispy calamari with olives and grapes"
24 | - "12 Mussels with stir fried seaweed"
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - #FF33B5E5
5 | - #FFAA66CC
6 | - #85C787
7 | - #FFFFBB33
8 | - #FFFF4444
9 | - #BCDAF7
10 | - #FF0099CC
11 | - #FF9933CC
12 | - #466B47
13 | - #FFFF8800
14 | - #FFCC0000
15 | - #FFFFFF
16 |
17 | - @color/blue
18 |
19 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | What\'s for Dinner 3?
3 |
4 | Hello world!
5 | Settings
6 |
7 |
8 | selectedDinner
9 |
10 |
11 | May we suggest...
12 | And the recipe is ...
13 | Order Dinner
14 | Sorry about that!
15 |
16 |
17 | This is where you will order your dinner online ...
18 | The recipe will appear here, with ingredient list and
19 | everything ...
20 | We\'re sorry you didn\'t like that suggestion.
21 | We have eradicated it forever, you will never be bothered by it again. \n\n\nAt least
22 | that will be true when the eradication functionality has been implemented.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
17 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/app/src/main/res/xml/track_app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | UA-XXXXXXX-1
4 | false
5 |
6 | Main screen
7 |
8 |
9 | Order dinner
10 |
11 |
12 | Eradicate dinner
13 |
14 |
15 | Show dinner
16 |
17 |
18 | Show recipe
19 |
20 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/DinnerApp_part4_start/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/udacity/Analytics_and_Tag_Manager/d8605301135880888f100f9fcdb1a2d3e0ce0cd2/DinnerApp_part4_start/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/DinnerApp_part4_start/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/DinnerApp_part4_start/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Analytics_and_Tag_Manager
2 | Code for the Analytics and Tag manager portions of the Google Play services course
3 |
4 | ##Sample App for Google Analytics and Tag Manager Udacity courses
5 |
6 | This repo contains complete Android Studio projects for each of the Google Analytics and Tag Manager lessons in the Google Play Services Udacity course.
7 |
8 | We provide the complete starting project for each lesson. The sample app is a simple app that generates a dinner suggestion. As you work through the course, you will add functionality to the app to include buttons for e-commerce steps, and also to show a daily special. More importantly, you'll add the code to send hits to Google Analytics and to use variables in a Tag Manager container.
9 |
10 | The What's for Dinner sample app is a very skeletal app with very limited functionality. It has hooks for additional activities, suching as showing the recipe for the suggested dinner, but these additional activities are not implemented.
11 |
12 | The purpose of the sample app is to provide a foundation you to learn how to add code to send hits to Google Analytics and to use Google Tag Manager.
13 |
14 | ##License
15 |
16 | Copyright 2015 Google, Inc.
17 |
18 | Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership.
19 |
20 | The ASF licenses this file to you 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
21 | http://www.apache.org/licenses/LICENSE-2.0
22 |
23 | 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.
24 |
25 | # Archival Note
26 | This repository is deprecated; therefore, we are going to archive it. However, learners will be able to fork it to their personal Github account but cannot submit PRs to this repository. If you have any issues or suggestions to make, feel free to:
27 | - Utilize the https://knowledge.udacity.com/ forum to seek help on content-specific issues.
28 | - Submit a support ticket along with the link to your forked repository if (learners are) blocked for other reasons. Here are the links for the [retail consumers](https://udacity.zendesk.com/hc/en-us/requests/new) and [enterprise learners](https://udacityenterprise.zendesk.com/hc/en-us/requests/new?ticket_form_id=360000279131).
--------------------------------------------------------------------------------