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..421dc48 --- /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..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..6b5cfcb --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,30 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 25 + buildToolsVersion "25.0.3" + defaultConfig { + applicationId "com.bignerdranch.android.mdbfirstminiappproject" + minSdkVersion 15 + targetSdkVersion 25 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(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:25.3.1' + compile 'com.android.support.constraint:constraint-layout:1.0.2' + testCompile 'junit:junit:4.12' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..6b4e1e8 --- /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 C:\Users\pauls\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 *; +#} + +# 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/bignerdranch/android/mdbfirstminiappproject/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/bignerdranch/android/mdbfirstminiappproject/ExampleInstrumentedTest.java new file mode 100644 index 0000000..341feba --- /dev/null +++ b/app/src/androidTest/java/com/bignerdranch/android/mdbfirstminiappproject/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.bignerdranch.android.mdbfirstminiappproject; + +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.bignerdranch.android.mdbfirstminiappproject", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..303e3e4 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/bignerdranch/android/mdbfirstminiappproject/Databse.java b/app/src/main/java/com/bignerdranch/android/mdbfirstminiappproject/Databse.java new file mode 100644 index 0000000..6a55be9 --- /dev/null +++ b/app/src/main/java/com/bignerdranch/android/mdbfirstminiappproject/Databse.java @@ -0,0 +1,109 @@ +package com.bignerdranch.android.mdbfirstminiappproject; + +/** + * Created by pauls on 9/15/2017. + */ + +public class Databse { + + Integer [] memberPics = { + R.drawable.aayushtyagi, + R.drawable.abhinavkoppu, + R.drawable.adhirajdatar, + R.drawable.akkshaykhoslaa, + R.drawable.amyshen, + R.drawable.aneeshjindal, + R.drawable.ashwinvaidyanathan, + R.drawable.bengoldberg, + R.drawable.billylu, + R.drawable.borisyue, + R.drawable.candiceye, + R.drawable.codyhsieh, + R.drawable.danielandrews, + R.drawable.edwardliu, + R.drawable.eliothan, + R.drawable.emaanhariri, + R.drawable.erickong, + R.drawable.jaredgutierrez, + R.drawable.jeffreyzhang, + R.drawable.jessicachen, + R.drawable.julialuo, + R.drawable.justinkim, + R.drawable.kevinjiang, + R.drawable.krishnanrajiyah, + R.drawable.kristinho, + R.drawable.leonkwak, + R.drawable.leviwalsh, + R.drawable.mohitkatyal, + R.drawable.muditmittal, + R.drawable.peterschafhalter, + R.drawable.radhikadhomse, + R.drawable.rochelleshen, + R.drawable.sahillamba, + R.drawable.sarahtang, + R.drawable.sayanpaul, + R.drawable.shariewang, + R.drawable.shivkushwah, + R.drawable.shreyareddy, + R.drawable.shubhamgoenka, + R.drawable.sumukhshivakumar, + R.drawable.tarunkhasnavis, + R.drawable.victorsun, + R.drawable.vidyaravikumar, + R.drawable.wilburshi, + R.drawable.younglin, + R.drawable.zachgovani + + }; + + String [] answer = { + "Aayush Tyagi", + "Abhinav Koppu", + "Adhiraj Datar", + "Akkshay Khoslaa", + "Amy Shen", + "Aneesh Jindal", + "Ashwin Vaidyanathan", + "Ben Goldberg", + "Billy Lu", + "Boris Yue", + "Candice Ye", + "Cody Hsieh", + "Daniel Andrews", + "Edward Liu", + "Eliot Han", + "Emaan Hariri", + "Eric Kong", + "Jared Gutierrez", + "Jeffrey Zhang", + "Jessica Chen", + "Julia Luo", + "Justin Kim", + "Kevin Jiang", + "Krishnan Rajiyah", + "Kristin Ho", + "Leon Kwak", + "Levi Walsh", + "Mohit Katyal", + "Mudit Mittal", + "Peter Schafhalter", + "Radhikad Homse", + "Rochelle Shen", + "Sahil Lamba", + "Sarah Tang", + "Sayan Paul", + "Sharie Wang", + "Shivkush Wah", + "Shreya Reddy", + "Shubham Goenka", + "Sumukh Shivakumar", + "Tarun Khasnavis", + "Victor Sun", + "Vidyara Vikumar", + "Wibur Shi", + "Young Lin", + "Zach Govani" + + + }; +} diff --git a/app/src/main/java/com/bignerdranch/android/mdbfirstminiappproject/MainActivity.java b/app/src/main/java/com/bignerdranch/android/mdbfirstminiappproject/MainActivity.java new file mode 100644 index 0000000..c8e5b9d --- /dev/null +++ b/app/src/main/java/com/bignerdranch/android/mdbfirstminiappproject/MainActivity.java @@ -0,0 +1,380 @@ +package com.bignerdranch.android.mdbfirstminiappproject; + +import android.content.DialogInterface; +import android.content.Intent; +import android.os.CountDownTimer; +import android.provider.ContactsContract; +import android.support.v7.app.AlertDialog; +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 org.w3c.dom.Text; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; + +public class MainActivity extends AppCompatActivity { + //initiating the four buttons + Button firstChoice; + Button secondChoice; + Button thirdChoice; + Button fourthChoice; + CountDownTimer mCountDown; + + //initiating the end game button (to be worked on) + Button endGame; + + //initiating an int variable for storing the overall score + int initialScore =0; + + //initiating the textviews that keep track of the score and the time + TextView gameScore ; + TextView time; + + //Initiating the imageview that contain MDB members' photos + ImageView memberPics; + + //Creating a MemberItem list with each member's photo corresponding to his/her name + List list; + + //creating a random generator + Random r; + + + int turn = 1; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + r = new Random(); + + memberPics = (ImageView)findViewById(R.id.memberPic); + + firstChoice = (Button)findViewById(R.id.firstChoice); + secondChoice = (Button)findViewById(R.id.secondChoice); + thirdChoice = (Button)findViewById(R.id.thirdChoice); + fourthChoice = (Button)findViewById(R.id.fourthChoice); + gameScore = (TextView)findViewById(R.id.gameScore); + endGame = (Button)findViewById(R.id.endGameButton); + //Initial game score = 0 + gameScore.setText(""+0); + time = (TextView)findViewById(R.id.time); + + list = new ArrayList<>(); + + //add all member photos and names to the list + for (int i=0; i + + + + +