Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
978f60c1
Commit
978f60c1
authored
Mar 17, 2018
by
Owais Chunawala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made the event page dynamic
parent
35190755
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
41 deletions
+117
-41
.idea/misc.xml
.idea/misc.xml
+1
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/adapter/FeedAdapter.java
...java/in/ac/iitb/gymkhana/iitbapp/adapter/FeedAdapter.java
+1
-1
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/EventFragment.java
...a/in/ac/iitb/gymkhana/iitbapp/fragment/EventFragment.java
+15
-1
app/src/main/res/layout/fragment_event.xml
app/src/main/res/layout/fragment_event.xml
+98
-37
app/src/main/res/layout/fragment_feed.xml
app/src/main/res/layout/fragment_feed.xml
+2
-1
No files found.
.idea/misc.xml
View file @
978f60c1
...
...
@@ -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"
>
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/adapter/FeedAdapter.java
View file @
978f60c1
...
...
@@ -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
));
...
...
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/fragment/EventFragment.java
View file @
978f60c1
...
...
@@ -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
());
}
}
app/src/main/res/layout/fragment_event.xml
View file @
978f60c1
...
...
@@ -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_w
eight=
"1
"
android:
text=
"Going
"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<TextView
android:
id=
"@+id/event_title_2
"
android:layout_w
idth=
"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/buttonBar
Button
Style"
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>
app/src/main/res/layout/fragment_feed.xml
View file @
978f60c1
...
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment