Skip to content
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 @@ -99,7 +99,12 @@ class SessionFragment : Fragment() {
rootView.speakersProgressBar.isVisible = false
})

sessionViewModel.loadSession(safeArgs.sessionId)
val currentSession = sessionViewModel.session.value
if (currentSession == null)
sessionViewModel.loadSession(safeArgs.sessionId)
else
makeSessionView(currentSession)

val currentSpeakers = sessionViewModel.speakersUnderSession.value
if (currentSpeakers == null)
sessionViewModel.loadSpeakersUnderSession(safeArgs.sessionId)
Expand Down Expand Up @@ -239,7 +244,8 @@ class SessionFragment : Fragment() {
rootView.sessionDetailAbstract.post {
if (rootView.sessionDetailAbstract.lineCount > LINE_COUNT_ABSTRACT) {
rootView.sessionDetailAbstractSeeMore.isVisible = true
rootView.sessionDetailAbstractContainer.setOnClickListener(sessionAbstractClickListener)
rootView.sessionDetailAbstract.setOnClickListener(sessionAbstractClickListener)
rootView.sessionDetailAbstractSeeMore.setOnClickListener(sessionAbstractClickListener)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.graphics.Color
import android.view.View
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.item_session.view.mircolocation
import kotlinx.android.synthetic.main.item_session.view.microLocation
import kotlinx.android.synthetic.main.item_session.view.sessionType
import kotlinx.android.synthetic.main.item_session.view.sessiontime
import kotlinx.android.synthetic.main.item_session.view.shortAbstract
Expand All @@ -23,16 +23,22 @@ class SessionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

fun bind(session: Session) {
itemView.title.text = session.title
session.sessionType.let {
itemView.sessionType.text = it?.name
}
session.microlocation.let {
itemView.mircolocation.text = it?.name
}

val sessionType = session.sessionType
if (sessionType == null)
itemView.sessionType.isVisible = false
else
itemView.sessionType.text = sessionType.name

val microLocation = session.microlocation
if (microLocation == null)
itemView.microLocation.isVisible = false
else
itemView.microLocation.text = microLocation.name

session.track.let {
if (it == null)
itemView.trackDetail.visibility = View.GONE
itemView.trackDetail.isVisible = false
else {
itemView.trackText.text = it.name
itemView.trackIcon.setColorFilter(Color.parseColor(it.color))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class SessionViewModel(
compositeDisposable += sessionService.fetchSession(id)
.withDefaultSchedulers()
.doOnSubscribe { mutableProgress.value = true }
.doFinally { mutableProgress.value = false }
.subscribe({
mutableSession.value = it
mutableProgress.value = false
}, {
Timber.e(it, "Error fetching session id $id")
mutableError.value = resource.getString(R.string.error_fetching_event_section_message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package org.fossasia.openevent.general.speakercall

import androidx.appcompat.app.AlertDialog
import android.os.Bundle
import android.text.Html
import android.text.method.LinkMovementMethod
import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
Expand All @@ -25,7 +27,6 @@ import org.fossasia.openevent.general.event.EventUtils.getFormattedDate
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.fossasia.openevent.general.utils.Utils.setToolbar
import org.fossasia.openevent.general.utils.extensions.nonNull
import org.fossasia.openevent.general.utils.stripHtml
import org.jetbrains.anko.design.snackbar
import org.threeten.bp.DateTimeUtils
import java.util.Date
Expand Down Expand Up @@ -170,7 +171,8 @@ class SpeakersCallFragment : Fragment() {
val endTime: Date = DateTimeUtils.toDate(endAt.toInstant())
val currentTime = Date()

rootView.speakersCallDescription.text = speakersCall.announcement.stripHtml()
rootView.speakersCallDescription.movementMethod = LinkMovementMethod.getInstance()
rootView.speakersCallDescription.text = Html.fromHtml(speakersCall.announcement)
if (currentTime < startTime) {
rootView.timeStatus.isVisible = false
rootView.speakersCallTimeDetail.text = getString(R.string.speakers_call_open_at, getFormattedDate(startAt))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ package org.fossasia.openevent.general.sponsor
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.squareup.picasso.Picasso
import kotlinx.android.synthetic.main.item_sponsor_detail.view.sponsorDetailURL
import kotlinx.android.synthetic.main.item_sponsor_detail.view.sponsorDetailLogo
import kotlinx.android.synthetic.main.item_sponsor_detail.view.sponsorDetailDescription
import kotlinx.android.synthetic.main.item_sponsor_detail.view.sponsorDetailType
import kotlinx.android.synthetic.main.item_sponsor_detail.view.sponsorDetailName
import org.fossasia.openevent.general.R
import org.fossasia.openevent.general.data.Resource
import org.fossasia.openevent.general.utils.Utils
import org.fossasia.openevent.general.utils.stripHtml

class SponsorsDetailAdapter : RecyclerView.Adapter<SponsorsDetailViewHolder>() {

Expand Down Expand Up @@ -41,6 +43,7 @@ class SponsorsDetailAdapter : RecyclerView.Adapter<SponsorsDetailViewHolder>() {

class SponsorsDetailViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
lateinit var sponsorURLClickListener: SponsorURLClickListener
private val resource = Resource()

fun bind(sponsor: Sponsor) {
Picasso.get()
Expand All @@ -51,19 +54,19 @@ class SponsorsDetailViewHolder(itemView: View) : RecyclerView.ViewHolder(itemVie

itemView.sponsorDetailName.text = sponsor.name
if (sponsor.type.isNullOrBlank()) {
itemView.sponsorDetailType.visibility = View.GONE
itemView.sponsorDetailType.isVisible = false
} else {
itemView.sponsorDetailType.text = "Type: ${sponsor.type}"
itemView.sponsorDetailType.visibility = View.VISIBLE
itemView.sponsorDetailType.text = resource.getString(R.string.sponsor_type, sponsor.type)
itemView.sponsorDetailType.isVisible = true
}
if (sponsor.description.isNullOrBlank()) {
itemView.sponsorDetailDescription.visibility = View.GONE
itemView.sponsorDetailDescription.isVisible = false
} else {
itemView.sponsorDetailDescription.text = sponsor.description
itemView.sponsorDetailDescription.visibility = View.VISIBLE
itemView.sponsorDetailDescription.text = sponsor.description.stripHtml()
itemView.sponsorDetailDescription.isVisible = true
}

itemView.sponsorDetailURL.setOnClickListener {
itemView.setOnClickListener {
sponsorURLClickListener.onClick(sponsor.url)
}
}
Expand Down
32 changes: 9 additions & 23 deletions app/src/main/res/layout/fragment_speaker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:paddingStart="@dimen/padding_large"
android:paddingEnd="@dimen/padding_large">
<ImageView
android:layout_width="@dimen/item_image_view_extra_large"
android:layout_height="@dimen/item_image_view_extra_large"
Expand Down Expand Up @@ -48,16 +50,12 @@
<View
android:layout_width="match_parent"
android:layout_height="@dimen/event_details_divider"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_extra_large"
android:background="@color/grey" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/divider_margin_top"
android:text="@string/about"
android:textColor="@color/dark_grey"
Expand All @@ -67,8 +65,6 @@
android:id="@+id/bio"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_large"
android:textColor="@color/light_grey"
tools:text="Description" />
Expand All @@ -93,28 +89,22 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/divider_margin_top"
android:text="Contact"
android:text="@string/contact"
android:textColor="@color/dark_grey"
android:textSize="@dimen/event_details_headers" />

<TextView
android:id="@+id/from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_large"
android:textColor="@color/light_grey"
tools:text="City, country" />
<TextView
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_large"
android:textColor="@color/light_grey"
android:autoLink="email"
Expand All @@ -123,8 +113,6 @@
android:id="@+id/mobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/layout_margin_large"
android:textColor="@color/light_grey"
android:autoLink="phone"
Expand All @@ -134,42 +122,40 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="@dimen/layout_margin_large"
android:layout_marginRight="@dimen/layout_margin_large"
android:layout_marginBottom="@dimen/divider_margin_top">
<ImageView
android:id="@+id/website"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/layout_margin_medium"
android:layout_marginEnd="@dimen/layout_margin_medium"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_link_black" />
<ImageView
android:id="@+id/twitter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/layout_margin_medium"
android:layout_marginEnd="@dimen/layout_margin_medium"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_twitter" />
<ImageView
android:id="@+id/facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/layout_margin_medium"
android:layout_marginEnd="@dimen/layout_margin_medium"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_facebook" />
<ImageView
android:id="@+id/linkedin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/layout_margin_medium"
android:layout_marginEnd="@dimen/layout_margin_medium"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_linkedin" />
<ImageView
android:id="@+id/github"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/layout_margin_medium"
android:layout_marginEnd="@dimen/layout_margin_medium"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_github" />
</LinearLayout>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_speakers_call.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
android:id="@+id/speakersCallDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web|email|phone"
android:layout_marginBottom="@dimen/layout_margin_large"
tools:text="@string/description_preview"/>
</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_session.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
android:textSize="@dimen/text_size_large" />

<TextView
android:id="@+id/mircolocation"
android:id="@+id/microLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_large"
Expand Down
9 changes: 1 addition & 8 deletions app/src/main/res/layout/item_sponsor_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="?selectableItemBackground"
android:layout_margin="@dimen/layout_margin_medium">

<LinearLayout
Expand Down Expand Up @@ -43,14 +44,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/layout_margin_small"
tools:text="@string/description_preview"/>

<ImageView
android:id="@+id/sponsorDetailURL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:src="@drawable/ic_link_black"
android:background="?attr/selectableItemBackgroundBorderless"/>
</LinearLayout>
</LinearLayout>

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -527,5 +527,7 @@
<string name="linkedin">LinkedIn</string>
<string name="order_now">Order Now</string>
<string name="no_location">No Location</string>
<string name="sponsor_type">Type: %1$s</string>
<string name="contact">Contact</string>

</resources>