Skip to content

Commit

Permalink
Merge pull request #69 from droidconKE/develop
Browse files Browse the repository at this point in the history
Develop Changes
  • Loading branch information
wangerekaharun authored Nov 28, 2019
2 parents 2338420 + 61d6d7c commit 49fa10b
Show file tree
Hide file tree
Showing 24 changed files with 142 additions and 148 deletions.
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: java
jdk:
- openjdk8

env:
- ANDROID_COMPILE_SDK="29" ANDROID_BUILD_TOOLS="29.0.2" ANDROID_SDK_TOOLS="4333796"

before_install:
- sudo apt-get --quiet update --yes
- sudo apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- echo "org.gradle.daemon=false" >> gradle.properties

before_script:
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip -d android-sdk-linux android-sdk.zip
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
>/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
>/dev/null
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses

script: "./gradlew -Pci --console=plain :app:testDebug"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/droidconKE/droidconKE2019App.svg?branch=develop)](https://travis-ci.org/droidconKE/droidconKE2019App)

# droidconKE Android App


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.GridLayoutManager
import com.android254.droidconke19.R
import com.android254.droidconke19.models.AboutDetailsModel
import com.android254.droidconke19.utils.loadImage
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.AboutViewModel
import kotlinx.android.synthetic.main.fragment_about.*
import org.jetbrains.anko.toast
Expand Down Expand Up @@ -49,18 +48,18 @@ class AboutFragment : Fragment() {
}

private fun observeLiveData() {
aboutViewModel.getAboutDetailsResponse().nonNull().observe(this) { aboutDetailsList ->
aboutViewModel.getAboutDetailsResponse().observe(this, Observer { aboutDetailsList ->
handleFetchAboutDetails(aboutDetailsList)
}
aboutViewModel.getAboutDetailsError().nonNull().observe(this) { databaseError ->
})
aboutViewModel.getAboutDetailsError().observe(this, Observer { databaseError ->
handleDatabaseError(databaseError)
}
aboutViewModel.getOrganizersResponse().nonNull().observe(this) {
})
aboutViewModel.getOrganizersResponse().observe(this, Observer {
handleGetOrganizersResponse(it)
}
aboutViewModel.getSponsorsResponse().nonNull().observe(this) {
})
aboutViewModel.getSponsorsResponse().observe(this, Observer {
handleSponsorsResponse(it)
}
})
}

private fun handleSponsorsResponse(it: List<AboutDetailsModel>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import android.view.Menu
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.RecyclerView
import com.android254.droidconke19.R
import com.android254.droidconke19.models.AgendaModel
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.AgendaViewModel
import kotlinx.android.synthetic.main.fragment_agenda.*
import org.jetbrains.anko.toast
Expand Down Expand Up @@ -40,12 +39,12 @@ class AgendaFragment : Fragment() {
}

private fun observeLiveData() {
agendaViewModel.getAgendasResponse().nonNull().observe(this) {
agendaViewModel.getAgendasResponse().observe(this, Observer {
handleAgendaResponse(it, agendaRv)
}
agendaViewModel.getAgendaError().nonNull().observe(this) {
})
agendaViewModel.getAgendaError().observe(this, Observer {
handleDatabaseError(it)
}
})
}

private fun handleAgendaResponse(agendaList: List<AgendaModel>, agendaRv: RecyclerView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import android.view.Menu
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import com.android254.droidconke19.R
import com.android254.droidconke19.models.Announcement
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.AnnouncementViewModel
import kotlinx.android.synthetic.main.fragment_announcements.*
import org.jetbrains.anko.toast
Expand Down Expand Up @@ -56,14 +55,13 @@ class AnnouncementFragment : Fragment() {
}

private fun observeLiveData() {
announcementViewModel.getAnnouncementsResponse().nonNull().observe(this) {
announcementViewModel.getAnnouncementsResponse().observe(this, Observer {
hideProgressBar()
announcementAdapter.setAnnouncements(it)
}
announcementViewModel.getAnnouncementError().nonNull().observe(this) {
})
announcementViewModel.getAnnouncementError().observe(this, Observer {
handleError(it)

}
})

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.RecyclerView
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings
import com.android254.droidconke19.BuildConfig
import com.android254.droidconke19.R
import com.android254.droidconke19.models.EventTypeModel
import com.android254.droidconke19.models.WifiDetailsModel
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.EventTypeViewModel
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings
import kotlinx.android.synthetic.main.fragment_event.*
import org.jetbrains.anko.toast
import org.koin.android.ext.android.inject
Expand Down Expand Up @@ -51,12 +50,12 @@ class EventFragment : Fragment() {
}

private fun observeLiveData() {
eventTypeViewModel.getWifiDetailsResponse().nonNull().observe(this) {
eventTypeViewModel.getWifiDetailsResponse().observe(this, Observer {
handleFetchEventsResponse(it, eventTypesRv)
}
eventTypeViewModel.getWifiDetailsError().nonNull().observe(this) {
})
eventTypeViewModel.getWifiDetailsError().observe(this, Observer {
handleDatabaseError(it)
}
})
}

private fun getRemoteConfigValues(wifiSsidText: TextView, wifiPasswordText: TextView) {
Expand All @@ -73,7 +72,8 @@ class EventFragment : Fragment() {
it.isSuccessful -> // After config data is successfully fetched, it must be activated before newly fetched
// values are returned.
firebaseRemoteConfig.activate()
else -> {}
else -> {
}
}
val wifiDetailsModel = WifiDetailsModel(firebaseRemoteConfig.getString("wifi_ssid"), firebaseRemoteConfig.getString("wifi_password"))
updateViews(wifiDetailsModel, wifiSsidText, wifiPasswordText)
Expand Down Expand Up @@ -104,13 +104,13 @@ class EventFragment : Fragment() {

}

private fun showProgressBar(){
private fun showProgressBar() {
progressBar.visibility = View.VISIBLE
eventTypeLinear.visibility = View.GONE

}

private fun hideProgressBar(){
private fun hideProgressBar() {
progressBar.visibility = View.GONE
eventTypeLinear.visibility = View.VISIBLE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import android.view.Menu
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import com.android254.droidconke19.R
import com.android254.droidconke19.models.UserEventFeedback
import com.android254.droidconke19.utils.isSignedIn
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.FeedBackViewModel
import com.google.firebase.auth.FirebaseAuth
import kotlinx.android.synthetic.main.fragment_event_feedback.*
Expand Down Expand Up @@ -74,12 +73,12 @@ class EventFeedbackFragment : Fragment() {
}

private fun observeLiveData() {
feedBackViewModel.getEventFeedBackResponse().nonNull().observe(this) {
feedBackViewModel.getEventFeedBackResponse().observe(this, Observer {
handleFeedbackResponse(it)
}
feedBackViewModel.getEventFeedbackError().nonNull().observe(this) {
})
feedBackViewModel.getEventFeedbackError().observe(this, Observer {
handleDataError(it)
}
})
}

private fun handleDataError(it: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import android.view.Menu
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.navigation.fragment.navArgs
import com.android254.droidconke19.R
import com.android254.droidconke19.models.SessionsModel
import com.android254.droidconke19.models.SessionsUserFeedback
import com.android254.droidconke19.utils.isSignedIn
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.SessionDataViewModel
import com.google.firebase.auth.FirebaseAuth
import kotlinx.android.synthetic.main.fragment_session_feedback.*
Expand Down Expand Up @@ -76,12 +74,12 @@ class SessionFeedbackFragment : Fragment() {
}

private fun observeLiveData() {
sessionDataViewModel.getSessionFeedBackResponse().nonNull().observe(this) {
sessionDataViewModel.getSessionFeedBackResponse().observe(this, Observer{
handleFeedbackResponse(it)
}
sessionDataViewModel.getSessionFeedbackError().nonNull().observe(this) {
})
sessionDataViewModel.getSessionFeedbackError().observe(this, Observer {
handleDatabaseError(it)
}
})

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavController
import androidx.navigation.fragment.FragmentNavigatorExtras
Expand All @@ -21,8 +22,6 @@ import com.android254.droidconke19.models.ReserveSeatModel
import com.android254.droidconke19.models.SessionsModel
import com.android254.droidconke19.ui.speakers.SpeakersAdapter
import com.android254.droidconke19.utils.isSignedIn
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.utils.toast
import com.android254.droidconke19.viewmodels.SessionDetailsViewModel
import com.google.firebase.auth.FirebaseAuth
Expand Down Expand Up @@ -139,9 +138,9 @@ class SessionDetailsFragment : Fragment() {
}

private fun observeLiveData() {
sessionDetailsViewModel.getReserveSeatResponse().nonNull().observe(this) {
sessionDetailsViewModel.getReserveSeatResponse().observe(this, Observer {
handleReserveSeatResponse(it)
}
})
}

private fun handleReserveSeatResponse(it: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.RecyclerView
import com.android254.droidconke19.R
Expand All @@ -16,8 +17,6 @@ import com.android254.droidconke19.repository.FavoritesStore
import com.android254.droidconke19.ui.filters.Filter
import com.android254.droidconke19.ui.filters.FilterStore
import com.android254.droidconke19.ui.schedule.ScheduleFragmentDirections
import com.android254.droidconke19.utils.nonNull
import com.android254.droidconke19.utils.observe
import com.android254.droidconke19.viewmodels.SessionsViewModel
import kotlinx.android.synthetic.main.fragment_day_session.*
import org.jetbrains.anko.toast
Expand Down Expand Up @@ -65,16 +64,16 @@ class SessionDayFragment : Fragment() {
}

private fun redirectToSessionDetails(it: SessionsModel) {
findNavController().navigate(ScheduleFragmentDirections.actionScheduleFragmentToSessionDetailsFragment(it,it.title))
findNavController().navigate(ScheduleFragmentDirections.actionScheduleFragmentToSessionDetailsFragment(it, it.title))
}

private fun observeLiveData() {
sessionsViewModel.getSessionsResponse().nonNull().observe(this) { sessionList ->
sessionsViewModel.getSessionsResponse().observe(this, Observer { sessionList ->
updateAdapterWithList(sessionList)
}
sessionsViewModel.getSessionsError().nonNull().observe(this) { databaseError ->
})
sessionsViewModel.getSessionsError().observe(this, Observer { databaseError ->
handleError(databaseError)
}
})
}

private fun updateAdapterWithList(sessionList: List<SessionsModel>) {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 49fa10b

Please sign in to comment.