Commit 9729d642 authored by Mrunzzz's avatar Mrunzzz

Merge conflicts Resolved 1

parents 91d490f7 b2f304b1
# IITB-App IITB App
\ No newline at end of file ===============
### Powered by the Web and Coding Club, IIT Bombay
All IITB content in one place. IITB App is the result of WnCC's coordinated efforts to build an applications that makes it easier to discover IITB content while being on the go.
The IITB App features the Placement Blog, Upcoming Events and general information on every active club/body in the Institute
### Features:
* Events Directory
* Placement Blog
* Mess Menus
* Placement Blog
* Internship Blog
* Inter Hostel GC rankings
* Academic Timetable
* Academic Calendar
* Complaint Management System
* Map
A more detailed list of features can be found [here](https://docs.google.com/document/d/1L4wzuw88JrLyBt1DvnjavtAwhJkXgNSIxJG3yBsLwQ0/edit?usp=sharing).
IITB App is a community effort and we appreciate the help of everyone who wants to help improve the App.
Check http://github.com/wncc for more information about all development activities under WnCC.
Development
-----------
Read the [Development Documentation](https://docs.google.com/document/d/1LYmtKPyA-TMFqxC9rxXHp785pUI05u9M-38qB0nQPDQ/edit?usp=sharing).
See the [Frontend Design](https://drive.google.com/drive/folders/0B8nDKRNC4Y7OZG5SV1hsOWdkdFE?usp=sharing).
### Contributors
See [list of contributors](https://github.com/unstablebrainiac/IITB-App/graphs/contributors)
Release
-------
The app is still in early stages of development and is not on the Play Store.
###### The IITB App, WnCC are not endorsed by IIT Bombay, the institute.
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 25 compileSdkVersion 26
buildToolsVersion "25.0.3" buildToolsVersion "26.0.2"
defaultConfig { defaultConfig {
applicationId "in.ac.iitb.gymkhana.iitbapp" applicationId "in.ac.iitb.gymkhana.iitbapp"
manifestPlaceholders 'appAuthRedirectScheme': 'https' manifestPlaceholders 'appAuthRedirectScheme': 'https'
minSdkVersion 17 minSdkVersion 17
targetSdkVersion 25 targetSdkVersion 26
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
...@@ -22,9 +22,9 @@ android { ...@@ -22,9 +22,9 @@ android {
} }
ext { ext {
supportLibVersion = '25.3.1' supportLibVersion = '26.1.0'
playServicesVersion = '11.0.2' playServicesVersion = '11.6.2'
butterKnifeVersion = '8.6.0' butterKnifeVersion = '8.7.0'
appAuthVersion = '0.2.0' appAuthVersion = '0.2.0'
retrofitVersion = '2.1.0' retrofitVersion = '2.1.0'
okhttpVersion = '3.4.1' okhttpVersion = '3.4.1'
...@@ -51,6 +51,5 @@ dependencies { ...@@ -51,6 +51,5 @@ dependencies {
compile "com.squareup.okhttp3:okhttp:${okhttpVersion}" compile "com.squareup.okhttp3:okhttp:${okhttpVersion}"
compile "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}" compile "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
compile "com.squareup.picasso:picasso:${picassoVersion}" compile "com.squareup.picasso:picasso:${picassoVersion}"
implementation 'com.android.support:support-v4:25.4.0'
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
...@@ -20,11 +20,8 @@ import android.widget.Toast; ...@@ -20,11 +20,8 @@ import android.widget.Toast;
import com.google.gson.Gson; import com.google.gson.Gson;
import java.util.List;
import in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface; import in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface;
import in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator; import in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator;
import in.ac.iitb.gymkhana.iitbapp.api.model.AppNotification;
import in.ac.iitb.gymkhana.iitbapp.api.model.NotificationsRequest; import in.ac.iitb.gymkhana.iitbapp.api.model.NotificationsRequest;
import in.ac.iitb.gymkhana.iitbapp.api.model.NotificationsResponse; import in.ac.iitb.gymkhana.iitbapp.api.model.NotificationsResponse;
import in.ac.iitb.gymkhana.iitbapp.fragment.AboutFragment; import in.ac.iitb.gymkhana.iitbapp.fragment.AboutFragment;
......
package in.ac.iitb.gymkhana.iitbapp; package in.ac.iitb.gymkhana.iitbapp;
import android.content.Context; import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -13,9 +12,6 @@ import android.widget.TextView; ...@@ -13,9 +12,6 @@ import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/** /**
* Created by mrunz on 6/7/17. * Created by mrunz on 6/7/17.
*/ */
......
...@@ -13,6 +13,7 @@ public class ServiceGenerator { ...@@ -13,6 +13,7 @@ public class ServiceGenerator {
.baseUrl(BASE_URL) .baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create()); .addConverterFactory(GsonConverterFactory.create());
private static Retrofit retrofit; private static Retrofit retrofit;
public static <S> S createService(Class<S> serviceClass) { public static <S> S createService(Class<S> serviceClass) {
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor(); HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY); httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
......
...@@ -10,6 +10,7 @@ public class DatabaseContract { ...@@ -10,6 +10,7 @@ public class DatabaseContract {
public static final String PATH_USER_PROFILE = "userProfile"; public static final String PATH_USER_PROFILE = "userProfile";
public static final String PATH_USER_FOLLOWERS = "userFollowers"; public static final String PATH_USER_FOLLOWERS = "userFollowers";
public static final String PATH_USER_FOLLOWS = "userFollows"; public static final String PATH_USER_FOLLOWS = "userFollows";
public static final String PATH_NEWS_FEED = "newsFeed";
public static final class MapEntry implements BaseColumns { public static final class MapEntry implements BaseColumns {
public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon() public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
...@@ -68,5 +69,20 @@ public class DatabaseContract { ...@@ -68,5 +69,20 @@ public class DatabaseContract {
} }
public static final class NewsFeedEntry implements BaseColumns {
public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon()
.appendPath(PATH_NEWS_FEED)
.build();
public static final String TABLE_NAME = "newsFeed";
public static final String COLUMN_EVENT_NAME = "event_name";
public static final String COLUMN_EVENT_DESCRIPTION = "event_description";
public static final String COLUMN_EVENT_IMAGE = "event_image";
public static final String COLUMN_EVENT_CREATOR_NAME = "event_creator_name";
public static final String COLUMN_EVENT_CREATOR_ID = "event_creator_id";
public static final String COLUMN_EVENT_GOING_STATUS = "event_going_status";
}
} }
...@@ -50,10 +50,20 @@ public class DatabaseHelper extends SQLiteOpenHelper { ...@@ -50,10 +50,20 @@ public class DatabaseHelper extends SQLiteOpenHelper {
DatabaseContract.UserFollowsEntry.COLUMN_USER_NAME + " TEXT NOT NULL, " + DatabaseContract.UserFollowsEntry.COLUMN_USER_NAME + " TEXT NOT NULL, " +
DatabaseContract.UserFollowsEntry.COLUMN_USER_PROFILE + " TEXT NOT NULL);"; DatabaseContract.UserFollowsEntry.COLUMN_USER_PROFILE + " TEXT NOT NULL);";
final String CREATE_TABLE_NEWS_FEED = "CREATE TABLE " + DatabaseContract.NewsFeedEntry.TABLE_NAME + " (" +
DatabaseContract.NewsFeedEntry._ID + " INTEGER PRIMARY KEY, " +
DatabaseContract.NewsFeedEntry.COLUMN_EVENT_NAME + " TEXT NOT NULL, " +
DatabaseContract.NewsFeedEntry.COLUMN_EVENT_DESCRIPTION + " TEXT NOT NULL, " +
DatabaseContract.NewsFeedEntry.COLUMN_EVENT_IMAGE + " TEXT NOT NULL, " +
DatabaseContract.NewsFeedEntry.COLUMN_EVENT_CREATOR_NAME + " TEXT NOT NULL, " +
DatabaseContract.NewsFeedEntry.COLUMN_EVENT_CREATOR_ID + " TEXT NOT NULL, " +
DatabaseContract.NewsFeedEntry.COLUMN_EVENT_GOING_STATUS + " INTEGER NOT NULL);";
db.execSQL(CREATE_TABLE_MAP); db.execSQL(CREATE_TABLE_MAP);
db.execSQL(CREATE_TABLE_USER_PROFILE); db.execSQL(CREATE_TABLE_USER_PROFILE);
db.execSQL(CREATE_TABLE_USER_FOLLOWERS); db.execSQL(CREATE_TABLE_USER_FOLLOWERS);
db.execSQL(CREATE_TABLE_USER_FOLLOWS); db.execSQL(CREATE_TABLE_USER_FOLLOWS);
db.execSQL(CREATE_TABLE_NEWS_FEED);
} }
@Override @Override
...@@ -62,6 +72,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { ...@@ -62,6 +72,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.UserProfileEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.UserProfileEntry.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.UserFollowersEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.UserFollowersEntry.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.UserFollowsEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.UserFollowsEntry.TABLE_NAME);
db.execSQL("DROP TABLE IF EXISTS " + DatabaseContract.NewsFeedEntry.TABLE_NAME);
onCreate(db); onCreate(db);
} }
} }
...@@ -22,6 +22,8 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -22,6 +22,8 @@ public class IITBAppContentProvider extends ContentProvider {
public static final int USER_FOLLOWER_WITH_ID = 301; public static final int USER_FOLLOWER_WITH_ID = 301;
public static final int USER_FOLLOWS = 400; public static final int USER_FOLLOWS = 400;
public static final int USER_FOLLOWS_WITH_ID = 401; public static final int USER_FOLLOWS_WITH_ID = 401;
public static final int NEWS_FEED = 500;
public static final int NEWS_FEED_WITH_ID = 501;
private static final UriMatcher sUriMatcher = buildUriMatcher(); private static final UriMatcher sUriMatcher = buildUriMatcher();
private DatabaseHelper databaseHelper; private DatabaseHelper databaseHelper;
...@@ -35,6 +37,8 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -35,6 +37,8 @@ public class IITBAppContentProvider extends ContentProvider {
matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_USER_FOLLOWERS + "/#", USER_FOLLOWER_WITH_ID); matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_USER_FOLLOWERS + "/#", USER_FOLLOWER_WITH_ID);
matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_USER_FOLLOWS, USER_FOLLOWS); matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_USER_FOLLOWS, USER_FOLLOWS);
matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_USER_FOLLOWS + "/#", USER_FOLLOWS_WITH_ID); matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_USER_FOLLOWS + "/#", USER_FOLLOWS_WITH_ID);
matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_NEWS_FEED, NEWS_FEED);
matcher.addURI(DatabaseContract.CONTENT_AUTHORITY, DatabaseContract.PATH_NEWS_FEED + "/#", NEWS_FEED_WITH_ID);
return matcher; return matcher;
} }
...@@ -135,6 +139,26 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -135,6 +139,26 @@ public class IITBAppContentProvider extends ContentProvider {
null, null,
sortOrder); sortOrder);
break; break;
case NEWS_FEED:
cursor = db.query(DatabaseContract.NewsFeedEntry.TABLE_NAME,
projection,
selection,
selectionArgs,
null,
null,
sortOrder);
break;
case NEWS_FEED_WITH_ID:
id = uri.getPathSegments().get(1);
selectionArguments = new String[]{id};
cursor = db.query(DatabaseContract.NewsFeedEntry.TABLE_NAME,
projection,
"_id=?",
selectionArguments,
null,
null,
sortOrder);
break;
default: default:
throw new SQLException("Wrong Uri: " + uri); throw new SQLException("Wrong Uri: " + uri);
...@@ -165,6 +189,12 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -165,6 +189,12 @@ public class IITBAppContentProvider extends ContentProvider {
return "vnd.android.cursor.dir" + "/" + DatabaseContract.CONTENT_AUTHORITY + "/" + DatabaseContract.PATH_USER_FOLLOWS; return "vnd.android.cursor.dir" + "/" + DatabaseContract.CONTENT_AUTHORITY + "/" + DatabaseContract.PATH_USER_FOLLOWS;
case USER_FOLLOWS_WITH_ID: case USER_FOLLOWS_WITH_ID:
return "vnd.android.cursor.item" + "/" + DatabaseContract.CONTENT_AUTHORITY + "/" + DatabaseContract.PATH_USER_FOLLOWS; return "vnd.android.cursor.item" + "/" + DatabaseContract.CONTENT_AUTHORITY + "/" + DatabaseContract.PATH_USER_FOLLOWS;
case NEWS_FEED:
return "vnd.android.cursor.dir" + "/" + DatabaseContract.CONTENT_AUTHORITY + "/" + DatabaseContract.PATH_NEWS_FEED;
case NEWS_FEED_WITH_ID:
return "vnd.android.cursor.item" + "/" + DatabaseContract.CONTENT_AUTHORITY + "/" + DatabaseContract.PATH_NEWS_FEED;
default: default:
throw new UnsupportedOperationException("Unknown uri: " + uri); throw new UnsupportedOperationException("Unknown uri: " + uri);
} }
...@@ -207,6 +237,14 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -207,6 +237,14 @@ public class IITBAppContentProvider extends ContentProvider {
} else } else
throw new SQLException("Failed to insert row into " + uri); throw new SQLException("Failed to insert row into " + uri);
break; break;
case NEWS_FEED:
id = db.insert(DatabaseContract.NewsFeedEntry.TABLE_NAME, null, values);
if (id > 0) {
returnUri = ContentUris.withAppendedId(DatabaseContract.NewsFeedEntry.CONTENT_URI, id);
} else
throw new SQLException("Failed to insert row into " + uri);
break;
default: default:
throw new SQLException("Wrong uri: " + uri); throw new SQLException("Wrong uri: " + uri);
...@@ -301,6 +339,27 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -301,6 +339,27 @@ public class IITBAppContentProvider extends ContentProvider {
db.endTransaction(); db.endTransaction();
} }
if (rowsInserted > 0) {
getContext().getContentResolver().notifyChange(uri, null);
}
return rowsInserted;
case NEWS_FEED:
db.beginTransaction();
rowsInserted = 0;
try {
for (ContentValues value : values) {
long _id = db.insert(DatabaseContract.NewsFeedEntry.TABLE_NAME, null, value);
if (_id != -1) {
rowsInserted++;
}
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
if (rowsInserted > 0) { if (rowsInserted > 0) {
getContext().getContentResolver().notifyChange(uri, null); getContext().getContentResolver().notifyChange(uri, null);
} }
...@@ -309,6 +368,7 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -309,6 +368,7 @@ public class IITBAppContentProvider extends ContentProvider {
default: default:
return super.bulkInsert(uri, values); return super.bulkInsert(uri, values);
} }
} }
@Override @Override
...@@ -347,6 +407,13 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -347,6 +407,13 @@ public class IITBAppContentProvider extends ContentProvider {
selectionArgs); selectionArgs);
break; break;
case NEWS_FEED:
numRowsDeleted = databaseHelper.getWritableDatabase().delete(
DatabaseContract.NewsFeedEntry.TABLE_NAME,
selection,
selectionArgs);
break;
case LOC_WITH_ID: case LOC_WITH_ID:
...@@ -372,6 +439,12 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -372,6 +439,12 @@ public class IITBAppContentProvider extends ContentProvider {
numRowsDeleted = databaseHelper.getWritableDatabase().delete(DatabaseContract.UserFollowsEntry.TABLE_NAME, "_id=?", new String[]{id}); numRowsDeleted = databaseHelper.getWritableDatabase().delete(DatabaseContract.UserFollowsEntry.TABLE_NAME, "_id=?", new String[]{id});
break; break;
case NEWS_FEED_WITH_ID:
id = uri.getPathSegments().get(1);
numRowsDeleted = databaseHelper.getWritableDatabase().delete(DatabaseContract.NewsFeedEntry.TABLE_NAME, "_id=?", new String[]{id});
break;
default: default:
throw new UnsupportedOperationException("Unknown uri: " + uri); throw new UnsupportedOperationException("Unknown uri: " + uri);
} }
...@@ -418,6 +491,12 @@ public class IITBAppContentProvider extends ContentProvider { ...@@ -418,6 +491,12 @@ public class IITBAppContentProvider extends ContentProvider {
itemsUpdated = databaseHelper.getWritableDatabase().update(DatabaseContract.UserFollowsEntry.TABLE_NAME, values, "_id=?", new String[]{id}); itemsUpdated = databaseHelper.getWritableDatabase().update(DatabaseContract.UserFollowsEntry.TABLE_NAME, values, "_id=?", new String[]{id});
break; break;
case NEWS_FEED_WITH_ID:
id = uri.getPathSegments().get(1);
itemsUpdated = databaseHelper.getWritableDatabase().update(DatabaseContract.NewsFeedEntry.TABLE_NAME, values, "_id=?", new String[]{id});
break;
default: default:
throw new UnsupportedOperationException("Unknown uri: " + uri); throw new UnsupportedOperationException("Unknown uri: " + uri);
} }
......
...@@ -86,8 +86,6 @@ public class AddEventFragment extends Fragment { ...@@ -86,8 +86,6 @@ public class AddEventFragment extends Fragment {
view = inflater.inflate(R.layout.fragment_add_event, container, false); view = inflater.inflate(R.layout.fragment_add_event, container, false);
ButterKnife.bind(this, view); ButterKnife.bind(this, view);
cb_permission.setVisibility(View.GONE); cb_permission.setVisibility(View.GONE);
cb_public.setVisibility(View.GONE); cb_public.setVisibility(View.GONE);
et_mapLocation.setVisibility(View.GONE); et_mapLocation.setVisibility(View.GONE);
...@@ -97,7 +95,6 @@ public class AddEventFragment extends Fragment { ...@@ -97,7 +95,6 @@ public class AddEventFragment extends Fragment {
open.setVisibility(View.VISIBLE); open.setVisibility(View.VISIBLE);
start.setOnClickListener(new View.OnClickListener() { start.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -106,10 +103,12 @@ public class AddEventFragment extends Fragment { ...@@ -106,10 +103,12 @@ public class AddEventFragment extends Fragment {
int mYear = calendar.get(Calendar.YEAR); int mYear = calendar.get(Calendar.YEAR);
int mMonth = calendar.get(Calendar.MONTH); int mMonth = calendar.get(Calendar.MONTH);
int mDay = calendar.get(Calendar.DAY_OF_MONTH); int mDay = calendar.get(Calendar.DAY_OF_MONTH);
final int mHour = calendar.get(Calendar.HOUR_OF_DAY); final int mHour = calendar.get(Calendar.HOUR_OF_DAY);
final int mMin = calendar.get(Calendar.MINUTE); final int mMin = calendar.get(Calendar.MINUTE);
long millis = calendar.getTimeInMillis(); long millis = calendar.getTimeInMillis();
DatePickerDialog datePickerDialog = new DatePickerDialog(getContext(), new DatePickerDialog.OnDateSetListener() { DatePickerDialog datePickerDialog = new DatePickerDialog(getContext(), new DatePickerDialog.OnDateSetListener() {
@Override @Override
...@@ -124,25 +123,29 @@ public class AddEventFragment extends Fragment { ...@@ -124,25 +123,29 @@ public class AddEventFragment extends Fragment {
} }
}, mYear, mMonth, mDay); }, mYear, mMonth, mDay);
datePickerDialog.show(); datePickerDialog.show();
timestamp_start = new Timestamp(millis); timestamp_start = new Timestamp(millis);
} }
}); });
end.setOnClickListener(new View.OnClickListener() { end.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
int mYear = calendar.get(Calendar.YEAR); int mYear = calendar.get(Calendar.YEAR);
int mMonth = calendar.get(Calendar.MONTH); int mMonth = calendar.get(Calendar.MONTH);
int mDay = calendar.get(Calendar.DAY_OF_MONTH); int mDay = calendar.get(Calendar.DAY_OF_MONTH);
final int mHour = calendar.get(Calendar.HOUR_OF_DAY); final int mHour = calendar.get(Calendar.HOUR_OF_DAY);
final int mMin = calendar.get(Calendar.MINUTE); final int mMin = calendar.get(Calendar.MINUTE);
long millis = calendar.getTimeInMillis(); long millis = calendar.getTimeInMillis();
DatePickerDialog datePickerDialog = new DatePickerDialog(getContext(), new DatePickerDialog.OnDateSetListener() { DatePickerDialog datePickerDialog = new DatePickerDialog(getContext(), new DatePickerDialog.OnDateSetListener() {
@Override @Override
...@@ -157,10 +160,12 @@ public class AddEventFragment extends Fragment { ...@@ -157,10 +160,12 @@ public class AddEventFragment extends Fragment {
} }
}, mYear, mMonth, mDay); }, mYear, mMonth, mDay);
datePickerDialog.show(); datePickerDialog.show();
timestamp_end = new Timestamp(millis); timestamp_end = new Timestamp(millis);
} }
}); });
if (cb_permission.isChecked()) { if (cb_permission.isChecked()) {
publicStatus = 1; publicStatus = 1;
...@@ -195,7 +200,10 @@ public class AddEventFragment extends Fragment { ...@@ -195,7 +200,10 @@ public class AddEventFragment extends Fragment {
createEvent.setOnClickListener(new View.OnClickListener() { createEvent.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
//addEvent();
Toast.makeText(getContext(), "Add Event", Toast.LENGTH_SHORT).show();
//TODO (2) save event
} }
}); });
......
...@@ -18,9 +18,9 @@ import in.ac.iitb.gymkhana.iitbapp.R; ...@@ -18,9 +18,9 @@ import in.ac.iitb.gymkhana.iitbapp.R;
*/ */
public class CalendarFragment extends Fragment { public class CalendarFragment extends Fragment {
FloatingActionButton fab;
private View view; private View view;
private Toast toast; private Toast toast;
FloatingActionButton fab;
public CalendarFragment() { public CalendarFragment() {
// Required empty public constructor // Required empty public constructor
...@@ -33,7 +33,7 @@ public class CalendarFragment extends Fragment { ...@@ -33,7 +33,7 @@ public class CalendarFragment extends Fragment {
// Inflate the layout for this fragment // Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_calendar, container, false); view = inflater.inflate(R.layout.fragment_calendar, container, false);
fab=(FloatingActionButton) view.findViewById(R.id.fab); fab = (FloatingActionButton) view.findViewById(R.id.fab);
final CalendarView simpleCalendarView = (CalendarView) view.findViewById(R.id.simpleCalendarView); // get the reference of CalendarView final CalendarView simpleCalendarView = (CalendarView) view.findViewById(R.id.simpleCalendarView); // get the reference of CalendarView
simpleCalendarView.setFirstDayOfWeek(1); // set Sunday as the first day of the week simpleCalendarView.setFirstDayOfWeek(1); // set Sunday as the first day of the week
...@@ -52,14 +52,14 @@ public class CalendarFragment extends Fragment { ...@@ -52,14 +52,14 @@ public class CalendarFragment extends Fragment {
} }
}); });
fab.setOnClickListener(new View.OnClickListener(){ fab.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
AddEventFragment addEventFragment=new AddEventFragment(); AddEventFragment addEventFragment = new AddEventFragment();
FragmentTransaction ft = getChildFragmentManager().beginTransaction(); FragmentTransaction ft = getChildFragmentManager().beginTransaction();
ft.replace(R.id.calendar_layout,addEventFragment); ft.replace(R.id.calendar_layout, addEventFragment);
ft.addToBackStack("addEvent"); ft.addToBackStack("addEvent");
ft.commit(); ft.commit();
} }
......
package in.ac.iitb.gymkhana.iitbapp.fragment; package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.content.ContentValues;
import android.database.Cursor;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction; import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import com.google.gson.Gson; import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import in.ac.iitb.gymkhana.iitbapp.Constants; import in.ac.iitb.gymkhana.iitbapp.Constants;
...@@ -24,6 +29,7 @@ import in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator; ...@@ -24,6 +29,7 @@ import in.ac.iitb.gymkhana.iitbapp.api.ServiceGenerator;
import in.ac.iitb.gymkhana.iitbapp.api.model.Event; import in.ac.iitb.gymkhana.iitbapp.api.model.Event;
import in.ac.iitb.gymkhana.iitbapp.api.model.NewsFeedRequest; import in.ac.iitb.gymkhana.iitbapp.api.model.NewsFeedRequest;
import in.ac.iitb.gymkhana.iitbapp.api.model.NewsFeedResponse; import in.ac.iitb.gymkhana.iitbapp.api.model.NewsFeedResponse;
import in.ac.iitb.gymkhana.iitbapp.data.DatabaseContract;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
...@@ -33,7 +39,8 @@ import retrofit2.Response; ...@@ -33,7 +39,8 @@ import retrofit2.Response;
*/ */
public class FeedFragment extends Fragment { public class FeedFragment extends Fragment {
RecyclerView feedRecyclerView; private RecyclerView feedRecyclerView;
private SwipeRefreshLayout feedSwipeRefreshLayout;
public FeedFragment() { public FeedFragment() {
// Required empty public constructor // Required empty public constructor
...@@ -50,7 +57,50 @@ public class FeedFragment extends Fragment { ...@@ -50,7 +57,50 @@ public class FeedFragment extends Fragment {
@Override @Override
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
Cursor cursor = getContext().getContentResolver().query(DatabaseContract.NewsFeedEntry.CONTENT_URI, null, null, null, null);
if (cursor.getCount() != 0) {
final List<Event> events = new ArrayList<>();
while (cursor.moveToNext()) {
Event event = new Event(cursor.getString(cursor.getColumnIndex(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_NAME)),
cursor.getString(cursor.getColumnIndex(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_DESCRIPTION)),
cursor.getString(cursor.getColumnIndex(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_IMAGE)),
cursor.getString(cursor.getColumnIndex(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_CREATOR_NAME)),
cursor.getString(cursor.getColumnIndex(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_CREATOR_ID)),
cursor.getInt(cursor.getColumnIndex(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_GOING_STATUS)));
events.add(event);
}
FeedAdapter feedAdapter = new FeedAdapter(events, new ItemClickListener() {
@Override
public void onItemClick(View v, int position) {
String eventJson = new Gson().toJson(events.get(position));
Bundle bundle = new Bundle();
bundle.putString(Constants.EVENT_JSON, eventJson);
EventFragment eventFragment = new EventFragment();
eventFragment.setArguments(bundle);
FragmentManager manager = getActivity().getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.replace(R.id.framelayout_for_fragment, eventFragment, eventFragment.getTag());
transaction.commit();
}
});
feedRecyclerView = (RecyclerView) getActivity().findViewById(R.id.feed_recycler_view);
feedRecyclerView.setAdapter(feedAdapter);
feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
}
updateFeed();
feedSwipeRefreshLayout = (SwipeRefreshLayout) getActivity().findViewById(R.id.feed_swipe_refresh_layout);
feedSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
updateFeed();
}
});
}
private void updateFeed() {
NewsFeedRequest newsFeedRequest = new NewsFeedRequest(NewsFeedRequest.FOLLOWED, 0, 20); NewsFeedRequest newsFeedRequest = new NewsFeedRequest(NewsFeedRequest.FOLLOWED, 0, 20);
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class); RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.getNewsFeed(newsFeedRequest).enqueue(new Callback<NewsFeedResponse>() { retrofitInterface.getNewsFeed(newsFeedRequest).enqueue(new Callback<NewsFeedResponse>() {
...@@ -77,13 +127,31 @@ public class FeedFragment extends Fragment { ...@@ -77,13 +127,31 @@ public class FeedFragment extends Fragment {
feedRecyclerView = (RecyclerView) getActivity().findViewById(R.id.feed_recycler_view); feedRecyclerView = (RecyclerView) getActivity().findViewById(R.id.feed_recycler_view);
feedRecyclerView.setAdapter(feedAdapter); feedRecyclerView.setAdapter(feedAdapter);
feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
long itemsRemoved = getContext().getContentResolver().delete(DatabaseContract.NewsFeedEntry.CONTENT_URI, null, null);
Log.d("FeedFragment", itemsRemoved + " items removed.");
ContentValues contentValues[] = new ContentValues[events.size()];
for (int i = 0; i < events.size(); i++) {
ContentValues contentValues1 = new ContentValues();
contentValues1.put(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_NAME, events.get(i).getEventName());
contentValues1.put(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_DESCRIPTION, events.get(i).getEventDescription());
contentValues1.put(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_IMAGE, events.get(i).getEventImage());
contentValues1.put(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_CREATOR_NAME, events.get(i).getEventCreatorName());
contentValues1.put(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_CREATOR_ID, events.get(i).getEventCreatorId());
contentValues1.put(DatabaseContract.NewsFeedEntry.COLUMN_EVENT_GOING_STATUS, events.get(i).getEventEnthu());
contentValues[i] = contentValues1;
}
int insertCount = getContext().getContentResolver().bulkInsert(DatabaseContract.NewsFeedEntry.CONTENT_URI, contentValues);
Log.d("FeedFragment", Integer.toString(insertCount) + " elements inserted");
} }
//Server Error //Server Error
feedSwipeRefreshLayout.setRefreshing(false);
} }
@Override @Override
public void onFailure(Call<NewsFeedResponse> call, Throwable t) { public void onFailure(Call<NewsFeedResponse> call, Throwable t) {
//Network Error //Network Error
feedSwipeRefreshLayout.setRefreshing(false);
} }
}); });
} }
......
...@@ -39,7 +39,6 @@ public class MapFragment extends Fragment implements OnMapReadyCallback { ...@@ -39,7 +39,6 @@ public class MapFragment extends Fragment implements OnMapReadyCallback {
googleMap.getUiSettings().setMyLocationButtonEnabled(false); googleMap.getUiSettings().setMyLocationButtonEnabled(false);
googleMap.getUiSettings().setZoomGesturesEnabled(true); googleMap.getUiSettings().setZoomGesturesEnabled(true);
LatLngBounds iitbBounds = new LatLngBounds(new LatLng(19.1249000, 72.9046000), new LatLng(19.143522, 72.920000)); LatLngBounds iitbBounds = new LatLngBounds(new LatLng(19.1249000, 72.9046000), new LatLng(19.143522, 72.920000));
googleMap.setLatLngBoundsForCameraTarget(iitbBounds); googleMap.setLatLngBoundsForCameraTarget(iitbBounds);
googleMap.setMaxZoomPreference(30); googleMap.setMaxZoomPreference(30);
......
...@@ -2,10 +2,10 @@ package in.ac.iitb.gymkhana.iitbapp.fragment; ...@@ -2,10 +2,10 @@ package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.app.SearchManager; import android.app.SearchManager;
import android.content.Context; import android.content.Context;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat; import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
...@@ -13,7 +13,6 @@ import android.view.MenuItem; ...@@ -13,7 +13,6 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ListView; import android.widget.ListView;
import android.support.v7.widget.SearchView;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -25,8 +24,9 @@ public class PeopleFragment extends Fragment { ...@@ -25,8 +24,9 @@ public class PeopleFragment extends Fragment {
View view; View view;
SearchView searchView; SearchView searchView;
PeopleSuggestionAdapter adapter; PeopleSuggestionAdapter adapter;
ArrayList<String> suggestionList=new ArrayList<String>(); ArrayList<String> suggestionList = new ArrayList<String>();
ListView listView; ListView listView;
public PeopleFragment() { public PeopleFragment() {
// Required empty public constructor // Required empty public constructor
} }
...@@ -36,7 +36,7 @@ public class PeopleFragment extends Fragment { ...@@ -36,7 +36,7 @@ public class PeopleFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
// Inflate the layout for this fragment // Inflate the layout for this fragment
view=inflater.inflate(R.layout.fragment_people, container, false); view = inflater.inflate(R.layout.fragment_people, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
suggestionList.add("Web and Coding Club"); suggestionList.add("Web and Coding Club");
...@@ -62,20 +62,17 @@ public class PeopleFragment extends Fragment { ...@@ -62,20 +62,17 @@ public class PeopleFragment extends Fragment {
suggestionList.add("SARC"); suggestionList.add("SARC");
suggestionList.add("Academic Council"); suggestionList.add("Academic Council");
listView= (ListView) view.findViewById(R.id.list_view); listView = (ListView) view.findViewById(R.id.list_view);
listView.setVisibility(View.GONE); listView.setVisibility(View.GONE);
adapter = new PeopleSuggestionAdapter(suggestionList);
adapter=new PeopleSuggestionAdapter(suggestionList);
listView.setAdapter(adapter); listView.setAdapter(adapter);
//TODO SuggestionClickListener //TODO SuggestionClickListener
return view; return view;
} }
......
package in.ac.iitb.gymkhana.iitbapp.gcm; package in.ac.iitb.gymkhana.iitbapp.gcm;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.google.android.gms.gcm.GcmListenerService; import com.google.android.gms.gcm.GcmListenerService;
import in.ac.iitb.gymkhana.iitbapp.MainActivity;
import in.ac.iitb.gymkhana.iitbapp.R;
public class MyGcmListenerService extends GcmListenerService { public class MyGcmListenerService extends GcmListenerService {
private static final String TAG = "MyGcmListenerService";
@Override
public void onMessageReceived(String s, Bundle bundle) {
String message = bundle.getString("message");
Log.d(TAG, "From: " + s);
Log.d(TAG, "Message: " + message);
sendNotification(message);
}
public void sendNotification(String message) {
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
//TODO Change the notification icon
.setSmallIcon(R.drawable.ic_notifications_black_24dp)
.setContentTitle("GCM Message")
.setContentText(message)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
}
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="50dip" /> <corners android:radius="50dip" />
<stroke android:width="0dip" android:color="#667162" /> <stroke android:width="0dip" android:color="#667162" />
<gradient android:angle="-90" android:endColor="#ecf833" android:startColor="#ecf833" /> <gradient android:angle="-90" android:endColor="@color/colorAccent" android:startColor="@color/colorAccent" />
</shape> </shape>
</item> </item>
</selector> </selector>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
android:id="@+id/framelayout_for_fragment" android:id="@+id/framelayout_for_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="in.ac.iitb.gymkhana.iitbapp.MainActivity" tools:context="in.ac.iitb.gymkhana.iitbapp.MainActivity"
tools:showIn="@layout/app_bar_main" tools:showIn="@layout/app_bar_main" />
android:orientation="vertical"/>
...@@ -16,68 +16,74 @@ ...@@ -16,68 +16,74 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="200dp">
android:layout_weight="1">
<ImageView <ImageView
android:id="@+id/iv_eventImage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/iv_eventImage" android:background="#EEEEEE" />
android:background="#EEEEEE"/>
<ImageButton <ImageButton
android:id="@+id/ib_eventImage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:src="@drawable/ic_input_add"
android:background="#EEEEEE" android:background="#EEEEEE"
android:id="@+id/ib_eventImage"/> android:src="@drawable/ic_input_add" />
</RelativeLayout> </RelativeLayout>
<EditText <EditText
android:id="@+id/et_eventName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/et_eventName" android:background="#81d2cb"
android:padding="16dp"
android:hint="Event Name" android:hint="Event Name"
android:padding="16dp"
android:paddingBottom="16dp" android:paddingBottom="16dp"
android:background="#81d2cb"
android:textColorHint="#FFFFFF" android:textColorHint="#FFFFFF"
/> />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:orientation="horizontal" android:layout_height="40dp"
android:layout_marginTop="10dp" android:layout_marginLeft="15dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:layout_height="40dp"> android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:paddingRight="6dp" android:paddingRight="6dp"
android:gravity="bottom" android:gravity="bottom"
android:paddingBottom="5dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/tv_start" android:id="@+id/tv_start"
android:textSize="20sp" android:textSize="20sp"
android:hint=" From " android:hint="From "
android:background="?attr/editTextBackground"
android:paddingTop="8dp"/> android:paddingTop="8dp"/>
<View <View
android:layout_width="3dp" android:layout_width="3dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"/> android:background="@color/common_google_signin_btn_text_dark_disabled" />
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:paddingRight="6dp" android:paddingRight="6dp"
android:paddingLeft="6dp"
android:gravity="bottom" android:gravity="bottom"
android:paddingBottom="5dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/tv_end" android:id="@+id/tv_end"
android:textSize="20sp" android:textSize="20sp"
android:hint=" To " android:hint="To "
android:background="?attr/editTextBackground"
android:paddingTop="8dp"/> android:paddingTop="8dp"/>
...@@ -85,26 +91,29 @@ ...@@ -85,26 +91,29 @@
</LinearLayout> </LinearLayout>
<EditText <EditText
android:layout_width="wrap_content" android:layout_width="match_parent"
android:paddingRight="6dp" android:paddingRight="6dp"
android:paddingLeft="8dp"
android:layout_marginLeft="16dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:id="@+id/et_venue" android:id="@+id/et_venue"
android:hint="Venue"/> android:hint="Venue"/>
<EditText <EditText
android:id="@+id/et_eventDetails"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:gravity="top" android:gravity="top"
android:textSize="20sp"
android:hint="Details" android:hint="Details"
android:layout_weight="1" android:paddingRight="6dp" />
android:id="@+id/et_eventDetails"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"/>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -114,7 +123,7 @@ ...@@ -114,7 +123,7 @@
<TextView android:layout_height="30dp" <TextView android:layout_height="30dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="Advanced Options" android:text="Advanced Options"
android:paddingLeft="16dp" android:paddingLeft="18dp"
android:textSize="20sp" android:textSize="20sp"
android:paddingRight="16dp"/> android:paddingRight="16dp"/>
<ImageView <ImageView
...@@ -135,7 +144,7 @@ ...@@ -135,7 +144,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/cb_public" android:id="@+id/cb_public"
android:layout_marginLeft="12dp" android:layout_marginLeft="20dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:text="Outsiders Allowed "/> android:text="Outsiders Allowed "/>
...@@ -143,7 +152,7 @@ ...@@ -143,7 +152,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/map_location" android:id="@+id/map_location"
android:layout_marginLeft="12dp" android:layout_marginLeft="22dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:hint="Map Location"/> android:hint="Map Location"/>
...@@ -152,13 +161,15 @@ ...@@ -152,13 +161,15 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Request User Info" android:text="Request User Info"
android:layout_marginLeft="12dp" android:layout_marginLeft="20dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:id="@+id/cb_permission"/> android:id="@+id/cb_permission"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
<Button <Button
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
...@@ -167,4 +178,5 @@ ...@@ -167,4 +178,5 @@
android:background="@drawable/round_text_box" android:background="@drawable/round_text_box"
android:id="@+id/button_createEvent" android:id="@+id/button_createEvent"
android:gravity="center"/> android:gravity="center"/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/calendar_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#E0E0E0" android:background="#E0E0E0"
android:id="@+id/calendar_layout"
android:theme="@style/CalendarTheme"> android:theme="@style/CalendarTheme">
...@@ -40,13 +40,13 @@ ...@@ -40,13 +40,13 @@
android:text="# Events Today" /> android:text="# Events Today" />
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:id="@+id/fab" android:layout_alignParentRight="true"
android:layout_margin="16dp" android:layout_margin="16dp"
android:src="@android:drawable/ic_input_add"/> android:src="@android:drawable/ic_input_add" />
</RelativeLayout> </RelativeLayout>
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<ImageView <ImageView
android:id="@+id/event_picture_2" android:id="@+id/event_picture_2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="360dp"
android:scaleType="centerCrop" />
<TextView <TextView
android:id="@+id/event_title_2" android:id="@+id/event_title_2"
...@@ -24,25 +25,29 @@ ...@@ -24,25 +25,29 @@
style="?android:attr/buttonBarStyle" style="?android:attr/buttonBarStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"
android:text="Going" />
<Button <Button
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"
android:text="Interested" />
<Button <Button
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"
android:text="Not Going" />
</LinearLayout> </LinearLayout>
<TextView <TextView
......
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/feed_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.FeedFragment" xmlns=""> tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.FeedFragment">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/feed_recycler_view" android:id="@+id/feed_recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</FrameLayout> </android.support.v4.widget.SwipeRefreshLayout>
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.PeopleFragment"> tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.PeopleFragment">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragment layout -->
...@@ -18,9 +17,9 @@ ...@@ -18,9 +17,9 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:visibility="gone"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_below="@+id/search" /> android:layout_below="@+id/search"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
...@@ -2,27 +2,27 @@ ...@@ -2,27 +2,27 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="8dp" android:orientation="horizontal"
android:orientation="horizontal"> android:paddingTop="8dp">
<ImageView <ImageView
android:layout_weight="1"
android:layout_width="0dp"
android:id="@+id/event_picture" android:id="@+id/event_picture"
android:layout_height="50dp" /> android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1" />
<LinearLayout <LinearLayout
android:orientation="vertical"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3" android:layout_weight="3"
android:layout_height="wrap_content"> android:orientation="vertical">
<TextView <TextView
android:textColor="@android:color/black"
android:textSize="24sp"
android:id="@+id/event_title" android:id="@+id/event_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="24sp" />
<TextView <TextView
android:id="@+id/event_details" android:id="@+id/event_details"
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:src="@drawable/ic_input_add"
android:id="@+id/event_enthu" android:id="@+id/event_enthu"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" /> android:src="@drawable/ic_input_add" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/suggestion_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="suggestion" android:hint="suggestion"
android:padding="8dp" android:padding="8dp"
android:textSize="20sp" android:textSize="20sp" />
android:id="@+id/suggestion_item"/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<group android:checkableBehavior="single"> <group android:checkableBehavior="single">
<item <item
android:id="@+id/nav_feed" android:id="@+id/nav_feed"
android:icon="@drawable/ic_feed" android:icon="@drawable/ic_dashboard_black_48dp"
android:title="Feed" /> android:title="Feed" />
<item <item
android:id="@+id/nav_my_events" android:id="@+id/nav_my_events"
...@@ -15,35 +15,36 @@ ...@@ -15,35 +15,36 @@
android:title="My Events" /> android:title="My Events" />
<item <item
android:id="@+id/nav_pt_cell" android:id="@+id/nav_pt_cell"
android:icon="@drawable/ic_pt" android:icon="@drawable/ic_work_black_48dp"
android:title="PT Cell" /> android:title="PT Cell" />
<item <item
android:id="@+id/nav_mess_menu" android:id="@+id/nav_mess_menu"
android:icon="@drawable/ic_mess_menu" android:icon="@drawable/ic_restaurant_black_48dp"
android:title="Mess Menu" /> android:title="Mess Menu" />
<item <item
android:id="@+id/nav_gc_rankings" android:id="@+id/nav_gc_rankings"
android:icon="@drawable/ic_poll" android:icon="@drawable/ic_equalizer_black_48dp"
android:title="GC Rankings" /> android:title="GC Rankings" />
<item <item
android:id="@+id/nav_calendar" android:id="@+id/nav_calendar"
android:icon="@drawable/ic_calendar" android:icon="@drawable/ic_date_range_black_48dp"
android:title="Calendar" /> android:title="Calendar" />
<item <item
android:id="@+id/nav_timetable" android:id="@+id/nav_timetable"
android:icon="@drawable/ic_timetable" android:icon="@drawable/ic_web_black_48dp"
android:title="Timetable" /> android:title="Timetable" />
<item <item
android:id="@+id/nav_cms" android:id="@+id/nav_cms"
android:icon="@drawable/ic_contacts" android:icon="@drawable/ic_announcement_black_48dp"
android:title="CMS" /> android:title="CMS" />e
<item <item
android:id="@+id/nav_map" android:id="@+id/nav_map"
android:icon="@drawable/ic_map" android:icon="@drawable/ic_map_black_48dp"
android:title="Map" /> android:title="Map" />
<item <item
android:id="@+id/nav_people" android:id="@+id/nav_people"
android:icon="@drawable/ic_supervisor_account_black_48dp"
android:title="People" /> android:title="People" />
</group> </group>
...@@ -55,7 +56,7 @@ ...@@ -55,7 +56,7 @@
android:title="Contacts" /> android:title="Contacts" />
<item <item
android:id="@+id/nav_about" android:id="@+id/nav_about"
android:icon="@drawable/ic_about" android:icon="@drawable/ic_info_black_48dp"
android:title="About" /> android:title="About" />
</menu> </menu>
</item> </item>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/action_notifications" android:id="@+id/action_notifications"
android:orderInCategory="1"
android:icon="@drawable/ic_notifications_black_24dp" android:icon="@drawable/ic_notifications_black_24dp"
android:orderInCategory="1"
android:title="Notifications" android:title="Notifications"
app:showAsAction="always" /> app:showAsAction="always" />
</menu> </menu>
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/action_search" android:id="@+id/action_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="always|collapseActionView"
android:icon="@android:drawable/ic_menu_search" android:icon="@android:drawable/ic_menu_search"
android:title="Search" /> android:title="Search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="always|collapseActionView" />
</menu> </menu>
\ No newline at end of file
...@@ -8,7 +8,7 @@ buildscript { ...@@ -8,7 +8,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha6' classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0' classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
#Mon Jul 03 20:03:13 IST 2017 #Fri Sep 22 00:09:34 IST 2017
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
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