Commit 5ea5fc1f authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

Merge branch 'release/0.9.1'

parents 3c478553 f4accc2b
...@@ -11,7 +11,6 @@ import android.widget.ImageView ...@@ -11,7 +11,6 @@ import android.widget.ImageView
import android.widget.ProgressBar import android.widget.ProgressBar
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import androidx.recyclerview.widget.RecyclerView
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.bluelinelabs.conductor.Controller import com.bluelinelabs.conductor.Controller
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
...@@ -38,7 +37,6 @@ class PhotoDialogController : Controller { ...@@ -38,7 +37,6 @@ class PhotoDialogController : Controller {
constructor(photoUrl: String) : super(bundleOf(PHOTO_URL_KEY to photoUrl)) constructor(photoUrl: String) : super(bundleOf(PHOTO_URL_KEY to photoUrl))
lateinit var recyclerView : RecyclerView
@SuppressLint("SourceLockedOrientationActivity") @SuppressLint("SourceLockedOrientationActivity")
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
......
...@@ -14,6 +14,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication ...@@ -14,6 +14,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import com.biganto.visual.roompark.data.repository.file.FileModule import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.data.service.network.INetworkMonitor
import com.biganto.visual.roompark.di.dagger.ActivityModule import com.biganto.visual.roompark.di.dagger.ActivityModule
import com.biganto.visual.roompark.di.dagger.AppComponent import com.biganto.visual.roompark.di.dagger.AppComponent
import com.biganto.visual.roompark.di.dagger.PerScreen import com.biganto.visual.roompark.di.dagger.PerScreen
...@@ -68,6 +69,9 @@ class StartPlansDownloadingDialogController : Controller { ...@@ -68,6 +69,9 @@ class StartPlansDownloadingDialogController : Controller {
@Inject @Inject
lateinit var rpActivity: RoomParkMainActivity lateinit var rpActivity: RoomParkMainActivity
@Inject
lateinit var networkMonitor: INetworkMonitor
override fun onContextAvailable(context: Context) { override fun onContextAvailable(context: Context) {
super.onContextAvailable(context) super.onContextAvailable(context)
...@@ -120,6 +124,12 @@ class StartPlansDownloadingDialogController : Controller { ...@@ -120,6 +124,12 @@ class StartPlansDownloadingDialogController : Controller {
view.findViewById<Button>(R.id.alert_ok_button) view.findViewById<Button>(R.id.alert_ok_button)
.clicks() .clicks()
.filter{
if (!networkMonitor.isConnected){
snackbar.showSnackBar(R.string.no_network_error)
}
networkMonitor.isConnected
}
.debounce(200, TimeUnit.MILLISECONDS) .debounce(200, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe { .subscribe {
......
...@@ -10,6 +10,8 @@ import android.widget.ProgressBar ...@@ -10,6 +10,8 @@ import android.widget.ProgressBar
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.core.os.bundleOf import androidx.core.os.bundleOf
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.ICollapsingToolBar
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.di.dagger.ActivityModule import com.biganto.visual.roompark.di.dagger.ActivityModule
...@@ -84,6 +86,11 @@ class DownloadTourDialogController : Controller { ...@@ -84,6 +86,11 @@ class DownloadTourDialogController : Controller {
super.onDetach(view) super.onDetach(view)
} }
private val bottomNavigationController: IBottomNavigation by lazy {rpActivity}
private val toolbar: ICollapsingToolBar by lazy {rpActivity}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
val view = inflater.inflate(getLayoutId(), container, false) val view = inflater.inflate(getLayoutId(), container, false)
......
...@@ -13,6 +13,8 @@ import com.biganto.visual.roompark.base.BaseRoomParkActivity ...@@ -13,6 +13,8 @@ import com.biganto.visual.roompark.base.BaseRoomParkActivity
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.data.repository.file.FileModule import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.data.service.network.INetworkMonitor
import com.biganto.visual.roompark.data.service.network.NoNetworkException
import com.biganto.visual.roompark.di.dagger.ActivityModule import com.biganto.visual.roompark.di.dagger.ActivityModule
import com.biganto.visual.roompark.di.dagger.AppComponent import com.biganto.visual.roompark.di.dagger.AppComponent
import com.biganto.visual.roompark.di.dagger.PerScreen import com.biganto.visual.roompark.di.dagger.PerScreen
...@@ -64,6 +66,10 @@ class StartToursDownloadingDialogController : Controller { ...@@ -64,6 +66,10 @@ class StartToursDownloadingDialogController : Controller {
@Inject @Inject
lateinit var rpActivity: RoomParkMainActivity lateinit var rpActivity: RoomParkMainActivity
@Inject
lateinit var networkMonitor: INetworkMonitor
override fun onContextAvailable(context: Context) { override fun onContextAvailable(context: Context) {
super.onContextAvailable(context) super.onContextAvailable(context)
...@@ -111,6 +117,12 @@ class StartToursDownloadingDialogController : Controller { ...@@ -111,6 +117,12 @@ class StartToursDownloadingDialogController : Controller {
detachDisposable.add( detachDisposable.add(
view.findViewById<Button>(R.id.alert_ok_button) view.findViewById<Button>(R.id.alert_ok_button)
.clicks() .clicks()
.filter{
if (!networkMonitor.isConnected){
snackbar.showSnackBar(R.string.no_network_error)
}
networkMonitor.isConnected
}
.debounce(200, TimeUnit.MILLISECONDS) .debounce(200, TimeUnit.MILLISECONDS)
.observeOn(Schedulers.io()) .observeOn(Schedulers.io())
.flatMap{ downloader.startToursDownloading()} .flatMap{ downloader.startToursDownloading()}
......
package com.biganto.visual.roompark.data.service.network package com.biganto.visual.roompark.data.service.network
import android.app.Application
import android.content.Context import android.content.Context
import android.net.ConnectivityManager import android.net.ConnectivityManager
import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
...@@ -9,7 +11,7 @@ import javax.inject.Singleton ...@@ -9,7 +11,7 @@ import javax.inject.Singleton
* Created by Vladislav Bogdashkin on 12.10.2018. * Created by Vladislav Bogdashkin on 12.10.2018.
*/ */
@Singleton @Singleton
class LiveNetworkMonitor(val context: Context) : INetworkMonitor { class LiveNetworkMonitor @Inject constructor(val context: Application) : INetworkMonitor {
override val isConnected: Boolean override val isConnected: Boolean
...@@ -23,7 +25,8 @@ class LiveNetworkMonitor(val context: Context) : INetworkMonitor { ...@@ -23,7 +25,8 @@ class LiveNetworkMonitor(val context: Context) : INetworkMonitor {
override val isWifiConnected: Boolean override val isWifiConnected: Boolean
get() { get() {
val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
return cm.activeNetworkInfo != null && (cm.activeNetworkInfo.type == ConnectivityManager.TYPE_WIFI); return cm.activeNetworkInfo != null
&& (cm.activeNetworkInfo.type == ConnectivityManager.TYPE_WIFI);
} }
} }
......
...@@ -11,6 +11,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb ...@@ -11,6 +11,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb
import com.biganto.visual.roompark.data.repository.db.requrey.DbModule import com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import com.biganto.visual.roompark.data.repository.file.FileModule import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.data.service.lifecycle.ForegroundLifecycleObserver import com.biganto.visual.roompark.data.service.lifecycle.ForegroundLifecycleObserver
import com.biganto.visual.roompark.data.service.network.INetworkMonitor
import com.biganto.visual.roompark.data.service.notification.INotificationCenter import com.biganto.visual.roompark.data.service.notification.INotificationCenter
import com.biganto.visual.roompark.domain.contract.* import com.biganto.visual.roompark.domain.contract.*
import dagger.BindsInstance import dagger.BindsInstance
...@@ -72,6 +73,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{ ...@@ -72,6 +73,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun provideNotifivations(): INotificationCenter fun provideNotifivations(): INotificationCenter
fun provideNetMonitor(): INetworkMonitor
fun provideAppContext():Application fun provideAppContext():Application
......
...@@ -12,6 +12,8 @@ import com.biganto.visual.roompark.data.repository.db.requrey.DbModule ...@@ -12,6 +12,8 @@ import com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import com.biganto.visual.roompark.data.repository.db.requrey.RequeryRepository import com.biganto.visual.roompark.data.repository.db.requrey.RequeryRepository
import com.biganto.visual.roompark.data.service.lifecycle.AppLifecycleListener import com.biganto.visual.roompark.data.service.lifecycle.AppLifecycleListener
import com.biganto.visual.roompark.data.service.lifecycle.ForegroundLifecycleObserver import com.biganto.visual.roompark.data.service.lifecycle.ForegroundLifecycleObserver
import com.biganto.visual.roompark.data.service.network.INetworkMonitor
import com.biganto.visual.roompark.data.service.network.LiveNetworkMonitor
import com.biganto.visual.roompark.data.service.notification.INotificationCenter import com.biganto.visual.roompark.data.service.notification.INotificationCenter
import com.biganto.visual.roompark.data.service.notification.NotificationCenter import com.biganto.visual.roompark.data.service.notification.NotificationCenter
import com.biganto.visual.roompark.domain.contract.* import com.biganto.visual.roompark.domain.contract.*
...@@ -92,4 +94,9 @@ abstract class DataModule { ...@@ -92,4 +94,9 @@ abstract class DataModule {
@Binds @Binds
abstract fun provideDb(db: RequeryRepository) : IDb abstract fun provideDb(db: RequeryRepository) : IDb
@Singleton
@Binds
abstract fun provideNetwork(networkMonitor: LiveNetworkMonitor) : INetworkMonitor
} }
\ No newline at end of file
...@@ -200,13 +200,9 @@ class EstateScreenController : ...@@ -200,13 +200,9 @@ class EstateScreenController :
private fun setToolbar(){ private fun setToolbar(){
toolBar.setToolbar(null, StatusToolbarModel()) toolBar.setToolbar(null, StatusToolbarModel())
toolBar.statusToolbar.findViewById<View>(R.id.back_cross).let { toolBar.statusToolbar.findViewById<View>(R.id.back_cross)
detachDisposable.add( .setOnClickListener { handleBack() }
it.clicks()
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe { handleBack() }
)
}
detachDisposable.add( detachDisposable.add(
flatScroll.scrollChangeEvents() flatScroll.scrollChangeEvents()
// .debounce (25,TimeUnit.MILLISECONDS) // .debounce (25,TimeUnit.MILLISECONDS)
......
...@@ -67,7 +67,9 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie ...@@ -67,7 +67,9 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie
} }
val onStartTourObs: Observable<EstateModel> get() = val onStartTourObs: Observable<EstateModel> get() =
startTour.clicks().filter { bindedModel.availableStatus }.map { bindedModel } startTour.clicks()
// .filter { bindedModel.availableStatus }
.map { bindedModel }
override fun onViewBound(model: EstateModel) { override fun onViewBound(model: EstateModel) {
estateTitle.text = estateTitle.text =
......
...@@ -16,6 +16,7 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController ...@@ -16,6 +16,7 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.conductor.dialogs.StartPlansDownloadingDialogController import com.biganto.visual.roompark.conductor.dialogs.StartPlansDownloadingDialogController
import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import com.biganto.visual.roompark.conductor.dialogs.tour_chooser.StartToursDownloadingDialogController import com.biganto.visual.roompark.conductor.dialogs.tour_chooser.StartToursDownloadingDialogController
import com.biganto.visual.roompark.data.service.network.INetworkMonitor
import com.biganto.visual.roompark.domain.model.SubscriptionModel import com.biganto.visual.roompark.domain.model.SubscriptionModel
import com.biganto.visual.roompark.presentation.screen.settings.util.CahcedListAdapter import com.biganto.visual.roompark.presentation.screen.settings.util.CahcedListAdapter
import com.biganto.visual.roompark.presentation.screen.settings.util.PushListAdapter import com.biganto.visual.roompark.presentation.screen.settings.util.PushListAdapter
...@@ -109,8 +110,15 @@ class SettingsScreenController : ...@@ -109,8 +110,15 @@ class SettingsScreenController :
@BindView(R.id.progress_lock_background) @BindView(R.id.progress_lock_background)
lateinit var progressShame:View lateinit var progressShame:View
@Inject
lateinit var networkMonitor: INetworkMonitor
@OnClick(R.id.downloadFlatCardsIcon) @OnClick(R.id.downloadFlatCardsIcon)
fun onStartTourPlans(){ fun onStartTourPlans(){
if (!networkMonitor.isConnected){
snackbar.showSnackBar(R.string.no_network_error)
return
}
router.pushController(RouterTransaction.with(StartPlansDownloadingDialogController()) router.pushController(RouterTransaction.with(StartPlansDownloadingDialogController())
.pushChangeHandler(DialogChangeHandler()) .pushChangeHandler(DialogChangeHandler())
.popChangeHandler(DialogChangeHandler()) .popChangeHandler(DialogChangeHandler())
...@@ -131,6 +139,10 @@ class SettingsScreenController : ...@@ -131,6 +139,10 @@ class SettingsScreenController :
@OnClick(R.id.downloadToursIcon) @OnClick(R.id.downloadToursIcon)
fun startDownloadingDialog(){ fun startDownloadingDialog(){
if (!networkMonitor.isConnected){
snackbar.showSnackBar(R.string.no_network_error)
return
}
router.pushController(RouterTransaction.with(StartToursDownloadingDialogController()) router.pushController(RouterTransaction.with(StartToursDownloadingDialogController())
.pushChangeHandler(DialogChangeHandler()) .pushChangeHandler(DialogChangeHandler())
.popChangeHandler(DialogChangeHandler()) .popChangeHandler(DialogChangeHandler())
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#000000"> android:background="#FF000000">
<com.github.chrisbanes.photoview.PhotoView <com.github.chrisbanes.photoview.PhotoView
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
<ImageView <ImageView
android:id="@+id/back_cross" android:id="@+id/back_cross"
android:layout_width="32dp" android:layout_width="48dp"
android:layout_height="32dp" android:layout_height="24dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="0dp"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:scaleType="centerCrop" android:scaleType="fitCenter"
android:tint="@color/colorGray" android:tint="@color/colorGray"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
......
...@@ -5,8 +5,8 @@ ext { ...@@ -5,8 +5,8 @@ ext {
minSdkVersion_RoomPark = 23 minSdkVersion_RoomPark = 23
compileSdkVersion_RoomPark = 28 compileSdkVersion_RoomPark = 28
VERSION_CODE = 6 VERSION_CODE = 7
VERSION_NAME = "0.9.0" VERSION_NAME = "0.9.1"
// supportLibraryVersion = '1.1.0-alpha05' // supportLibraryVersion = '1.1.0-alpha05'
constrainLayoutVersion = '1.1.3' constrainLayoutVersion = '1.1.3'
......
Room Park official Android application Room Park official Android application
- - v.0.9.0 - - - - v.0.9.1 - -
Pre-release version Pre-release version
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment