Commit 0459e678 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix errors

parent 0845fa5b
...@@ -30,12 +30,11 @@ abstract class BigantoBasePresenter<V : MvpView, VS> ...@@ -30,12 +30,11 @@ abstract class BigantoBasePresenter<V : MvpView, VS>
open fun parseError(t: Throwable) : VS = open fun parseError(t: Throwable) : VS =
when (t) { when (t) {
is CustomApiException ->{ is CustomApiException -> {
Timber.e("CustomApiException ${t.messageStringId} / ${t.customMessage}") Timber.e("CustomApiException ${t.messageStringId} / ${t.customMessage}")
parse(t) parse(t)
} }
is NoNetworkException -> {parse(t)}
is NoNetworkException -> parse(t)
else -> {Timber.e(t);parse(t)} else -> {Timber.e(t);parse(t)}
} }
......
package com.biganto.visual.roompark.conductor.dialogs package com.biganto.visual.roompark.conductor.dialogs
import android.annotation.SuppressLint
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
import android.graphics.Bitmap import android.graphics.Bitmap
import android.os.Bundle import android.os.Bundle
...@@ -37,6 +38,7 @@ class PhotoDialogController : Controller { ...@@ -37,6 +38,7 @@ class PhotoDialogController : Controller {
lateinit var recyclerView : RecyclerView lateinit var recyclerView : RecyclerView
@SuppressLint("SourceLockedOrientationActivity")
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)
...@@ -85,6 +87,7 @@ class PhotoDialogController : Controller { ...@@ -85,6 +87,7 @@ class PhotoDialogController : Controller {
@LayoutRes @LayoutRes
fun getLayoutId() = R.layout.photo_viewer fun getLayoutId() = R.layout.photo_viewer
@SuppressLint("SourceLockedOrientationActivity")
override fun handleBack(): Boolean { override fun handleBack(): Boolean {
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
return router.popCurrentController() return router.popCurrentController()
......
...@@ -77,6 +77,7 @@ class ChooseTourDialogController : Controller { ...@@ -77,6 +77,7 @@ class ChooseTourDialogController : Controller {
}) })
view.findViewById<View>(R.id.close_current_button).setOnClickListener { handleBack() } view.findViewById<View>(R.id.close_current_button).setOnClickListener { handleBack() }
view.setOnClickListener { handleBack() }
return view return view
} }
......
...@@ -232,7 +232,7 @@ class EstateRepository @Inject constructor( ...@@ -232,7 +232,7 @@ class EstateRepository @Inject constructor(
override fun getDeals(): Observable<List<DealModel>> { override fun getDeals(): Observable<List<DealModel>> {
return Observable.mergeDelayError( return Observable.mergeDelayError(
arrayListOf( arrayListOf(
getDealsDb, // getDealsDb,
getDealsApi getDealsApi
) )
) )
......
...@@ -300,6 +300,7 @@ class AlbumsScreenController : ...@@ -300,6 +300,7 @@ class AlbumsScreenController :
.debounce (300L,TimeUnit.MILLISECONDS) .debounce (300L,TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnNext { (albumsRecyclerView.adapter as AlbumListAdapter).setItems(arrayListOf())} .doOnNext { (albumsRecyclerView.adapter as AlbumListAdapter).setItems(arrayListOf())}
.share()
override fun onPhotoSelected(): Observable<PhotoModel> override fun onPhotoSelected(): Observable<PhotoModel>
......
...@@ -69,8 +69,9 @@ class AlbumsScreenPresenter @Inject constructor( ...@@ -69,8 +69,9 @@ class AlbumsScreenPresenter @Inject constructor(
val headerItemSelected = intent(AlbumsScreen::onAlbumSelected) val headerItemSelected = intent(AlbumsScreen::onAlbumSelected)
.doOnNext { selectedIndex = it.albumId } .doOnNext { selectedIndex = it.albumId }
.doOnNext { restoreModel.currentIndex = it.albumId } .doOnNext { restoreModel.currentIndex = it.albumId }
.flatMap<AlbumsScreenViewState> { model -> .switchMap<AlbumsScreenViewState> { model ->
requestAlbum(model.albumId) requestAlbum(model.albumId)
.onErrorReturn(::parseError)
.startWith(Observable.just<AlbumsScreenViewState>(AlbumsScreenViewState.HeaderAlbumChoosed(item = model)) .startWith(Observable.just<AlbumsScreenViewState>(AlbumsScreenViewState.HeaderAlbumChoosed(item = model))
) )
} }
......
...@@ -30,15 +30,17 @@ class DealsScreenPresenter @Inject constructor( ...@@ -30,15 +30,17 @@ class DealsScreenPresenter @Inject constructor(
val fetchDeals = interactor.fetchDeals() val fetchDeals = interactor.fetchDeals()
.flatMap { deals -> .flatMap { deals ->
getStatusList getStatusList
.map { .map{
List(deals.size) { index -> List(deals.size) { index ->
DealPreviewModel( DealPreviewModel(
Pair(deals[index], it) Pair(deals[index], it)
) )
} }
} }
.doOnError { Timber.e(" ERORORO ") }
} }
.map(DealsScreenViewState::DealsLoaded) .map<DealsScreenViewState>(DealsScreenViewState::DealsLoaded)
.onErrorReturn(::parseError)
val state = Observable.mergeDelayError( val state = Observable.mergeDelayError(
arrayListOf( arrayListOf(
......
...@@ -101,8 +101,6 @@ class SettingsScreenPresenter @Inject constructor( ...@@ -101,8 +101,6 @@ class SettingsScreenPresenter @Inject constructor(
} }
.startWith(SettingsScreenViewState.OnCacheDeleting(0f)) .startWith(SettingsScreenViewState.OnCacheDeleting(0f))
.doOnError { Timber.e(it) } .doOnError { Timber.e(it) }
.onErrorReturn(::parseError)
} }
val state = Observable.mergeDelayError( val state = Observable.mergeDelayError(
......
...@@ -5,8 +5,10 @@ import android.view.View ...@@ -5,8 +5,10 @@ import android.view.View
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.util.view_utils.snackbar.SnackBarMessageType.* import com.biganto.visual.roompark.util.view_utils.snackbar.SnackBarMessageType.*
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
/** /**
...@@ -68,9 +70,27 @@ class SnackBarProvider @Inject constructor(val activity: Activity) : ISnackBarPr ...@@ -68,9 +70,27 @@ class SnackBarProvider @Inject constructor(val activity: Activity) : ISnackBarPr
override fun showSnackBar(message: String, type: SnackBarMessageType, length: Int) { override fun showSnackBar(message: String, type: SnackBarMessageType, length: Int) {
snack?.dismiss() snack?.dismiss()
snack = Snackbar snack = Snackbar
.make(parentView, message, length) .make(parentView, message, length)
.setAction(actionText(type)) {} // .setAction(actionText(type)) {}
.setActionTextColor(color(type)) // .setActionTextColor(color(type))
Timber.w(" act - ${activity} ")
Timber.w(" act - ${(activity as? IBottomNavigation)} ")
// (activity as? IBottomNavigation)?.let {bNAv ->
// Timber.w(" act $bNAv" )
// snack?.apply {
// Timber.w(" sna")
// view.layoutParams = (view.layoutParams as CoordinatorLayout.LayoutParams).apply {
// Timber.w(" fusc $this")
// setMargins(
// leftMargin,
// topMargin,
// rightMargin,
// 300
// )
// }
// }?.show()
// }
snack?.show() snack?.show()
} }
......
...@@ -120,13 +120,14 @@ ...@@ -120,13 +120,14 @@
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation_view" android:id="@+id/bottom_navigation_view"
android:background="@color/colorOpacityCardBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/bottom_navigation_height"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:visibility="gone" android:visibility="gone"
app:elevation="0dp" app:elevation="0dp"
app:itemBackground="@color/colorCommonBackground" app:itemBackground="@color/colorOpacityBackgroundInv"
app:itemHorizontalTranslationEnabled="false" app:itemHorizontalTranslationEnabled="false"
app:itemIconTint="@drawable/bottom_navigation_icon_selector" app:itemIconTint="@drawable/bottom_navigation_icon_selector"
app:labelVisibilityMode="unlabeled" app:labelVisibilityMode="unlabeled"
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:minHeight="80dp"
android:orientation="vertical" android:orientation="vertical"
tools:itemCount="1" tools:itemCount="1"
tools:listitem="@layout/photo_preview_viewholder" /> tools:listitem="@layout/photo_preview_viewholder" />
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
android:id="@+id/tour_preview_imageView" android:id="@+id/tour_preview_imageView"
android:layout_width="32dp" android:layout_width="32dp"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_marginStart="19dp" android:layout_marginStart="0dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
app:srcCompat="@drawable/ic_bell_on" /> app:srcCompat="@drawable/ic_bell_on" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
style="@style/Default_TextView" style="@style/Common_Text.Notice"
android:id="@+id/tour_name" android:id="@+id/tour_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
<ImageView <ImageView
android:id="@+id/tour_status_imageView" android:id="@+id/tour_status_imageView"
android:layout_width="32dp" android:layout_width="wrap_content"
android:layout_height="32dp" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="@+id/tour_name"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="@+id/tour_name"
app:srcCompat="@drawable/ic_back" /> app:srcCompat="@drawable/ic_back" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -18,5 +18,6 @@ ...@@ -18,5 +18,6 @@
<item name="colorControlNormal">@color/colorAccent</item> <item name="colorControlNormal">@color/colorAccent</item>
<item name="android:statusBarColor">@color/colorPrimary</item> <item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>
<item name="snackbarStyle">@style/Widget.RoomPark.Snackbar</item>
</style> </style>
</resources> </resources>
\ No newline at end of file
<resources> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
...@@ -15,6 +15,17 @@ ...@@ -15,6 +15,17 @@
<item name="colorControlHighlight">@color/colorAccent</item> <item name="colorControlHighlight">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorAccent</item> <item name="colorControlNormal">@color/colorAccent</item>
<item name="android:statusBarColor">@color/colorPrimary</item> <item name="android:statusBarColor">@color/colorPrimary</item>
<item name="snackbarStyle">@style/Widget.RoomPark.Snackbar</item>
</style>
<style name="Widget.RoomPark.Snackbar" parent="Widget.MaterialComponents.Snackbar" tools:override="true">
<item name="android:layout_margin">@null</item>
<!-- Use default Snackbar margins for top/left/right -->
<item name="android:layout_marginTop" tools:ignore="PrivateResource">@dimen/mtrl_snackbar_margin</item>
<item name="android:layout_marginLeft" tools:ignore="PrivateResource">@dimen/mtrl_snackbar_margin</item>
<item name="android:layout_marginRight" tools:ignore="PrivateResource">@dimen/mtrl_snackbar_margin</item>
<!-- Custom bottom margin, this could work for top/left/right too -->
<item name="android:layout_marginBottom">@dimen/bottom_navigation_height</item>
</style> </style>
<style name="Widget.MainTextInputStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox"> <style name="Widget.MainTextInputStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
......
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