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

made the event page dynamic

parent 35190755
......@@ -24,7 +24,7 @@
</value>
</option>
</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" />
</component>
<component name="ProjectType">
......
......@@ -57,7 +57,7 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
// viewHolder.eventDetails.setText(currentEvent.getEventDescription());
Timestamp timestamp = currentEvent.getEventStartTime();
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");
viewHolder.eventDate.setText(simpleDateFormatDate.format(Date));
......
......@@ -12,6 +12,10 @@ import android.widget.TextView;
import com.google.gson.Gson;
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.R;
import in.ac.iitb.gymkhana.iitbapp.data.Event;
......@@ -46,7 +50,10 @@ public class EventFragment extends Fragment {
private void inflateViews(Event event) {
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 eventDescription = (TextView) getActivity().findViewById(R.id.event_description_2);
......@@ -54,5 +61,12 @@ public class EventFragment extends Fragment {
eventTitle.setText(event.getEventName());
eventDetails.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,50 +8,111 @@
<ImageView
android:id="@+id/event_picture_2"
android:layout_width="match_parent"
android:layout_height="360dp"
android:scaleType="centerCrop" />
android:layout_height="0dp"
android:scaleType="centerCrop"
android:layout_weight="1"/>
<TextView
android:id="@+id/event_title_2"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
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_details_2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<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
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<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>
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Going" />
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/event_title_2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Interested" />
<TextView
android:id="@+id/event_details_2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Not Going" />
</LinearLayout>
android:background="@color/colorPrimary"
android:orientation="horizontal">
<TextView
android:id="@+id/event_description_2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Going" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Interested" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Not Going" />
</LinearLayout>
<TextView
android:id="@+id/event_description_2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
......@@ -8,6 +8,7 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/feed_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:paddingTop="8dp"/>
</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