Skip to content

Commit a10c9af

Browse files
AkshayCHDiamareebjamal
authored andcommitted
feat: Add Session type in SessionDetailActivity (fossasia#2342) (fossasia#2344)
1 parent d10fc02 commit a10c9af

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

android/app/src/main/java/org/fossasia/openevent/core/track/session/SessionDetailActivity.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.fossasia.openevent.core.bookmark.OnBookmarkSelectedListener;
5353
import org.fossasia.openevent.data.Microlocation;
5454
import org.fossasia.openevent.data.Session;
55+
import org.fossasia.openevent.data.SessionType;
5556
import org.fossasia.openevent.data.Speaker;
5657
import org.fossasia.openevent.data.Track;
5758
import org.fossasia.openevent.data.repository.RealmDataRepository;
@@ -113,6 +114,12 @@ public class SessionDetailActivity extends BaseActivity implements AppBarLayout.
113114
protected ImageView youtubeThumbnail;
114115
@BindView(R.id.watch)
115116
protected ImageButton playButton;
117+
@BindView(R.id.sessionType)
118+
protected TextView sessionType;
119+
@BindView(R.id.type)
120+
protected TextView typeLabel;
121+
@BindView(R.id.typeLayout)
122+
protected LinearLayout typelayout;
116123

117124
private String trackName, title, location;
118125
private int trackColor, darkColor, fontColor;
@@ -140,6 +147,7 @@ public void onCreate(final Bundle savedInstanceState) {
140147

141148
title = getIntent().getStringExtra(ConstantStrings.SESSION);
142149
trackName = getIntent().getStringExtra(ConstantStrings.TRACK);
150+
143151
if (TextUtils.isEmpty(trackName))
144152
hasTrack = false;
145153
id = getIntent().getIntExtra(ConstantStrings.ID, 0);
@@ -213,6 +221,13 @@ private void updateSession() {
213221
text_room1.setText(location);
214222
}
215223

224+
SessionType type = session.getSessionType();
225+
226+
if (type != null) {
227+
sessionType.setText(type.getName());
228+
typelayout.setVisibility(View.VISIBLE);
229+
}
230+
216231
text_title.setText(title);
217232
if (TextUtils.isEmpty(session.getSubtitle())) {
218233
text_subtitle.setVisibility(View.GONE);

android/app/src/main/res/layout/content_session_detail.xml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
android:layout_height="wrap_content"
4040
android:columnCount="3"
4141
android:padding="10dp"
42-
android:rowCount="4">
42+
android:rowCount="5">
4343

4444
<TextView
4545
android:id="@+id/trak"
@@ -67,6 +67,43 @@
6767
android:textColor="@color/primary_text"
6868
android:textSize="@dimen/text_size_large" />
6969

70+
<TextView
71+
android:id="@+id/type"
72+
android:layout_width="wrap_content"
73+
android:layout_height="wrap_content"
74+
android:layout_marginEnd="@dimen/layout_margin_medium"
75+
android:layout_marginRight="30dp"
76+
android:text="@string/type"
77+
android:textColor="@color/primary_text"
78+
android:textSize="@dimen/text_size_large"
79+
android:textStyle="bold" />
80+
81+
<LinearLayout
82+
android:layout_width="wrap_content"
83+
android:layout_height="wrap_content"
84+
android:layout_columnSpan="2"
85+
android:id="@+id/typeLayout"
86+
android:visibility="gone"
87+
android:layout_rowSpan="1">
88+
89+
<TextView
90+
android:id="@+id/dot"
91+
android:layout_width="wrap_content"
92+
android:layout_height="wrap_content"
93+
android:text="@string/dot_session"
94+
android:textColor="@color/primary_text"
95+
android:textSize="@dimen/text_size_large"
96+
android:textStyle="bold" />
97+
98+
<TextView
99+
android:id="@+id/sessionType"
100+
android:layout_width="wrap_content"
101+
android:layout_height="wrap_content"
102+
android:textColor="@color/primary_text"
103+
android:textSize="@dimen/text_size_large" />
104+
105+
</LinearLayout>
106+
70107
<TextView
71108
android:id="@+id/date"
72109
android:layout_width="wrap_content"

android/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
<string name="no_notification">No notifications yet!</string>
212212
<string name="charges_warning">Data charges may apply</string>
213213
<string name="tracks">Track</string>
214+
<string name="type">Type</string>
214215
<string name="dot_session">:&#160;</string>
215216
<string name="date">Date</string>
216217
<string name="duration">Duration</string>

0 commit comments

Comments
 (0)