Skip to content

Commit f07191b

Browse files
committed
fix: event title being cut off in EventDetailsFragment
Fixes: #1499 Changes: - Add right margins and change other attributes according to constraint layout to correct the issue of text being cut off Additional changes: - Refactored a few layout view identifiers to remove ambiguity
1 parent 1ee0e2d commit f07191b

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

app/src/main/java/org/fossasia/openevent/general/event/EventDetailsFragment.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import kotlinx.android.synthetic.main.content_event.view.eventOrganiserName
3535
import kotlinx.android.synthetic.main.content_event.view.eventTimingLinearLayout
3636
import kotlinx.android.synthetic.main.content_event.view.imageMap
3737
import kotlinx.android.synthetic.main.content_event.view.locationUnderMap
38-
import kotlinx.android.synthetic.main.content_event.view.logo
39-
import kotlinx.android.synthetic.main.content_event.view.logoIcon
38+
import kotlinx.android.synthetic.main.content_event.view.eventImage
39+
import kotlinx.android.synthetic.main.content_event.view.organizerLogoIcon
4040
import kotlinx.android.synthetic.main.content_event.view.nestedContentEventScroll
4141
import kotlinx.android.synthetic.main.content_event.view.organizerName
4242
import kotlinx.android.synthetic.main.content_event.view.refundPolicy
@@ -139,7 +139,7 @@ class EventDetailsFragment : Fragment() {
139139
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
140140
rootView.nestedContentEventScroll.setOnScrollChangeListener { _, _, scrollY, _, _ ->
141141
if (thisActivity is AppCompatActivity) {
142-
if (scrollY > rootView.eventName.height + rootView.logo.height)
142+
if (scrollY > rootView.eventName.height + rootView.eventImage.height)
143143
/*Toolbar title set to name of Event if scrolled more than
144144
combined height of eventImage and eventName views*/
145145
thisActivity.supportActionBar?.title = title
@@ -171,7 +171,7 @@ class EventDetailsFragment : Fragment() {
171171
.load(event.logoUrl)
172172
.placeholder(requireDrawable(requireContext(), R.drawable.ic_person_black))
173173
.transform(CircleTransform())
174-
.into(rootView.logoIcon)
174+
.into(rootView.organizerLogoIcon)
175175

176176
val organizerDescriptionListener = View.OnClickListener {
177177
if (rootView.seeMoreOrganizer.text == getString(R.string.see_more)) {
@@ -271,7 +271,7 @@ class EventDetailsFragment : Fragment() {
271271
Picasso.get()
272272
.load(it)
273273
.placeholder(R.drawable.header)
274-
.into(rootView.logo)
274+
.into(rootView.eventImage)
275275
}
276276

277277
// Add event to Calendar

app/src/main/res/layout/content_event.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
<ImageView
17-
android:id="@+id/logo"
17+
android:id="@+id/eventImage"
1818
android:layout_width="@dimen/layout_margin_none"
1919
android:layout_height="@dimen/layout_margin_none"
2020
android:scaleType="centerCrop"
@@ -27,29 +27,30 @@
2727

2828
<TextView
2929
android:id="@+id/eventName"
30-
android:layout_width="wrap_content"
30+
android:layout_width="0dp"
3131
android:layout_height="wrap_content"
32-
android:layout_marginStart="@dimen/layout_margin_large"
3332
android:layout_marginLeft="@dimen/layout_margin_large"
33+
android:layout_marginRight="@dimen/layout_margin_large"
3434
android:layout_marginTop="@dimen/layout_margin_large"
3535
android:fontFamily="sans-serif-light"
3636
android:textColor="@color/dark_grey"
3737
android:textSize="@dimen/text_size_extra_large"
38-
app:layout_constraintStart_toStartOf="@+id/logo"
39-
app:layout_constraintTop_toBottomOf="@+id/logo"
38+
app:layout_constraintStart_toStartOf="@+id/eventImage"
39+
app:layout_constraintTop_toBottomOf="@+id/eventImage"
40+
app:layout_constraintEnd_toEndOf="@+id/eventImage"
4041
tools:text="Open Source Meetup" />
4142

4243
<TextView
4344
android:id="@+id/eventOrganiserName"
44-
android:layout_width="wrap_content"
45+
android:layout_width="0dp"
4546
android:layout_height="wrap_content"
4647
android:layout_marginTop="@dimen/layout_margin_moderate"
4748
android:fontFamily="sans-serif-thin"
48-
android:text="TextView"
4949
android:textColor="@color/dark_grey"
5050
android:textStyle="bold"
5151
app:layout_constraintStart_toStartOf="@+id/eventName"
5252
app:layout_constraintTop_toBottomOf="@+id/eventName"
53+
app:layout_constraintEnd_toEndOf="@+id/eventName"
5354
tools:text="by FOSSASIA"
5455
android:visibility="gone" />
5556

@@ -128,7 +129,7 @@
128129
</LinearLayout>
129130

130131
<LinearLayout
131-
android:id="@+id/linearLayout"
132+
android:id="@+id/refundPolicyLinearLayout"
132133
android:layout_width="0dp"
133134
android:layout_height="wrap_content"
134135
android:layout_marginTop="@dimen/layout_margin_large"
@@ -179,7 +180,7 @@
179180
app:layout_constraintEnd_toEndOf="parent"
180181
app:layout_constraintHorizontal_bias="0.5"
181182
app:layout_constraintStart_toStartOf="parent"
182-
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
183+
app:layout_constraintTop_toBottomOf="@+id/refundPolicyLinearLayout"
183184
tools:visibility="visible">
184185

185186
<View
@@ -316,10 +317,11 @@
316317
android:orientation="horizontal">
317318

318319
<ImageView
319-
android:id="@+id/logoIcon"
320+
android:id="@+id/organizerLogoIcon"
320321
android:layout_width="@dimen/logo_icon_width"
321322
android:layout_height="@dimen/logo_icon_height"
322323
android:layout_marginRight="@dimen/layout_margin_large"
324+
android:layout_marginEnd="@dimen/layout_margin_large"
323325
android:layout_gravity="center_horizontal"
324326
android:layout_marginBottom="@dimen/layout_margin_small"
325327
android:scaleType="centerCrop"
@@ -365,6 +367,7 @@
365367
android:layout_width="match_parent"
366368
android:layout_height="wrap_content"
367369
android:paddingLeft="@dimen/padding_large"
370+
android:paddingRight="@dimen/padding_large"
368371
android:paddingTop="@dimen/padding_small" />
369372
</LinearLayout>
370373

0 commit comments

Comments
 (0)