Skip to content

Commit

Permalink
Merge pull request #2024 from fossasia/development
Browse files Browse the repository at this point in the history
chore: Release v0.5.0
  • Loading branch information
iamareebjamal authored Jun 29, 2019
2 parents 63aa2fd + 053c967 commit 9c6cd6f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: v$NEXT_PATCH_VERSION 🌈
tag-template: v$NEXT_PATCH_VERSION
name-template: Release v$NEXT_MINOR_VERSION 🌈
tag-template: v$NEXT_MINOR_VERSION
categories:
- title: 🚀 Features
label: feature
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId "com.eventyay.attendee"
minSdkVersion 21
targetSdkVersion 28
versionCode 10
versionName "0.4.0"
versionCode 11
versionName "0.5.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,6 @@ class EventDetailsFragment : Fragment() {
menu.findItem(R.id.open_external_event_url).isVisible = false
if (currentEvent.codeOfConduct.isNullOrBlank())
menu.findItem(R.id.code_of_conduct).isVisible = false
if (currentEvent.speakersCall == null)
menu.findItem(R.id.call_for_speakers).isVisible = false
setFavoriteIconFilled(currentEvent.favorite)
}
super.onPrepareOptionsMenu(menu)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ class EventService(
.toList()
}

fun getEventTopics(): Flowable<List<EventTopic>> {
return eventTopicsDao.getAllEventTopics()
}

