diff --git a/.gitignore b/.gitignore
index a002544..88afc98 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,9 +36,9 @@ proguard/
# Android Studio captures folder
captures/
-# Intellij
+# IntelliJ
*.iml
-.idea/workspace.xml
+.idea/*
# Keystore files
*.jks
diff --git a/README.md b/README.md
index 463db4c..4009382 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,12 @@
-# ProjectMobilegeddon
-Team 9 CMPUT301W17T09's public Mobilegeddon repository.
+
+
+# ProjectMO*od*9
+## Mood Organizer *overdose* #9
+Team 9 CMPUT301W17T09's public MOod9 repository.
Teammembers:
* vinnakot - Rohit Vinnakota
* dannick - Dannick Pomerleau
* cdkushni - Colin Kushniruk
* ddao - Dai Dao
-* shlakhte - Anton Shlakhter
* fmachaal - Fady Machalani
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..b369805
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,9 @@
+# Reading Week
+* UML diagrams
+* Stub model (method signatures)
+* Stub controller (method signatures)
+* Unit Test Model
+* Unit Test Controller
+* Create Activities
+* Do XML for views
+* Anything else you want to do on top (time permitted)
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..115f502
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,33 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
+ defaultConfig {
+ applicationId "ca.ualberta.cmput301w17t09.mood9.mood9"
+ minSdkVersion 23
+ targetSdkVersion 25
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:25.1.0'
+ compile 'com.android.support:design:25.1.0'
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support:recyclerview-v7:25.1.0'
+ compile 'io.searchbox:jest-droid:2.0.4'
+ compile 'com.google.guava:guava:21.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..35eb663
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/fady/Android/Sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/app/src/androidTest/java/ca/ualberta/cmput301w17t09/mood9/mood9/ExampleInstrumentedTest.java b/app/src/androidTest/java/ca/ualberta/cmput301w17t09/mood9/mood9/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..f6f9ad0
--- /dev/null
+++ b/app/src/androidTest/java/ca/ualberta/cmput301w17t09/mood9/mood9/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("ca.ualberta.cmput301w17t09.mood9.mood9", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..cc11daa
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/AddMoodActivity.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/AddMoodActivity.java
new file mode 100644
index 0000000..6a6e86a
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/AddMoodActivity.java
@@ -0,0 +1,59 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ExpandableListAdapter;
+import android.widget.ExpandableListView;
+import android.widget.SimpleExpandableListAdapter;
+import android.widget.Spinner;
+import android.widget.SpinnerAdapter;
+
+public class AddMoodActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_add_mood);
+
+ Spinner emotionsSpinner = (Spinner) findViewById(R.id.emotions_spinner);
+ Spinner socialSpinner = (Spinner) findViewById(R.id.social_spinner);
+ EditText trigger = (EditText) findViewById(R.id.trigger_edittext);
+ Button addLocation = (Button) findViewById(R.id.button);
+ Button save = (Button) findViewById(R.id.button2);
+
+ String[] emotions = {"Anger", "Confusion", "Happiness", "Sadness", "Shame", "Surprise"};
+ int[] emoticons = {R.drawable.anger, R.drawable.confusion, R.drawable.happiness, R.drawable.sadness, R.drawable.shame, R.drawable.surpise};
+ // map emotions = EmotionModel.getEmotions();
+ String[] socials = {"TEMP", "DO NOT USE", "With my enemies", "All Alone"};
+
+ EmotionsSpinnerAdapter emotionsSpinnerAdapter = new EmotionsSpinnerAdapter(getApplicationContext(), emoticons, emotions);
+ emotionsSpinner.setAdapter(emotionsSpinnerAdapter);
+
+
+ ArrayAdapter socialSpinnerAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, socials);
+ socialSpinner.setAdapter(socialSpinnerAdapter);
+
+
+ addLocation.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //TODO Add location functionality to the button
+ }
+ });
+
+ save.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ //TODO Need to actually save the information that is entered
+ finish();
+ }
+ });
+
+ }
+
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/Emotion.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/Emotion.java
new file mode 100644
index 0000000..4e20317
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/Emotion.java
@@ -0,0 +1,41 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class Emotion {
+ private String id;
+ private String name;
+ private String color;
+ private String description;
+ private String image_name;
+
+ public Emotion(String id, String name, String color, String description, String image_name) {
+ this.id = id;
+ this.name = name;
+ this.color = color;
+ this.description = description;
+ this.image_name = image_name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getColor() {
+ return color;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getImageName() {
+ return image_name;
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionModel.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionModel.java
new file mode 100644
index 0000000..f6abf3a
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionModel.java
@@ -0,0 +1,57 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class EmotionModel {
+ protected static LoadingCache emotions;
+
+ public static Emotion getEmotion(String id){
+ Emotion emo = null;
+ try {
+ emo = emotions.get(id);
+ } catch (ExecutionException e) {
+ // TODO
+ }
+ return emo;
+ }
+
+ public static void initEmotions() {
+ EmotionModel.emotions = CacheBuilder.newBuilder()
+ .maximumSize(100) // maximum 100 records can be cached
+ .build(new CacheLoader(){ // build the cacheloader
+
+ @Override
+ public Emotion load(String id) throws Exception {
+ //make the expensive call
+ return getFromXMLRessource(id);
+ }
+ });
+ }
+
+ public static ConcurrentMap getEmotions(){
+ return emotions.asMap();
+ }
+
+ public static Emotion getFromXMLRessource(String id){
+ // TODO
+ return new Emotion("", "", "", "", "");
+ }
+
+ public static void setOnXMLResource(Emotion emotion){
+ //Sets an emotion
+ }
+
+ public static void initialLoad(){
+
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionsSpinnerAdapter.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionsSpinnerAdapter.java
new file mode 100644
index 0000000..e42f6a9
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionsSpinnerAdapter.java
@@ -0,0 +1,55 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+/**
+ * Created by fmachaal on 2/22/17.
+ */
+
+//Sourced from http://abhiandroid.com/ui/custom-spinner-examples.html
+ //On Feb 22, 2017
+
+public class EmotionsSpinnerAdapter extends BaseAdapter {
+ Context context;
+ int emoticons[];
+ String[] emotions;
+ LayoutInflater inflter;
+
+ public EmotionsSpinnerAdapter(Context applicationContext, int[] emoticons, String[] emotions) {
+ this.context = applicationContext;
+ this.emoticons = emoticons;
+ this.emotions = emotions;
+ inflter = (LayoutInflater.from(applicationContext));
+ }
+
+ @Override
+ public int getCount() {
+ return emoticons.length;
+ }
+
+ @Override
+ public Object getItem(int i) {
+ return null;
+ }
+
+ @Override
+ public long getItemId(int i) {
+ return 0;
+ }
+
+ @Override
+ public View getView(int i, View view, ViewGroup viewGroup) {
+ view = inflter.inflate(R.layout.emotion_spinner_layout, null);
+ ImageView icon = (ImageView) view.findViewById(R.id.imageView);
+ TextView names = (TextView) view.findViewById(R.id.textView);
+ icon.setImageResource(emoticons[i]);
+ names.setText(emotions[i]);
+ return view;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/FeedActivity.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/FeedActivity.java
new file mode 100644
index 0000000..8f7c5c0
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/FeedActivity.java
@@ -0,0 +1,111 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.design.widget.FloatingActionButton;
+import android.support.design.widget.Snackbar;
+import android.view.View;
+import android.support.design.widget.NavigationView;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
+
+public class FeedActivity extends AppCompatActivity
+ implements NavigationView.OnNavigationItemSelectedListener {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_feed);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ addMood();
+ }
+ });
+
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
+ this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
+ drawer.setDrawerListener(toggle);
+ toggle.syncState();
+
+ NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
+ navigationView.setNavigationItemSelectedListener(this);
+
+
+ //This changes the title of the toolbar - need to change according to feed shown
+ toolbar.setTitle(R.string.universal_feed);
+ }
+
+ @Override
+ public void onBackPressed() {
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ if (drawer.isDrawerOpen(GravityCompat.START)) {
+ drawer.closeDrawer(GravityCompat.START);
+ } else {
+ super.onBackPressed();
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.menu_feed, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ //noinspection SimplifiableIfStatement
+ if (id == R.id.search) {
+ //TODO Add functionality to the search button
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ @SuppressWarnings("StatementWithEmptyBody")
+ @Override
+ public boolean onNavigationItemSelected(MenuItem item) {
+ // Handle navigation view item clicks here.
+ int id = item.getItemId();
+
+ if (id == R.id.personal) {
+ // Handle the camera action
+ } else if (id == R.id.followed) {
+
+ } else if (id == R.id.universal) {
+
+ } else if (id == R.id.near_me) {
+
+ } else if (id == R.id.profile) {
+
+ } else if (id == R.id.about) {
+
+ }
+
+ DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
+ drawer.closeDrawer(GravityCompat.START);
+ return true;
+ }
+
+ private void addMood() {
+ Intent addMoodIntent = new Intent(this, AddMoodActivity.class);
+ startActivity(addMoodIntent);
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MainActivity.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MainActivity.java
new file mode 100644
index 0000000..6663e29
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MainActivity.java
@@ -0,0 +1,39 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ Button goButton = (Button) findViewById(R.id.go);
+ EditText usernameField = (EditText) findViewById(R.id.username_field);
+
+
+ goButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent feedIntent = new Intent(MainActivity.this, FeedActivity.class);
+ startActivity(feedIntent);
+ finish();
+ }
+ });
+
+ }
+
+
+
+
+}
+
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/Mood.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/Mood.java
new file mode 100644
index 0000000..cfaaa1c
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/Mood.java
@@ -0,0 +1,131 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import java.util.Date;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class Mood {
+ // The following fields are to be serialized
+ private String id;
+ private Double latitude;
+ private Double longitutde;
+ private String trigger;
+ private String emotionId;
+ private String socialSituationId;
+ private String imageTriggerId;
+ private Date date;
+ private String user_id;
+
+ // The following fields should not be serialized
+ private User user;
+ private Emotion emotion;
+ private SocialSituation socialSituation;
+
+
+ public Mood(String id, Double latitude, Double longitutde,
+ String trigger, String emotionId, String socialSituationId,
+ String imageTriggerId, Date date,String user_id) {
+ this.id = id;
+ this.latitude = latitude;
+ this.longitutde = longitutde;
+ this.trigger = trigger;
+ this.emotionId = emotionId;
+ this.socialSituationId = socialSituationId;
+ this.imageTriggerId = imageTriggerId;
+ this.date = date;
+ this.user_id = user_id;
+ }
+
+
+ public Mood(){
+
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Double getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitude(Double latitude) {
+ this.latitude = latitude;
+ }
+
+ public Double getLongitutde() {
+ return longitutde;
+ }
+
+ public void setLongitutde(Double longitutde) {
+ this.longitutde = longitutde;
+ }
+
+ public String getTrigger() {
+ return trigger;
+ }
+
+ public void setTrigger(String trigger) {
+ this.trigger = trigger;
+ }
+
+ public String getEmotionId() {
+ return emotionId;
+ }
+
+ public void setEmotionId(String emotionId) {
+ this.emotionId = emotionId;
+ this.emotion = EmotionModel.getEmotion(emotionId);
+ }
+
+ public String getSocialSituationId() {
+ return socialSituationId;
+ }
+
+ public void setSocialSituationId(String socialSituationId) {
+ this.socialSituationId = socialSituationId;
+ this.socialSituation = SocialSituationModel.getSocialSituation(socialSituationId);
+ }
+
+ public String getImageTriggerId() {
+ return imageTriggerId;
+ }
+
+ public void setImageTriggerId(String imageTriggerId) {
+ this.imageTriggerId = imageTriggerId;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public String getUser_id() {
+ return user_id;
+ }
+
+ public void setUser_id(String user_id) {
+ this.user_id = user_id;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public Emotion getEmotion() {
+ return emotion;
+ }
+
+ public SocialSituation getSocialSituation() {
+ return socialSituation;
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodFeed.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodFeed.java
new file mode 100644
index 0000000..0f6376b
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodFeed.java
@@ -0,0 +1,9 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class MoodFeed {
+
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodModel.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodModel.java
new file mode 100644
index 0000000..c365974
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodModel.java
@@ -0,0 +1,106 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+
+import java.util.LinkedList;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class MoodModel {
+ protected static LoadingCache moods;
+ protected static LinkedList tasks;
+
+ private enum TaskType {
+ PUT, DELETE
+ }
+
+ private class MoodTask{
+ private Mood mood;
+ private TaskType type;
+
+ public MoodTask(Mood mood, TaskType type) {
+ this.mood = mood;
+ this.type = type;
+ }
+
+ public Mood getMood() {
+ return mood;
+ }
+
+ public TaskType getType() {
+ return type;
+ }
+ }
+
+ public static Mood getMood(String id){
+ Mood m = null;
+ try {
+ m = moods.get(id);
+ } catch (ExecutionException e) {
+ // TODO
+ }
+ return m;
+ }
+
+ public static void loadMood() {
+ MoodModel.moods = CacheBuilder.newBuilder()
+ .maximumSize(100) // maximum 100 records can be cached
+ .expireAfterAccess(30, TimeUnit.MINUTES) // cache will expire after 30 minutes of access
+ .build(new CacheLoader(){ // build the cacheloader
+
+ @Override
+ public Mood load(String id) throws Exception {
+ //make the expensive call
+ return getFromElasticSearch(id);
+ }
+ });
+ }
+
+ public static ConcurrentMap getMoods(){
+ return moods.asMap();
+ }
+
+ public static Mood getFromElasticSearch(String id){
+ // TODO
+ return new Mood();
+ }
+
+ public static void setOnElasticSearch(Mood mood){
+ //Send mood to elastic search
+ }
+
+ public static ConcurrentMap getMyMoods(){
+ // TODO
+ return moods.asMap();
+ }
+
+ public static ConcurrentMap getFollowedMoods(User user){
+ // TODO
+ return moods.asMap();
+ }
+
+ public static ConcurrentMap getUniversalMoods(){
+ // TODO
+ return moods.asMap();
+ }
+
+ public static ConcurrentMap getMoodsNear(Double latitude, Double longitude){
+ // TODO
+ return moods.asMap();
+ }
+
+ public static void deleteMood(Mood mood){
+
+ }
+
+ public static void updateMood(Mood mood){
+
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/SocialSituation.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/SocialSituation.java
new file mode 100644
index 0000000..d4ab60d
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/SocialSituation.java
@@ -0,0 +1,29 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class SocialSituation {
+ private String id;
+ private String name;
+ private String description;
+
+ public SocialSituation(String id, String name, String description) {
+ this.id = id;
+ this.name = name;
+ this.description = description;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/SocialSituationModel.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/SocialSituationModel.java
new file mode 100644
index 0000000..26cf51d
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/SocialSituationModel.java
@@ -0,0 +1,52 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class SocialSituationModel {
+ protected static LoadingCache socialSituations;
+
+ public static SocialSituation getSocialSituation(String id){
+ SocialSituation ss = null;
+ try {
+ ss = socialSituations.get(id);
+ } catch (ExecutionException e) {
+ // TODO
+ }
+ return ss;
+ }
+
+ public static void initSocialSituations() {
+ SocialSituationModel.socialSituations = CacheBuilder.newBuilder()
+ .maximumSize(100) // maximum 100 records can be cached
+ .build(new CacheLoader(){ // build the cacheloader
+
+ @Override
+ public SocialSituation load(String id) throws Exception {
+ //make the expensive call
+ return getFromXMLRessource(id);
+ }
+ });
+ }
+
+ public static ConcurrentMap getSocialSituations(){
+ return socialSituations.asMap();
+ }
+
+ public static SocialSituation getFromXMLRessource(String id){
+ // TODO
+ return new SocialSituation("", "", "");
+ }
+
+ public static void initialLoad(){
+
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/User.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/User.java
new file mode 100644
index 0000000..27dbe8b
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/User.java
@@ -0,0 +1,31 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class User {
+ private String id;
+ private String name;
+
+ public User(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/UserModel.java b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/UserModel.java
new file mode 100644
index 0000000..7179d0a
--- /dev/null
+++ b/app/src/main/java/ca/ualberta/cmput301w17t09/mood9/mood9/UserModel.java
@@ -0,0 +1,59 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+
+import org.apache.commons.lang3.concurrent.ConcurrentException;
+
+import java.util.Date;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by dannick on 2/22/17.
+ */
+
+public class UserModel {
+ protected static LoadingCache users;
+
+
+ public void setOnElasticSearch(User user){
+ //Add the user to elastic search
+ }
+
+
+ public static User getUser(String id){
+ User u = null;
+ try {
+ u = users.get(id);
+ } catch (ExecutionException e) {
+ // TODO
+ }
+ return u;
+ }
+
+ public static void loadUsers() {
+ UserModel.users = CacheBuilder.newBuilder()
+ .maximumSize(100) // maximum 100 records can be cached
+ .expireAfterAccess(30, TimeUnit.MINUTES) // cache will expire after 30 minutes of access
+ .build(new CacheLoader(){ // build the cacheloader
+
+ @Override
+ public User load(String id) throws Exception {
+ //make the expensive call
+ return getFromElasticSearch(id);
+ }
+ });
+ }
+
+ public static ConcurrentMap getUsers(){
+ return users.asMap();
+ }
+
+ public static User getFromElasticSearch(String id){
+ // TODO
+ return new User("", "");
+ }
+}
diff --git a/app/src/main/res/drawable/anger.png b/app/src/main/res/drawable/anger.png
new file mode 100644
index 0000000..c89eb0d
Binary files /dev/null and b/app/src/main/res/drawable/anger.png differ
diff --git a/app/src/main/res/drawable/confusion.png b/app/src/main/res/drawable/confusion.png
new file mode 100644
index 0000000..c04c33c
Binary files /dev/null and b/app/src/main/res/drawable/confusion.png differ
diff --git a/app/src/main/res/drawable/happiness.png b/app/src/main/res/drawable/happiness.png
new file mode 100644
index 0000000..e4da7c6
Binary files /dev/null and b/app/src/main/res/drawable/happiness.png differ
diff --git a/app/src/main/res/drawable/ic_add_mood.xml b/app/src/main/res/drawable/ic_add_mood.xml
new file mode 100644
index 0000000..91b1ae9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_add_mood.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_face.xml b/app/src/main/res/drawable/ic_face.xml
new file mode 100644
index 0000000..739bbfb
--- /dev/null
+++ b/app/src/main/res/drawable/ic_face.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_followed.xml b/app/src/main/res/drawable/ic_followed.xml
new file mode 100644
index 0000000..4cfd869
--- /dev/null
+++ b/app/src/main/res/drawable/ic_followed.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_globe.xml b/app/src/main/res/drawable/ic_globe.xml
new file mode 100644
index 0000000..d976b42
--- /dev/null
+++ b/app/src/main/res/drawable/ic_globe.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_lightbulb.xml b/app/src/main/res/drawable/ic_lightbulb.xml
new file mode 100644
index 0000000..2a8e9d7
--- /dev/null
+++ b/app/src/main/res/drawable/ic_lightbulb.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_location.xml b/app/src/main/res/drawable/ic_location.xml
new file mode 100644
index 0000000..e3291a9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_location.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_camera.xml b/app/src/main/res/drawable/ic_menu_camera.xml
new file mode 100644
index 0000000..0d9ea10
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_camera.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_gallery.xml b/app/src/main/res/drawable/ic_menu_gallery.xml
new file mode 100644
index 0000000..f6872c4
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_gallery.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_manage.xml b/app/src/main/res/drawable/ic_menu_manage.xml
new file mode 100644
index 0000000..c1be60b
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_manage.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_menu_send.xml b/app/src/main/res/drawable/ic_menu_send.xml
new file mode 100644
index 0000000..00c668c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_send.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_share.xml b/app/src/main/res/drawable/ic_menu_share.xml
new file mode 100644
index 0000000..a28fb9e
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_share.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_menu_slideshow.xml b/app/src/main/res/drawable/ic_menu_slideshow.xml
new file mode 100644
index 0000000..209aa64
--- /dev/null
+++ b/app/src/main/res/drawable/ic_menu_slideshow.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_personal.xml b/app/src/main/res/drawable/ic_personal.xml
new file mode 100644
index 0000000..b2cb337
--- /dev/null
+++ b/app/src/main/res/drawable/ic_personal.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_search.xml b/app/src/main/res/drawable/ic_search.xml
new file mode 100644
index 0000000..fa90906
--- /dev/null
+++ b/app/src/main/res/drawable/ic_search.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/logo.png b/app/src/main/res/drawable/logo.png
new file mode 100644
index 0000000..78ffafd
Binary files /dev/null and b/app/src/main/res/drawable/logo.png differ
diff --git a/app/src/main/res/drawable/logo_inv.png b/app/src/main/res/drawable/logo_inv.png
new file mode 100644
index 0000000..0c24330
Binary files /dev/null and b/app/src/main/res/drawable/logo_inv.png differ
diff --git a/app/src/main/res/drawable/sadness.png b/app/src/main/res/drawable/sadness.png
new file mode 100644
index 0000000..130c8d2
Binary files /dev/null and b/app/src/main/res/drawable/sadness.png differ
diff --git a/app/src/main/res/drawable/shame.png b/app/src/main/res/drawable/shame.png
new file mode 100644
index 0000000..4363bb7
Binary files /dev/null and b/app/src/main/res/drawable/shame.png differ
diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml
new file mode 100644
index 0000000..458b4b0
--- /dev/null
+++ b/app/src/main/res/drawable/side_nav_bar.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/surpise.png b/app/src/main/res/drawable/surpise.png
new file mode 100644
index 0000000..ab9757a
Binary files /dev/null and b/app/src/main/res/drawable/surpise.png differ
diff --git a/app/src/main/res/layout/activity_add_mood.xml b/app/src/main/res/layout/activity_add_mood.xml
new file mode 100644
index 0000000..bdd8dd7
--- /dev/null
+++ b/app/src/main/res/layout/activity_add_mood.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_feed.xml b/app/src/main/res/layout/activity_feed.xml
new file mode 100644
index 0000000..c7ad745
--- /dev/null
+++ b/app/src/main/res/layout/activity_feed.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..e869142
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/app_bar_feed.xml b/app/src/main/res/layout/app_bar_feed.xml
new file mode 100644
index 0000000..a764fe9
--- /dev/null
+++ b/app/src/main/res/layout/app_bar_feed.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/content_feed.xml b/app/src/main/res/layout/content_feed.xml
new file mode 100644
index 0000000..cdebbb4
--- /dev/null
+++ b/app/src/main/res/layout/content_feed.xml
@@ -0,0 +1,16 @@
+
+
+
+
diff --git a/app/src/main/res/layout/emotion_spinner_layout.xml b/app/src/main/res/layout/emotion_spinner_layout.xml
new file mode 100644
index 0000000..f0f0d77
--- /dev/null
+++ b/app/src/main/res/layout/emotion_spinner_layout.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_mood.xml b/app/src/main/res/layout/fragment_mood.xml
new file mode 100644
index 0000000..eaa0385
--- /dev/null
+++ b/app/src/main/res/layout/fragment_mood.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/nav_header_feed.xml b/app/src/main/res/layout/nav_header_feed.xml
new file mode 100644
index 0000000..f7095ac
--- /dev/null
+++ b/app/src/main/res/layout/nav_header_feed.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/activity_feed_drawer.xml b/app/src/main/res/menu/activity_feed_drawer.xml
new file mode 100644
index 0000000..f740daa
--- /dev/null
+++ b/app/src/main/res/menu/activity_feed_drawer.xml
@@ -0,0 +1,38 @@
+
+
+
+
diff --git a/app/src/main/res/menu/menu_feed.xml b/app/src/main/res/menu/menu_feed.xml
new file mode 100644
index 0000000..12417a4
--- /dev/null
+++ b/app/src/main/res/menu/menu_feed.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 0000000..dbbdd40
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..e0ddcca
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,9 @@
+
+
+ #E91E63
+ #880E4F
+ #3F51B5
+ #FFF
+ #000
+ #D3D3D3
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..677b755
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,10 @@
+
+
+ 16dp
+ 16dp
+ 16dp
+ 30sp
+
+ 16dp
+ 160dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..0cae3b3
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,19 @@
+
+ MOod9
+ Settings
+ Username
+ FeedActivity
+ Universal Feed
+ Emotion
+ Social
+ Add Location
+ Save
+ Mood Organizer overdose #9
+ Open navigation drawer
+ Close navigation drawer
+ Personal Feed
+ Followed Feed
+ Near Me
+ Profile
+ About
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..545b9c6
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/xml/emotions.xml b/app/src/main/res/xml/emotions.xml
new file mode 100644
index 0000000..3ca723f
--- /dev/null
+++ b/app/src/main/res/xml/emotions.xml
@@ -0,0 +1,11 @@
+
+
+
+
+ 0
+ Happiness
+ I'm so happy
+ #ffffff
+ happiness.png
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/social_situations.xml b/app/src/main/res/xml/social_situations.xml
new file mode 100644
index 0000000..bc15920
--- /dev/null
+++ b/app/src/main/res/xml/social_situations.xml
@@ -0,0 +1,8 @@
+
+
+
+ 0
+ Alone
+ There's no one here besides me.
+
+
\ No newline at end of file
diff --git a/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionModelTest.java b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionModelTest.java
new file mode 100644
index 0000000..2a88cf2
--- /dev/null
+++ b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/EmotionModelTest.java
@@ -0,0 +1,53 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import org.junit.Test;
+
+import java.util.concurrent.ConcurrentMap;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by Rohit on 2017-02-23.
+ */
+
+public class EmotionModelTest {
+
+ @Test
+ public void testInitEmotions(){
+ EmotionModel test = new EmotionModel();
+ Emotion e1 = new Emotion("1","Test","Red","Happy","Happy.png");
+ Emotion e2 = new Emotion("2","Test1","blue","sad","sad.png");
+ test.setOnXMLResource(e1);
+ test.setOnXMLResource(e2);
+ test.initEmotions();
+ assertEquals(test.getEmotion("1"),e1);
+ assertEquals(test.getEmotion("2"),e2);
+ }
+
+ @Test
+ public void testXMLResource(){
+ EmotionModel test = new EmotionModel();
+ Emotion e1 = new Emotion("1","Test","Red","Happy","Happy.png");
+ Emotion e2 = new Emotion("2","Test1","blue","sad","sad.png");
+ test.setOnXMLResource(e1);
+ test.setOnXMLResource(e2);
+ Emotion teste = test.getFromXMLRessource("1");
+ Emotion teste2 = test.getFromXMLRessource("2");
+ assertEquals(e1,teste);
+ assertEquals(e2,teste2);
+ }
+
+ @Test
+ public void testGetEmotions(){
+ EmotionModel test = new EmotionModel();
+ Emotion e1 = new Emotion("1","Test","Red","Happy","Happy.png");
+ Emotion e2 = new Emotion("2","Test1","blue","sad","sad.png");
+ test.setOnXMLResource(e1);
+ test.setOnXMLResource(e2);
+ test.initEmotions();
+ ConcurrentMap testing = test.getEmotions();
+ assertEquals(testing.size(),2);
+ assertEquals(testing.get("1"),e1);
+ assertEquals(testing.get("2"),e2);
+ }
+}
diff --git a/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/ExampleUnitTest.java b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/ExampleUnitTest.java
new file mode 100644
index 0000000..23da93b
--- /dev/null
+++ b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/ExampleUnitTest.java
@@ -0,0 +1,21 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+ @Test
+ public void lk(){
+ assertEquals(3,5);
+ }
+}
\ No newline at end of file
diff --git a/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodModelTest.java b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodModelTest.java
new file mode 100644
index 0000000..b52177a
--- /dev/null
+++ b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/MoodModelTest.java
@@ -0,0 +1,129 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import java.util.Date;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * Created by Rohit on 2017-02-22.
+ */
+
+public class MoodModelTest {
+
+ @Test
+ public void testLoadMood(){
+ MoodModel test = new MoodModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"1");
+ Mood m2 = new Mood("2",12.22,13.22,"Trigger","2","With 2 others","14",new Date(12-11-2016),"2");
+ test.setOnElasticSearch(m1);
+ test.setOnElasticSearch(m2);
+ test.loadMood();
+ assertEquals(test.getMood("1"),m1);
+ assertEquals(test.getMood("2"),m2);
+
+ }
+
+ @Test
+ public void testElasticSearch(){
+ MoodModel test = new MoodModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"2");
+ test.setOnElasticSearch(m1);
+ Mood testmood = test.getFromElasticSearch("1");
+ assertEquals(m1,testmood);
+ }
+
+ @Test
+ public void testDeleteMood(){
+ MoodModel test = new MoodModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"1");
+ Mood m2 = new Mood("2",12.22,13.22,"Trigger","2","With 2 others","14",new Date(12-11-2016),"2");
+ test.setOnElasticSearch(m1);
+ test.setOnElasticSearch(m2);
+ test.loadMood();
+ test.deleteMood(m1);
+ assertEquals(test.getFromElasticSearch("1"),null);
+ test.loadMood();
+ assertEquals(test.getMood("1"),null);
+ }
+
+ @Test
+ public void testUpdateMood(){
+ MoodModel test = new MoodModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"1");
+ test.setOnElasticSearch(m1);
+ test.loadMood();
+ assertEquals(test.getMood("1"),m1);
+ m1.setId("2");
+ test.updateMood(m1); //Assuming updateMood automatically modifies elasticsearch
+ assertEquals(test.getFromElasticSearch("1"),null);
+ assertEquals(test.getFromElasticSearch("2"),m1);
+ test.loadMood();
+ assertEquals(test.getMood("1"),null);
+ assertEquals(test.getMood("2"),m1);
+ }
+
+ @Test
+ public void testGetMoodsNear(){
+ MoodModel test = new MoodModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"1");
+ Mood m2 = new Mood("2",12.22,13.22,"Trigger","2","With 2 others","14",new Date(12-11-2016),"2");
+ Mood m3 = new Mood("3",9999.0,9999.0,"Trigger","2","With 2 others","15",new Date(12-11-2016),"3");
+ //http://tutorials.jenkov.com/java-util-concurrent/concurrentmap.html
+ ConcurrentMap testing = new ConcurrentHashMap();
+ testing.put("1",m1);
+ testing.put("2",m2);
+ ConcurrentMap test1 = test.getMoodsNear(12.22,13.22);
+ assertEquals(test1,testing);
+ }
+
+ @Test
+ public void testMyMoods(){
+ //Not sure how
+ }
+
+ @Test
+ public void testGetUniversalMoods(){
+ MoodModel test = new MoodModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"1");
+ Mood m2 = new Mood("2",12.22,13.22,"Trigger","2","With 2 others","14",new Date(12-11-2016),"1");
+ Mood m3 = new Mood("3",9999.0,9999.0,"Trigger","2","With 2 others","15",new Date(12-11-2016),"2");
+ ConcurrentMap testing = new ConcurrentHashMap();
+ testing.put("1",m1);
+ testing.put("2",m2);
+ testing.put("3",m3);
+ test.setOnElasticSearch(m1);
+ test.setOnElasticSearch(m2);
+ test.setOnElasticSearch(m3);
+ test.loadMood();
+ ConcurrentMap final1 = test.getUniversalMoods();
+ assertEquals(testing,final1);
+ }
+
+ @Test
+ public void testGetFollowedMoods(){
+ MoodModel test = new MoodModel();
+ UserModel sample = new UserModel();
+ Mood m1 = new Mood("1",12.22,13.22,"Trigger","1","Alone","22",new Date(12-12-2016),"1");
+ Mood m2 = new Mood("2",12.22,13.22,"Trigger","2","With 2 others","14",new Date(12-11-2016),"1");
+ Mood m3 = new Mood("3",9999.0,9999.0,"Trigger","2","With 2 others","15",new Date(12-11-2016),"2");
+ User u1 = new User("1","Test");
+ sample.setOnElasticSearch(u1);
+ sample.loadUsers();
+ User user1 = sample.getUser("1");
+ ConcurrentMap testing = new ConcurrentHashMap();
+ testing.put("1",m1);
+ testing.put("2",m2);
+ test.setOnElasticSearch(m1);
+ test.setOnElasticSearch(m2);
+ test.setOnElasticSearch(m3);
+ test.loadMood();
+ ConcurrentMap final1 = test.getFollowedMoods(user1);
+ assertEquals(testing,final1);
+ }
+
+
+}
diff --git a/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/UserModelTest.java b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/UserModelTest.java
new file mode 100644
index 0000000..0155d83
--- /dev/null
+++ b/app/src/test/java/ca/ualberta/cmput301w17t09/mood9/mood9/UserModelTest.java
@@ -0,0 +1,52 @@
+package ca.ualberta.cmput301w17t09.mood9.mood9;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+
+import java.util.concurrent.ConcurrentMap;
+/**
+ * Created by Rohit on 2017-02-23.
+ */
+
+public class UserModelTest {
+
+ //Also tests getUser since the code for that test would be redundant
+ @Test
+ public void testLoadUsers(){
+ UserModel test = new UserModel();
+ User user1 = new User("1","Test");
+ User user2 = new User("2","Test1");
+ test.setOnElasticSearch(user1);
+ test.setOnElasticSearch(user2);
+ test.loadUsers();
+ assertEquals(test.getUser("1"),user1);
+ assertEquals(test.getUser("2"),user2);
+ }
+
+ //Tests both the uplink and downlink for our elasticsearch
+ @Test
+ public void testElasticSearch(){
+ UserModel test = new UserModel();
+ User user1 = new User("1","Test");
+ test.setOnElasticSearch(user1);
+ User testuser = test.getFromElasticSearch("1");
+ assertEquals(user1,testuser);
+ }
+
+ @Test
+ public void testGetUsers(){
+ UserModel test = new UserModel();
+ User user1 = new User("1","Test");
+ User user2 = new User("2","Test1");
+ test.setOnElasticSearch(user1);
+ test.setOnElasticSearch(user2);
+ test.loadUsers();
+ ConcurrentMap map1 = test.getUsers();
+ assertEquals(map1.size(),2);
+ assertEquals(map1.get("1"),user1);
+ assertEquals(map1.get("2"),user2);
+ }
+
+
+}
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..74b2ab0
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.2.3'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/doc/assets/anger.svg b/doc/assets/anger.svg
new file mode 100644
index 0000000..662072c
--- /dev/null
+++ b/doc/assets/anger.svg
@@ -0,0 +1,611 @@
+
+
+
+
diff --git a/doc/assets/confusion.svg b/doc/assets/confusion.svg
new file mode 100644
index 0000000..fca9202
--- /dev/null
+++ b/doc/assets/confusion.svg
@@ -0,0 +1,161 @@
+
+
+
+
diff --git a/doc/assets/happiness.svg b/doc/assets/happiness.svg
new file mode 100644
index 0000000..0355276
--- /dev/null
+++ b/doc/assets/happiness.svg
@@ -0,0 +1,93 @@
+
+
+
+
diff --git a/doc/assets/logo.svg b/doc/assets/logo.svg
new file mode 100644
index 0000000..c03a067
--- /dev/null
+++ b/doc/assets/logo.svg
@@ -0,0 +1,153 @@
+
+
+
+
diff --git a/doc/assets/logo_inv.svg b/doc/assets/logo_inv.svg
new file mode 100644
index 0000000..66f9d3b
--- /dev/null
+++ b/doc/assets/logo_inv.svg
@@ -0,0 +1,157 @@
+
+
+
+
diff --git a/doc/assets/sadness.svg b/doc/assets/sadness.svg
new file mode 100644
index 0000000..74cc8d8
--- /dev/null
+++ b/doc/assets/sadness.svg
@@ -0,0 +1,146 @@
+
+
+
+
diff --git a/doc/assets/shame.svg b/doc/assets/shame.svg
new file mode 100644
index 0000000..d789cd3
--- /dev/null
+++ b/doc/assets/shame.svg
@@ -0,0 +1,102 @@
+
+
+
+
diff --git a/doc/assets/surpise.svg b/doc/assets/surpise.svg
new file mode 100644
index 0000000..909a0ef
--- /dev/null
+++ b/doc/assets/surpise.svg
@@ -0,0 +1,111 @@
+
+
+
+
diff --git a/doc/meetings/2017-02-16.md b/doc/meetings/2017-02-16.md
new file mode 100644
index 0000000..645e747
--- /dev/null
+++ b/doc/meetings/2017-02-16.md
@@ -0,0 +1,15 @@
+# Meeting Notes
+## Attendance
+
+Everyone is here!!!!
+
+Even the TA Ian
+
+## Next few tasks
+Dai, Colin are doing usescases
+Rohit is going to do the storyboard
+Dannick is going to do the descriptions for the mockup
+Fady is float for the next day
+
+## Stuff
+Please fill Peer Review Forms...
diff --git a/doc/mockup/1.1-Logon.md b/doc/mockup/1.1-Logon.md
new file mode 100644
index 0000000..b7b11ed
--- /dev/null
+++ b/doc/mockup/1.1-Logon.md
@@ -0,0 +1,6 @@
+# 1.1-Logon
+
+This is the initial activity when you first open the account.
+It includes the logo, appname
+
+As well it provides you a text box to enter your username as well as a button to continue.
diff --git a/doc/mockup/1.1-Logon.png b/doc/mockup/1.1-Logon.png
new file mode 100644
index 0000000..bfadb21
Binary files /dev/null and b/doc/mockup/1.1-Logon.png differ
diff --git a/doc/mockup/2.1-Screen 1.png b/doc/mockup/2.1-Screen 1.png
new file mode 100644
index 0000000..8fd82f1
Binary files /dev/null and b/doc/mockup/2.1-Screen 1.png differ
diff --git a/doc/mockup/2.1-Screen1.md b/doc/mockup/2.1-Screen1.md
new file mode 100644
index 0000000..8ec858f
--- /dev/null
+++ b/doc/mockup/2.1-Screen1.md
@@ -0,0 +1,7 @@
+# 2.1-Screen1
+
+This is the main activity of the app. It provides you a list of moods
+that you can view.
+
+It also provides a button to filter those moods and a button to create a
+mood event
diff --git a/doc/mockup/2.2-Following.png b/doc/mockup/2.2-Following.png
new file mode 100644
index 0000000..8f124b5
Binary files /dev/null and b/doc/mockup/2.2-Following.png differ
diff --git a/doc/mockup/2.3-YourMoods.png b/doc/mockup/2.3-YourMoods.png
new file mode 100644
index 0000000..feb712e
Binary files /dev/null and b/doc/mockup/2.3-YourMoods.png differ
diff --git a/doc/mockup/3.1-Sidebar.md b/doc/mockup/3.1-Sidebar.md
new file mode 100644
index 0000000..36155da
--- /dev/null
+++ b/doc/mockup/3.1-Sidebar.md
@@ -0,0 +1,7 @@
+This is the swipe sidebar that is available throughout the app.
+The personal button opens your personal activity feed
+The followed button shows you the latest mood of the people you are following.
+The universal button shows you the latest moods of the people using the app
+The near me button opens the map showing you the mood of those near you
+The profile button opens the your profile where you can edit who is following you.
+The about button provides copyright details and a faq.
diff --git a/doc/mockup/3.1-Sidebar.png b/doc/mockup/3.1-Sidebar.png
new file mode 100644
index 0000000..975588a
Binary files /dev/null and b/doc/mockup/3.1-Sidebar.png differ
diff --git a/doc/mockup/4.1-AddMood.md b/doc/mockup/4.1-AddMood.md
new file mode 100644
index 0000000..e3fc592
--- /dev/null
+++ b/doc/mockup/4.1-AddMood.md
@@ -0,0 +1,5 @@
+# 4.1-AddMood
+
+This activity is the one that is accessed when you are creating/editing a mood.
+
+In this activity you can set the emotion, trigger, social setting and location that you felt your mood.
diff --git a/doc/mockup/4.1-AddMood.png b/doc/mockup/4.1-AddMood.png
new file mode 100644
index 0000000..f2869ba
Binary files /dev/null and b/doc/mockup/4.1-AddMood.png differ
diff --git a/doc/mockup/5.1-UserProfile.md b/doc/mockup/5.1-UserProfile.md
new file mode 100644
index 0000000..53b1aee
--- /dev/null
+++ b/doc/mockup/5.1-UserProfile.md
@@ -0,0 +1,5 @@
+# 5.1-UserProfile
+
+This activity provides you the oppurtunity to change your username
+as well as manage the people that you follow and the requests from other
+who want to follow you.
diff --git a/doc/mockup/5.1-UserProfile.png b/doc/mockup/5.1-UserProfile.png
new file mode 100644
index 0000000..592cf4d
Binary files /dev/null and b/doc/mockup/5.1-UserProfile.png differ
diff --git a/doc/mockup/6.1-Map.md b/doc/mockup/6.1-Map.md
new file mode 100644
index 0000000..afea586
--- /dev/null
+++ b/doc/mockup/6.1-Map.md
@@ -0,0 +1,5 @@
+# 6.1-Map
+
+This activity us the one that shows all the moods near you.
+The pins will be the colour of the emotion and upon clicking the pin
+it will open the moods activity.
diff --git a/doc/mockup/6.1-Map.png b/doc/mockup/6.1-Map.png
new file mode 100644
index 0000000..fec2ff9
Binary files /dev/null and b/doc/mockup/6.1-Map.png differ
diff --git a/doc/mockup/7.1-MoodView.md b/doc/mockup/7.1-MoodView.md
new file mode 100644
index 0000000..e1ccb64
--- /dev/null
+++ b/doc/mockup/7.1-MoodView.md
@@ -0,0 +1,7 @@
+# 7.1-MoodView
+
+This activity allows us to see all the details of a Mood.
+If it is one of our moods we can edit it using the pencil button.
+
+The details provided is the user who posted it, the date and time it was posted, the trigger text and the trigger. The emoticon and the colours of this page change with the emtion. If an image is provided it is displayed with the trigger. If a location is provided a map with a pin of the location is also shown.
+
diff --git a/doc/mockup/7.1-MoodView.png b/doc/mockup/7.1-MoodView.png
new file mode 100644
index 0000000..dd41e6d
Binary files /dev/null and b/doc/mockup/7.1-MoodView.png differ
diff --git a/doc/mockup/Storyboard/Storyboard.dia b/doc/mockup/Storyboard/Storyboard.dia
new file mode 100644
index 0000000..b4c12e7
Binary files /dev/null and b/doc/mockup/Storyboard/Storyboard.dia differ
diff --git a/doc/mockup/Storyboard/Storyboard.pdf b/doc/mockup/Storyboard/Storyboard.pdf
new file mode 100644
index 0000000..2a10581
Binary files /dev/null and b/doc/mockup/Storyboard/Storyboard.pdf differ
diff --git a/doc/mockup/mockup.md b/doc/mockup/mockup.md
new file mode 100644
index 0000000..992ce8e
--- /dev/null
+++ b/doc/mockup/mockup.md
@@ -0,0 +1 @@
+# **MO**_od_
diff --git a/doc/mood_usercase_specs.txt b/doc/mood_usercase_specs.txt
new file mode 100644
index 0000000..d60d62d
--- /dev/null
+++ b/doc/mood_usercase_specs.txt
@@ -0,0 +1,48 @@
+Post Moods
+Track Moods
+Share Moods
+
+USER CASE:
+NAME:Moods
+GOAL:Add new Mood event with current date/time,
+emotional state, optional trigger, optional social situation.
+-Emotional States: anger, confusion, disgust, fear, happiness, sadness, shame, surprise.
+-Emoticons and colors to represent emotional states.
+-View all details of mood events meaning by default mood events should be compact and concise.
+-Editable details of user's own mood events.
+-Delete user's own mood events.
+
+
+USER CASE:
+NAME:Other Details
+GOAL:Specify Mood event status text/photo and social situation
+
+USER CASE:
+NAME:Profile
+GOAL:Change Profile Username
+
+USER CASE:
+NAME:Mood History
+GOAL:View Mood History, sorted most recent first,
+filterable by how recent/mood emotion/mood status contains word
+
+USER CASE:
+NAME:Mood Following and Sharing
+GOAL:-Follow another user's mood event/Grant
+another user permission to follow my mood event
+-View list of recent mood events of all users I am following,
+sortable by date/time; recent first. Filterable by:
+How recent/mood emotion/mood status contains word
+
+USER CASE:
+NAME:Geolocation and Maps
+GOAL:Attach location to mood event,
+see map of mood events with emotions based on filtered mood history list.
+Followers can see their followed user's mood event maps.
+Users can see a map of all user's mood events
+within range of them if the event has a location.
+
+USER CASE:
+NAME:Offline Behavior
+GOAL:Be able to add, edit or delete a mood event while offline,
+go online and it will synchronize with the database.
diff --git a/doc/style_guide.md b/doc/style_guide.md
new file mode 100644
index 0000000..65593c0
--- /dev/null
+++ b/doc/style_guide.md
@@ -0,0 +1,10 @@
+# Style Guide
+## Branding
+All references of **MO**_od_ need to be styled.
+
+## Colours
+Primary: #E91E63
+
+Dark: #880EF4
+
+Accent: #177E89, #34D1BF, #92DCE5
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..aac7c9b
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# 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.
+org.gradle.jvmargs=-Xmx1536m
+
+# 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
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..04e285f
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Dec 28 10:00:20 PST 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..9d82f78
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,160 @@
+#!/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
+
+# 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\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+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"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # 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/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/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/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'