Commit 62e21c5e authored by Sajal Narang's avatar Sajal Narang

Add ScrollView in EventFragment, fix minor bugs, fix #81

parent 38eaca6a
...@@ -53,12 +53,14 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> { ...@@ -53,12 +53,14 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
viewHolder.eventTitle.setText(currentEvent.getEventName()); viewHolder.eventTitle.setText(currentEvent.getEventName());
// viewHolder.eventDetails.setText(currentEvent.getEventDescription()); // viewHolder.eventDetails.setText(currentEvent.getEventDescription());
Timestamp timestamp = currentEvent.getEventStartTime(); Timestamp timestamp = currentEvent.getEventStartTime();
Date Date = new Date(timestamp.getTime()); if (timestamp != null) {
SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("dd MMM"); Date Date = new Date(timestamp.getTime());
SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a"); SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("dd MMM");
SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a");
viewHolder.eventDate.setText(simpleDateFormatDate.format(Date)); viewHolder.eventDate.setText(simpleDateFormatDate.format(Date));
viewHolder.eventTime.setText(simpleDateFormatTime.format(Date)); viewHolder.eventTime.setText(simpleDateFormatTime.format(Date));
}
StringBuilder eventVenueName = new StringBuilder(); StringBuilder eventVenueName = new StringBuilder();
for (Venue venue : currentEvent.getEventVenues()) { for (Venue venue : currentEvent.getEventVenues()) {
eventVenueName.append(", ").append(venue.getVenueName()); eventVenueName.append(", ").append(venue.getVenueName());
......
...@@ -134,9 +134,13 @@ public class FeedFragment extends BaseFragment { ...@@ -134,9 +134,13 @@ public class FeedFragment extends BaseFragment {
getActivityBuffer().safely(new ActivityBuffer.IRunnable() { getActivityBuffer().safely(new ActivityBuffer.IRunnable() {
@Override @Override
public void run(Activity pActivity) { public void run(Activity pActivity) {
feedRecyclerView = getActivity().findViewById(R.id.feed_recycler_view); try {
feedRecyclerView.setAdapter(feedAdapter); feedRecyclerView = getActivity().findViewById(R.id.feed_recycler_view);
feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); feedRecyclerView.setAdapter(feedAdapter);
feedRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
} catch (NullPointerException e) {
e.printStackTrace();
}
} }
}); });
} }
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:layout_marginLeft="16dp" android:layout_marginStart="16dp"
android:layout_marginRight="16dp" android:layout_marginEnd="16dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:layout_weight="3" android:layout_weight="3"
android:orientation="vertical"> android:orientation="vertical">
...@@ -150,21 +150,24 @@ ...@@ -150,21 +150,24 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginBottom="6dp" android:layout_marginLeft="8dp"
android:layout_marginLeft="6dp" android:layout_marginRight="8dp"
android:layout_marginRight="6dp"
android:background="#aaa"> android:background="#aaa">
</View> </View>
<TextView <ScrollView
android:id="@+id/event_page_description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" <TextView
android:layout_marginTop="8dp" android:id="@+id/event_page_description"
android:textColor="#777" android:layout_width="match_parent"
android:textSize="16sp" /> android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:textColor="#777"
android:textSize="16sp" />
</ScrollView>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
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