diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..96cc43e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..7ac24c7
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..5d19981
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..f5e9010
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index fe059e5..7238033 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,3 @@
-# sp17proj4android
-
Repository for Spring 2017 MDB Android Training Program Mini-Project 4 Submissions
Finalized mini-projects should be stored in personal portfolios, but this repository will be used for providing feedback on code quality using the GitHub code review features.
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..80f42d6
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,44 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion "26.0.1"
+ defaultConfig {
+ applicationId "com.example.joey.mdbsocials"
+ minSdkVersion 15
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ vectorDrawables.useSupportLibrary = true
+
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ 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:26.0.0-alpha1'
+ compile 'com.android.support.constraint:constraint-layout:1.0.2'
+ compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
+ compile 'com.android.support:cardview-v7:26.0.0-alpha1'
+ compile 'com.github.bumptech.glide:glide:3.8.0'
+ compile 'com.google.firebase:firebase-core:10.0.1'
+ compile 'com.google.firebase:firebase-auth:10.0.1'
+ compile 'com.google.firebase:firebase-database:10.0.1'
+ compile 'com.google.firebase:firebase-storage:10.0.1'
+ compile 'com.android.support:design:26.0.0-alpha1'
+ compile 'com.firebaseui:firebase-ui-storage:0.6.0'
+
+ testCompile 'junit:junit:4.12'
+}
+
+apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/app/google-services.json b/app/google-services.json
new file mode 100644
index 0000000..5c798bf
--- /dev/null
+++ b/app/google-services.json
@@ -0,0 +1,42 @@
+{
+ "project_info": {
+ "project_number": "406430029370",
+ "firebase_url": "https://mdbsocials-1b45c.firebaseio.com",
+ "project_id": "mdbsocials-1b45c",
+ "storage_bucket": "mdbsocials-1b45c.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:406430029370:android:479d592c2c2c236d",
+ "android_client_info": {
+ "package_name": "com.example.joey.mdbsocials"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "406430029370-0ltu61tdn3mt4p8ddnabgetq3ma80m63.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyA7qHngMUfLUE3EGZDsbUIEvobSVuvi0Xc"
+ }
+ ],
+ "services": {
+ "analytics_service": {
+ "status": 1
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "ads_service": {
+ "status": 2
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..c1dea9d
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /home/joey/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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/app/src/androidTest/java/com/example/joey/mdbsocials/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/joey/mdbsocials/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..49fe7cc
--- /dev/null
+++ b/app/src/androidTest/java/com/example/joey/mdbsocials/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.joey.mdbsocials;
+
+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("com.example.joey.mdbsocials", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..ffc3702
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/joey/mdbsocials/CreateSocial.java b/app/src/main/java/com/example/joey/mdbsocials/CreateSocial.java
new file mode 100644
index 0000000..5ad9e10
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/CreateSocial.java
@@ -0,0 +1,79 @@
+package com.example.joey.mdbsocials;
+
+import android.content.Intent;
+import android.icu.text.SimpleDateFormat;
+import android.net.Uri;
+import android.support.annotation.NonNull;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.google.android.gms.tasks.OnFailureListener;
+import com.google.android.gms.tasks.OnSuccessListener;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+import com.google.firebase.database.ServerValue;
+import com.google.firebase.storage.FirebaseStorage;
+import com.google.firebase.storage.StorageReference;
+import com.google.firebase.storage.UploadTask;
+
+public class CreateSocial extends AppCompatActivity implements View.OnClickListener{
+
+ private Uri file;
+ private EditText socialName;
+ private EditText socialDate;
+ private EditText socialDescription;
+ private ImageView previewImage;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_create_social);
+
+ socialName = (EditText) findViewById(R.id.socialName);
+ socialDate = (EditText) findViewById(R.id.profileDate);
+ socialDescription = (EditText) findViewById(R.id.socalDescription);
+ previewImage = (ImageView) findViewById(R.id.imagePreview);
+
+ findViewById(R.id.addImage).setOnClickListener(this);
+ findViewById(R.id.createSocial).setOnClickListener(this);
+
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()){
+ case R.id.createSocial:
+ String name = socialName.getText().toString();
+ String date = socialDate.getText().toString();
+ String description = socialDescription.getText().toString();
+ FirebaseUtils.pushNewSocial(this, name, description, date, file);
+
+ break;
+ case R.id.addImage:
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.setType("image/*");
+ startActivityForResult(intent, 1);
+ break;
+ }
+ }
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data){
+ super.onActivityResult(requestCode, resultCode, data);
+
+ if(resultCode == RESULT_OK && requestCode == 1){
+ file = data.getData();
+ previewImage.setImageURI(file);
+
+
+ }
+ }
+
+}
diff --git a/app/src/main/java/com/example/joey/mdbsocials/EventProfile.java b/app/src/main/java/com/example/joey/mdbsocials/EventProfile.java
new file mode 100644
index 0000000..4d88f9b
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/EventProfile.java
@@ -0,0 +1,90 @@
+package com.example.joey.mdbsocials;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.bumptech.glide.Glide;
+import com.firebase.ui.storage.images.FirebaseImageLoader;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.database.DataSnapshot;
+import com.google.firebase.database.DatabaseError;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+import com.google.firebase.database.MutableData;
+import com.google.firebase.database.Transaction;
+import com.google.firebase.database.ValueEventListener;
+import com.google.firebase.storage.FirebaseStorage;
+import com.google.firebase.storage.StorageReference;
+
+import java.util.ArrayList;
+
+public class EventProfile extends AppCompatActivity {
+
+ private int interested;
+ private Button interestedButton;
+ private ArrayList people;
+ private FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_event_profile);
+
+ final String id = getIntent().getStringExtra("id");
+ final DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials/" + id);
+ interested = getIntent().getIntExtra("interested", 0);
+ people = new ArrayList<>();
+ interestedButton = (Button) findViewById(R.id.profileInterestButton);
+
+ ((TextView) findViewById(R.id.profileTitle)).setText(getIntent().getStringExtra("name"));
+ ((TextView) findViewById(R.id.profileDescription)).setText(getIntent().getStringExtra("description"));
+ ((TextView) findViewById(R.id.profileDate)).setText(getIntent().getStringExtra("date"));
+ ((TextView) findViewById(R.id.profileInterested)).setText(""+interested);
+
+ FirebaseUtils.loadImageFromFirebase(id, (ImageView) findViewById(R.id.profileImage), (ProgressBar) findViewById(R.id.progressBarProfile));
+
+ //use transaction to update the number
+
+ //TODO: Could not determine how to get this listener in FirebaseUtils.class because the onclicklistener can ONLY be set after valueEventListener executed
+ ref.child("people").addValueEventListener(new ValueEventListener() {
+ @Override
+ public void onDataChange(DataSnapshot dataSnapshot) {
+ for (DataSnapshot person : dataSnapshot.getChildren()){
+ people.add(person.getValue(String.class));
+ }
+ if(people.contains(user.getEmail())){
+ interestedButton.setText("Already Interested!");
+ }
+ interestedButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(!people.contains(user.getEmail())){
+ FirebaseUtils.addInterestedTransaction(id);
+ interested++;
+ ((TextView) findViewById(R.id.profileInterested)).setText(""+interested);
+
+ }
+ }
+ });
+ }
+
+ @Override
+ public void onCancelled(DatabaseError databaseError) {
+ Toast.makeText(EventProfile.this,"Oh no! Database error!", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+
+ }
+
+
+
+}
diff --git a/app/src/main/java/com/example/joey/mdbsocials/FeedActivity.java b/app/src/main/java/com/example/joey/mdbsocials/FeedActivity.java
new file mode 100644
index 0000000..8affa05
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/FeedActivity.java
@@ -0,0 +1,64 @@
+package com.example.joey.mdbsocials;
+
+import android.content.Intent;
+import android.support.design.widget.FloatingActionButton;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.View;
+import android.widget.ListAdapter;
+import android.widget.Toast;
+
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.database.DataSnapshot;
+import com.google.firebase.database.DatabaseError;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+import com.google.firebase.database.ValueEventListener;
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+public class FeedActivity extends AppCompatActivity implements View.OnClickListener{
+
+ ArrayList socials = new ArrayList<>();
+ final SocialAdapter adapter = new SocialAdapter(FeedActivity.this, socials);
+ private DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials");
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_feed);
+
+ RecyclerView activityList = (RecyclerView) findViewById(R.id.activityList);
+ activityList.setLayoutManager(new LinearLayoutManager(this));
+
+ activityList.setAdapter(adapter);
+
+ FirebaseUtils.initFeed(FeedActivity.this, adapter);
+
+ findViewById(R.id.newSocialFAB).setOnClickListener(this);
+
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()){
+ case R.id.newSocialFAB:
+ Intent intent = new Intent(getApplicationContext(), CreateSocial.class);
+ startActivity(intent);
+ break;
+ }
+
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ Intent intent = new Intent(FeedActivity.this, LoginActivity.class);
+ FirebaseAuth.getInstance().signOut();
+ startActivity(intent);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/joey/mdbsocials/FirebaseUtils.java b/app/src/main/java/com/example/joey/mdbsocials/FirebaseUtils.java
new file mode 100644
index 0000000..334dcd3
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/FirebaseUtils.java
@@ -0,0 +1,288 @@
+package com.example.joey.mdbsocials;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.annotation.NonNull;
+import android.util.Log;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.OnFailureListener;
+import com.google.android.gms.tasks.OnSuccessListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.database.DataSnapshot;
+import com.google.firebase.database.DatabaseError;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+import com.google.firebase.database.MutableData;
+import com.google.firebase.database.Transaction;
+import com.google.firebase.database.ValueEventListener;
+import com.google.firebase.storage.FirebaseStorage;
+import com.google.firebase.storage.StorageReference;
+import com.google.firebase.storage.UploadTask;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ * Created by joey on 10/6/17.
+ */
+
+public class FirebaseUtils {
+
+
+ /**
+ * Creates a new user in firebase
+ * @param context the context of the signup activity - used to display toasts
+ * @param email the email the user wishes to create account with as string
+ * @param pass1 password string
+ * @param pass2 check to see if two passwords match
+ */
+ public static void attemptSignup(final Context context, String email, String pass1, String pass2) {
+ if (email.equals("")) {
+ Toast.makeText(context, "Enter Valid email!", Toast.LENGTH_SHORT).show();
+ } else if (pass1.equals("") || pass2.equals("")) {
+ Toast.makeText(context, "Complete both password banks!", Toast.LENGTH_SHORT).show();
+ } else if (!pass1.equals(pass2)) {
+ Toast.makeText(context, "Passwords do not match!", Toast.LENGTH_SHORT).show();
+ } else {
+ FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, pass1).addOnCompleteListener((Activity) context,
+ new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ if (!task.isSuccessful()) {
+ Toast.makeText(context, "Signup failed!", Toast.LENGTH_SHORT).show();
+ } else {
+ Intent intent = new Intent(context, FeedActivity.class);
+ context.startActivity(intent);
+ }
+ }
+ });
+ }
+
+ }
+
+ /**
+ *Attempts a login based on user input in fields
+ * @param context the context of Login Activity
+ * @param email a string that is the email the user submits
+ * @param password a string that is the password the user submits.
+ */
+ public static void attemptLogin(final Context context, String email, String password) {
+
+ if (!email.equals("") && !password.equals("")) {
+ FirebaseAuth.getInstance().signInWithEmailAndPassword(email, password).addOnCompleteListener((Activity) context,
+ new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ Log.d("FIREBASE", "signInWithEmail:onComplete:"+task.isSuccessful());
+
+ if(!task.isSuccessful()){
+ Log.w("FIREBASE", "signInWithEmail:failed", task.getException());
+ Toast.makeText(context, "Login failed!", Toast.LENGTH_SHORT).show();
+ }else {
+ Intent intent = new Intent(context, FeedActivity.class);
+ context.startActivity(intent);
+ Toast.makeText(context, "Login SUCCESS!", Toast.LENGTH_SHORT).show();
+ }
+
+ }
+ });
+
+ }
+ }
+
+ /**
+ * Attempts to create a new social based on entered fields.
+ * @param context context of CreateSocial Activity to push toasts / start activiites
+ * @param name name of new social
+ * @param description description of social
+ * @param date date of social
+ * @param file image file associated with social
+ */
+ public static void pushNewSocial(final CreateSocial context, final String name, final String description, final String date, final Uri file){
+ //check to see if image exists
+ if(file == null){
+ Toast.makeText(context, "no image selected!", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if(name.equals("") || description.equals("") ||date.equals("")){
+ Toast.makeText(context, "Must fill in fields", Toast.LENGTH_SHORT).show();
+ return;
+ }
+ //get Firebase information
+ final DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials");
+ StorageReference storageReference = FirebaseStorage.getInstance().getReference();
+ final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
+
+
+ //First generate a key for the image
+ final String key = ref.push().getKey();
+ StorageReference imageRef = storageReference.child(key + ".png");
+
+ imageRef.putFile(file).addOnFailureListener(new OnFailureListener() {
+ @Override
+ public void onFailure(@NonNull Exception e) {
+ Toast.makeText(context, "no image selected!", Toast.LENGTH_SHORT).show();
+ }
+ }).addOnSuccessListener(new OnSuccessListener() {
+ @Override
+ public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
+ Social social = new Social(key, user.getEmail(), name, description, date);
+
+ ref.child(key).setValue(social);
+
+ Intent returnIntent = new Intent(context, FeedActivity.class);
+ context.startActivity(returnIntent);
+
+ }
+ });
+ }
+
+ /**
+ * Creates the firebase listener for social objects and adds them to the feed Recycler view.
+ * @param context context of the feed activity
+ * @param adapter the adapter of the recycler view
+ */
+ public static void initFeed(final FeedActivity context, final SocialAdapter adapter){
+ final ArrayList socials = adapter.getSocials();
+ DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials");
+ ref.orderByChild("timestamp").addValueEventListener(new ValueEventListener() {
+ @Override
+ public void onDataChange(DataSnapshot dataSnapshot) {
+ ArrayList newSocials = new ArrayList<>();
+ for (DataSnapshot socialObject : dataSnapshot.getChildren()){
+ Social social = socialObject.getValue(Social.class);
+ newSocials.add(social);
+ }
+ //CODE DOES ORDER BY TIMESTAMP, but in descending order, reverse to chagne to ascending.
+ Collections.reverse(newSocials);
+ socials.clear();
+ socials.addAll(newSocials);
+ adapter.notifyDataSetChanged();
+ }
+
+ @Override
+ public void onCancelled(DatabaseError databaseError) {
+ Toast.makeText(context,"Oh no! Database error!", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ }
+
+ /**
+ * Class used for asycronous image downloading.
+ */
+ private static class DownloadImagesTask extends AsyncTask {
+
+ private ImageView imageView;
+ private ProgressBar progressBar;
+
+ public DownloadImagesTask(ImageView imageView, ProgressBar progressBar){
+ this.imageView = imageView;
+ this.progressBar = progressBar;
+ }
+
+ @Override
+ protected Bitmap doInBackground(Uri... uris) {
+ if(uris.length == 1){
+ return downloadImage(uris[0].toString());
+ }
+ return null;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ imageView.setVisibility(View.INVISIBLE);
+ progressBar.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ protected void onPostExecute(Bitmap result) {
+ imageView.setImageBitmap(result);
+ imageView.setVisibility(View.VISIBLE);
+ progressBar.setVisibility(View.GONE);
+ }
+
+
+ private Bitmap downloadImage(String src) {
+ try {
+ URL url = new URL(src);
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setDoInput(true);
+ connection.connect();
+ InputStream input = connection.getInputStream();
+ Bitmap myBitmap = BitmapFactory.decodeStream(input);
+ return myBitmap;
+ } catch (MalformedURLException e) {
+ Log.d("Exceptions", e.getMessage());
+ } catch (IOException e) {
+ Log.d("Exceptions", e.getMessage());
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Instantiates a new Download image task to pull an image from firebase for a given social
+ * @param id the id of the social
+ * @param imageView view where image is placed
+ * @param progressBar progress bar that image replaces.
+ */
+ public static void loadImageFromFirebase(final String id, final ImageView imageView, final ProgressBar progressBar){
+ StorageReference storageReference = FirebaseStorage.getInstance().getReference().child(id+".png");
+ storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener() {
+ @Override
+ public void onSuccess(Uri uri) {
+ new DownloadImagesTask(imageView, progressBar).execute(uri);
+ }
+ });
+
+ }
+
+ /**
+ * Uses firebase transaction to update interested field
+ * @param id id of the social.
+ */
+ public static void addInterestedTransaction(String id){
+ final DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials/" + id);
+ String key = ref.child("people").push().getKey();
+ ref.child("people").child(key).setValue(FirebaseAuth.getInstance().getCurrentUser().getEmail());
+ ref.child("interested").runTransaction(new Transaction.Handler() {
+ @Override
+ public Transaction.Result doTransaction(MutableData mutableData) {
+ int interested = mutableData.getValue(Integer.class);
+ interested++;
+ mutableData.setValue(interested);
+ return Transaction.success(mutableData);
+ }
+
+ @Override
+ public void onComplete(DatabaseError databaseError, boolean b,
+ DataSnapshot dataSnapshot) {
+ Log.d("FIREBASE", "Successful incrementation of interested count");
+
+ }
+ });
+
+ }
+
+
+}
diff --git a/app/src/main/java/com/example/joey/mdbsocials/LoginActivity.java b/app/src/main/java/com/example/joey/mdbsocials/LoginActivity.java
new file mode 100644
index 0000000..786d381
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/LoginActivity.java
@@ -0,0 +1,82 @@
+package com.example.joey.mdbsocials;
+
+
+import android.content.Intent;
+import android.support.annotation.NonNull;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+
+public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
+
+ private static FirebaseAuth mAuth;
+ private FirebaseAuth.AuthStateListener mAuthListener;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+
+ findViewById(R.id.loginButton).setOnClickListener(this);
+ findViewById(R.id.signUpButton).setOnClickListener(this);
+
+
+ mAuth = FirebaseAuth.getInstance();
+
+ mAuthListener = new FirebaseAuth.AuthStateListener() {
+ @Override
+ public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
+ FirebaseUser user = firebaseAuth.getCurrentUser();
+ if(user != null) {
+ //user is signed in
+ Log.d("FIREBASE", "onAuthStateChanged:signed_in" + user.getUid());
+ }else{
+ //user is signed out
+ Log.d("FIREABASE", "onAuthStateChanged:signed_out");
+ }
+ }
+ };
+
+ mAuth.addAuthStateListener(mAuthListener);
+
+ }
+
+ @Override
+ public void onClick(View view) {
+ Log.d("THIS", "SHIT WAS CALLED");
+ switch(view.getId()){
+ case R.id.loginButton:
+ String email = ((EditText) findViewById(R.id.emailText)).getText().toString();
+ String password = ((EditText) findViewById(R.id.passwordText)).getText().toString();
+ FirebaseUtils.attemptLogin(this, email, password);
+ break;
+ case R.id.signUpButton:
+ Intent intent = new Intent(LoginActivity.this, SignUpActivity.class);
+ startActivity(intent);
+ break;
+ default:
+ break;
+ }
+ }
+
+
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mAuth.signOut();
+ ((EditText) findViewById(R.id.emailText)).setText("");
+ ((EditText) findViewById(R.id.passwordText)).setText("");
+
+ }
+}
diff --git a/app/src/main/java/com/example/joey/mdbsocials/SignUpActivity.java b/app/src/main/java/com/example/joey/mdbsocials/SignUpActivity.java
new file mode 100644
index 0000000..e1b55a7
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/SignUpActivity.java
@@ -0,0 +1,58 @@
+package com.example.joey.mdbsocials;
+
+import android.content.Intent;
+import android.support.annotation.NonNull;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+
+public class SignUpActivity extends AppCompatActivity implements View.OnClickListener {
+
+ private FirebaseAuth mAuth;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_sign_up);
+
+ findViewById(R.id.createAccountButton).setOnClickListener(this);
+
+ mAuth = FirebaseAuth.getInstance();
+ }
+
+ @Override
+ public void onClick(View view) {
+ switch (view.getId()){
+ case R.id.createAccountButton:
+ String email = ((EditText) findViewById(R.id.signUpEmailText)).getText().toString();
+ String pass1 = ((EditText) findViewById(R.id.signUpPasswordText)).getText().toString();
+ String pass2 = ((EditText) findViewById(R.id.confirmPasswordText)).getText().toString();
+ FirebaseUtils.attemptSignup(this, email, pass1, pass2);
+ break;
+ }
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ mAuth.signOut();
+ ((EditText) findViewById(R.id.signUpEmailText)).setText("");
+ ((EditText) findViewById(R.id.signUpPasswordText)).setText("");
+ ((EditText) findViewById(R.id.confirmPasswordText)).setText("");
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ Intent intent = new Intent(SignUpActivity.this, LoginActivity.class);
+ startActivity(intent);
+ }
+}
diff --git a/app/src/main/java/com/example/joey/mdbsocials/Social.java b/app/src/main/java/com/example/joey/mdbsocials/Social.java
new file mode 100644
index 0000000..71c0eb0
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/Social.java
@@ -0,0 +1,85 @@
+package com.example.joey.mdbsocials;
+
+/**
+ * Created by joey on 9/28/17.
+ */
+
+public class Social {
+ String id;
+ String name;
+ String owner;
+ String date;
+ String description;
+ int interested = 0;
+
+ public Social(){}
+
+
+
+ public Social(String id, String owner, String name, String date, String description, int interested) {
+ this.id = id;
+ this.owner = owner;
+ this.name = name;
+ this.date = date;
+ this.description = description;
+ this.interested = interested;
+ }
+
+ public Social(String id, String owner, String name, String date, String description) {
+ this.id = id;
+ this.owner = owner;
+ this.name = name;
+ this.date = date;
+ this.description = description;
+ this.interested = 0;
+ }
+
+ 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;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public int getInterested() {
+ return interested;
+ }
+
+ public void setInterested(int interested) {
+ this.interested = interested;
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/joey/mdbsocials/SocialAdapter.java b/app/src/main/java/com/example/joey/mdbsocials/SocialAdapter.java
new file mode 100644
index 0000000..b18c731
--- /dev/null
+++ b/app/src/main/java/com/example/joey/mdbsocials/SocialAdapter.java
@@ -0,0 +1,93 @@
+package com.example.joey.mdbsocials;
+
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.firebase.ui.storage.images.FirebaseImageLoader;
+import com.google.firebase.storage.FirebaseStorage;
+import com.google.firebase.storage.StorageReference;
+
+import java.util.ArrayList;
+
+/**
+ * Created by joey on 9/27/17.
+ */
+
+public class SocialAdapter extends RecyclerView.Adapter {
+ private Context context;
+ private ArrayList socials;
+
+ public ArrayList getSocials(){
+ return socials;
+ }
+
+ public SocialAdapter(Context context, ArrayList socials){
+ this.context = context;
+ this.socials = socials;
+ }
+
+ @Override
+ public SocialViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.social_row, parent, false);
+ return new SocialViewHolder(v);
+ }
+
+ @Override
+ public void onBindViewHolder(SocialViewHolder holder, int position) {
+ Social social = socials.get(position);
+ holder.emailText.setText(social.owner);
+ holder.interestedCount.setText("" + social.interested);
+ holder.eventName.setText(social.name);
+
+ FirebaseUtils.loadImageFromFirebase(social.id, holder.eventImage, holder.progressBar);
+ }
+
+ @Override
+ public int getItemCount(){
+ return socials.size();
+ }
+
+ class SocialViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ TextView eventName;
+ ImageView eventImage;
+ TextView interestedCount;
+ TextView emailText;
+ ProgressBar progressBar;
+
+ public SocialViewHolder(View v){
+ super(v);
+ eventName = v.findViewById(R.id.eventName);
+ eventImage = v.findViewById(R.id.eventImage);
+ interestedCount = v.findViewById(R.id.eventInterested);
+ emailText = v.findViewById(R.id.eventEmail);
+ progressBar = v.findViewById(R.id.progressBar);
+ itemView.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ // implement code to open the detail screen for the current view
+ Social s = socials.get(getAdapterPosition());
+ Intent intent = new Intent(context, EventProfile.class);
+ intent.putExtra("id", s.id);
+ intent.putExtra("name", s.name);
+ intent.putExtra("date", s.date);
+ intent.putExtra("description", s.description);
+ intent.putExtra("interested", s.interested);
+
+ context.startActivity(intent);
+
+
+ }
+ }
+
+}
diff --git a/app/src/main/res/drawable/ic_add_black_24dp.xml b/app/src/main/res/drawable/ic_add_black_24dp.xml
new file mode 100644
index 0000000..0258249
--- /dev/null
+++ b/app/src/main/res/drawable/ic_add_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/mdblogo.png b/app/src/main/res/drawable/mdblogo.png
new file mode 100644
index 0000000..5295423
Binary files /dev/null and b/app/src/main/res/drawable/mdblogo.png differ
diff --git a/app/src/main/res/layout/activity_create_social.xml b/app/src/main/res/layout/activity_create_social.xml
new file mode 100644
index 0000000..e0cb2ca
--- /dev/null
+++ b/app/src/main/res/layout/activity_create_social.xml
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_event_profile.xml b/app/src/main/res/layout/activity_event_profile.xml
new file mode 100644
index 0000000..8df6107
--- /dev/null
+++ b/app/src/main/res/layout/activity_event_profile.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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..8003932
--- /dev/null
+++ b/app/src/main/res/layout/activity_feed.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..c1f91f9
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_sign_up.xml b/app/src/main/res/layout/activity_sign_up.xml
new file mode 100644
index 0000000..63d75e9
--- /dev/null
+++ b/app/src/main/res/layout/activity_sign_up.xml
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/social_row.xml b/app/src/main/res/layout/social_row.xml
new file mode 100644
index 0000000..1e6f68a
--- /dev/null
+++ b/app/src/main/res/layout/social_row.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
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-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9a078e3
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.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-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..efc028a
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.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-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..3af2608
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.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-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9bec2e6
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.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/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..34947cd
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3ab3e9c
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..507f8ab
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ MDBSocials
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..be38018
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/example/joey/mdbsocials/ExampleUnitTest.java b/app/src/test/java/com/example/joey/mdbsocials/ExampleUnitTest.java
new file mode 100644
index 0000000..b68972d
--- /dev/null
+++ b/app/src/test/java/com/example/joey/mdbsocials/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.joey.mdbsocials;
+
+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);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..187daca
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,29 @@
+// 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.3.3'
+ classpath 'com.google.gms:google-services:3.1.0'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ maven {
+ url "https://maven.google.com" // Google's Maven repository
+ }
+
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
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..eed667d
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Sep 27 17:25:26 PDT 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-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..aec9973
--- /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'