Skip to content

Commit

Permalink
✨ Add New Menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
adithya321 committed Mar 7, 2017
1 parent b72ac04 commit 391d055
Show file tree
Hide file tree
Showing 14 changed files with 217 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/assets/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
},
{
Expand Down
23 changes: 23 additions & 0 deletions app/src/main/java/com/pimp/instincts/activities/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/res/drawable/ic_facebook.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ Instincts
~ Copyright (C) 2017 Adithya J
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M17,2V2H17V6H15C14.31,6 14,6.81 14,7.5V10H14L17,10V14H14V22H10V14H7V10H10V6A4,4 0,0 1,14 2H17Z" />
</vector>
27 changes: 27 additions & 0 deletions app/src/main/res/drawable/ic_instagram.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ Instincts
~ Copyright (C) 2017 Adithya J
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M7.8,2H16.2C19.4,2 22,4.6 22,7.8V16.2A5.8,5.8 0,0 1,16.2 22H7.8C4.6,22 2,19.4 2,16.2V7.8A5.8,5.8 0,0 1,7.8 2M7.6,4A3.6,3.6 0,0 0,4 7.6V16.4C4,18.39 5.61,20 7.6,20H16.4A3.6,3.6 0,0 0,20 16.4V7.6C20,5.61 18.39,4 16.4,4H7.6M17.25,5.5A1.25,1.25 0,0 1,18.5 6.75A1.25,1.25 0,0 1,17.25 8A1.25,1.25 0,0 1,16 6.75A1.25,1.25 0,0 1,17.25 5.5M12,7A5,5 0,0 1,17 12A5,5 0,0 1,12 17A5,5 0,0 1,7 12A5,5 0,0 1,12 7M12,9A3,3 0,0 0,9 12A3,3 0,0 0,12 15A3,3 0,0 0,15 12A3,3 0,0 0,12 9Z" />
</vector>
27 changes: 27 additions & 0 deletions app/src/main/res/drawable/ic_local_pizza.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ Instincts
~ Copyright (C) 2017 Adithya J
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,2C8.43,2 5.23,3.54 3.01,6L12,22l8.99,-16C18.78,3.55 15.57,2 12,2zM7,7c0,-1.1 0.9,-2 2,-2s2,0.9 2,2 -0.9,2 -2,2 -2,-0.9 -2,-2zM12,15c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
</vector>
27 changes: 27 additions & 0 deletions app/src/main/res/drawable/ic_twitter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
~ Instincts
~ Copyright (C) 2017 Adithya J
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z" />
</vector>
14 changes: 13 additions & 1 deletion app/src/main/res/layout/fragment_buses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,22 @@
android:orientation="vertical"
tools:context="com.pimp.instincts.activities.HospitalityActivity$PlaceholderFragment">

<Button
android:id="@+id/ssn_bus_routes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:fontFamily="sans-serif"
android:text="SSN Bus Routes"
android:textSize="20sp"
android:textStyle="bold" />

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:layout_marginBottom="16dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">

Expand Down
40 changes: 40 additions & 0 deletions app/src/main/res/menu/menu_about.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
~ Instincts
~ Copyright (C) 2017 Adithya J
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>
-->

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/action_twitter"
android:icon="@drawable/ic_twitter"
android:orderInCategory="100"
android:title="Twitter"
app:showAsAction="always" />
<item
android:id="@+id/action_facebook"
android:icon="@drawable/ic_facebook"
android:orderInCategory="200"
android:title="Facebook"
app:showAsAction="always" />
<item
android:id="@+id/action_instagram"
android:icon="@drawable/ic_instagram"
android:orderInCategory="300"
android:title="Facebook"
app:showAsAction="always" />
</menu>
7 changes: 7 additions & 0 deletions app/src/main/res/menu/menu_events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search"
android:orderInCategory="200"
android:title="Search"
app:showAsAction="always" />

<item
android:id="@+id/action_food"
android:icon="@drawable/ic_local_pizza"
android:orderInCategory="100"
android:title="Search"
app:showAsAction="always" />
Expand Down

0 comments on commit 391d055

Please sign in to comment.