Skip to content

Commit

Permalink
fix: Empty organizer section in Ticket Details (fossasia#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman Bansal committed Mar 17, 2019
1 parent 3ab8922 commit 88ecb52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import android.net.Uri
import android.provider.CalendarContract
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_card_order_details.view.calendar
import kotlinx.android.synthetic.main.item_card_order_details.view.date
import kotlinx.android.synthetic.main.item_card_order_details.view.eventDetails
import kotlinx.android.synthetic.main.item_card_order_details.view.eventName
import kotlinx.android.synthetic.main.item_card_order_details.view.eventSummary
import kotlinx.android.synthetic.main.item_card_order_details.view.location
import kotlinx.android.synthetic.main.item_card_order_details.view.date
import kotlinx.android.synthetic.main.item_card_order_details.view.eventSummary
import kotlinx.android.synthetic.main.item_card_order_details.view.organizer
import kotlinx.android.synthetic.main.item_card_order_details.view.map
import kotlinx.android.synthetic.main.item_card_order_details.view.eventDetails
import kotlinx.android.synthetic.main.item_card_order_details.view.organizerLabel
import kotlinx.android.synthetic.main.item_card_order_details.view.name
import kotlinx.android.synthetic.main.item_card_order_details.view.calendar
import kotlinx.android.synthetic.main.item_card_order_details.view.orderIdentifier
import kotlinx.android.synthetic.main.item_card_order_details.view.organizer
import kotlinx.android.synthetic.main.item_card_order_details.view.qrCodeView
import org.fossasia.openevent.general.attendees.Attendee
import org.fossasia.openevent.general.event.Event
Expand All @@ -41,8 +42,12 @@ class OrderDetailsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
itemView.location.text = event.locationName
itemView.date.text = "$formattedDate\n$formattedTime $timezone"
itemView.eventSummary.text = event.description?.stripHtml()
itemView.organizer.text = event.organizerName

if (event.organizerName.isNullOrEmpty()) {
itemView.organizerLabel.visibility = View.GONE
} else {
itemView.organizer.text = event.organizerName
}
itemView.map.setOnClickListener {
val mapUrl = loadMapUrl(event)
val mapIntent = Intent(Intent.ACTION_VIEW, Uri.parse(mapUrl))
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout-land/item_card_order_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
android:layout_margin="@dimen/layout_margin_medium"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/organizerLabel"
android:paddingTop="@dimen/padding_medium"
android:layout_gravity="center"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_card_order_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
tools:text="@string/event_details" />

<TextView
android:id="@+id/organizerLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/organizer"
Expand Down

0 comments on commit 88ecb52

Please sign in to comment.