Skip to content

fix: event title being cut off in EventDetailsFragment #1500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import kotlinx.android.synthetic.main.content_event.view.eventOrganiserName
import kotlinx.android.synthetic.main.content_event.view.eventTimingLinearLayout
import kotlinx.android.synthetic.main.content_event.view.imageMap
import kotlinx.android.synthetic.main.content_event.view.locationUnderMap
import kotlinx.android.synthetic.main.content_event.view.logo
import kotlinx.android.synthetic.main.content_event.view.logoIcon
import kotlinx.android.synthetic.main.content_event.view.eventImage
import kotlinx.android.synthetic.main.content_event.view.organizerLogoIcon
import kotlinx.android.synthetic.main.content_event.view.nestedContentEventScroll
import kotlinx.android.synthetic.main.content_event.view.organizerName
import kotlinx.android.synthetic.main.content_event.view.refundPolicy
Expand Down Expand Up @@ -139,7 +139,7 @@ class EventDetailsFragment : Fragment() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
rootView.nestedContentEventScroll.setOnScrollChangeListener { _, _, scrollY, _, _ ->
if (thisActivity is AppCompatActivity) {
if (scrollY > rootView.eventName.height + rootView.logo.height)
if (scrollY > rootView.eventName.height + rootView.eventImage.height)
/*Toolbar title set to name of Event if scrolled more than
combined height of eventImage and eventName views*/
thisActivity.supportActionBar?.title = title
Expand Down Expand Up @@ -171,7 +171,7 @@ class EventDetailsFragment : Fragment() {
.load(event.logoUrl)
.placeholder(requireDrawable(requireContext(), R.drawable.ic_person_black))
.transform(CircleTransform())
.into(rootView.logoIcon)
.into(rootView.organizerLogoIcon)

val organizerDescriptionListener = View.OnClickListener {
if (rootView.seeMoreOrganizer.text == getString(R.string.see_more)) {
Expand Down Expand Up @@ -271,7 +271,7 @@ class EventDetailsFragment : Fragment() {
Picasso.get()
.load(it)
.placeholder(R.drawable.header)
.into(rootView.logo)
.into(rootView.eventImage)
}

// Add event to Calendar
Expand Down
23 changes: 13 additions & 10 deletions app/src/main/res/layout/content_event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


<ImageView
android:id="@+id/logo"
android:id="@+id/eventImage"
android:layout_width="@dimen/layout_margin_none"
android:layout_height="@dimen/layout_margin_none"
android:scaleType="centerCrop"
Expand All @@ -27,29 +27,30 @@

<TextView
android:id="@+id/eventName"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_margin_large"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginTop="@dimen/layout_margin_large"
android:fontFamily="sans-serif-light"
android:textColor="@color/dark_grey"
android:textSize="@dimen/text_size_extra_large"
app:layout_constraintStart_toStartOf="@+id/logo"
app:layout_constraintTop_toBottomOf="@+id/logo"
app:layout_constraintStart_toStartOf="@+id/eventImage"
app:layout_constraintTop_toBottomOf="@+id/eventImage"
app:layout_constraintEnd_toEndOf="@+id/eventImage"
tools:text="Open Source Meetup" />

<TextView
android:id="@+id/eventOrganiserName"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_moderate"
android:fontFamily="sans-serif-thin"
android:text="TextView"
android:textColor="@color/dark_grey"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@+id/eventName"
app:layout_constraintTop_toBottomOf="@+id/eventName"
app:layout_constraintEnd_toEndOf="@+id/eventName"
tools:text="by FOSSASIA"
android:visibility="gone" />

Expand Down Expand Up @@ -128,7 +129,7 @@
</LinearLayout>

<LinearLayout
android:id="@+id/linearLayout"
android:id="@+id/refundPolicyLinearLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_large"
Expand Down Expand Up @@ -179,7 +180,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
app:layout_constraintTop_toBottomOf="@+id/refundPolicyLinearLayout"
tools:visibility="visible">

<View
Expand Down Expand Up @@ -316,10 +317,11 @@
android:orientation="horizontal">

<ImageView
android:id="@+id/logoIcon"
android:id="@+id/organizerLogoIcon"
android:layout_width="@dimen/logo_icon_width"
android:layout_height="@dimen/logo_icon_height"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginEnd="@dimen/layout_margin_large"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/layout_margin_small"
android:scaleType="centerCrop"
Expand Down Expand Up @@ -365,6 +367,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/padding_large"
android:paddingRight="@dimen/padding_large"
android:paddingTop="@dimen/padding_small" />
</LinearLayout>

Expand Down