diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a4c7838
--- /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..c7d1c5a
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..fe72da5
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ 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/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..3543521
--- /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..d5b0147
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,41 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 24
+ buildToolsVersion "24.0.2"
+ defaultConfig {
+ applicationId "com.projects.mdb.mdbsocials"
+ minSdkVersion 14
+ targetSdkVersion 24
+ 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(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:24.2.1'
+ compile 'com.android.support:design:24.2.1'
+ testCompile 'junit:junit:4.12'
+ compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
+ compile 'com.android.support:cardview-v7:24.2.1'
+ compile 'com.android.support:recyclerview-v7:24.2.1'
+ compile 'com.google.firebase:firebase-core:9.6.1'
+ compile 'com.google.firebase:firebase-auth:9.6.1'
+ compile 'com.google.firebase:firebase-storage:9.6.1'
+ compile 'com.google.firebase:firebase-database:9.6.1'
+ compile 'com.github.bumptech.glide:glide:3.7.0'
+ compile 'com.android.support:palette-v7:24.2.1'
+}
+
+apply plugin: 'com.google.gms.google-services'
diff --git a/app/google-services.json b/app/google-services.json
new file mode 100644
index 0000000..24f6b12
--- /dev/null
+++ b/app/google-services.json
@@ -0,0 +1,42 @@
+{
+ "project_info": {
+ "project_number": "1082602066966",
+ "firebase_url": "https://mdbsocials-700a9.firebaseio.com",
+ "project_id": "mdbsocials-700a9",
+ "storage_bucket": "mdbsocials-700a9.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:1082602066966:android:e9cc6be388f1b08f",
+ "android_client_info": {
+ "package_name": "com.projects.mdb.mdbsocials"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "1082602066966-029arvecm878lbmc07aq41uefnov6p46.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyAzxt2y8QKqJ1_5GzDGeOsirnceXq8_C2s"
+ }
+ ],
+ "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..8112cd7
--- /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 C:\Users\Aayush\AppData\Local\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/com/projects/mdb/mdbsocials/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/projects/mdb/mdbsocials/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..1c0e3d1
--- /dev/null
+++ b/app/src/androidTest/java/com/projects/mdb/mdbsocials/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.pokedex.mdb.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.pokedex.mdb.mdbsocials", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b197872
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/InterestedActivity.java b/app/src/main/java/com/projects/mdb/mdbsocials/InterestedActivity.java
new file mode 100644
index 0000000..0b7c8e1
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/InterestedActivity.java
@@ -0,0 +1,25 @@
+package com.projects.mdb.mdbsocials;
+
+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;
+
+/**
+ * List of email addresses of those who are interested in the Social
+ */
+public class InterestedActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_interested);
+ RecyclerView recyclerAdapter = (RecyclerView)findViewById(R.id.recyclegirl);
+ recyclerAdapter.setLayoutManager(new LinearLayoutManager(this));
+ String[] people = getIntent().getStringArrayExtra("interestedPeople");
+ if (people.length > 0) {
+ recyclerAdapter.setAdapter(new InterestedAdapter(getApplicationContext(), people));
+ }
+ }
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/InterestedAdapter.java b/app/src/main/java/com/projects/mdb/mdbsocials/InterestedAdapter.java
new file mode 100644
index 0000000..236e44a
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/InterestedAdapter.java
@@ -0,0 +1,58 @@
+package com.projects.mdb.mdbsocials;
+
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+
+/**
+ * Created by Aayush on 10/12/2016.
+ * A simple adapter to list the email addresses of those who have said they are interested
+ */
+
+public class InterestedAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+ private String[] emails;
+
+ public InterestedAdapter(Context context, String[] emails) {
+ this.context = context;
+ this.emails = emails;
+ }
+
+
+ @Override
+ public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.interested_row_view, parent, false);
+ return new CustomViewHolder(view);
+ }
+
+
+ @Override
+ public void onBindViewHolder(CustomViewHolder holder, int position) {
+ holder.textView.setText(emails[position]);
+ }
+
+ @Override
+ public int getItemCount() {
+ return emails.length;
+ }
+
+ class CustomViewHolder extends RecyclerView.ViewHolder {
+ TextView textView;
+
+ public CustomViewHolder(View view) {
+ super(view);
+ this.textView = (TextView) view.findViewById(R.id.interested_text_view);
+ }
+ }
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/ListActivity.java b/app/src/main/java/com/projects/mdb/mdbsocials/ListActivity.java
new file mode 100644
index 0000000..355fdaf
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/ListActivity.java
@@ -0,0 +1,57 @@
+package com.projects.mdb.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.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+
+/**
+ * Created by Aayush on 10/11/2016.
+ * The main list of Socials screen
+ */
+public class ListActivity extends AppCompatActivity {
+
+ private Utils utils;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_list);
+ RecyclerView recyclerAdapter = (RecyclerView)findViewById(R.id.recycleman);
+ recyclerAdapter.setLayoutManager(new LinearLayoutManager(this));
+ utils = new Utils();
+ SocialsAdapter adapter = new SocialsAdapter(getApplicationContext(), utils.getSocialist());
+ recyclerAdapter.setAdapter(adapter);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(getApplicationContext(), NewSocialActivity.class);
+ startActivity(intent);
+ }
+ });
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.menu_main, menu);
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ /**
+ * Signs the user out and returns to the login screen
+ * @param item the signout menu item
+ */
+ public void signout(MenuItem item) {
+ Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
+ LoginActivity.getmAuth().signOut();
+ startActivity(intent);
+ }
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/LoginActivity.java b/app/src/main/java/com/projects/mdb/mdbsocials/LoginActivity.java
new file mode 100644
index 0000000..1d1904d
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/LoginActivity.java
@@ -0,0 +1,299 @@
+package com.projects.mdb.mdbsocials;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.annotation.TargetApi;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.support.annotation.NonNull;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.app.LoaderManager.LoaderCallbacks;
+
+import android.content.CursorLoader;
+import android.content.Loader;
+import android.database.Cursor;
+import android.net.Uri;
+
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.ContactsContract;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.inputmethod.EditorInfo;
+import android.widget.ArrayAdapter;
+import android.widget.AutoCompleteTextView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.TextView;
+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;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static android.Manifest.permission.READ_CONTACTS;
+
+/**
+ * A attemptLogin screen that offers attemptLogin via email/password.
+ */
+//TODO oh sweet jesus gotta fix this, remove all the this's and just die in general
+public class LoginActivity extends AppCompatActivity implements LoaderCallbacks {
+
+ /**
+ * Id to identity READ_CONTACTS permission request.
+ */
+ private static final int REQUEST_READ_CONTACTS = 0;
+
+
+ /**
+ * Keep track of the attemptLogin task to ensure we can cancel it if requested.
+ */
+
+ // UI references.
+ private AutoCompleteTextView mEmailView;
+ private EditText mPasswordView;
+ private View mProgressView;
+ private View mLoginFormView;
+ private static FirebaseAuth mAuth;
+ private FirebaseAuth.AuthStateListener mAuthListener;
+ private DatabaseReference usersRef;
+ private static String name;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+ // Set up the attemptLogin form.
+ mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
+ populateAutoComplete();
+
+ mAuth = FirebaseAuth.getInstance();
+ mPasswordView = (EditText) findViewById(R.id.password);
+ mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+ @Override
+ public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
+ if (id == R.id.login || id == EditorInfo.IME_NULL) {
+ attemptLogin();
+ return true;
+ }
+ return false;
+ }
+ });
+
+ Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
+ mEmailSignInButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ attemptLogin();
+ }
+ });
+
+ Button signUpButton = (Button) findViewById(R.id.sign_up_button);
+ signUpButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ attemptSignUp();
+ }
+ });
+
+ mLoginFormView = findViewById(R.id.login_form);
+ mProgressView = findViewById(R.id.login_progress);
+
+ usersRef = FirebaseDatabase.getInstance().getReference().child("user");
+
+ mAuthListener = new FirebaseAuth.AuthStateListener() {
+ @Override
+ public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
+ FirebaseUser user = firebaseAuth.getCurrentUser();
+ if (user != null) {
+ Log.d("ye", "onAuthStateChanged:signed_in:" + user.getUid());
+
+ } else {
+ Log.d("ye", "onAuthStateChanged:signed_out");
+ }
+ }
+ };
+ }
+
+ public static FirebaseAuth getmAuth() {
+ return mAuth;
+ }
+
+ /**
+ * Necessary to use built in attemptLogin
+ */
+ private void populateAutoComplete() {
+ if (!mayRequestContacts()) {
+ return;
+ }
+
+ getLoaderManager().initLoader(0, null, this);
+ }
+
+ /**
+ * Used for autocomplete
+ * @return whether or not permission is granted
+ */
+ private boolean mayRequestContacts() {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
+ return true;
+ }
+ if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
+ return true;
+ }
+ if (shouldShowRequestPermissionRationale(READ_CONTACTS)) {
+ Snackbar.make(mEmailView, R.string.permission_rationale, Snackbar.LENGTH_INDEFINITE)
+ .setAction(android.R.string.ok, new View.OnClickListener() {
+ @Override
+ @TargetApi(Build.VERSION_CODES.M)
+ public void onClick(View v) {
+ requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
+ }
+ });
+ } else {
+ requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
+ }
+ return false;
+ }
+
+ /**
+ * Callback received when a permissions request has been completed.
+ */
+ @Override
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
+ @NonNull int[] grantResults) {
+ if (requestCode == REQUEST_READ_CONTACTS) {
+ if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ populateAutoComplete();
+ }
+ }
+ }
+
+ /**
+ * Attempts to create a Firebase User
+ */
+ private void attemptSignUp() {
+ String email = mEmailView.getText().toString();
+ String password = mPasswordView.getText().toString();
+
+ mAuth.createUserWithEmailAndPassword(email, password)
+ .addOnCompleteListener(this, new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ Log.d("ye", "createUserWithEmail:onComplete:" + task.isSuccessful());
+
+ // If sign in fails, display a message to the user. If sign in succeeds
+ // the auth state listener will be notified and logic to handle the
+ // signed in user can be handled in the listener.
+ if (!task.isSuccessful()) {
+ Toast.makeText(LoginActivity.this, "sign up failed",
+ Toast.LENGTH_SHORT).show();
+ }
+ else {
+ Intent intent = new Intent(getApplicationContext(), ListActivity.class);
+ startActivity(intent);
+ }
+ }
+ });
+ }
+
+ /**
+ * Attempts to login the Firebase User
+ */
+ private void attemptLogin() {
+ String email = mEmailView.getText().toString();
+ String password = mPasswordView.getText().toString();
+ if (!email.equals("") && !password.equals("")) {
+ mAuth.signInWithEmailAndPassword(email, password)
+ .addOnCompleteListener(this, new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+ Log.d("ye", "signInWithEmail:onComplete:" + task.isSuccessful());
+
+ // If sign in fails, display a message to the user. If sign in succeeds
+ // the auth state listener will be notified and logic to handle the
+ // signed in user can be handled in the listener.
+ if (!task.isSuccessful()) {
+ Log.w("ye", "signInWithEmail:failed", task.getException());
+ Toast.makeText(LoginActivity.this, "Sign in failed",
+ Toast.LENGTH_SHORT).show();
+ }
+
+ else {
+ Intent intent = new Intent(getApplicationContext(), ListActivity.class);
+ startActivity(intent);
+ }
+ }
+ });
+ }
+ }
+
+ @Override
+ public Loader onCreateLoader(int i, Bundle bundle) {
+ return new CursorLoader(this,
+ // Retrieve data rows for the device user's 'profile' contact.
+ Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI,
+ ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION,
+
+ // Select only email addresses.
+ ContactsContract.Contacts.Data.MIMETYPE +
+ " = ?", new String[]{ContactsContract.CommonDataKinds.Email
+ .CONTENT_ITEM_TYPE},
+
+ // Show primary email addresses first. Note that there won't be
+ // a primary email address if the user hasn't specified one.
+ ContactsContract.Contacts.Data.IS_PRIMARY + " DESC");
+ }
+
+ @Override
+ public void onLoadFinished(Loader cursorLoader, Cursor cursor) {
+ List emails = new ArrayList<>();
+ cursor.moveToFirst();
+ while (!cursor.isAfterLast()) {
+ emails.add(cursor.getString(ProfileQuery.ADDRESS));
+ cursor.moveToNext();
+ }
+
+ addEmailsToAutoComplete(emails);
+ }
+
+ @Override
+ public void onLoaderReset(Loader cursorLoader) {}
+
+ /**
+ * Another autocomplete helper function
+ * @param emailAddressCollection
+ */
+ private void addEmailsToAutoComplete(List emailAddressCollection) {
+ //Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
+ ArrayAdapter adapter =
+ new ArrayAdapter<>(LoginActivity.this,
+ android.R.layout.simple_dropdown_item_1line, emailAddressCollection);
+
+ mEmailView.setAdapter(adapter);
+ }
+
+ /**
+ * Necessary to implement autocomplete
+ */
+ private interface ProfileQuery {
+ String[] PROJECTION = {
+ ContactsContract.CommonDataKinds.Email.ADDRESS,
+ ContactsContract.CommonDataKinds.Email.IS_PRIMARY,
+ };
+
+ int ADDRESS = 0;
+ }
+
+}
+
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/NewSocialActivity.java b/app/src/main/java/com/projects/mdb/mdbsocials/NewSocialActivity.java
new file mode 100644
index 0000000..f9a3bf9
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/NewSocialActivity.java
@@ -0,0 +1,89 @@
+package com.projects.mdb.mdbsocials;
+
+import android.content.Intent;
+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.Toast;
+
+import com.google.android.gms.tasks.OnFailureListener;
+import com.google.android.gms.tasks.OnSuccessListener;
+import com.google.firebase.database.DatabaseReference;
+import com.google.firebase.database.FirebaseDatabase;
+import com.google.firebase.storage.FirebaseStorage;
+import com.google.firebase.storage.StorageReference;
+import com.google.firebase.storage.UploadTask;
+
+import java.util.ArrayList;
+
+/**
+ * Creates a new social given the image and other information
+ */
+public class NewSocialActivity extends AppCompatActivity {
+
+ private Uri file;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_new_social);
+ Button submitButton = (Button)findViewById(R.id.submitButton);
+ Button button2 = (Button)findViewById(R.id.button2);
+ final EditText nameEditText = (EditText)findViewById(R.id.nameEditText);
+ final EditText dateEditText = (EditText)findViewById(R.id.dateEditText);
+ final EditText descriptionEditText = (EditText)findViewById(R.id.descriptionEditText);
+ final EditText hostEditText = (EditText)findViewById(R.id.hostEditText);
+ button2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+ intent.setType("image/*");
+ startActivityForResult(intent, 1);
+ }
+ });
+ //TODO this looks messy tho
+ submitButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ final DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
+ final String key = ref.child("socials").push().getKey();
+ StorageReference storageRef = FirebaseStorage.getInstance().getReferenceFromUrl("gs://mdbsocials-700a9.appspot.com");
+ StorageReference riversRef = storageRef.child(key + ".png");
+ riversRef.putFile(file).addOnFailureListener(new OnFailureListener() {
+ @Override
+ public void onFailure(@NonNull Exception exception) {
+ Toast.makeText(NewSocialActivity.this, "need an image!", Toast.LENGTH_SHORT).show();
+ }
+ }).addOnSuccessListener(new OnSuccessListener() {
+ @Override
+ public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
+ String name = nameEditText.getText().toString();
+ String date = dateEditText.getText().toString();
+ String description = descriptionEditText.getText().toString();
+ String creator = hostEditText.getText().toString();
+ Intent intent = new Intent(getApplicationContext(), ListActivity.class);
+ ref.child("socials").child(key).child("name").setValue(name);
+ ref.child("socials").child(key).child("date").setValue(date);
+ ref.child("socials").child(key).child("description").setValue(description);
+ ref.child("socials").child(key).child("creator").setValue(creator);
+ ref.child("socials").child(key).child("interested").setValue(0);
+ ref.child("socials").child(key).child("interestedPeople").setValue(new ArrayList());
+ startActivity(intent);
+ }
+ });
+ }
+ });
+
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (resultCode == RESULT_OK && requestCode == 1) {
+ file = data.getData();
+ }
+ super.onActivityResult(requestCode, resultCode, data);
+ }
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/ScrollingActivity.java b/app/src/main/java/com/projects/mdb/mdbsocials/ScrollingActivity.java
new file mode 100644
index 0000000..d4c99ad
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/ScrollingActivity.java
@@ -0,0 +1,112 @@
+package com.projects.mdb.mdbsocials;
+
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.design.widget.CollapsingToolbarLayout;
+import android.support.design.widget.FloatingActionButton;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.graphics.Palette;
+import android.support.v7.widget.Toolbar;
+import android.util.Log;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.bumptech.glide.Glide;
+import com.google.android.gms.tasks.OnFailureListener;
+import com.google.android.gms.tasks.OnSuccessListener;
+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.GenericTypeIndicator;
+import com.google.firebase.database.ValueEventListener;
+
+import java.util.ArrayList;
+
+/**
+ * Displays details of the Social given a social id
+ */
+public class ScrollingActivity extends AppCompatActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_scrolling);
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ final CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.toolbar_layout);
+ final TextView textView = (TextView)findViewById(R.id.maintext);
+ final String id = getIntent().getStringExtra("id");
+ DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials/" + id);
+ ref.addListenerForSingleValueEvent(new ValueEventListener() {
+ @Override
+ public void onDataChange(DataSnapshot dataSnapshot) {
+ collapsingToolbarLayout.setTitle(dataSnapshot.child("name").getValue(String.class));
+ if (dataSnapshot.child("interestedPeople").getValue() == null) {
+ findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Toast.makeText(ScrollingActivity.this, "sorry no one is interested", Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+ else {
+ final ArrayList jesus = dataSnapshot.child("interestedPeople").getValue(new GenericTypeIndicator>() {});
+ findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(getApplicationContext(), InterestedActivity.class);
+ String[] arr = new String[jesus.size()];
+ for (int i = 0; i < jesus.size(); ++i) {
+ arr[i] = jesus.get(i);
+ }
+ intent.putExtra("interestedPeople", arr);
+ startActivity(intent);
+ }
+ });
+ }
+ Utils.setBitmap(getApplicationContext(), collapsingToolbarLayout, R.id.imageView2, id);
+ textView.setText(dataSnapshot.child("description").getValue(String.class));
+ }
+
+ @Override
+ public void onCancelled(DatabaseError databaseError) {}
+ });
+ FloatingActionButton fab2 = (FloatingActionButton) findViewById(R.id.fab2);
+ fab2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ final String email = FirebaseAuth.getInstance().getCurrentUser().getEmail();
+ final DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials/" + getIntent().getStringExtra("id"));
+ ref.addListenerForSingleValueEvent(new ValueEventListener() {
+ @Override
+ public void onDataChange(DataSnapshot dataSnapshot) {
+ ref.child("interestedPeople").child("" + dataSnapshot.child("interested").getValue(Integer.class)).setValue(email);
+ ref.child("interested").setValue((int)(dataSnapshot.child("interested").getValue(Integer.class) + 1));
+ }
+
+ @Override
+ public void onCancelled(DatabaseError databaseError) {}
+ });
+ }
+ });
+ }
+/*
+ @Override
+ public void onResume() {
+ super.onResume();
+ Utils soc = new Utils();
+ s = soc.getSocialByID(s.getID());
+ Log.d("yo", s.getID());
+ collapsingToolbarLayout.setTitle(s.getName());
+ textView.setText(s.getDescription() + '\n' + s.getDate());
+ }
+ */
+
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/SocialsAdapter.java b/app/src/main/java/com/projects/mdb/mdbsocials/SocialsAdapter.java
new file mode 100644
index 0000000..d08f64c
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/SocialsAdapter.java
@@ -0,0 +1,109 @@
+package com.projects.mdb.mdbsocials;
+
+/**
+ * Created by Aayush on 10/3/2016.
+ */
+
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.annotation.NonNull;
+import android.support.v7.graphics.Palette;
+import android.support.v7.widget.CardView;
+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.TextView;
+import android.widget.Toast;
+
+import com.bumptech.glide.Glide;
+import com.google.android.gms.tasks.OnFailureListener;
+import com.google.android.gms.tasks.OnSuccessListener;
+import com.google.firebase.storage.FirebaseStorage;
+
+import java.util.ArrayList;
+
+import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
+
+
+/**
+ * Created by Aayush on 9/28/2016.
+ */
+
+public class SocialsAdapter extends RecyclerView.Adapter {
+
+ private Context context;
+ private ArrayList socialist;
+
+ public SocialsAdapter(Context context, ArrayList socialist) {
+ this.context = context;
+ this.socialist = socialist;
+ }
+
+
+ @Override
+ public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.socials_row_view, parent, false);
+ return new CustomViewHolder(view);
+ }
+
+
+ @Override
+ public void onBindViewHolder(final CustomViewHolder holder, int position) {
+ Utils.Social social = socialist.get(position);
+ holder.eventNameTextView.setText(social.getName());
+ holder.numberTextView.setText("" + social.getInterested() + " people are interested");
+ if (social.getInterested() == 1) {holder.numberTextView.setText("1 person is interested");}
+ holder.creatorTextView.setText("Created by " + social.getCreator() + " on " + social.getDate());
+ Utils.setBitmap(context, holder.cardView, holder.imageView.getId(), social.getID());
+ }
+
+
+ @Override
+ public int getItemCount() {
+ return socialist.size();
+ }
+
+ /**
+ * A card displayed in the RecyclerView
+ */
+ class CustomViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
+ TextView eventNameTextView;
+ ImageView imageView;
+ TextView numberTextView;
+ TextView creatorTextView;
+ CardView cardView;
+
+ public CustomViewHolder (View view) {
+ super(view);
+ this.eventNameTextView = (TextView) view.findViewById(R.id.eventNameTextView);
+ this.imageView = (ImageView) view.findViewById(R.id.imageView);
+ this.numberTextView = (TextView) view.findViewById(R.id.numberTextView);
+ this.creatorTextView = (TextView) view.findViewById(R.id.creatorTextView);
+ this.cardView = (CardView) view.findViewById(R.id.card);
+ view.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ /*Get adapter position is getting the number of the row that was clicked,
+ starting at 0
+ */
+ Toast.makeText(context, "yooooooo", Toast.LENGTH_SHORT).show();
+ Utils.Social s = socialist.get(getAdapterPosition());
+ Intent intent = new Intent(context, ScrollingActivity.class);
+ String[] info = {(String)creatorTextView.getText(),
+ s.getDescription(),
+ (String)numberTextView.getText(),
+ (String)eventNameTextView.getText()};
+ intent.putExtra("id", s.getID());
+ intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+ }
+ }
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/SplashActivity.java b/app/src/main/java/com/projects/mdb/mdbsocials/SplashActivity.java
new file mode 100644
index 0000000..dce4355
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/SplashActivity.java
@@ -0,0 +1,23 @@
+package com.projects.mdb.mdbsocials;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+
+/**
+ * Created by Aayush on 10/15/2016.
+ *
+ * A simple Splash Activity that displays a blue screen with the app icon in the middle
+ */
+
+public class SplashActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Intent intent = new Intent(this, LoginActivity.class);
+ startActivity(intent);
+ finish();
+ }
+}
diff --git a/app/src/main/java/com/projects/mdb/mdbsocials/Utils.java b/app/src/main/java/com/projects/mdb/mdbsocials/Utils.java
new file mode 100644
index 0000000..d21a177
--- /dev/null
+++ b/app/src/main/java/com/projects/mdb/mdbsocials/Utils.java
@@ -0,0 +1,183 @@
+package com.projects.mdb.mdbsocials;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.support.annotation.NonNull;
+import android.support.v7.graphics.Palette;
+import android.util.Log;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import com.bumptech.glide.Glide;
+import com.google.android.gms.tasks.OnFailureListener;
+import com.google.android.gms.tasks.OnSuccessListener;
+import com.google.firebase.database.ChildEventListener;
+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.GenericTypeIndicator;
+import com.google.firebase.database.ValueEventListener;
+import com.google.firebase.storage.FirebaseStorage;
+
+import java.util.ArrayList;
+
+/**
+ * Created by Aayush on 10/4/2016.
+ */
+
+//long live the revolution
+public class Utils {
+ private DatabaseReference ref;
+ private ArrayList socialist;
+
+ /**
+ * initializes list of socials Socialist
+ */
+ public Utils() {
+ socialist = new ArrayList();
+ ref = FirebaseDatabase.getInstance().getReference("/socials");
+ ref.orderByChild("date").addChildEventListener(new ChildEventListener() {
+ @Override
+ public void onChildAdded(DataSnapshot dataSnapshot, String s) {
+ Log.d(dataSnapshot.getKey(), dataSnapshot.getValue().toString());
+ if (dataSnapshot.child("interested").getValue() == null) {
+ socialist.add(new Social(dataSnapshot.getKey(),
+ dataSnapshot.child("creator").getValue(String.class),
+ dataSnapshot.child("date").getValue(String.class),
+ dataSnapshot.child("description").getValue(String.class),
+ dataSnapshot.child("name").getValue(String.class)));
+ }
+ else {
+ socialist.add(new Social(dataSnapshot.getKey(),
+ dataSnapshot.child("creator").getValue(String.class),
+ dataSnapshot.child("date").getValue(String.class),
+ dataSnapshot.child("description").getValue(String.class),
+ dataSnapshot.child("interested").getValue(Integer.class),
+ dataSnapshot.child("name").getValue(String.class),
+ dataSnapshot.child("interestedPeople").getValue(new GenericTypeIndicator>() {
+ })));
+ }
+ }
+
+ @Override
+ public void onChildChanged(DataSnapshot dataSnapshot, String s) {
+
+ }
+
+ @Override
+ public void onChildRemoved(DataSnapshot dataSnapshot) {
+
+ }
+
+ @Override
+ public void onChildMoved(DataSnapshot dataSnapshot, String s) {
+
+ }
+
+ @Override
+ public void onCancelled(DatabaseError databaseError) {
+
+ }
+ });
+
+ }
+
+ /**
+ * @return the list of socials
+ */
+ public ArrayList getSocialist() {
+ return socialist;
+ }
+
+ /**
+ * A class to represent a social
+ */
+ public class Social{
+ private String creator;
+ private String date;
+ private String description;
+ private int interested = 0;
+ private String id;
+ private String name;
+
+ public Social(String id, String creator, String date, String description, String name) {
+ this.name = name;
+ this.description = description;
+ this.creator = creator;
+ this.date = date;
+ this.id = id;
+ }
+
+ public Social(String id, String creator, String date, String description, int interested, String name, ArrayList interestedPeople) {
+ this.name = name;
+ this.interested = interested;
+ this.description = description;
+ this.creator = creator;
+ this.date = date;
+ this.id = id;
+ }
+
+ //TODO get rid of unused functions
+ public String getCreator() {return creator;}
+ public void setCreator(String creator) {this.creator = creator;}
+ public String getDate() {return date;}
+ public String getDescription() {return description;}
+ public int getInterested() {return interested;}
+ public String getName() {return name;}
+ public void setName(String name) {this.name = name;}
+ public String getID() {return id;}
+ }
+
+ /**
+ * sets the bitmap of the image view and the background color using Palette
+ * @param context
+ * @param view containing view of imageViewId
+ * @param imageViewId
+ * @param id
+ */
+ public static void setBitmap(final Context context, final View view, final int imageViewId, String id) {
+ class DownloadFilesTask extends AsyncTask {
+ protected Bitmap doInBackground(String... strings) {
+ try {return Glide.
+ with(context).
+ load(strings[0]).
+ asBitmap().
+ into(100, 100). // Width and height
+ get();}
+ catch (Exception e) {return null;}
+ }
+
+ protected void onProgressUpdate(Void... progress) {}
+
+ protected void onPostExecute(Bitmap result) {
+ ((ImageView)view.findViewById(imageViewId)).setImageBitmap(result);
+ Palette.PaletteAsyncListener paletteListener = new Palette.PaletteAsyncListener() {
+ public void onGenerated(Palette palette) {
+ int defaulto = 0x000000;
+ view.setBackgroundColor(palette.getDominantColor(defaulto));
+ }
+ };
+ if (result != null && !result.isRecycled()) {
+ Palette.from(result).generate(paletteListener);
+ }
+ }
+ }
+
+ FirebaseStorage.getInstance().getReferenceFromUrl("gs://mdbsocials-700a9.appspot.com").child(id + ".png").getDownloadUrl().addOnSuccessListener(new OnSuccessListener() {
+ @Override
+ public void onSuccess(Uri uri) {
+ Log.d("ye", uri.toString());
+ new DownloadFilesTask().execute(uri.toString());
+ }
+ }).addOnFailureListener(new OnFailureListener() {
+ @Override
+ public void onFailure(@NonNull Exception exception) {
+ Log.d("sad", exception.toString());
+ }
+ });
+ }
+}
diff --git a/app/src/main/res/drawable/background_splash.xml b/app/src/main/res/drawable/background_splash.xml
new file mode 100644
index 0000000..cc5d298
--- /dev/null
+++ b/app/src/main/res/drawable/background_splash.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+ -
+
+
+
+
\ No newline at end of file
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..b9b8eca
--- /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/ic_people_black_24dp.xml b/app/src/main/res/drawable/ic_people_black_24dp.xml
new file mode 100644
index 0000000..4cfd869
--- /dev/null
+++ b/app/src/main/res/drawable/ic_people_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_star_black_24dp.xml b/app/src/main/res/drawable/ic_star_black_24dp.xml
new file mode 100644
index 0000000..fa1c999
--- /dev/null
+++ b/app/src/main/res/drawable/ic_star_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_interested.xml b/app/src/main/res/layout/activity_interested.xml
new file mode 100644
index 0000000..38fd67c
--- /dev/null
+++ b/app/src/main/res/layout/activity_interested.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_list.xml b/app/src/main/res/layout/activity_list.xml
new file mode 100644
index 0000000..7b71fa8
--- /dev/null
+++ b/app/src/main/res/layout/activity_list.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
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..dbe4049
--- /dev/null
+++ b/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_new_social.xml b/app/src/main/res/layout/activity_new_social.xml
new file mode 100644
index 0000000..2853c62
--- /dev/null
+++ b/app/src/main/res/layout/activity_new_social.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_scrolling.xml b/app/src/main/res/layout/activity_scrolling.xml
new file mode 100644
index 0000000..391f8a7
--- /dev/null
+++ b/app/src/main/res/layout/activity_scrolling.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/content_scrolling.xml b/app/src/main/res/layout/content_scrolling.xml
new file mode 100644
index 0000000..261e206
--- /dev/null
+++ b/app/src/main/res/layout/content_scrolling.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/interested_row_view.xml b/app/src/main/res/layout/interested_row_view.xml
new file mode 100644
index 0000000..abca4fe
--- /dev/null
+++ b/app/src/main/res/layout/interested_row_view.xml
@@ -0,0 +1,17 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/socials_row_view.xml b/app/src/main/res/layout/socials_row_view.xml
new file mode 100644
index 0000000..09f59b7
--- /dev/null
+++ b/app/src/main/res/layout/socials_row_view.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
new file mode 100644
index 0000000..f32ad8f
--- /dev/null
+++ b/app/src/main/res/menu/menu_main.xml
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_scrolling.xml b/app/src/main/res/menu/menu_scrolling.xml
new file mode 100644
index 0000000..37e74c8
--- /dev/null
+++ b/app/src/main/res/menu/menu_scrolling.xml
@@ -0,0 +1,10 @@
+
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..cc28b75
--- /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..62df187
--- /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..eabf18c
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #041E42
+ #041E42
+ #FFC72C
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..586d3ea
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,8 @@
+
+
+ 16dp
+ 16dp
+ 16dp
+ 180dp
+ 16dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..7af2b91
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,108 @@
+
+ MDB Socials
+
+
+ Email
+ Password (optional)
+ Sign in or register
+ Sign in
+ This email address is invalid
+ This password is too short
+ This password is incorrect
+ This field is required
+ "Contacts permissions are needed for providing email
+ completions."
+
+ SocialsListActivity
+ ScrollingActivity
+
+ "Material is the metaphor.\n\n"
+
+ "A material metaphor is the unifying theory of a rationalized space and a system of motion."
+ "The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
+ "technologically advanced and open to imagination and magic.\n"
+ "Surfaces and edges of the material provide visual cues that are grounded in reality. The "
+ "use of familiar tactile attributes helps users quickly understand affordances. Yet the "
+ "flexibility of the material creates new affordances that supercede those in the physical "
+ "world, without breaking the rules of physics.\n"
+ "The fundamentals of light, surface, and movement are key to conveying how objects move, "
+ "interact, and exist in space and in relation to each other. Realistic lighting shows "
+ "seams, divides space, and indicates moving parts.\n\n"
+
+ "Bold, graphic, intentional.\n\n"
+
+ "The foundational elements of print based design typography, grids, space, scale, color, "
+ "and use of imagery guide visual treatments. These elements do far more than please the "
+ "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
+ "imagery, large scale typography, and intentional white space create a bold and graphic "
+ "interface that immerse the user in the experience.\n"
+ "An emphasis on user actions makes core functionality immediately apparent and provides "
+ "waypoints for the user.\n\n"
+
+ "Motion provides meaning.\n\n"
+
+ "Motion respects and reinforces the user as the prime mover. Primary user actions are "
+ "inflection points that initiate motion, transforming the whole design.\n"
+ "All action takes place in a single environment. Objects are presented to the user without "
+ "breaking the continuity of experience even as they transform and reorganize.\n"
+ "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
+ "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
+
+ "3D world.\n\n"
+
+ "The material environment is a 3D space, which means all objects have x, y, and z "
+ "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
+ "positive z-axis extending towards the viewer. Every sheet of material occupies a single "
+ "position along the z-axis and has a standard 1dp thickness.\n"
+ "On the web, the z-axis is used for layering and not for perspective. The 3D world is "
+ "emulated by manipulating the y-axis.\n\n"
+
+ "Light and shadow.\n\n"
+
+ "Within the material environment, virtual lights illuminate the scene. Key lights create "
+ "directional shadows, while ambient light creates soft shadows from all angles.\n"
+ "Shadows in the material environment are cast by these two light sources. In Android "
+ "development, shadows occur when light sources are blocked by sheets of material at "
+ "various positions along the z-axis. On the web, shadows are depicted by manipulating the "
+ "y-axis only. The following example shows the card with a height of 6dp.\n\n"
+
+ "Resting elevation.\n\n"
+
+ "All material objects, regardless of size, have a resting elevation, or default elevation "
+ "that does not change. If an object changes elevation, it should return to its resting "
+ "elevation as soon as possible.\n\n"
+
+ "Component elevations.\n\n"
+
+ "The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
+ "does not vary from 6dp in one app to 16dp in another app).\n"
+ "Components may have different resting elevations across platforms, depending on the depth "
+ "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
+
+ "Responsive elevation and dynamic elevation offsets.\n\n"
+
+ "Some component types have responsive elevation, meaning they change elevation in response "
+ "to user input (e.g., normal, focused, and pressed) or system events. These elevation "
+ "changes are consistently implemented using dynamic elevation offsets.\n"
+ "Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
+ "to the component’s resting state. They ensure that elevation changes are consistent "
+ "across actions and component types. For example, all components that lift on press have "
+ "the same elevation change relative to their resting elevation.\n"
+ "Once the input event is completed or cancelled, the component will return to its resting "
+ "elevation.\n\n"
+
+ "Avoiding elevation interference.\n\n"
+
+ "Components with responsive elevations may encounter other components as they move between "
+ "their resting elevations and dynamic elevation offsets. Because material cannot pass "
+ "through other material, components avoid interfering with one another any number of ways, "
+ "whether on a per component basis or using the entire app layout.\n"
+ "On a component level, components can move or be removed before they cause interference. "
+ "For example, a floating action button (FAB) can disappear or move off screen before a "
+ "user picks up a card, or it can move if a snackbar appears.\n"
+ "On the layout level, design your app layout to minimize opportunities for interference. "
+ "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
+ "when a user tries to pick up one of cards.\n\n"
+
+ Settings
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..5598cff
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/projects/mdb/mdbsocials/ExampleUnitTest.java b/app/src/test/java/com/projects/mdb/mdbsocials/ExampleUnitTest.java
new file mode 100644
index 0000000..6ad3ea9
--- /dev/null
+++ b/app/src/test/java/com/projects/mdb/mdbsocials/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.pokedex.mdb.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..f27cdb9
--- /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.0'
+ classpath 'com.google.gms:google-services:3.0.0'
+ // 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/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..3530b01
--- /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 100644
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..d3db109
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'