From abe500f903903a08a475dc772ce5c18a936f0f30 Mon Sep 17 00:00:00 2001 From: jhejna Date: Fri, 29 Sep 2017 23:21:12 -0700 Subject: [PATCH 1/3] project submission --- .gitignore | 9 + .idea/compiler.xml | 22 +++ .idea/copyright/profiles_settings.xml | 3 + .idea/gradle.xml | 18 ++ .idea/misc.xml | 46 +++++ .idea/modules.xml | 9 + .idea/runConfigurations.xml | 12 ++ README.md | 1 + app/.gitignore | 1 + app/build.gradle | 44 +++++ app/google-services.json | 42 +++++ app/proguard-rules.pro | 25 +++ .../mdbsocials/ExampleInstrumentedTest.java | 26 +++ app/src/main/AndroidManifest.xml | 25 +++ .../example/joey/mdbsocials/CreateSocial.java | 124 ++++++++++++++ .../example/joey/mdbsocials/EventProfile.java | 105 ++++++++++++ .../example/joey/mdbsocials/FeedActivity.java | 89 ++++++++++ .../joey/mdbsocials/LoginActivity.java | 100 +++++++++++ .../joey/mdbsocials/SignUpActivity.java | 79 +++++++++ .../com/example/joey/mdbsocials/Social.java | 23 +++ .../joey/mdbsocials/SocialAdapter.java | 87 ++++++++++ .../main/res/drawable/ic_add_black_24dp.xml | 9 + app/src/main/res/drawable/mdblogo.png | Bin 0 -> 20795 bytes .../res/layout/activity_create_social.xml | 140 +++++++++++++++ .../res/layout/activity_event_profile.xml | 110 ++++++++++++ app/src/main/res/layout/activity_feed.xml | 32 ++++ app/src/main/res/layout/activity_login.xml | 108 ++++++++++++ app/src/main/res/layout/activity_sign_up.xml | 120 +++++++++++++ app/src/main/res/layout/social_row.xml | 87 ++++++++++ app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3418 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4208 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2206 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2555 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4842 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6114 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7718 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10056 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10486 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14696 bytes app/src/main/res/values/colors.xml | 6 + app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/styles.xml | 13 ++ .../joey/mdbsocials/ExampleUnitTest.java | 17 ++ build.gradle | 29 ++++ gradle.properties | 17 ++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53636 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 160 ++++++++++++++++++ gradlew.bat | 90 ++++++++++ settings.gradle | 1 + 50 files changed, 1838 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 README.md create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/google-services.json create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/com/example/joey/mdbsocials/ExampleInstrumentedTest.java create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/example/joey/mdbsocials/CreateSocial.java create mode 100644 app/src/main/java/com/example/joey/mdbsocials/EventProfile.java create mode 100644 app/src/main/java/com/example/joey/mdbsocials/FeedActivity.java create mode 100644 app/src/main/java/com/example/joey/mdbsocials/LoginActivity.java create mode 100644 app/src/main/java/com/example/joey/mdbsocials/SignUpActivity.java create mode 100644 app/src/main/java/com/example/joey/mdbsocials/Social.java create mode 100644 app/src/main/java/com/example/joey/mdbsocials/SocialAdapter.java create mode 100644 app/src/main/res/drawable/ic_add_black_24dp.xml create mode 100644 app/src/main/res/drawable/mdblogo.png create mode 100644 app/src/main/res/layout/activity_create_social.xml create mode 100644 app/src/main/res/layout/activity_event_profile.xml create mode 100644 app/src/main/res/layout/activity_feed.xml create mode 100644 app/src/main/res/layout/activity_login.xml create mode 100644 app/src/main/res/layout/activity_sign_up.xml create mode 100644 app/src/main/res/layout/social_row.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 app/src/test/java/com/example/joey/mdbsocials/ExampleUnitTest.java create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle 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/README.md b/README.md new file mode 100644 index 0000000..d43b488 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# MDBSocials 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..74f9626 --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/CreateSocial.java @@ -0,0 +1,124 @@ +package com.example.joey.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.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 { + + private Uri file; + private Button createSocial; + private Button addImage; + private EditText socialName; + private EditText socialDate; + private EditText socialDescription; + private ImageView previewImage; + + private final DatabaseReference ref = FirebaseDatabase.getInstance().getReference("/socials"); + private StorageReference storageReference = FirebaseStorage.getInstance().getReference(); + private FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_create_social); + + createSocial = (Button) findViewById(R.id.createSocial); + addImage = (Button) findViewById(R.id.addImage); + socialName = (EditText) findViewById(R.id.socialName); + socialDate = (EditText) findViewById(R.id.profileDate); + socialDescription = (EditText) findViewById(R.id.socalDescription); + previewImage = (ImageView) findViewById(R.id.imagePreview); + + addImage.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.setType("image/*"); + startActivityForResult(intent, 1); + } + }); + + createSocial.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + //check to see if image exists + if(file == null){ + Toast.makeText(CreateSocial.this, "no image selected!", Toast.LENGTH_SHORT).show(); + return; + } + //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(CreateSocial.this, "no image selected!", Toast.LENGTH_SHORT).show(); + } + }).addOnSuccessListener(new OnSuccessListener() { + @Override + public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { + String name = socialName.getText().toString(); + if(name.equals("")){ + name = "No name"; + } + String date = socialDate.getText().toString(); + if(date.equals("")){ + date = "N/A"; + } + String description = socialDescription.getText().toString(); + if(description.equals("")){ + description = "No description"; + } + String owner = user.getEmail(); + //add to firebase + ref.child(key).child("interested").setValue(0); + ref.child(key).child("timestamp").setValue(ServerValue.TIMESTAMP); + ref.child(key).child("name").setValue(name); + ref.child(key).child("date").setValue(date); + ref.child(key).child("description").setValue(description); + ref.child(key).child("owner").setValue(owner); + + Intent returnIntent = new Intent(CreateSocial.this, FeedActivity.class); + startActivity(returnIntent); + + } + }); + + + } + }); + + } + + @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..b5942c8 --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/EventProfile.java @@ -0,0 +1,105 @@ +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.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); + + StorageReference storageReference = FirebaseStorage.getInstance().getReference().child(id+".png"); + Glide.with(getApplicationContext()).using(new FirebaseImageLoader()).load(storageReference).into((ImageView) findViewById(R.id.profileImage)); + //use transaction to update the number + + + 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())){ + String key = ref.child("people").push().getKey(); + ref.child("people").child(key).setValue(user.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) { + // Transaction completed + } + }); + 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); + } + }); + + + } + + + +} 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..53aee70 --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/FeedActivity.java @@ -0,0 +1,89 @@ +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 { + + 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); + + ref.orderByChild("timestamp").addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(DataSnapshot dataSnapshot) { + ArrayList newSocials = new ArrayList<>(); + for (DataSnapshot socialObject : dataSnapshot.getChildren()){ + Log.d("WTF", socialObject.child("interested").getValue().getClass().toString()); + Log.d("WTF", socialObject.child("interested").getValue().toString()); + + Social social = new Social(socialObject.getKey(), + socialObject.child("owner").getValue(String.class), + socialObject.child("name").getValue(String.class), + socialObject.child("date").getValue(String.class), + socialObject.child("description").getValue(String.class), + socialObject.child("interested").getValue(Integer.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(FeedActivity.this,"Oh no! Database error!", Toast.LENGTH_SHORT); + } + }); + + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.newSocialFAB); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intent = new Intent(getApplicationContext(), CreateSocial.class); + startActivity(intent); + } + }); + + } + + @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/LoginActivity.java b/app/src/main/java/com/example/joey/mdbsocials/LoginActivity.java new file mode 100644 index 0000000..99aaeec --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/LoginActivity.java @@ -0,0 +1,100 @@ +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 { + + private static FirebaseAuth mAuth; + private FirebaseAuth.AuthStateListener mAuthListener; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + + 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"); + } + } + }; + + //maybe put the listener attachment in onCreate not onStart? + mAuth.addAuthStateListener(mAuthListener); + + ((Button) findViewById(R.id.loginButton)).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + attemptLogin(); + } + }); + + + ((Button) findViewById(R.id.signUpButton)).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(LoginActivity.this, SignUpActivity.class); + startActivity(intent); + } + }); + + } + + private void attemptLogin() { + String email = ((EditText) findViewById(R.id.emailText)).getText().toString(); + String password = ((EditText) findViewById(R.id.passwordText)).getText().toString(); + if (!email.equals("") && !password.equals("")) { + mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this, 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(LoginActivity.this, "Login failed!", Toast.LENGTH_SHORT).show(); + }else { + Intent intent = new Intent(LoginActivity.this, FeedActivity.class); + startActivity(intent); + Toast.makeText(LoginActivity.this, "Login SUCCESS!", Toast.LENGTH_SHORT).show(); + + } + + } + }); + + } + } + + @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..f408898 --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/SignUpActivity.java @@ -0,0 +1,79 @@ +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 { + + private FirebaseAuth mAuth; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_sign_up); + + mAuth = FirebaseAuth.getInstance(); + + ((Button) findViewById(R.id.createAccountButton)).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + attemptSignup(); + } + }); + + } + + private void attemptSignup(){ + 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(); + if(email.equals("")){ + Toast.makeText(SignUpActivity.this, "Enter Valid email!", Toast.LENGTH_SHORT).show(); + } + else if(pass1.equals("") || pass2.equals("")){ + Toast.makeText(SignUpActivity.this, "Complete both password banks!", Toast.LENGTH_SHORT).show(); + } + else if(!pass1.equals(pass2)){ + Toast.makeText(SignUpActivity.this, "Passwords do not match!", Toast.LENGTH_SHORT).show(); + }else{ + mAuth.createUserWithEmailAndPassword(email, pass1).addOnCompleteListener(this, new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + if(!task.isSuccessful()) { + Toast.makeText(SignUpActivity.this, "Signup failed!", Toast.LENGTH_SHORT).show(); + }else { + Intent intent = new Intent(SignUpActivity.this, FeedActivity.class); + startActivity(intent); + } + } + }); + } + + } + @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..f127d13 --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/Social.java @@ -0,0 +1,23 @@ +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(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; + } + +} \ 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..95bfd64 --- /dev/null +++ b/app/src/main/java/com/example/joey/mdbsocials/SocialAdapter.java @@ -0,0 +1,87 @@ +package com.example.joey.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 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 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); + + StorageReference storageReference = FirebaseStorage.getInstance().getReference().child(social.id+".png"); + Glide.with(context).using(new FirebaseImageLoader()).load(storageReference).into(holder.eventImage); + + } + + @Override + public int getItemCount(){ + return socials.size(); + } + + class SocialViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { + TextView eventName; + ImageView eventImage; + TextView interestedCount; + TextView emailText; + + public SocialViewHolder(View v){ + super(v); + eventName = (TextView) v.findViewById(R.id.eventName); + eventImage = (ImageView) v.findViewById(R.id.eventImage); + interestedCount = (TextView) v.findViewById(R.id.eventInterested); + emailText = (TextView) v.findViewById(R.id.eventEmail); + 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 0000000000000000000000000000000000000000..52954230d0b2693787d5f42bd5d9dd2783ab17b7 GIT binary patch literal 20795 zcma%iWmp^E)AkaATX1)Gw;~NRP}~YFPSDcgP~2UMJB3mT6e#ZQ?oeEdI}|U)p8WpT z^?rXh+3fDwWHaaNnc2DLo{7{@dyRuhfe8Qrj-mog3jmOG5&Qn=sEE&!>LoA42K-(| zRR#d6;;0N}*}00AKY@DI@xunz#Pd;o9=2Y?sp06^;arCC!FaRSv$ z`85o9{_mCB_9F?=g5e-9?}FIsA=WN{Q3>PezeYy|z5g2F|6Bjq$W9=3&^{@u%Asvw zP(rx*0`bWW5KS0vjxz5NGG6^}RjK`s_zw+05hkPUv2>E{4yT%}d+yjjm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$;4k;j^X zV4qsTuapt?2j{mGz7EEWrsXJFnTteWHa!ZwVj#Eup0jTTL9-1kO=1~;)S<@OgafM& z74OxjU*;sZ*X%y{X5QqLs<80BzJOGwxSH zw_XPY`$dup!el zR{6)$o5kgRzDATxM@4lGKw79}K;foO;#D`&lfgS4Qg2lXE0f6ty{UAUf=b3I1e_RTYk<{r6<|jDqT2`fa`OPUH|fOO%#amRzsPIj zjFcJ9JoMTwp}^~uFUdNiZx;Zgot1is_AK`nhSopoajw9+yN61J4|H&)M*EaZ;jBM! zw24(>np?vMuXyQ=c^!V-#6`=9mMfT+xt5zgj6+``c@ar<)KUqi*M}3E*96Yip;VsK zcCmu=@2FypSgS{$35gXuDJlJJKE6g@HnW*pua30I_p}5D7g>(SC=ZR7@oU$>D}`Is zL8B9?trgHT(5B=d!qIWs@`*{sY+r0eK*8?hin_O zq$$`2OFa^8X^dM7-#I-w+0LF6f{tk)3 z-uk$92WG|!6%zaZ9r%F$KWyqm-wP^;D@aCzK&e1oM4*Rjpr@KU#*?uCiVy`Ac?e8i zQN;=ZQ@eSSG36mDY7od4M{nQ%0{HlO+((A}UjS6;e*lmb*5?cWV4!QN(*$>U_#bsK B=e_^{ literal 0 HcmV?d00001 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 @@ + + + + + + + + + + + + + + + + + +