Commit a05de136 authored by Sajal Narang's avatar Sajal Narang Committed by GitHub

Merge pull request #126 from pulsejet/nav

Make drawer consistent with PWA
parents e574e526 7d4a6ded
......@@ -30,21 +30,17 @@ import com.squareup.picasso.Picasso;
import in.ac.iitb.gymkhana.iitbapp.api.UnsafeOkHttpClient;
import in.ac.iitb.gymkhana.iitbapp.api.model.NotificationsResponse;
import in.ac.iitb.gymkhana.iitbapp.data.User;
import in.ac.iitb.gymkhana.iitbapp.fragment.AboutFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.CMSFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.CalendarFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.ContactsFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.FeedFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.GCRankingsFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.MapFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.MessMenuFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.MyEventsFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.NewsFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.NotificationsFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.PeopleFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.PlacementBlogFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.ProfileFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.TimetableFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.QLinksFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.SettingsFragment;
import in.ac.iitb.gymkhana.iitbapp.fragment.TrainingBlogFragment;
import static in.ac.iitb.gymkhana.iitbapp.Constants.MY_PERMISSIONS_REQUEST_ACCESS_LOCATION;
......@@ -227,21 +223,13 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
MessMenuFragment messMenuFragment = new MessMenuFragment();
updateFragment(messMenuFragment);
break;
case R.id.nav_gc_rankings:
GCRankingsFragment gcrankingsFragment = new GCRankingsFragment();
updateFragment(gcrankingsFragment);
break;
case R.id.nav_calendar:
CalendarFragment calendarFragment = new CalendarFragment();
updateFragment(calendarFragment);
break;
case R.id.nav_cms:
CMSFragment cmsFragment = new CMSFragment();
updateFragment(cmsFragment);
break;
case R.id.nav_timetable:
TimetableFragment timetableFragment = new TimetableFragment();
updateFragment(timetableFragment);
case R.id.nav_qlinks:
QLinksFragment qLinksFragment = new QLinksFragment();
updateFragment(qLinksFragment);
break;
case R.id.nav_map:
MapFragment mapFragment = new MapFragment();
......@@ -254,18 +242,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
break;
case R.id.nav_contacts:
ContactsFragment contactsFragment = new ContactsFragment();
updateFragment(contactsFragment);
break;
case R.id.nav_about:
AboutFragment aboutFragment = new AboutFragment();
updateFragment(aboutFragment);
break;
case R.id.nav_people:
PeopleFragment peopleFragment = new PeopleFragment();
updateFragment(peopleFragment);
case R.id.nav_settings:
SettingsFragment settingsFragment = new SettingsFragment();
updateFragment(settingsFragment);
break;
}
......
package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import in.ac.iitb.gymkhana.iitbapp.R;
/**
* A simple {@link Fragment} subclass.
*/
public class GCRankingsFragment extends BaseFragment {
public GCRankingsFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_gc_rankings, container, false);
}
}
package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.app.SearchManager;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import java.util.ArrayList;
import in.ac.iitb.gymkhana.iitbapp.PeopleSuggestionAdapter;
import in.ac.iitb.gymkhana.iitbapp.R;
public class PeopleFragment extends BaseFragment {
View view;
SearchView searchView;
PeopleSuggestionAdapter adapter;
ArrayList<String> suggestionList = new ArrayList<String>();
ListView listView;
public PeopleFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_people, container, false);
setHasOptionsMenu(true);
suggestionList.add("Web and Coding Club");
suggestionList.add("Electronics and Robotics Club");
suggestionList.add("Krittika");
suggestionList.add("Maths and Physics Club");
suggestionList.add("Aeromodelling Club");
suggestionList.add("Literati");
suggestionList.add("Roots");
suggestionList.add("Staccato");
suggestionList.add("Saaz");
suggestionList.add("InSync");
suggestionList.add("Pixels");
suggestionList.add("Rang");
suggestionList.add("FourthWall");
suggestionList.add("WeSpeak and Vaani");
suggestionList.add("SilverScreen");
suggestionList.add("IIT-BBC");
suggestionList.add("Design Club");
suggestionList.add("LifeStyleClub");
suggestionList.add("MoodIndigo");
suggestionList.add("Techfest");
suggestionList.add("SARC");
suggestionList.add("Academic Council");
listView = (ListView) view.findViewById(R.id.list_view);
listView.setVisibility(View.GONE);
adapter = new PeopleSuggestionAdapter(suggestionList);
listView.setAdapter(adapter);
//TODO SuggestionClickListener
return view;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
menu.clear();
inflater.inflate(R.menu.search_view_menu, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
final SearchManager searchManager =
(SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE);
searchView =
(SearchView) MenuItemCompat.getActionView(searchItem);
searchView.setSearchableInfo(
searchManager.getSearchableInfo(getActivity().getComponentName()));
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
searchView.clearFocus();
listView.setVisibility(View.GONE);
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
listView.setVisibility(View.VISIBLE);
adapter.getFilter().filter(newText);
return false;
}
});
}
}
......@@ -12,10 +12,10 @@ import in.ac.iitb.gymkhana.iitbapp.R;
/**
* A simple {@link Fragment} subclass.
*/
public class CMSFragment extends BaseFragment {
public class QLinksFragment extends BaseFragment {
public CMSFragment() {
public QLinksFragment() {
// Required empty public constructor
}
......@@ -24,7 +24,7 @@ public class CMSFragment extends BaseFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_cms, container, false);
return inflater.inflate(R.layout.fragment_qlinks, container, false);
}
}
......@@ -11,20 +11,32 @@ import in.ac.iitb.gymkhana.iitbapp.R;
/**
* A simple {@link Fragment} subclass.
* Use the {@link SettingsFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class ContactsFragment extends BaseFragment {
public class SettingsFragment extends Fragment {
public ContactsFragment() {
public SettingsFragment() {
// Required empty public constructor
}
public static SettingsFragment newInstance(String param1, String param2) {
SettingsFragment fragment = new SettingsFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_contacts, container, false);
return inflater.inflate(R.layout.fragment_settings, container, false);
}
}
package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import in.ac.iitb.gymkhana.iitbapp.R;
/**
* A simple {@link Fragment} subclass.
*/
public class TimetableFragment extends BaseFragment {
public TimetableFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_timetable, container, false);
}
}
<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="#FF000000"
android:pathData="M3.9,12c0,-1.71 1.39,-3.1 3.1,-3.1h4L11,7L7,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5h4v-1.9L7,15.1c-1.71,0 -3.1,-1.39 -3.1,-3.1zM8,13h8v-2L8,11v2zM17,7h-4v1.9h4c1.71,0 3.1,1.39 3.1,3.1s-1.39,3.1 -3.1,3.1h-4L13,17h4c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5z"/>
</vector>
<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="#FF000000"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.ContactsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.GCRankingsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.PeopleFragment">
<!-- TODO: Update blank fragment layout -->
<!--<android.support.v7.widget.SearchView-->
<!--android:id="@+id/search"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--app:defaultQueryHint="Search"-->
<!--android:clickable="true"/>-->
<ListView
android:id="@+id/list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/search"
android:visibility="gone" />
</RelativeLayout>
......@@ -2,7 +2,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.CMSFragment">
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.QLinksFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.TimetableFragment">
tools:context=".fragment.SettingsFragment">
<!-- TODO: Update blank fragment layout -->
<TextView
......
......@@ -9,15 +9,20 @@
android:id="@+id/nav_feed"
android:icon="@drawable/ic_dashboard_black_48dp"
android:title="Feed" />
<item
android:id="@+id/nav_news"
android:icon="@drawable/baseline_rss_feed_black_48"
android:title="News" />
<item
android:id="@+id/nav_my_events"
android:icon="@drawable/ic_event"
android:title="My Events" />
<item
android:id="@+id/nav_news"
android:icon="@drawable/baseline_rss_feed_black_48"
android:title="News" />
android:id="@+id/nav_mess_menu"
android:icon="@drawable/ic_restaurant_black_48dp"
android:title="Mess Menu" />
<item
android:id="@+id/nav_placement_blog"
......@@ -29,47 +34,25 @@
android:icon="@drawable/ic_work_black_48dp"
android:title="Training Blog" />
<item
android:id="@+id/nav_mess_menu"
android:icon="@drawable/ic_restaurant_black_48dp"
android:title="Mess Menu" />
<item
android:id="@+id/nav_gc_rankings"
android:icon="@drawable/ic_equalizer_black_48dp"
android:title="GC Rankings" />
<item
android:id="@+id/nav_calendar"
android:icon="@drawable/ic_date_range_black_48dp"
android:title="Calendar" />
<item
android:id="@+id/nav_timetable"
android:icon="@drawable/ic_web_black_48dp"
android:title="Timetable" />
<item
android:id="@+id/nav_cms"
android:icon="@drawable/ic_announcement_black_48dp"
android:title="CMS" />
<item
android:id="@+id/nav_map"
android:icon="@drawable/ic_map_black_48dp"
android:title="Map" />
<item
android:id="@+id/nav_people"
android:icon="@drawable/ic_supervisor_account_black_48dp"
android:title="People" />
</group>
<item android:title="Communicate">
<menu>
<item
android:id="@+id/nav_contacts"
android:icon="@drawable/ic_phone"
android:title="Contacts" />
android:id="@+id/nav_qlinks"
android:icon="@drawable/ic_link_black_24dp"
android:title="Quick Links" />
<item
android:id="@+id/nav_about"
android:icon="@drawable/ic_info_black_48dp"
android:title="About" />
</menu>
</item>
android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings_black_24dp"
android:title="Settings" />
</group>
</menu>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment