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

fix errors

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