Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0a0bb1f
Canged ProjectMobileGeddon to MOod9
shammancer Feb 10, 2017
75e2b17
Created the acronym
shammancer Feb 10, 2017
54dd30f
Update README.md
shammancer Feb 10, 2017
5de2ab4
Create MoodUserCase Specifications
Cdkushni Feb 15, 2017
5cb5e4c
Bye bye Anton!
shammancer Feb 16, 2017
a52e088
Let's OverDOSE!!!!!!
shammancer Feb 16, 2017
c3fc11d
Added Style Guide
shammancer Feb 16, 2017
11358ec
Create mockup.md
fadymach Feb 16, 2017
eb8700e
Initial MOckup Upload
fadymach Feb 16, 2017
de5254e
Changed file name
fmachaal Feb 16, 2017
6e254ef
Added android studio project
fmachaal Feb 16, 2017
dfa264b
Merge pull request #1 from Cdkushni/patch-1
shammancer Feb 16, 2017
c0814b8
Moved mood usr specs
Feb 16, 2017
1cbce35
Spacing
shammancer Feb 16, 2017
98a865d
Added Logo
Feb 16, 2017
18aaf02
Merge branch 'master' of github.com:CMPUT301W17T09/MOod9
Feb 16, 2017
bcc7df4
Updated logo, It's actually on the canvas
Feb 16, 2017
92cbb1b
Added Logo to Readme
shammancer Feb 16, 2017
da641ac
Added png of logo
Feb 16, 2017
e58e892
Merge branch 'master' of github.com:CMPUT301W17T09/MOod9
Feb 16, 2017
e56fb56
Added logo to readme
shammancer Feb 16, 2017
0ebb3b8
Add files via upload
Cdkushni Feb 16, 2017
fc5553a
Fixed logo
shammancer Feb 17, 2017
5761a35
Added Inverted Logo
shammancer Feb 17, 2017
36ec9bd
added .idea folder
fmachaal Feb 17, 2017
5df646d
Added mockup details
shammancer Feb 17, 2017
8d1b7d1
Merge branch 'master' of github.com:CMPUT301W17T09/MOod9
shammancer Feb 17, 2017
55c8813
Added missing description
shammancer Feb 17, 2017
2547f9b
Add files via upload
rohitvinnakota Feb 17, 2017
8eb8afd
renamed mockup files
fmachaal Feb 17, 2017
2a4e09b
Added the storyboard pdf and dia file
fmachaal Feb 17, 2017
d968ecf
Added a TODO list
fadymach Feb 17, 2017
e1b3725
Moved to Wiki.
Cdkushni Feb 17, 2017
202964e
Added doc/assets folder because app/src/main/res/drawable does not li…
shammancer Feb 22, 2017
ccff1f8
Added meeting minutes
shammancer Feb 22, 2017
5c9479d
Added MainActivity and FeedActivity
fmachaal Feb 22, 2017
b756a7a
Updated .gitignore
shammancer Feb 22, 2017
f536339
Updated gitignore
shammancer Feb 22, 2017
0c9f9cd
Stopped tracking .idea
shammancer Feb 22, 2017
66b0982
Merge to master
shammancer Feb 22, 2017
ff2c52f
Added xml ressources
shammancer Feb 22, 2017
3dc55f7
Added mood icons
fmachaal Feb 22, 2017
c319390
Merge remote-tracking branch 'origin/master'
fmachaal Feb 22, 2017
0ac87a7
added fragement view
Feb 22, 2017
11e7082
Initial stubbing of models
shammancer Feb 22, 2017
b1a1adb
Basic Moods
shammancer Feb 23, 2017
a48ea30
Added Guava and ElasticSearch to project. Also made UserModel use Loa…
shammancer Feb 23, 2017
ceab5de
Made models all use LoadingCache
shammancer Feb 23, 2017
068aa93
EmotionalModel and SocialSituationModel need initial load
shammancer Feb 23, 2017
4565783
SocialSituationModel needs initial load
shammancer Feb 23, 2017
f23305e
Initial Mood Model
shammancer Feb 23, 2017
a46175a
Added navigation drawer
fmachaal Feb 23, 2017
722dbcb
Basic MoodModel
shammancer Feb 23, 2017
20f5927
Added launcher icon
fmachaal Feb 23, 2017
96793b4
added icons
fmachaal Feb 23, 2017
de87b25
Merge branch 'master' of github.com:CMPUT301W17T09/MOod9
fmachaal Feb 23, 2017
e153092
Added navigation drawer
fmachaal Feb 23, 2017
d56e423
started unit testing
rohitvinnakota Feb 24, 2017
f9a48a2
all function skeletons created
rohitvinnakota Feb 24, 2017
bda4258
testing done
rohitvinnakota Feb 24, 2017
e75461c
final
rohitvinnakota Feb 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ proguard/
# Android Studio captures folder
captures/

# Intellij
# IntelliJ
*.iml
.idea/workspace.xml
.idea/*

# Keystore files
*.jks
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# ProjectMobilegeddon
Team 9 CMPUT301W17T09's public Mobilegeddon repository.
<img src="https://github.com/CMPUT301W17T09/MOod9/blob/master/app/src/main/res/drawable/logo.png" height="300" width="300">

# 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
9 changes: 9 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
33 changes: 33 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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 *;
#}
Original file line number Diff line number Diff line change
@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}
31 changes: 31 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.ualberta.cmput301w17t09.mood9.mood9">

<uses-permission
android:name="android.permission.INTERNET" />

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

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AddMoodActivity" />
<activity
android:name=".FeedActivity"
android:label="@string/title_activity_feed"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -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<Emotion> 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<String> socialSpinnerAdapter = new ArrayAdapter<String>(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();
}
});

}

}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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<String, Emotion> 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<String, Emotion>(){ // build the cacheloader

@Override
public Emotion load(String id) throws Exception {
//make the expensive call
return getFromXMLRessource(id);
}
});
}

public static ConcurrentMap<String, Emotion> 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(){

}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Loading