Commit 978f60c1 authored by Owais Chunawala's avatar Owais Chunawala

made the event page dynamic

parent 35190755
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
...@@ -57,7 +57,7 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> { ...@@ -57,7 +57,7 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
// viewHolder.eventDetails.setText(currentEvent.getEventDescription()); // viewHolder.eventDetails.setText(currentEvent.getEventDescription());
Timestamp timestamp = currentEvent.getEventStartTime(); Timestamp timestamp = currentEvent.getEventStartTime();
Date Date = new Date(timestamp.getTime()); Date Date = new Date(timestamp.getTime());
SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("MM/dd/yyyy"); SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("dd MMM");
SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a"); SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a");
viewHolder.eventDate.setText(simpleDateFormatDate.format(Date)); viewHolder.eventDate.setText(simpleDateFormatDate.format(Date));
......
...@@ -12,6 +12,10 @@ import android.widget.TextView; ...@@ -12,6 +12,10 @@ import android.widget.TextView;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import in.ac.iitb.gymkhana.iitbapp.Constants; import in.ac.iitb.gymkhana.iitbapp.Constants;
import in.ac.iitb.gymkhana.iitbapp.R; import in.ac.iitb.gymkhana.iitbapp.R;
import in.ac.iitb.gymkhana.iitbapp.data.Event; import in.ac.iitb.gymkhana.iitbapp.data.Event;
...@@ -46,7 +50,10 @@ public class EventFragment extends Fragment { ...@@ -46,7 +50,10 @@ public class EventFragment extends Fragment {
private void inflateViews(Event event) { private void inflateViews(Event event) {
ImageView eventPicture = (ImageView) getActivity().findViewById(R.id.event_picture_2); ImageView eventPicture = (ImageView) getActivity().findViewById(R.id.event_picture_2);
TextView eventTitle = (TextView) getActivity().findViewById(R.id.event_title_2); TextView eventTitle = (TextView) getActivity().findViewById(R.id.event_page_title);
TextView eventDate = (TextView) getActivity().findViewById(R.id.event_page_date);
TextView eventTime = (TextView) getActivity().findViewById(R.id.event_page_time);
TextView eventVenue = (TextView) getActivity().findViewById(R.id.event_page_venue);
TextView eventDetails = (TextView) getActivity().findViewById(R.id.event_details_2); TextView eventDetails = (TextView) getActivity().findViewById(R.id.event_details_2);
TextView eventDescription = (TextView) getActivity().findViewById(R.id.event_description_2); TextView eventDescription = (TextView) getActivity().findViewById(R.id.event_description_2);
...@@ -54,5 +61,12 @@ public class EventFragment extends Fragment { ...@@ -54,5 +61,12 @@ public class EventFragment extends Fragment {
eventTitle.setText(event.getEventName()); eventTitle.setText(event.getEventName());
eventDetails.setText(event.getEventDescription()); eventDetails.setText(event.getEventDescription());
eventDescription.setText(event.getEventDescription()); eventDescription.setText(event.getEventDescription());
Timestamp timestamp = event.getEventStartTime();
Date Date = new Date(timestamp.getTime());
SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat("dd MMM");
SimpleDateFormat simpleDateFormatTime = new SimpleDateFormat("HH:mm a");
eventDate.setText(simpleDateFormatDate.format(Date));
eventTime.setText(simpleDateFormatDate.format(Date));
eventVenue.setText(event.getEventVenues().get(0).getVenueName());
} }
} }
...@@ -8,9 +8,69 @@ ...@@ -8,9 +8,69 @@
<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="360dp" android:layout_height="0dp"
android:scaleType="centerCrop" /> android:scaleType="centerCrop"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:orientation="vertical"
android:layout_gravity="center_vertical"
android:layout_marginRight="12dp"
android:layout_marginLeft="12dp">
<TextView
android:id="@+id/event_page_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="18sp"
android:text="Event Title"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/event_page_date"
android:text="26 May"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" | "
android:textSize="20dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/event_page_time"
android:text="6:00 PM"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" | "
android:textSize="20dp"/>
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:id="@+id/event_page_venue"
android:text="LH 101"
android:ellipsize="end"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView <TextView
android:id="@+id/event_title_2" android:id="@+id/event_title_2"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -54,4 +114,5 @@ ...@@ -54,4 +114,5 @@
android:id="@+id/event_description_2" android:id="@+id/event_description_2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<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"
android:paddingTop="8dp"/>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
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