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
aed98789
Commit
aed98789
authored
Feb 02, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use single textview for subtitle on Event Fragment
parent
7937fb1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
43 deletions
+14
-43
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+14
-12
app/src/main/res/layout/fragment_event.xml
app/src/main/res/layout/fragment_event.xml
+0
-31
No files found.
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
aed98789
...
@@ -22,6 +22,7 @@ import android.text.Spannable;
...
@@ -22,6 +22,7 @@ import android.text.Spannable;
import
android.text.SpannableString
;
import
android.text.SpannableString
;
import
android.text.Spanned
;
import
android.text.Spanned
;
import
android.text.TextPaint
;
import
android.text.TextPaint
;
import
android.text.TextUtils
;
import
android.text.method.LinkMovementMethod
;
import
android.text.method.LinkMovementMethod
;
import
android.text.style.ClickableSpan
;
import
android.text.style.ClickableSpan
;
import
android.text.style.ForegroundColorSpan
;
import
android.text.style.ForegroundColorSpan
;
...
@@ -159,8 +160,6 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
...
@@ -159,8 +160,6 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
eventPicture
=
(
ImageView
)
getActivity
().
findViewById
(
R
.
id
.
event_picture_2
);
eventPicture
=
(
ImageView
)
getActivity
().
findViewById
(
R
.
id
.
event_picture_2
);
TextView
eventTitle
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_title
);
TextView
eventTitle
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_title
);
TextView
eventDate
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_date
);
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
eventDescription
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_description
);
TextView
eventDescription
=
(
TextView
)
getActivity
().
findViewById
(
R
.
id
.
event_page_description
);
goingButton
=
getActivity
().
findViewById
(
R
.
id
.
going_button
);
goingButton
=
getActivity
().
findViewById
(
R
.
id
.
going_button
);
interestedButton
=
getActivity
().
findViewById
(
R
.
id
.
interested_button
);
interestedButton
=
getActivity
().
findViewById
(
R
.
id
.
interested_button
);
...
@@ -180,13 +179,6 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
...
@@ -180,13 +179,6 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
Date
Date
=
new
Date
(
timestamp
.
getTime
());
Date
Date
=
new
Date
(
timestamp
.
getTime
());
SimpleDateFormat
simpleDateFormatDate
=
new
SimpleDateFormat
(
"dd MMM"
);
SimpleDateFormat
simpleDateFormatDate
=
new
SimpleDateFormat
(
"dd MMM"
);
SimpleDateFormat
simpleDateFormatTime
=
new
SimpleDateFormat
(
"HH:mm"
);
SimpleDateFormat
simpleDateFormatTime
=
new
SimpleDateFormat
(
"HH:mm"
);
eventDate
.
setText
(
simpleDateFormatDate
.
format
(
Date
));
eventTime
.
setText
(
simpleDateFormatTime
.
format
(
Date
));
StringBuilder
eventVenueName
=
new
StringBuilder
();
for
(
Venue
venue
:
event
.
getEventVenues
())
{
eventVenueName
.
append
(
", "
).
append
(
venue
.
getVenueShortName
());
}
final
List
<
Body
>
bodyList
=
event
.
getEventBodies
();
final
List
<
Body
>
bodyList
=
event
.
getEventBodies
();
bodyRecyclerView
=
(
RecyclerView
)
getActivity
().
findViewById
(
R
.
id
.
body_card_recycler_view
);
bodyRecyclerView
=
(
RecyclerView
)
getActivity
().
findViewById
(
R
.
id
.
body_card_recycler_view
);
...
@@ -194,8 +186,16 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
...
@@ -194,8 +186,16 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
bodyRecyclerView
.
setAdapter
(
bodyAdapter
);
bodyRecyclerView
.
setAdapter
(
bodyAdapter
);
bodyRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
bodyRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
// Common
final
String
timing
=
simpleDateFormatDate
.
format
(
Date
)
+
" | "
+
simpleDateFormatTime
.
format
(
Date
);
StringBuilder
eventVenueName
=
new
StringBuilder
();
for
(
Venue
venue
:
event
.
getEventVenues
())
{
eventVenueName
.
append
(
", "
).
append
(
venue
.
getVenueShortName
());
}
// Make the venues clickable
// Make the venues clickable
if
(
!
eventVenueName
.
toString
().
equals
(
""
)
)
{
if
(
eventVenueName
.
length
()
>
0
)
{
// Get the whole string
// Get the whole string
SpannableString
ss
=
new
SpannableString
(
eventVenueName
.
toString
().
substring
(
2
));
SpannableString
ss
=
new
SpannableString
(
eventVenueName
.
toString
().
substring
(
2
));
...
@@ -226,8 +226,10 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
...
@@ -226,8 +226,10 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
}
}
// Setup the text view
// Setup the text view
eventVenue
.
setText
(
ss
);
eventDate
.
setText
(
TextUtils
.
concat
(
timing
+
" | "
,
ss
));
eventVenue
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
eventDate
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
}
else
{
eventDate
.
setText
(
TextUtils
.
concat
(
timing
));
}
}
interestedButton
.
setOnClickListener
(
getUESOnClickListener
(
1
));
interestedButton
.
setOnClickListener
(
getUESOnClickListener
(
1
));
...
...
app/src/main/res/layout/fragment_event.xml
View file @
aed98789
...
@@ -119,37 +119,6 @@
...
@@ -119,37 +119,6 @@
android:text=
"No Date Specified"
android:text=
"No Date Specified"
android:textColor=
"@color/colorWhite"
android:textColor=
"@color/colorWhite"
android:textSize=
"16sp"
/>
android:textSize=
"16sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
" | "
android:textColor=
"@color/colorWhite"
android:textSize=
"20sp"
/>
<TextView
android:id=
"@+id/event_page_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"No Time Specified"
android:textColor=
"@color/colorWhite"
android:textSize=
"16sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
" | "
android:textColor=
"@color/colorWhite"
android:textSize=
"20sp"
/>
<TextView
android:id=
"@+id/event_page_venue"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:ellipsize=
"end"
android:text=
"Venue"
android:textColor=
"@color/colorWhite"
android:textSize=
"16sp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
...
...
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