Commit fd65a25e authored by Sajal Narang's avatar Sajal Narang

Reformat code

parent 17339d0d
......@@ -2,9 +2,11 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/IITB-App.iml" filepath="$PROJECT_DIR$/IITB-App.iml" />
<module fileurl="file://$PROJECT_DIR$/IITB-App.iml" filepath="$PROJECT_DIR$/IITB-App.iml" />
<module fileurl="file://$PROJECT_DIR$/IITBApp.iml" filepath="$PROJECT_DIR$/IITBApp.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "in.ac.iitb.gymkhana.iitbapp"
manifestPlaceholders 'appAuthRedirectScheme': 'https'
minSdkVersion 17
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
......@@ -22,9 +22,9 @@ android {
}
ext {
supportLibVersion = '25.3.1'
playServicesVersion = '11.0.2'
butterKnifeVersion = '8.6.0'
supportLibVersion = '26.1.0'
playServicesVersion = '11.6.2'
butterKnifeVersion = '8.7.0'
appAuthVersion = '0.2.0'
retrofitVersion = '2.1.0'
okhttpVersion = '3.4.1'
......@@ -51,6 +51,5 @@ dependencies {
compile "com.squareup.okhttp3:okhttp:${okhttpVersion}"
compile "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
compile "com.squareup.picasso:picasso:${picassoVersion}"
implementation 'com.android.support:support-v4:25.4.0'
}
apply plugin: 'com.google.gms.google-services'
......@@ -20,11 +20,8 @@ import android.widget.Toast;
import com.google.gson.Gson;
import java.util.List;
import in.ac.iitb.gymkhana.iitbapp.api.RetrofitInterface;
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.NotificationsResponse;
import in.ac.iitb.gymkhana.iitbapp.fragment.AboutFragment;
......
package in.ac.iitb.gymkhana.iitbapp;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -13,9 +12,6 @@ import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by mrunz on 6/7/17.
*/
......
......@@ -13,6 +13,7 @@ public class ServiceGenerator {
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create());
private static Retrofit retrofit;
public static <S> S createService(Class<S> serviceClass) {
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
......
......@@ -55,24 +55,24 @@ public class AddEventFragment extends Fragment {
container.removeAllViews();
view = inflater.inflate(R.layout.fragment_add_event, container, false);
ButterKnife.bind(this,view);
ButterKnife.bind(this, view);
date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar=Calendar.getInstance();
int mYear=calendar.get(Calendar.YEAR);
int mMonth=calendar.get(Calendar.MONTH);
int mDay=calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePickerDialog=new DatePickerDialog(getContext(), new DatePickerDialog.OnDateSetListener() {
Calendar calendar = Calendar.getInstance();
int mYear = calendar.get(Calendar.YEAR);
int mMonth = calendar.get(Calendar.MONTH);
int mDay = calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePickerDialog = new DatePickerDialog(getContext(), new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
date.setText(dayOfMonth + "/" + month + "/" + year);
}
} ,mYear,mMonth,mDay);
datePickerDialog.show();
}, mYear, mMonth, mDay);
datePickerDialog.show();
}
});
......@@ -81,16 +81,16 @@ public class AddEventFragment extends Fragment {
@Override
public void onClick(View v) {
Calendar calendar=Calendar.getInstance();
int mHour=calendar.get(Calendar.HOUR_OF_DAY);
int mMin=calendar.get(Calendar.MINUTE);
Calendar calendar = Calendar.getInstance();
int mHour = calendar.get(Calendar.HOUR_OF_DAY);
int mMin = calendar.get(Calendar.MINUTE);
TimePickerDialog timePickerDialog=new TimePickerDialog(getContext(), new TimePickerDialog.OnTimeSetListener() {
TimePickerDialog timePickerDialog = new TimePickerDialog(getContext(), new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
time.setText(hourOfDay+":"+minute);
time.setText(hourOfDay + ":" + minute);
}
},mHour,mMin,true);
}, mHour, mMin, true);
timePickerDialog.show();
}
......@@ -98,14 +98,14 @@ public class AddEventFragment extends Fragment {
imageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getContext(),"Add Image", Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), "Add Image", Toast.LENGTH_SHORT).show();
//TODO (1) upload image to server
}
});
createEvent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getContext(),"Add Event", Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), "Add Event", Toast.LENGTH_SHORT).show();
//TODO (2) save event
}
});
......
......@@ -18,9 +18,9 @@ import in.ac.iitb.gymkhana.iitbapp.R;
*/
public class CalendarFragment extends Fragment {
FloatingActionButton fab;
private View view;
private Toast toast;
FloatingActionButton fab;
public CalendarFragment() {
// Required empty public constructor
......@@ -33,7 +33,7 @@ public class CalendarFragment extends Fragment {
// Inflate the layout for this fragment
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
simpleCalendarView.setFirstDayOfWeek(1); // set Sunday as the first day of the week
......@@ -52,14 +52,14 @@ public class CalendarFragment extends Fragment {
}
});
fab.setOnClickListener(new View.OnClickListener(){
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AddEventFragment addEventFragment=new AddEventFragment();
AddEventFragment addEventFragment = new AddEventFragment();
FragmentTransaction ft = getChildFragmentManager().beginTransaction();
ft.replace(R.id.calendar_layout,addEventFragment);
ft.replace(R.id.calendar_layout, addEventFragment);
ft.addToBackStack("addEvent");
ft.commit();
}
......
......@@ -17,9 +17,7 @@ import android.view.ViewGroup;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List;
import in.ac.iitb.gymkhana.iitbapp.Constants;
......@@ -105,7 +103,7 @@ public class FeedFragment extends Fragment {
private void updateFeed() {
NewsFeedRequest newsFeedRequest = new NewsFeedRequest(NewsFeedRequest.FOLLOWED, 0, 20);
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.getNewsFeed(newsFeedRequest ).enqueue(new Callback<NewsFeedResponse>() {
retrofitInterface.getNewsFeed(newsFeedRequest).enqueue(new Callback<NewsFeedResponse>() {
@Override
public void onResponse(Call<NewsFeedResponse> call, Response<NewsFeedResponse> response) {
if (response.isSuccessful()) {
......
......@@ -2,10 +2,10 @@ package in.ac.iitb.gymkhana.iitbapp.fragment;
import android.app.SearchManager;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.SearchView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
......@@ -13,7 +13,6 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.support.v7.widget.SearchView;
import java.util.ArrayList;
......@@ -25,8 +24,9 @@ public class PeopleFragment extends Fragment {
View view;
SearchView searchView;
PeopleSuggestionAdapter adapter;
ArrayList<String> suggestionList=new ArrayList<String>();
ArrayList<String> suggestionList = new ArrayList<String>();
ListView listView;
public PeopleFragment() {
// Required empty public constructor
}
......@@ -36,7 +36,7 @@ public class PeopleFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// 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);
suggestionList.add("Web and Coding Club");
......@@ -62,21 +62,18 @@ public class PeopleFragment extends Fragment {
suggestionList.add("SARC");
suggestionList.add("Academic Council");
listView= (ListView) view.findViewById(R.id.list_view);
listView = (ListView) view.findViewById(R.id.list_view);
listView.setVisibility(View.GONE);
adapter=new PeopleSuggestionAdapter(suggestionList);
adapter = new PeopleSuggestionAdapter(suggestionList);
listView.setAdapter(adapter);
//TODO SuggestionClickListener
return view;
return view;
}
@Override
......
......@@ -5,7 +5,7 @@
android:id="@+id/framelayout_for_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="in.ac.iitb.gymkhana.iitbapp.MainActivity"
tools:showIn="@layout/app_bar_main"
android:orientation="vertical"/>
tools:showIn="@layout/app_bar_main" />
......@@ -9,119 +9,124 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ImageView
android:id="@+id/iv_eventImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/iv_eventImage"
android:background="#EEEEEE"/>
android:background="#EEEEEE" />
<ImageButton
android:id="@+id/ib_eventImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ic_input_add"
android:background="#EEEEEE"
android:id="@+id/ib_eventImage"/>
android:src="@drawable/ic_input_add" />
</RelativeLayout>
<EditText
android:id="@+id/et_eventName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/et_eventName"
android:padding="16dp"
android:background="#81d2cb"
android:hint="Event Name"
android:padding="16dp"
android:paddingBottom="16dp"
android:background="#81d2cb"
android:textColorHint="#FFFFFF"
/>
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_height="40dp">
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:paddingRight="6dp"
android:paddingLeft="6dp"
android:layout_height="match_parent"
android:id="@+id/tv_date"
android:hint=" Date "
android:paddingTop="8dp"/>
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="8dp" />
<View
android:layout_width="3dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/common_google_signin_btn_text_dark_disabled"/>
android:layout_marginTop="5dp"
android:background="@color/common_google_signin_btn_text_dark_disabled" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:paddingRight="6dp"
android:paddingLeft="6dp"
android:layout_height="match_parent"
android:id="@+id/tv_time"
android:hint=" Time "
android:paddingTop="8dp"/>
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="8dp" />
<View
android:layout_width="3dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/common_google_signin_btn_text_dark_disabled"/>
android:layout_marginTop="5dp"
android:background="@color/common_google_signin_btn_text_dark_disabled" />
<EditText
android:id="@+id/et_venue"
android:layout_width="wrap_content"
android:paddingRight="6dp"
android:paddingLeft="6dp"
android:layout_height="match_parent"
android:id="@+id/et_venue"
android:hint="Venue"/>
android:hint="Venue"
android:paddingLeft="6dp"
android:paddingRight="6dp" />
</LinearLayout>
<EditText
android:id="@+id/et_eventDetails"
android:layout_width="match_parent"
android:layout_height="0dp"
android:gravity="top"
android:hint="Details"
android:layout_weight="1"
android:id="@+id/et_eventDetails"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:background="#E0E0E0"
/>
android:gravity="top"
android:hint="Details"
android:paddingLeft="6dp"
android:paddingRight="6dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
>
android:layout_marginTop="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Public"
android:textSize="18sp"
android:layout_marginLeft="8dp"
android:paddingLeft="8dp"/>
android:paddingLeft="8dp"
android:text="Public"
android:textSize="18sp" />
<CheckBox
android:id="@+id/cb_public"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:id="@+id/cb_public"
android:layout_marginRight="10dp"/>
android:layout_marginRight="10dp" />
</RelativeLayout>
<Button
android:id="@+id/button_createEvent"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/colorAccent"
android:text="Create"
android:id="@+id/button_createEvent"
android:gravity="center"/>
android:gravity="center"
android:text="Create" />
</LinearLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/calendar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E0E0E0"
android:id="@+id/calendar_layout"
android:theme="@style/CalendarTheme">
......@@ -40,13 +40,13 @@
android:text="# Events Today" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:id="@+id/fab"
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:src="@android:drawable/ic_input_add"/>
android:src="@android:drawable/ic_input_add" />
</RelativeLayout>
......@@ -6,10 +6,10 @@
tools:context="in.ac.iitb.gymkhana.iitbapp.fragment.EventFragment">
<ImageView
android:scaleType="centerCrop"
android:id="@+id/event_picture_2"
android:layout_width="match_parent"
android:layout_height="360dp" />
android:layout_height="360dp"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/event_title_2"
......@@ -22,32 +22,32 @@
android:layout_height="wrap_content" />
<LinearLayout
android:background="@color/colorPrimary"
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<Button
android:text="Going"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:text="Going" />
<Button
android:text="Interested"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:text="Interested" />
<Button
android:text="Not Going"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:text="Not Going" />
</LinearLayout>
<TextView
......
......@@ -2,25 +2,24 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="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">
<!-- 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"/>-->
<!--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:visibility="gone"
android:layout_alignParentStart="true"
android:layout_below="@+id/search" />
android:layout_below="@+id/search"
android:visibility="gone" />
</RelativeLayout>
......@@ -2,27 +2,27 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="8dp">
<ImageView
android:layout_weight="1"
android:layout_width="0dp"
android:id="@+id/event_picture"
android:layout_height="50dp" />
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_height="wrap_content">
android:orientation="vertical">
<TextView
android:textColor="@android:color/black"
android:textSize="24sp"
android:id="@+id/event_title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="24sp" />
<TextView
android:id="@+id/event_details"
......@@ -32,10 +32,10 @@
</LinearLayout>
<ImageView
android:src="@drawable/ic_input_add"
android:id="@+id/event_enthu"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content" />
android:src="@drawable/ic_input_add" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/suggestion_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="suggestion"
android:padding="8dp"
android:textSize="20sp"
android:id="@+id/suggestion_item"/>
android:textSize="20sp" />
</LinearLayout>
\ No newline at end of file
......@@ -24,8 +24,8 @@
android:title="Mess Menu" />
<item
android:id="@+id/nav_gc_rankings"
android:title="GC Rankings"
android:icon="@drawable/ic_equalizer_black_48dp"/>
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"
......@@ -44,8 +44,8 @@
android:title="Map" />
<item
android:id="@+id/nav_people"
android:title="People"
android:icon="@drawable/ic_supervisor_account_black_48dp"/>
android:icon="@drawable/ic_supervisor_account_black_48dp"
android:title="People" />
</group>
<item android:title="Communicate">
......
......@@ -3,8 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_notifications"
android:orderInCategory="1"
android:icon="@drawable/ic_notifications_black_24dp"
android:orderInCategory="1"
android:title="Notifications"
app:showAsAction="always" />
</menu>
......@@ -4,8 +4,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="always|collapseActionView"
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>
\ No newline at end of file
......@@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
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