Commit f7665cac authored by Yash Khemchandani's avatar Yash Khemchandani

Updated Variable Names according to Conventions

parent 26129725
......@@ -7,6 +7,7 @@ public class Constants {
public static final int RESULT_LOAD_IMAGE = 11;
public static final String NOTIFICATIONS_RESPONSE_JSON = "notifications_json";
public static final String EVENT_JSON = "event_json";
public static final String EVENT_LIST_JSON = "event_list_json";
public static final String USER_ID = "user_id";
public static final String USER_HOSTEL = "user_hostel";
public static final String SENT_TOKEN_TO_SERVER = "sentTokenToServer";
......@@ -19,5 +20,6 @@ public class Constants {
public static final int STATUS_GOING = 2;
public static final int STATUS_INTERESTED = 1;
public static final int STATUS_NOT_GOING = 0;
public static final String BODY_JSON= "body_json";
public static final String BODY_JSON = "body_json";
public static final String BODY_LIST_JSON = "body_list_json";
}
......@@ -30,7 +30,7 @@ import in.ac.iitb.gymkhana.iitbapp.data.Body;
*/
public class BodyRecyclerViewFragment extends Fragment {
private static final String TAG = "BodyRecyclerViewFragment";
private static final String ARG_BODY = "bodies";
private RecyclerView recyclerView;
private BodyAdapter bodyAdapter;
......@@ -42,10 +42,10 @@ public class BodyRecyclerViewFragment extends Fragment {
}
// TODO: Rename and change types and number of parameters
public static BodyRecyclerViewFragment newInstance(List<Body> arg_bodyList) {
public static BodyRecyclerViewFragment newInstance(List<Body> bodyList) {
BodyRecyclerViewFragment fragment = new BodyRecyclerViewFragment();
Bundle args = new Bundle();
args.putString(ARG_BODY, new Gson().toJson(arg_bodyList));
args.putString(Constants.BODY_LIST_JSON, new Gson().toJson(bodyList));
fragment.setArguments(args);
return fragment;
}
......@@ -54,7 +54,8 @@ public class BodyRecyclerViewFragment extends Fragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
bodyList = new Gson().fromJson(getArguments().getString(ARG_BODY), new TypeToken<List<Body>>(){}.getType());
bodyList = new Gson().fromJson(getArguments().getString(Constants.BODY_LIST_JSON
), new TypeToken<List<Body>>(){}.getType());
}
}
......
......@@ -29,7 +29,7 @@ import in.ac.iitb.gymkhana.iitbapp.data.Event;
*/
public class EventRecyclerViewFragment extends Fragment {
private static final String TAG = "EventRecyclerViewFragment";
private static final String ARG_EVENT= "events";
private RecyclerView recyclerView;
private FeedAdapter feedAdapter;
......@@ -41,10 +41,10 @@ public class EventRecyclerViewFragment extends Fragment {
}
// TODO: Rename and change types and number of parameters
public static EventRecyclerViewFragment newInstance(List<Event> arg_eventList) {
public static EventRecyclerViewFragment newInstance(List<Event> eventList) {
EventRecyclerViewFragment fragment = new EventRecyclerViewFragment();
Bundle args = new Bundle();
args.putString(ARG_EVENT, new Gson().toJson(arg_eventList));
args.putString(Constants.EVENT_LIST_JSON, new Gson().toJson(eventList));
fragment.setArguments(args);
return fragment;
}
......@@ -53,7 +53,7 @@ public class EventRecyclerViewFragment extends Fragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
eventList = new Gson().fromJson(getArguments().getString(ARG_EVENT), new TypeToken<List<Event>>(){}.getType());
eventList = new Gson().fromJson(getArguments().getString(Constants.EVENT_LIST_JSON), new TypeToken<List<Event>>(){}.getType());
}
}
......
......@@ -6,7 +6,6 @@
android:orientation="vertical"
tools:context=".fragment.BodyRecyclerViewFragment">
<!-- TODO: Update blank fragment layout -->
<android.support.v7.widget.RecyclerView
android:id="@+id/body_recycler_view"
......
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