summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatherine Kuan <katherinekuan@google.com>2014-02-07 19:03:11 -0800
committerKatherine Kuan <katherinekuan@google.com>2014-02-11 18:06:42 -0800
commit601ab11519a115ae3cdcffa2705a138390f0a634 (patch)
treea6cd2b720322726429c9fdc8f9ac97b9e474cc50
parenta7254542b06878f0c3b34a6c3d91b9e7d3990f74 (diff)
downloaddemos-601ab11519a115ae3cdcffa2705a138390f0a634.tar.gz
Add JustForUs application
- Sample app that displays a GridView of coupons for Valentine's Day DevByte - Responsive layout (# of grid columns change based on device width) - Use AssetProvider to share images Change-Id: I6035446883938ad16f973c572e1aca059b54c8d2
-rw-r--r--JustForUs/.gitignore6
-rw-r--r--JustForUs/README26
-rw-r--r--JustForUs/build.gradle30
-rw-r--r--JustForUs/gradle.properties18
-rw-r--r--JustForUs/gradle/wrapper/gradle-wrapper.jarbin0 -> 49896 bytes
-rw-r--r--JustForUs/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xJustForUs/gradlew164
-rw-r--r--JustForUs/gradlew.bat90
-rw-r--r--JustForUs/justforus/build.gradle36
-rw-r--r--JustForUs/justforus/src/main/AndroidManifest.xml40
-rw-r--r--JustForUs/justforus/src/main/assets/boat.jpgbin0 -> 29630 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/dinner.jpgbin0 -> 33313 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/hawaii.jpgbin0 -> 26619 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/park.jpgbin0 -> 64900 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/picnic.jpgbin0 -> 48948 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/present.jpgbin0 -> 26611 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/rose.jpgbin0 -> 37111 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/spa.jpgbin0 -> 58551 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/sunrise.jpgbin0 -> 38324 bytes
-rw-r--r--JustForUs/justforus/src/main/assets/zoo.jpgbin0 -> 69914 bytes
-rw-r--r--JustForUs/justforus/src/main/java/com/example/android/justforus/AssetProvider.java183
-rw-r--r--JustForUs/justforus/src/main/java/com/example/android/justforus/MainActivity.java271
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-hdpi/ab_solid.9.pngbin0 -> 230 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-hdpi/ic_action_heart.pngbin0 -> 812 bytes
-rw-r--r--JustForUs/justforus/src/main/res/drawable-hdpi/ic_launcher.pngbin0 -> 8986 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-mdpi/ab_solid.9.pngbin0 -> 183 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-mdpi/ic_action_heart.pngbin0 -> 469 bytes
-rw-r--r--JustForUs/justforus/src/main/res/drawable-mdpi/ic_launcher.pngbin0 -> 4727 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-xhdpi/ab_solid.9.pngbin0 -> 279 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-xhdpi/ic_action_heart.pngbin0 -> 997 bytes
-rw-r--r--JustForUs/justforus/src/main/res/drawable-xhdpi/ic_launcher.pngbin0 -> 14211 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-xxhdpi/ab_solid.9.pngbin0 -> 383 bytes
-rwxr-xr-xJustForUs/justforus/src/main/res/drawable-xxhdpi/ic_action_heart.pngbin0 -> 1727 bytes
-rw-r--r--JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_launcher.pngbin0 -> 26663 bytes
-rw-r--r--JustForUs/justforus/src/main/res/drawable-xxxhdpi/ic_launcher.pngbin0 -> 41675 bytes
-rw-r--r--JustForUs/justforus/src/main/res/drawable/overlay_bg.xml24
-rw-r--r--JustForUs/justforus/src/main/res/drawable/touch_layer_bg.xml21
-rw-r--r--JustForUs/justforus/src/main/res/layout/activity_main.xml32
-rw-r--r--JustForUs/justforus/src/main/res/layout/grid_item.xml65
-rw-r--r--JustForUs/justforus/src/main/res/values-sw600dp-w720dp/integers.xml19
-rw-r--r--JustForUs/justforus/src/main/res/values-sw600dp/integers.xml19
-rw-r--r--JustForUs/justforus/src/main/res/values/colors.xml25
-rw-r--r--JustForUs/justforus/src/main/res/values/integers.xml19
-rw-r--r--JustForUs/justforus/src/main/res/values/strings.xml38
-rw-r--r--JustForUs/justforus/src/main/res/values/styles.xml29
-rw-r--r--JustForUs/settings.gradle14
46 files changed, 1175 insertions, 0 deletions
diff --git a/JustForUs/.gitignore b/JustForUs/.gitignore
new file mode 100644
index 0000000..5f5f4c7
--- /dev/null
+++ b/JustForUs/.gitignore
@@ -0,0 +1,6 @@
+.gradle
+/local.properties
+/.idea
+.DS_Store
+*.iml
+build/ \ No newline at end of file
diff --git a/JustForUs/README b/JustForUs/README
new file mode 100644
index 0000000..6d80064
--- /dev/null
+++ b/JustForUs/README
@@ -0,0 +1,26 @@
+This is an example app that displays a list of coupons.
+
+Build Instructions
+-------------------
+
+This sample uses the Gradle build system. To build this project, use the
+"gradlew build" command or use "Import Project" in Android Studio.
+
+To see a list of all available commands, run "gradlew tasks".
+
+Dependencies
+-------------
+
+- Android SDK Build-tools v19.0.1
+- Android Support Repository v4
+- Android Support Library v19.0.1
+- Google Repository 5
+
+Dependencies are available for download via the Android SDK Manager.
+
+Android Studio is available for download at:
+ http://developer.android.com/sdk/installing/studio.html
+
+The images in the app's main/assets folder are licensed under Creative Commons Attribution 2.5
+(http://creativecommons.org/licenses/by/2.5/). They can be attributed to Katherine Kuan.
+Please follow the best practices for attribution (http://wiki.creativecommons.org/Marking/Users). \ No newline at end of file
diff --git a/JustForUs/build.gradle b/JustForUs/build.gradle
new file mode 100644
index 0000000..7675426
--- /dev/null
+++ b/JustForUs/build.gradle
@@ -0,0 +1,30 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.7.+'
+ }
+}
+
+allprojects {
+ repositories {
+ mavenCentral()
+ }
+}
diff --git a/JustForUs/gradle.properties b/JustForUs/gradle.properties
new file mode 100644
index 0000000..5d08ba7
--- /dev/null
+++ b/JustForUs/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Settings specified in this file will override any Gradle settings
+# configured through the IDE.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true \ No newline at end of file
diff --git a/JustForUs/gradle/wrapper/gradle-wrapper.jar b/JustForUs/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/JustForUs/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/JustForUs/gradle/wrapper/gradle-wrapper.properties b/JustForUs/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..9b8ffdd
--- /dev/null
+++ b/JustForUs/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
diff --git a/JustForUs/gradlew b/JustForUs/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/JustForUs/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/JustForUs/gradlew.bat b/JustForUs/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/JustForUs/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/JustForUs/justforus/build.gradle b/JustForUs/justforus/build.gradle
new file mode 100644
index 0000000..703c252
--- /dev/null
+++ b/JustForUs/justforus/build.gradle
@@ -0,0 +1,36 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+apply plugin: 'android'
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion "19.0.1"
+
+ defaultConfig {
+ minSdkVersion 9
+ targetSdkVersion 19
+ versionCode 1
+ versionName "1.0"
+ }
+ buildTypes {
+ release {
+ runProguard false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+ }
+ }
+}
+
+dependencies {
+ compile 'com.android.support:appcompat-v7:19.0.1'
+}
diff --git a/JustForUs/justforus/src/main/AndroidManifest.xml b/JustForUs/justforus/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..bc6cf38
--- /dev/null
+++ b/JustForUs/justforus/src/main/AndroidManifest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.justforus" >
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name="com.example.android.justforus.MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <provider
+ android:name="com.example.android.justforus.AssetProvider"
+ android:authorities="com.example.android.justforus"
+ android:grantUriPermissions="true"
+ android:exported="true"/>
+ </application>
+
+</manifest>
diff --git a/JustForUs/justforus/src/main/assets/boat.jpg b/JustForUs/justforus/src/main/assets/boat.jpg
new file mode 100644
index 0000000..434f530
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/boat.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/dinner.jpg b/JustForUs/justforus/src/main/assets/dinner.jpg
new file mode 100644
index 0000000..b8f42f1
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/dinner.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/hawaii.jpg b/JustForUs/justforus/src/main/assets/hawaii.jpg
new file mode 100644
index 0000000..c156870
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/hawaii.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/park.jpg b/JustForUs/justforus/src/main/assets/park.jpg
new file mode 100644
index 0000000..ed6aa9c
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/park.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/picnic.jpg b/JustForUs/justforus/src/main/assets/picnic.jpg
new file mode 100644
index 0000000..c7e10ae
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/picnic.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/present.jpg b/JustForUs/justforus/src/main/assets/present.jpg
new file mode 100644
index 0000000..554436d
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/present.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/rose.jpg b/JustForUs/justforus/src/main/assets/rose.jpg
new file mode 100644
index 0000000..4ca14bf
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/rose.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/spa.jpg b/JustForUs/justforus/src/main/assets/spa.jpg
new file mode 100644
index 0000000..28e2b8d
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/spa.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/sunrise.jpg b/JustForUs/justforus/src/main/assets/sunrise.jpg
new file mode 100644
index 0000000..81d309e
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/sunrise.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/assets/zoo.jpg b/JustForUs/justforus/src/main/assets/zoo.jpg
new file mode 100644
index 0000000..9155a58
--- /dev/null
+++ b/JustForUs/justforus/src/main/assets/zoo.jpg
Binary files differ
diff --git a/JustForUs/justforus/src/main/java/com/example/android/justforus/AssetProvider.java b/JustForUs/justforus/src/main/java/com/example/android/justforus/AssetProvider.java
new file mode 100644
index 0000000..ee373c1
--- /dev/null
+++ b/JustForUs/justforus/src/main/java/com/example/android/justforus/AssetProvider.java
@@ -0,0 +1,183 @@
+/*
+* Copyright (C) 2013 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package com.example.android.justforus;
+
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.res.AssetFileDescriptor;
+import android.content.res.AssetManager;
+import android.database.Cursor;
+import android.database.MatrixCursor;
+import android.net.Uri;
+import android.provider.OpenableColumns;
+import android.util.Log;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import static java.net.URLConnection.guessContentTypeFromName;
+
+/**
+ * Generic content provider, which makes any files available in this app's "assets" directory
+ * available publicly.
+ *
+ * <p>To use, add the following to your AndroidManifest.xml:
+ *
+ * <code><pre>
+ * <provider
+ * android:name=".AssetProvider"
+ * android:authorities="[YOUR CONTENT PROVIDER DOMAIN HERE]"
+ * android:grantUriPermissions="true"
+ * android:exported="true"/>
+ * </pre></code>
+ */
+public class AssetProvider extends ContentProvider {
+
+ /**
+ * Content provider authority that identifies data that is offered by this
+ * {@link AssetProvider}.
+ */
+ public static String CONTENT_URI = "com.example.android.justforus";
+
+ private static final String TAG = "AssetProvider";
+
+ AssetManager mAssets;
+
+ @Override
+ public boolean onCreate() {
+ Context ctx = getContext();
+ if (ctx == null) {
+ // Context not available. Give up.
+ return false;
+ }
+ mAssets = ctx.getAssets();
+ return true;
+ }
+
+ @Override
+ public String getType(Uri uri){
+ // Returns the MIME type for the selected URI, in conformance with the ContentProvider
+ // interface. Looks up the file indicated by /res/assets/{uri.path}, and returns the MIME
+ // type for that file as guessed by the URLConnection class.
+
+ // Setup
+ String path = uri.getLastPathSegment();
+
+ // Check if file exists
+ if (!fileExists(path)) {
+ return null;
+ }
+
+ // Determine MIME-type based on filename
+ return guessContentTypeFromName(uri.toString());
+ }
+
+
+ @Override
+ public AssetFileDescriptor openAssetFile (Uri uri, String mode)
+ throws FileNotFoundException, SecurityException {
+ // ContentProvider interface for opening a file descriptor by URI. This content provider
+ // maps all URIs to the contents of the APK's assets folder, so a file handle to
+ // /res/assets/{uri.path} will be returned.
+
+ // Security check. This content provider only supports read-only access. (Also, the contents
+ // of an APKs assets folder are immutable, so read-write access doesn't make sense here.)
+ if (!"r".equals(mode)) {
+ throw new SecurityException("Only read-only access is supported, mode must be [r]");
+ }
+
+ // Open asset from within APK and return file descriptor
+ String path = uri.getLastPathSegment();
+ try {
+ return mAssets.openFd(path);
+ } catch (IOException e) {
+ throw new FileNotFoundException();
+ }
+ }
+
+ /**
+ * Check if file exists inside APK assets.
+ *
+ * @param path Fully qualified path to file.
+ * @return true if exists, false otherwise.
+ */
+ private boolean fileExists(String path) {
+ try {
+ // Check to see if file can be opened. If so, file exists.
+ mAssets.openFd(path).close();
+ return true;
+ } catch (IOException e) {
+ // Unable to open file descriptor for specified path; file doesn't exist.
+ return false;
+ }
+ }
+
+ @Override
+ public Cursor query(Uri uri, String[] projection, String selection,
+ String[] selectionArgs, String sortOrder) {
+ String path = uri.getLastPathSegment();
+ if (!fileExists(path)) {
+ Log.e(TAG, "Requested file doesn't exist at " + path);
+ return null;
+ }
+
+ // Create matrix cursor
+ if (projection == null) {
+ projection = new String[]{
+ OpenableColumns.DISPLAY_NAME,
+ OpenableColumns.SIZE,
+ };
+ }
+
+ MatrixCursor matrixCursor = new MatrixCursor(projection, 1);
+ Object[] row = new Object[projection.length];
+ for (int col = 0; col < projection.length; col++) {
+ if (OpenableColumns.DISPLAY_NAME.equals(projection[col])) {
+ row[col] = path;
+ } else if (OpenableColumns.SIZE.equals(projection[col])) {
+ try {
+ AssetFileDescriptor afd = openAssetFile(uri, "r");
+ if (afd != null) {
+ row[col] = Long.valueOf(afd.getLength());
+ }
+ afd.close();
+ } catch (IOException e) {
+ Log.e(TAG, e.toString());
+ }
+ }
+ }
+ matrixCursor.addRow(row);
+ return matrixCursor;
+ }
+
+ // Required/unused ContentProvider methods below.
+ @Override
+ public Uri insert(Uri uri, ContentValues contentValues) {
+ throw new RuntimeException("Operation not supported");
+ }
+
+ @Override
+ public int delete(Uri uri, String selection, String[] selectionArgs) {
+ throw new RuntimeException("Operation not supported");
+ }
+
+ @Override
+ public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+ throw new RuntimeException("Operation not supported");
+ }
+}
diff --git a/JustForUs/justforus/src/main/java/com/example/android/justforus/MainActivity.java b/JustForUs/justforus/src/main/java/com/example/android/justforus/MainActivity.java
new file mode 100644
index 0000000..d799f30
--- /dev/null
+++ b/JustForUs/justforus/src/main/java/com/example/android/justforus/MainActivity.java
@@ -0,0 +1,271 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.justforus;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v4.app.ShareCompat;
+import android.support.v7.app.ActionBarActivity;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.BaseAdapter;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Activity to display a grid of coupons. The number of columns varies based on screen width,
+ * and goes down to a one-column grid on a small device such as a phone.
+ *
+ * <p>A coupon consists of a photo, title, and subtitle.
+ *
+ * <p>Tapping on a coupon to redeem it brings up the Android "share"
+ * dialog with a pre-populated message based on the coupon text.
+ */
+public class MainActivity extends ActionBarActivity implements OnItemClickListener {
+
+ // Name of person giving out these coupons. When the user clicks on a coupon and shares
+ // to another app, this name will be part of the pre-populated text.
+ // TODO: Fill in your name here
+ private static final String SENDER_NAME = "";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ // Set activity_main.xml to be the layout for this activity
+ setContentView(R.layout.activity_main);
+
+ // Fetch the {@link LayoutInflater} service so that new views can be created
+ LayoutInflater inflater = (LayoutInflater) getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+
+ // Find the {@link GridView} that was already defined in the XML layout
+ GridView gridView = (GridView) findViewById(R.id.grid);
+
+ // Initialize the adapter with all the coupons. Set the adapter on the {@link GridView}.
+ gridView.setAdapter(new CouponAdapter(inflater, createAllCoupons()));
+
+ // Set a click listener for each coupon in the grid
+ gridView.setOnItemClickListener(this);
+ }
+
+ /**
+ * Generate the list of all coupons.
+ * @return The list of coupons.
+ */
+ private List<Coupon> createAllCoupons() {
+ // TODO: Customize this list of coupons for your personal use.
+ // You can add a title, subtitle, and a photo (in the assets directory).
+ List<Coupon> coupons = new ArrayList<Coupon>();
+ coupons.add(new Coupon("Walk in the park" /* title */,
+ "Take a stroll in the flower garden" /* subtitle */, "park.jpg" /* image */));
+ coupons.add(new Coupon("Trip to the zoo",
+ "See the cute zoo animals", "zoo.jpg"));
+ coupons.add(new Coupon("Watch sunrise",
+ "Drive out to the vista point and watch the sunrise at 6am", "sunrise.jpg"));
+ coupons.add(new Coupon("Hawaii getaway",
+ "Relax in Hawaii by going to the beach and attending luaus", "hawaii.jpg"));
+ coupons.add(new Coupon("Spa day",
+ "Receive a massage and enjoy the peace and quiet", "spa.jpg"));
+ coupons.add(new Coupon("Homemade dinner",
+ "Your favorite meal cooked by yours truly", "dinner.jpg"));
+ coupons.add(new Coupon("Day on the water",
+ "Boat ride down the river on a breezy day", "boat.jpg"));
+ coupons.add(new Coupon("Flowers",
+ "Delivered to your front door", "rose.jpg"));
+ coupons.add(new Coupon("Picnic",
+ "Wine, bread, and cheese at the vineyard", "picnic.jpg"));
+ coupons.add(new Coupon("Surprise gift",
+ "Won't be revealed until redeemed", "present.jpg"));
+ return coupons;
+ }
+
+ /**
+ * Callback method for a when a coupon is clicked. A new share intent is created with the
+ * coupon title. Then the user can select which app to share the content of the coupon with.
+ *
+ * @param parent The AdapterView where the click happened.
+ * @param view The view within the AdapterView that was clicked (this
+ * will be a view provided by the adapter).
+ * @param position The position of the view in the adapter.
+ * @param id The row id of the item that was clicked.
+ */
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ // Find coupon that was clicked based off of position in adapter
+ Coupon coupon = (Coupon) parent.getItemAtPosition(position);
+
+ // Create share intent
+ Intent shareIntent = ShareCompat.IntentBuilder.from(this)
+ .setText(getShareText(coupon))
+ .setType("image/jpeg")
+ .setStream(coupon.mImageUri)
+ .setChooserTitle(getString(R.string.redeem_using))
+ .createChooserIntent();
+ startActivity(shareIntent);
+ }
+
+ /**
+ * Create the share intent text based on the coupon title, subtitle, and whether or not
+ * there is a {@link #SENDER_NAME}.
+ *
+ * @param coupon to create the intent text for.
+ * @return string to be used in the share intent.
+ */
+ private String getShareText(Coupon coupon) {
+ // If there is no sender name, just use the coupon title and subtitle
+ if (TextUtils.isEmpty(SENDER_NAME)) {
+ return getString(R.string.message_format_without_sender,
+ coupon.mTitle, coupon.mSubtitle);
+ } else {
+ // Otherwise, use the other string template and pass in the {@link #SENDER_NAME} too
+ return getString(R.string.message_format_with_sender, SENDER_NAME,
+ coupon.mTitle, coupon.mSubtitle);
+ }
+ }
+
+ /**
+ * Adapter for grid of coupons.
+ */
+ private static class CouponAdapter extends BaseAdapter {
+
+ private LayoutInflater mInflater;
+ private List<Coupon> mAllCoupons;
+
+ /**
+ * Constructs a new {@link CouponAdapter}.
+ *
+ * @param inflater to create new views
+ * @param allCoupons for list of all coupons to be displayed
+ */
+ public CouponAdapter(LayoutInflater inflater, List<Coupon> allCoupons) {
+ if (allCoupons == null) {
+ throw new IllegalStateException("Can't have null list of coupons");
+ }
+ mAllCoupons = allCoupons;
+ mInflater = inflater;
+ }
+
+ @Override
+ public int getCount() {
+ return mAllCoupons.size();
+ }
+
+ @Override
+ public Coupon getItem(int position) {
+ return mAllCoupons.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View result = convertView;
+ if (result == null) {
+ result = mInflater.inflate(R.layout.grid_item, parent, false);
+ }
+
+ // Try to get view cache or create a new one if needed
+ ViewCache viewCache = (ViewCache) result.getTag();
+ if (viewCache == null) {
+ viewCache = new ViewCache(result);
+ result.setTag(viewCache);
+ }
+
+ // Fetch item
+ Coupon coupon = getItem(position);
+
+ // Bind the data
+ viewCache.mTitleView.setText(coupon.mTitle);
+ viewCache.mSubtitleView.setText(coupon.mSubtitle);
+ viewCache.mImageView.setImageURI(coupon.mImageUri);
+
+ return result;
+ }
+ }
+
+ /**
+ * Cache of views in the grid item view to make recycling of views quicker. This avoids
+ * additional {@link View#findViewById(int)} calls after the {@link ViewCache} is first
+ * created for a view. See
+ * {@link CouponAdapter#getView(int position, View convertView, ViewGroup parent)}.
+ */
+ private static class ViewCache {
+
+ /** View that displays the title of the coupon */
+ private final TextView mTitleView;
+
+ /** View that displays the subtitle of the coupon */
+ private final TextView mSubtitleView;
+
+ /** View that displays the image associated with the coupon */
+ private final ImageView mImageView;
+
+ /**
+ * Constructs a new {@link ViewCache}.
+ *
+ * @param view which contains children views that should be cached.
+ */
+ private ViewCache(View view) {
+ mTitleView = (TextView) view.findViewById(R.id.title);
+ mSubtitleView = (TextView) view.findViewById(R.id.subtitle);
+ mImageView = (ImageView) view.findViewById(R.id.image);
+ }
+ }
+
+ /**
+ * Model object for coupon.
+ */
+ private static class Coupon {
+
+ /** Title of the coupon. */
+ private final String mTitle;
+
+ /** Description of the coupon. */
+ private final String mSubtitle;
+
+ /** Content URI of the image for the coupon. */
+ private final Uri mImageUri;
+
+ /**
+ * Constructs a new {@link Coupon}.
+ *
+ * @param titleString is the title
+ * @param subtitleString is the description
+ * @param imageAssetFilePath is the file path from the application's assets folder for
+ * the image associated with this coupon
+ */
+ private Coupon(String titleString, String subtitleString, String imageAssetFilePath) {
+ mTitle = titleString;
+ mSubtitle = subtitleString;
+ mImageUri = Uri.parse("content://" + AssetProvider.CONTENT_URI + "/" +
+ imageAssetFilePath);
+ }
+ }
+}
diff --git a/JustForUs/justforus/src/main/res/drawable-hdpi/ab_solid.9.png b/JustForUs/justforus/src/main/res/drawable-hdpi/ab_solid.9.png
new file mode 100755
index 0000000..b5ddf4e
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-hdpi/ab_solid.9.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-hdpi/ic_action_heart.png b/JustForUs/justforus/src/main/res/drawable-hdpi/ic_action_heart.png
new file mode 100755
index 0000000..e813ce7
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-hdpi/ic_action_heart.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-hdpi/ic_launcher.png b/JustForUs/justforus/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..f028034
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-mdpi/ab_solid.9.png b/JustForUs/justforus/src/main/res/drawable-mdpi/ab_solid.9.png
new file mode 100755
index 0000000..6447e29
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-mdpi/ab_solid.9.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-mdpi/ic_action_heart.png b/JustForUs/justforus/src/main/res/drawable-mdpi/ic_action_heart.png
new file mode 100755
index 0000000..82452f0
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-mdpi/ic_action_heart.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-mdpi/ic_launcher.png b/JustForUs/justforus/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..6508e92
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xhdpi/ab_solid.9.png b/JustForUs/justforus/src/main/res/drawable-xhdpi/ab_solid.9.png
new file mode 100755
index 0000000..c9681c0
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xhdpi/ab_solid.9.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xhdpi/ic_action_heart.png b/JustForUs/justforus/src/main/res/drawable-xhdpi/ic_action_heart.png
new file mode 100755
index 0000000..286fad7
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xhdpi/ic_action_heart.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xhdpi/ic_launcher.png b/JustForUs/justforus/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..9bd497e
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xxhdpi/ab_solid.9.png b/JustForUs/justforus/src/main/res/drawable-xxhdpi/ab_solid.9.png
new file mode 100755
index 0000000..19a47e5
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xxhdpi/ab_solid.9.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_action_heart.png b/JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_action_heart.png
new file mode 100755
index 0000000..6545664
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_action_heart.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_launcher.png b/JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b13d5f4
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable-xxxhdpi/ic_launcher.png b/JustForUs/justforus/src/main/res/drawable-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..5fd3e94
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/JustForUs/justforus/src/main/res/drawable/overlay_bg.xml b/JustForUs/justforus/src/main/res/drawable/overlay_bg.xml
new file mode 100644
index 0000000..23d9882
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable/overlay_bg.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- Gradient for an overlay on an image -->
+<shape
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <gradient
+ android:startColor="@color/overlay_bg_color"
+ android:endColor="@android:color/transparent"
+ android:angle="90"/>
+</shape>
diff --git a/JustForUs/justforus/src/main/res/drawable/touch_layer_bg.xml b/JustForUs/justforus/src/main/res/drawable/touch_layer_bg.xml
new file mode 100644
index 0000000..aa3d5c5
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/drawable/touch_layer_bg.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- Touch layer for when a coupon is pressed. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@color/touch_overlay_bg_color"/>
+ <item android:drawable="@android:color/transparent" />
+</selector>
diff --git a/JustForUs/justforus/src/main/res/layout/activity_main.xml b/JustForUs/justforus/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..bda77cb
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/layout/activity_main.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- Layout for the main activity. -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="com.example.app.MainActivity"
+ tools:ignore="MergeRootFrame" >
+
+ <GridView
+ android:id="@+id/grid"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:numColumns="@integer/num_columns"/>
+
+</FrameLayout>
diff --git a/JustForUs/justforus/src/main/res/layout/grid_item.xml b/JustForUs/justforus/src/main/res/layout/grid_item.xml
new file mode 100644
index 0000000..db62bda
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/layout/grid_item.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- Layout for a grid item (which is a coupon). -->
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="200dp"
+ android:layout_width="match_parent">
+
+ <ImageView
+ android:id="@+id/image"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:scaleType="centerCrop"/>
+
+ <LinearLayout
+ android:background="@drawable/overlay_bg"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:padding="16dp">
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:paddingTop="16dp"
+ android:fontFamily="sans-serif-condensed"
+ android:textAppearance="?android:textAppearanceLargeInverse"/>
+
+ <TextView
+ android:id="@+id/subtitle"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:maxLines="2"
+ android:ellipsize="end"
+ android:fontFamily="sans-serif"
+ android:textAppearance="?android:textAppearanceSmallInverse"/>
+
+ </LinearLayout>
+
+ <View
+ android:id="@+id/touch_layer"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:background="@drawable/touch_layer_bg"/>
+</RelativeLayout>
diff --git a/JustForUs/justforus/src/main/res/values-sw600dp-w720dp/integers.xml b/JustForUs/justforus/src/main/res/values-sw600dp-w720dp/integers.xml
new file mode 100644
index 0000000..e6e1e3a
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/values-sw600dp-w720dp/integers.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <!-- Number of columns in the grid view for a wider screen device (likely a tablet). -->
+ <integer name="num_columns">3</integer>
+</resources>
diff --git a/JustForUs/justforus/src/main/res/values-sw600dp/integers.xml b/JustForUs/justforus/src/main/res/values-sw600dp/integers.xml
new file mode 100644
index 0000000..334dfc4
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/values-sw600dp/integers.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <!-- Number of columns in the grid view for a wider screen device (likely a tablet). -->
+ <integer name="num_columns">2</integer>
+</resources>
diff --git a/JustForUs/justforus/src/main/res/values/colors.xml b/JustForUs/justforus/src/main/res/values/colors.xml
new file mode 100644
index 0000000..28a71fd
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/values/colors.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <!-- Gradient start color of the overlay on the coupon image -->
+ <color name="overlay_bg_color">#CC000000</color>
+
+ <!-- Background color of the app -->
+ <color name="bg_color">#F8BBD0</color>
+
+ <!-- Pressed state color for a coupon -->
+ <color name="touch_overlay_bg_color">#33999999</color>
+</resources>
diff --git a/JustForUs/justforus/src/main/res/values/integers.xml b/JustForUs/justforus/src/main/res/values/integers.xml
new file mode 100644
index 0000000..0fe18d3
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/values/integers.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <!-- Number of columns in the grid view, which changes based on device size. -->
+ <integer name="num_columns">1</integer>
+</resources>
diff --git a/JustForUs/justforus/src/main/res/values/strings.xml b/JustForUs/justforus/src/main/res/values/strings.xml
new file mode 100644
index 0000000..141327a
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/values/strings.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- String resources -->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Title of the application. [CHAR LIMIT=12] -->
+ <string name="app_name">Just for Us</string>
+
+ <!--
+ Template string with coupon title, subtitle, and sender name for the text to use
+ when the coupon is shared with other apps. [CHAR LIMIT=NONE]
+ -->
+ <string name="message_format_without_sender">Excited to redeem my coupon! <xliff:g id="coupon_title">%s</xliff:g> - <xliff:g id="coupon_subtitle">%s</xliff:g> #justforus</string>
+
+ <!--
+ Template string with coupon title, subtitle, and sender name for the text to use
+ when the coupon is shared with other apps. [CHAR LIMIT=NONE]
+ -->
+ <string name="message_format_with_sender">Excited to redeem my coupon with <xliff:g id="coupon_title">%s</xliff:g>! <xliff:g id="coupon_title">%s</xliff:g> - <xliff:g id="coupon_subtitle">%s</xliff:g> #justforus</string>
+
+ <!--
+ Title of the share intent picker dialog. Displayed above a list of apps that the
+ user can share to. [CHAR LIMIT=20]
+ -->
+ <string name="redeem_using">Redeem using</string>
+</resources>
diff --git a/JustForUs/justforus/src/main/res/values/styles.xml b/JustForUs/justforus/src/main/res/values/styles.xml
new file mode 100644
index 0000000..2234e6f
--- /dev/null
+++ b/JustForUs/justforus/src/main/res/values/styles.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- Style definitions -->
+<resources>
+ <!-- Theme of the app -->
+ <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <item name="android:windowBackground">@color/bg_color</item>
+ <item name="android:actionBarStyle">@style/ActionBarStyle</item>
+ </style>
+
+ <!-- Theme of the action bar -->
+ <style name="ActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
+ <item name="android:background">@drawable/ab_solid</item>
+ <item name="android:icon">@drawable/ic_action_heart</item>
+ </style>
+</resources>
diff --git a/JustForUs/settings.gradle b/JustForUs/settings.gradle
new file mode 100644
index 0000000..8423b02
--- /dev/null
+++ b/JustForUs/settings.gradle
@@ -0,0 +1,14 @@
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+include ':justforus'