fun getEventTypes(): Single<List<EventType>> {
return eventTypesApi.getEventTypes()
}
Expand All @@ -85,6 +81,9 @@ class EventService(
val query = "[{\"name\":\"location-name\",\"op\":\"ilike\",\"val\":\"%$locationName%\"}," +
"{\"name\":\"ends-at\",\"op\":\"ge\",\"val\":\"%${EventUtils.getTimeInISO8601(Date())}%\"}]"
return eventApi.searchEvents("name", query).flatMapPublisher { apiList ->
apiList.forEach {
it.speakersCall?.let { sc -> speakersCallDao.insertSpeakerCall(sc) }
}
updateFavorites(apiList)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import kotlinx.android.synthetic.main.fragment_search_results.view.eventsRecycle
import kotlinx.android.synthetic.main.fragment_search_results.view.noSearchResults
import kotlinx.android.synthetic.main.fragment_search_results.view.shimmerSearch
import kotlinx.android.synthetic.main.fragment_search_results.view.toolbar
import kotlinx.android.synthetic.main.fragment_search_results.view.toolbarLayout
import kotlinx.android.synthetic.main.fragment_search_results.view.searchText
import kotlinx.android.synthetic.main.fragment_search_results.view.filter
import kotlinx.android.synthetic.main.fragment_search_results.view.clearSearchText
Expand All @@ -51,6 +52,7 @@ import org.fossasia.openevent.general.utils.Utils.hideSoftKeyboard
import org.fossasia.openevent.general.utils.Utils.showSoftKeyboard
import org.fossasia.openevent.general.utils.extensions.setPostponeSharedElementTransition
import org.fossasia.openevent.general.utils.extensions.setStartPostponedEnterTransition
import kotlin.math.abs

class SearchResultsFragment : Fragment(), CompoundButton.OnCheckedChangeListener {

Expand Down Expand Up @@ -263,11 +265,13 @@ class SearchResultsFragment : Fragment(), CompoundButton.OnCheckedChangeListener
})

rootView.appBar.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, offset ->
if (Math.abs(offset) == appBarLayout.totalScrollRange) {
if (abs(offset) == appBarLayout.totalScrollRange) {
rootView.toolbarTitle.text = if (rootView.searchText.text.isNullOrBlank())
getString(R.string.search_hint) else rootView.searchText.text.toString()
rootView.toolbarLayout.elevation = resources.getDimension(R.dimen.custom_toolbar_elevation)
} else {
rootView.toolbarTitle.text = ""
rootView.toolbarLayout.elevation = 0F
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,6 @@ class SpeakersCallFragment : Fragment() {
private val speakersCallViewModel by viewModel<SpeakersCallViewModel>()
private val safeArgs: SpeakersCallFragmentArgs by navArgs()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (speakersCallViewModel.isLoggedIn()) {
val currentUser = speakersCallViewModel.user.value
if (currentUser == null) {
speakersCallViewModel.loadMyUserAndSpeaker(safeArgs.eventId, safeArgs.eventIdentifier)
} else {
val currentSpeaker = speakersCallViewModel.speaker.value
if (currentSpeaker == null) {
speakersCallViewModel.loadMySpeaker(currentUser, safeArgs.eventId, safeArgs.eventIdentifier)
}
}
}
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
rootView = inflater.inflate(R.layout.fragment_speakers_call, container, false)

Expand Down Expand Up @@ -85,6 +70,18 @@ class SpeakersCallFragment : Fragment() {
showEmptyView(false)
})

if (speakersCallViewModel.isLoggedIn()) {
val currentUser = speakersCallViewModel.user.value
if (currentUser == null) {
speakersCallViewModel.loadMyUserAndSpeaker(safeArgs.eventId, safeArgs.eventIdentifier)
} else {
val currentSpeaker = speakersCallViewModel.speaker.value
if (currentSpeaker == null) {
speakersCallViewModel.loadMySpeaker(currentUser, safeArgs.eventId, safeArgs.eventIdentifier)
}
}
}

speakersCallViewModel.loadSpeakersCall(safeArgs.eventId)
return rootView
}
Expand Down Expand Up @@ -150,9 +147,9 @@ class SpeakersCallFragment : Fragment() {
}

private fun showEmptyView(show: Boolean) {
rootView.speakersCallContainer.visibility = if (show) View.GONE else View.VISIBLE
rootView.speakersCallEmptyView.visibility = if (show) View.VISIBLE else View.GONE
if (show) rootView.submitProposalButton.visibility = View.GONE
rootView.speakersCallContainer.isVisible = !show
rootView.speakersCallEmptyView.isVisible = show
if (show) rootView.submitProposalButton.isVisible = false
}

private fun loadSpeakersCallSection(speakersCall: SpeakersCall) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class SpeakersCallViewModel(
val speakersCall: LiveData<SpeakersCall> = mutableSpeakersCall
private val mutableMessage = SingleLiveEvent<String>()
val message: LiveData<String> = mutableMessage
private val mutableProgress = MutableLiveData<Boolean>(true)
private val mutableProgress = MutableLiveData(true)
val progress: LiveData<Boolean> = mutableProgress
private val mutableSpeaker = MutableLiveData<Speaker>()
val speaker: LiveData<Speaker> = mutableSpeaker
private val mutableUser = MutableLiveData<User>()
val user: LiveData<User> = mutableUser
private val mutableEmptySpeakersCall = MutableLiveData<Boolean>(true)
private val mutableEmptySpeakersCall = MutableLiveData<Boolean>()
val emptySpeakersCall: LiveData<Boolean> = mutableEmptySpeakersCall

fun isLoggedIn(): Boolean = authHolder.isLoggedIn()
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/res/layout/fragment_search_results.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@
android:layout_height="match_parent"
android:orientation="vertical">

<androidx.cardview.widget.CardView
android:id="@+id/toolbarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:background="@color/colorPrimary"
app:titleTextColor="@color/black"
android:layout_width="match_parent"
app:navigationIcon="@drawable/ic_arrow_back_black"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
app:layout_constraintTop_toTopOf="parent">
android:backgroundTint="@color/white">
<TextView
android:id="@+id/toolbarTitle"
style = "@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
Expand All @@ -31,6 +36,7 @@
android:tint="@color/black"
android:src="@drawable/ic_filter"/>
</androidx.appcompat.widget.Toolbar>
</androidx.cardview.widget.CardView>

<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit 9c6cd6f

Please sign in to comment.