From 391d055cc25bd02250da07c8b8b5b7ad0adf2a2e Mon Sep 17 00:00:00 2001 From: Adithya J Date: Tue, 7 Mar 2017 21:50:31 +0530 Subject: [PATCH] :sparkles: Add New Menu items --- app/build.gradle | 4 +- app/src/main/assets/events.json | 6 +-- .../instincts/activities/AboutActivity.java | 23 +++++++++++ .../instincts/activities/EventsActivity.java | 4 ++ .../activities/HospitalityActivity.java | 11 +++++ .../instincts/activities/MapsActivity.java | 2 + .../activities/ScheduleActivity.java | 4 ++ app/src/main/res/drawable/ic_facebook.xml | 27 +++++++++++++ app/src/main/res/drawable/ic_instagram.xml | 27 +++++++++++++ app/src/main/res/drawable/ic_local_pizza.xml | 27 +++++++++++++ app/src/main/res/drawable/ic_twitter.xml | 27 +++++++++++++ app/src/main/res/layout/fragment_buses.xml | 14 ++++++- app/src/main/res/menu/menu_about.xml | 40 +++++++++++++++++++ app/src/main/res/menu/menu_events.xml | 7 ++++ 14 files changed, 217 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/ic_facebook.xml create mode 100644 app/src/main/res/drawable/ic_instagram.xml create mode 100644 app/src/main/res/drawable/ic_local_pizza.xml create mode 100644 app/src/main/res/drawable/ic_twitter.xml create mode 100644 app/src/main/res/menu/menu_about.xml diff --git a/app/build.gradle b/app/build.gradle index becddf7..f851d60 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,8 +28,8 @@ android { applicationId "com.pimp.instincts" minSdkVersion 21 targetSdkVersion 25 - versionCode 3 - versionName "1.2.2" + versionCode 4 + versionName "1.3.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/assets/events.json b/app/src/main/assets/events.json index 958e23f..85fdd44 100644 --- a/app/src/main/assets/events.json +++ b/app/src/main/assets/events.json @@ -163,10 +163,10 @@ "endTime": "09-03-2017 17:00:00", "location": "IT Seminar Hall", "type": "Quiz", - "description": "", - "rules": "", + "description": "It wasn't sheer happenstance that made you click on this link - the Lord of Light guided you here, didn't he? Will you be the one quizzer to rule them all, though? Come find out at the Fandom Quiz at Instincts 2017!", + "rules": "Teams of 2 or 3. Lonewolves can come and find their packs.\n\nNo electronic devices allowed.\n\nTwo rounds, a prelims and a finals.\n\nStarred questions will be used to break ties in the prelims.\n\nQM's decisions are final and binding.", "info": "", - "contact1": "", + "contact1": "Sreenivas V:9789813312", "contact2": "" }, { diff --git a/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java b/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java index 96c7179..a78d5e3 100644 --- a/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java +++ b/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java @@ -18,6 +18,8 @@ package com.pimp.instincts.activities; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; @@ -27,6 +29,7 @@ import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; +import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -57,12 +60,32 @@ protected void onCreate(Bundle savedInstanceState) { tabLayout.setupWithViewPager(mViewPager); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.menu_about, menu); + return true; + } + @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); break; + case R.id.action_twitter: + Intent browserIntent1 = new Intent(Intent.ACTION_VIEW, + Uri.parse("https://twitter.com/ssn_instincts")); + startActivity(browserIntent1); + break; + case R.id.action_facebook: + Intent browserIntent2 = new Intent(Intent.ACTION_VIEW, + Uri.parse("https://www.facebook.com/instincts.ssn/")); + startActivity(browserIntent2); + case R.id.action_instagram: + Intent browserIntent3 = new Intent(Intent.ACTION_VIEW, + Uri.parse("https://www.instagram.com/ssninstincts/")); + startActivity(browserIntent3); + break; } return super.onOptionsItemSelected(item); } diff --git a/app/src/main/java/com/pimp/instincts/activities/EventsActivity.java b/app/src/main/java/com/pimp/instincts/activities/EventsActivity.java index 4b24731..59829f4 100644 --- a/app/src/main/java/com/pimp/instincts/activities/EventsActivity.java +++ b/app/src/main/java/com/pimp/instincts/activities/EventsActivity.java @@ -79,6 +79,10 @@ public boolean onOptionsItemSelected(MenuItem item) { startActivity(new Intent(EventsActivity.this, SearchActivity.class) .putExtra("theme", R.style.EventsTheme)); break; + case R.id.action_food: + startActivity(new Intent(EventsActivity.this, MapsActivity.class) + .putExtra("location", "Food Stalls")); + break; } return super.onOptionsItemSelected(item); } diff --git a/app/src/main/java/com/pimp/instincts/activities/HospitalityActivity.java b/app/src/main/java/com/pimp/instincts/activities/HospitalityActivity.java index 23931f0..8dfe649 100644 --- a/app/src/main/java/com/pimp/instincts/activities/HospitalityActivity.java +++ b/app/src/main/java/com/pimp/instincts/activities/HospitalityActivity.java @@ -32,6 +32,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; import com.pimp.instincts.R; @@ -107,6 +108,16 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, break; case 2: rootView = inflater.inflate(R.layout.fragment_buses, container, false); + + Button button = (Button) rootView.findViewById(R.id.ssn_bus_routes); + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, + Uri.parse("http://www.ssn.edu.in/wp-content/uploads/2016/01/Bus_ciruclar.pdf")); + startActivity(browserIntent); + } + }); break; default: diff --git a/app/src/main/java/com/pimp/instincts/activities/MapsActivity.java b/app/src/main/java/com/pimp/instincts/activities/MapsActivity.java index e5455c3..0b0a315 100644 --- a/app/src/main/java/com/pimp/instincts/activities/MapsActivity.java +++ b/app/src/main/java/com/pimp/instincts/activities/MapsActivity.java @@ -70,6 +70,7 @@ public class MapsActivity extends FragmentActivity implements OnMapReadyCallback private LatLng IT_LABS = new LatLng(12.751621, 80.196869); private LatLng FOUNTAIN = new LatLng(12.751590, 80.195825); private LatLng MECH_SEMINAR_HALL = new LatLng(12.751813, 80.194363); + private LatLng FOOD_STALL = new LatLng(12.750869, 80.197492); @Override protected void onCreate(Bundle savedInstanceState) { @@ -90,6 +91,7 @@ protected void onCreate(Bundle savedInstanceState) { stringToLatLngMap.put("IT Labs", IT_LABS); stringToLatLngMap.put("Fountain", FOUNTAIN); stringToLatLngMap.put("Mech Seminar Hall", MECH_SEMINAR_HALL); + stringToLatLngMap.put("Food Stalls", FOOD_STALL); mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(this); diff --git a/app/src/main/java/com/pimp/instincts/activities/ScheduleActivity.java b/app/src/main/java/com/pimp/instincts/activities/ScheduleActivity.java index 894fccd..b5d8890 100644 --- a/app/src/main/java/com/pimp/instincts/activities/ScheduleActivity.java +++ b/app/src/main/java/com/pimp/instincts/activities/ScheduleActivity.java @@ -85,6 +85,10 @@ public boolean onOptionsItemSelected(MenuItem item) { startActivity(new Intent(ScheduleActivity.this, SearchActivity.class) .putExtra("theme", R.style.ScheduleTheme)); break; + case R.id.action_food: + startActivity(new Intent(ScheduleActivity.this, MapsActivity.class) + .putExtra("location", "Food Stalls")); + break; } return super.onOptionsItemSelected(item); } diff --git a/app/src/main/res/drawable/ic_facebook.xml b/app/src/main/res/drawable/ic_facebook.xml new file mode 100644 index 0000000..42957e1 --- /dev/null +++ b/app/src/main/res/drawable/ic_facebook.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_instagram.xml b/app/src/main/res/drawable/ic_instagram.xml new file mode 100644 index 0000000..76d9212 --- /dev/null +++ b/app/src/main/res/drawable/ic_instagram.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_local_pizza.xml b/app/src/main/res/drawable/ic_local_pizza.xml new file mode 100644 index 0000000..d214f27 --- /dev/null +++ b/app/src/main/res/drawable/ic_local_pizza.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_twitter.xml b/app/src/main/res/drawable/ic_twitter.xml new file mode 100644 index 0000000..75c6649 --- /dev/null +++ b/app/src/main/res/drawable/ic_twitter.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/app/src/main/res/layout/fragment_buses.xml b/app/src/main/res/layout/fragment_buses.xml index 29220eb..5ff98ee 100644 --- a/app/src/main/res/layout/fragment_buses.xml +++ b/app/src/main/res/layout/fragment_buses.xml @@ -27,10 +27,22 @@ android:orientation="vertical" tools:context="com.pimp.instincts.activities.HospitalityActivity$PlaceholderFragment"> +