Commit e95ce74e authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

Merge branch 'feature/esates_fix' into develop

parents 9c1dc92c ada433bd
......@@ -7,6 +7,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.ProgressBar
import androidx.annotation.LayoutRes
import androidx.core.os.bundleOf
......@@ -21,6 +22,7 @@ import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.github.chrisbanes.photoview.PhotoView
import com.google.android.material.snackbar.Snackbar
import timber.log.Timber
/**
......@@ -45,7 +47,6 @@ class PhotoDialogController : Controller {
val progress = view.findViewById<ProgressBar>(R.id.photo_load_progress_bar)
progress.visibility = View.VISIBLE
view.findViewById<View>(R.id.close_current_button).setOnClickListener { handleBack() }
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
......@@ -81,6 +82,13 @@ class PhotoDialogController : Controller {
})
.into(photoView)
}
view.findViewById<ImageView>(R.id.close_current_button).setOnClickListener {
Timber.d("Clicked")
handleBack()
}
return view
}
......
......@@ -17,6 +17,7 @@ import com.biganto.visual.roompark.di.dagger.AppComponent
import com.biganto.visual.roompark.di.dagger.PerScreen
import com.biganto.visual.roompark.domain.interactor.ToursInteractor
import com.biganto.visual.roompark.domain.model.TourModel
import com.biganto.visual.roompark.domain.model.fromEntity
import com.biganto.visual.roompark.domain.use_case.DownloadUseCase
import com.biganto.visual.roompark.util.view_utils.snackbar.ISnackBarProvider
import com.biganto.visual.roomparkvr.data.repository.db.requery.model.TourPreviewEntity
......@@ -100,8 +101,8 @@ class DownloadTourDialogController : Controller {
downloadTourTitleText.text = tour.title
Glide.with(view)
.load(tour.previewUrl)
.transform(BlurTransformation(13, 8))
.transform(ColorFilterTransformation(0x99000000.toInt()))
.transform(BlurTransformation(13, 8)
,ColorFilterTransformation(0x99000000.toInt()))
.into(downloaderBg)
disposables.add(
......@@ -114,7 +115,10 @@ class DownloadTourDialogController : Controller {
{ model ->
updateProgressBar(model.downloadedFiles, model.overallFiles)
if (model.overallFiles == model.downloadedFiles)
activity?.let{ startPlayer(it,tour) }
activity?.let{
startPlayer(it, fromEntity(model))
handleBack()
}
}
,{error ->
Timber.e(error)
......
......@@ -91,6 +91,7 @@ class ChooseTourDialogController : Controller {
when (tour.downloadState) {
DownloadState.Downloaded -> {
activity?.let { startPlayer(it, tour) }
handleBack()
}
else -> {
router.replaceTopController(
......
......@@ -73,7 +73,9 @@ class AlbumsContractModule @Inject constructor(
arrayListOf(fetchTopLevelAlbumsDb,fetchTopLevelAlbumsApi)
)
.doOnNext { Timber.d("got entity $it") }
.map { fromEntity(it,::fromEntity) }
.map { fromEntity(it,::fromEntity).sortedByDescending{ album -> album.published } }
//endregion allAlbums
//region concrete Albums
......
package com.biganto.visual.roompark.data.data_provider
import com.biganto.visual.roompark.data.repository.db.IDb
import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.domain.contract.TourContract
import com.biganto.visual.roompark.domain.model.AuthInfoModel
import io.reactivex.Completable
import io.reactivex.Observable
import timber.log.Timber
import javax.inject.Inject
/**
* Created by Vladislav Bogdashkin on 29.10.2019.
*/
//@Singleton
class ToursRepository @Inject constructor(
private val files: FileModule,
private val db:IDb
): TourContract {
override fun getMultiTourId(building: Int, number: Int): Observable<AuthInfoModel> {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun getOffer(offerId: Int): Observable<AuthInfoModel> {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun deleteToursDbInfo(): Completable =
Completable.merge(arrayListOf(
db.dropTourFileJuncTable(),
db.dropFileTable(),
db.dropTourTable()
))
.doOnComplete { Timber.w("Completed --") }
.doOnError { Timber.e(it) }
}
......@@ -69,4 +69,7 @@ interface IDb {
fun getTourPreview(tourId: String): ReactiveResult<TourPreviewEntity>
fun getTourPreviewsObservableResult(estateId: Int): Observable<ReactiveResult<TourPreviewEntity>>
fun getEstateTourPreviews(estateId: Int): Observable<List<TourPreviewEntity>>
fun dropFileTable(): Completable
fun dropTourFileJuncTable(): Completable
fun dropTourTable(): Completable
}
\ No newline at end of file
......@@ -14,6 +14,7 @@ import io.reactivex.BackpressureStrategy
import io.reactivex.Completable
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.rxkotlin.toCompletable
import io.reactivex.schedulers.Schedulers
import io.requery.Persistable
import io.requery.android.sqlite.DatabaseSource
......@@ -51,6 +52,12 @@ class RequeryRepository @Inject constructor(
)
: IDb {
override fun dropTourTable() = store.delete(TourPreviewEntity::class).get().toCompletable()
override fun dropTourFileJuncTable() = store.delete(TourFileJunctionEntity::class).get().toCompletable()
override fun dropFileTable() = store.delete(FileEntity::class).get().toCompletable()
private inline fun <reified T : Persistable> fetchAll() =
store.select(T::class)
......
......@@ -33,9 +33,14 @@ class FileModule @Inject constructor(val context: Application) {
fun getFile(fileUri: String): File {
try {
val fileName =if (fileUri.contains("/")) fileUri.substring(fileUri.lastIndexOf("/")) else fileUri
val fileDir = if (fileUri.contains("/")) fileUri.substring(0, fileUri.lastIndexOf("/")) else ""
val directory = File(rootFolder, fileDir)
val fileName =
if (fileUri.contains("/")) fileUri.substring(fileUri.lastIndexOf("/"))
else fileUri
val fileDir =
if (fileUri.contains("/"))
fileUri.substring(0, fileUri.lastIndexOf("/"))
else ""
val directory = File(assetsFile(context), fileDir)
directory.mkdirs()
val file = File(directory, fileName)
......@@ -61,7 +66,7 @@ class FileModule @Inject constructor(val context: Application) {
file.writeText(content) //to json array because core unity method parse data like TourData[] Estate[] etc..
}
fun deleteFile(uri:String)= getFile(uri).delete()
// fun deleteFile(uri:String)= getFile(uri).delete()
fun deleteAllCacheObservable() =
Observable.create<Pair<Int, Int>> {emitter ->
......@@ -89,9 +94,11 @@ class FileModule @Inject constructor(val context: Application) {
fun getDirectory(context: Context, dirType: FileDirectory): File =
File(context.filesDir.absolutePath.plus(dirType.dir))
fun assetsDirectory(context: Context): String = context.filesDir.absolutePath
fun assetsDirectory(context: Context): String =
getDirectory(context,FileDirectory.ToursDir("biganto")).absolutePath
fun assetsFile(context: Context): File = context.filesDir.absoluteFile
fun assetsFile(context: Context): File =
getDirectory(context,FileDirectory.ToursDir("biganto"))
}
......
......@@ -62,6 +62,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun provideUtils():DeviceUtilsContract
fun provideTour():TourContract
fun provideAppContext():Application
fun provideFileSystem(): FileModule
......
......@@ -51,6 +51,10 @@ abstract class ContractRepositoryModule {
@Binds
@Singleton
abstract fun provideDeviceContract(impl: DeviceUtilsRepository): DeviceUtilsContract
@Binds
@Singleton
abstract fun provideTourContract(impl: ToursRepository): TourContract
}
......
package com.biganto.visual.roompark.domain.contract
import com.biganto.visual.roompark.domain.model.AuthInfoModel
import io.reactivex.Completable
import io.reactivex.Observable
......@@ -10,4 +11,5 @@ import io.reactivex.Observable
interface TourContract {
fun getMultiTourId(building:Int, number:Int) : Observable<AuthInfoModel>
fun getOffer(offerId:Int) : Observable<AuthInfoModel>
fun deleteToursDbInfo(): Completable
}
\ No newline at end of file
......@@ -36,9 +36,9 @@ class SettingsInteractor @Inject constructor(
}
private val plans
private val plans : Observable<CachedDataModel>
get() = settingsUseCase.planTypesSize.map {
CachedDataModel(activity.resources.getString(R.string.plans_cache),it,1)
CachedDataModel(activity.resources.getString(R.string.plans_cache), it, 1)
}
private val tours
......@@ -64,7 +64,7 @@ class SettingsInteractor @Inject constructor(
fun deleteCacheFiles() = settingsUseCase.clearAllCache()
fun getCacheInfo() =
fun getCacheInfo(): Observable<MutableList<CachedDataModel>> =
Observable.concatArray(plans, tours, feeds, albums, overall).toList().toObservable()
fun fetchSettings(): Observable<SettingsModel> = Observable.just(sampleSettings)
......
package com.biganto.visual.roompark.domain.interactor
import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.domain.model.TourModel
import com.biganto.visual.roompark.domain.use_case.DownloadUseCase
import com.biganto.visual.roompark.domain.use_case.TourPreviewsUseCase
import io.reactivex.Observable
import javax.inject.Inject
/**
......@@ -14,7 +16,11 @@ class ToursInteractor @Inject constructor(
private val tourUseCase:TourPreviewsUseCase
){
fun getEstateTourList(estate:EstateModel) =
fun getEstateTourList(multiTourId:Int?,estateId:Int) =
tourUseCase.fetchTourOffer(multiTourId
?: error("Отсутсвуют виртуальные туры для данного объекта"),estateId)
fun getEstateTourList(estate:EstateModel): Observable<List<TourModel>> =
tourUseCase.fetchTourOffer(estate.multitourId
?: error("Отсутсвуют виртуальные туры для данного объекта"),estate.id)
......
......@@ -277,7 +277,11 @@ class DownloadUseCase @Inject constructor(
tour.let {
val metaUri = RevisionString("$META_PREDICTION${tour.id}$META_FILE_TYPE")
it.setMetaFileEntityId(metaUri)
fileModule.saveFileToDisk(fileModule.getFile(metaUri.uri()), meta)
fileModule.saveFileToDisk(
File(
FileModule.assetsDirectory(context).plus(metaUri.uri())
),meta
)
}
}
?.map { tour }
......
......@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.domain.use_case
import com.biganto.visual.roompark.data.data_provider.AuthContractModule
import com.biganto.visual.roompark.domain.contract.FilesContract
import com.biganto.visual.roompark.domain.contract.TourContract
import io.reactivex.Observable
import javax.inject.Inject
......@@ -11,26 +12,28 @@ import javax.inject.Inject
class SettingsUseCase @Inject constructor(
private val authContract: AuthContractModule,
private val fileContract: FilesContract
private val fileContract: FilesContract,
private val tourContract: TourContract
){
fun signOut() = authContract.signOut()
fun clearAllCache() = fileContract.deleteAllFiles()
fun clearAllCache(): Observable<Pair<Int, Int>> =
tourContract.deleteToursDbInfo()
.andThen(fileContract.deleteAllFiles())
val planTypesSize
get() = Observable.just(fileContract.getPlansSize())
get() = Observable.defer { Observable.just(fileContract.getPlansSize()) }
val albumsSize
get() = Observable.just(fileContract.getAlbumSize())
get() = Observable.defer { Observable.just(fileContract.getAlbumSize()) }
val feedsSize
get() = Observable.just(fileContract.getFeedSize())
get() = Observable.defer { Observable.just(fileContract.getFeedSize()) }
val toursSize
get() = Observable.just(fileContract.getToursSize())
get() = Observable.defer { Observable.just(fileContract.getToursSize()) }
val overallSize
get() = Observable.just(fileContract.allCacheSize())
get() = Observable.defer { Observable.just(fileContract.allCacheSize()) }
}
\ No newline at end of file
......@@ -34,6 +34,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import jp.wasabeef.glide.transformations.BlurTransformation
import jp.wasabeef.glide.transformations.ColorFilterTransformation
import jp.wasabeef.glide.transformations.CropTransformation
import timber.log.Timber
import java.util.concurrent.TimeUnit
import javax.inject.Inject
......@@ -289,8 +290,9 @@ class AlbumsScreenController :
private fun loadGlideBlurred(url:String, context: Context, drawable: Target<Drawable>) =
Glide.with(context)
.load(url)
.transform(BlurTransformation(13, 2))
.transform(ColorFilterTransformation(0xCC000000.toInt()))
.transform(CropTransformation(nestedScrollView.width,nestedScrollView.height)
,BlurTransformation(8, 1)
,ColorFilterTransformation(0xCC000000.toInt()))
.into(drawable)
override fun onAlbumSelected(): Observable<AlbumPreviewModel>
......
......@@ -10,6 +10,8 @@ import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyc
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import java.text.SimpleDateFormat
import java.util.*
/**
......@@ -31,12 +33,17 @@ class AlbumsHeaderAdapter : CommonRecyclerAdapter<AlbumsHeaderViewHolder, AlbumP
class AlbumsHeaderViewHolder(itemView: View) : CommonViewHolder<AlbumPreviewModel>(itemView) {
private val dateFormatter = SimpleDateFormat("dd MMMM yyyy", Locale("ru"))
@BindView(R.id.preview) lateinit var preview:ImageView
@BindView(R.id.card_title) lateinit var articleTitle:TextView
@BindView(R.id.card_updated) lateinit var articleDate:TextView
override fun onViewBound(model: AlbumPreviewModel) {
articleTitle.text = model.title
articleDate.text = dateFormatter.format(model.published)
Glide.with(itemView)
.load(model.previewUrl)
.centerCrop()
......
......@@ -9,5 +9,6 @@ import io.reactivex.Observable
interface DealScreen : BigantoBaseContract<DealScreenViewState> {
fun onSubscription(): Observable<Boolean>
fun tourCardClicked(): Observable<Int>
}
......@@ -12,10 +12,13 @@ import com.biganto.visual.roompark.base.HeaderToolbarModel
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import com.biganto.visual.roompark.conductor.dialogs.tour_chooser.ChooseTourDialogController
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.typeDoubleString
import com.biganto.visual.roompark.domain.model.typeShortString
import com.biganto.visual.roompark.presentation.screen.estate.EstateScreenController
import com.biganto.visual.roompark.util.extensions.setGone
import com.biganto.visual.roompark.util.extensions.toRubly
import com.biganto.visual.roompark.util.monades.ExceptionString
import com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
......@@ -96,6 +99,14 @@ class DealScreenController :
@BindView(R.id.start_tour_image_view) lateinit var tourScreen: RoundedImageView
override fun tourCardClicked(): Observable<Int> =
tourScreen.clicks()
.map { 1 }
.debounce(320L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
private var servedDeal : DealModel? = null
override fun onAttach(view: View) {
......@@ -189,6 +200,7 @@ class DealScreenController :
is DealScreenViewState.RestoreView -> render(viewState)
is DealScreenViewState.SubscriptionStatus -> render(viewState)
is DealScreenViewState.SubscriptionError -> render(viewState)
is DealScreenViewState.ToursLoaded -> render(viewState)
}
}
......@@ -232,6 +244,15 @@ class DealScreenController :
}
}
private fun render(viewState: DealScreenViewState.ToursLoaded) {
router.pushController(RouterTransaction.with(
ChooseTourDialogController(ArrayList(viewState.tours))
)
.popChangeHandler(DialogChangeHandler())
.pushChangeHandler(DialogChangeHandler())
)
}
private fun render(viewState: DealScreenViewState.SomeError) =
showError(viewState.exception)
......@@ -245,6 +266,8 @@ class DealScreenController :
private fun render(viewState: DealScreenViewState.LoadDeal) {
servedDeal = viewState.estate
startTourView.setGone(servedDeal?.estate?.multitourId == null)
dealTitle.text = resources?.getString(
viewState.estate.estate.type.typeDoubleString(),
viewState.estate.estate.number
......
......@@ -3,6 +3,8 @@ package com.biganto.visual.roompark.presentation.screen.deal
import android.content.Context
import com.biganto.visual.roompark.conductor.BigantoBasePresenter
import com.biganto.visual.roompark.domain.interactor.DealInteractor
import com.biganto.visual.roompark.domain.interactor.ToursInteractor
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.SubscriptionModel
import com.biganto.visual.roompark.util.monades.ExceptionString
import io.reactivex.Observable
......@@ -19,6 +21,7 @@ import javax.inject.Named
class DealScreenPresenter @Inject constructor(
private val interactor: DealInteractor,
private val toursInteractor: ToursInteractor,
private val context: Context,
@Named(SELECTED_DEAL_ID_KEY) private val dealId:String
)
......@@ -28,7 +31,7 @@ class DealScreenPresenter @Inject constructor(
override fun defaultErrorViewStateHandler() =
{ e: ExceptionString -> DealScreenViewState.SomeError(e) }
private var restoreModel = RestoreModel(null)
private var restoreModel = RestoreModel(null,null)
override fun detachView() {
super.detachView()
......@@ -38,6 +41,7 @@ class DealScreenPresenter @Inject constructor(
override fun bindIntents() {
val fetchDeal = interactor.getDeal(dealId)
.doOnNext { restoreModel.deal = it }
.map<DealScreenViewState>{ deal ->
DealScreenViewState.LoadDeal(deal ,interactor.getStatusListSync())
}
......@@ -64,13 +68,23 @@ class DealScreenPresenter @Inject constructor(
.map<DealScreenViewState> { DealScreenViewState.SubscriptionStatus(it.state) }
.startWith(Observable.just<DealScreenViewState>(DealScreenViewState.Idle()))
val onStartTours = intent(DealScreen::tourCardClicked)
.map { restoreModel.deal }
.map{ it.estate }
.flatMap {estate -> toursInteractor.getEstateTourList(estate)
.map { DealScreenViewState.ToursLoaded(it) }
}
val state = Observable.mergeDelayError(
arrayListOf(
restoreStateObservable,
fetchDeal,
setRead,
onSubChecked,
fetchSubscription
fetchSubscription,
onStartTours
))
.doOnError { Timber.e(it) }
.onErrorReturn(::parseError)
......@@ -83,4 +97,4 @@ class DealScreenPresenter @Inject constructor(
data class RestoreModel(var sub: SubscriptionModel?)
\ No newline at end of file
data class RestoreModel(var sub: SubscriptionModel?,var deal: DealModel?)
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.deal
import com.biganto.visual.roompark.conductor.BigantoBaseViewState
import com.biganto.visual.roompark.domain.model.DealModel
import com.biganto.visual.roompark.domain.model.StatusModel
import com.biganto.visual.roompark.domain.model.TourModel
import com.biganto.visual.roompark.util.monades.ExceptionString
/**
......@@ -17,4 +18,5 @@ sealed class DealScreenViewState : BigantoBaseViewState() {
class RestoreView(val restore:RestoreModel) : DealScreenViewState()
class SubscriptionStatus(val subState: Boolean) : DealScreenViewState()
class SubscriptionError(val subState: Boolean) : DealScreenViewState()
class ToursLoaded(val tours:List<TourModel>) : DealScreenViewState()
}
\ No newline at end of file
package com.biganto.visual.roompark.presentation.screen.deals
import com.biganto.visual.roompark.conductor.BigantoBaseContract
import com.biganto.visual.roompark.domain.model.DealPreviewModel
import io.reactivex.Observable
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface DealsScreen : BigantoBaseContract<DealsScreenViewState> {
fun tourCardClicked(): Observable<DealPreviewModel>
}
......@@ -9,12 +9,16 @@ import com.biganto.visual.roompark.base.HeaderToolbarModel
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import com.biganto.visual.roompark.conductor.dialogs.tour_chooser.ChooseTourDialogController
import com.biganto.visual.roompark.domain.model.DealPreviewModel
import com.biganto.visual.roompark.presentation.screen.deal.DealScreenController
import com.biganto.visual.roompark.presentation.screen.deals.util.DealsListAdapter
import com.biganto.visual.roompark.presentation.screen.estate.EstateScreenController
import com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import com.bluelinelabs.conductor.RouterTransaction
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import timber.log.Timber
import javax.inject.Inject
......@@ -90,13 +94,6 @@ class DealsScreenController :
.popChangeHandler(FadeChangeHandler())
.pushChangeHandler(FadeChangeHandler())
)
},
(dealsRecyclerView.adapter as DealsListAdapter)
.startTour
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
Timber.d("got tour clicked $it")
showMessage(R.string.tour_not_allowed)
}
)
}
......@@ -107,6 +104,12 @@ class DealsScreenController :
bindRecycler()
}
override fun tourCardClicked(): Observable<DealPreviewModel> =
(dealsRecyclerView.adapter as DealsListAdapter)
.startTour
.map { it }
.observeOn(AndroidSchedulers.mainThread())
override fun render(viewState: DealsScreenViewState) {
super.render(viewState)
Timber.d("Render state $viewState")
......@@ -114,6 +117,7 @@ class DealsScreenController :
is DealsScreenViewState.Idle -> render(viewState)
is DealsScreenViewState.DealsLoaded -> render(viewState)
is DealsScreenViewState.SomeError -> render(viewState)
is DealsScreenViewState.ToursLoaded -> render(viewState)
}
}
......@@ -125,6 +129,16 @@ class DealsScreenController :
(dealsRecyclerView.adapter as DealsListAdapter).addItems(viewState.items)
}
private fun render(viewState: DealsScreenViewState.ToursLoaded) {
router.pushController(RouterTransaction.with(
ChooseTourDialogController(ArrayList(viewState.tours))
)
.popChangeHandler(DialogChangeHandler())
.pushChangeHandler(DialogChangeHandler())
)
}
private fun render(viewState: DealsScreenViewState.SomeError) =
showError(viewState.exception)
......
......@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.deals
import com.biganto.visual.roompark.conductor.BigantoBasePresenter
import com.biganto.visual.roompark.domain.interactor.DealsInteractor
import com.biganto.visual.roompark.domain.interactor.ToursInteractor
import com.biganto.visual.roompark.domain.model.DealPreviewModel
import com.biganto.visual.roompark.util.monades.ExceptionString
import io.reactivex.Observable
......@@ -16,7 +17,8 @@ import javax.inject.Inject
class DealsScreenPresenter @Inject constructor(
private val interactor: DealsInteractor
private val interactor: DealsInteractor,
private val toursInteractor: ToursInteractor
)
: BigantoBasePresenter<DealsScreen, DealsScreenViewState>() {
......@@ -42,10 +44,18 @@ class DealsScreenPresenter @Inject constructor(
.map<DealsScreenViewState>(DealsScreenViewState::DealsLoaded)
.onErrorReturn(::parseError)
val onStartTours = intent(DealsScreen::tourCardClicked)
.flatMap {dealPreview ->
toursInteractor.getEstateTourList(dealPreview.tourId,dealPreview.estateId)
.map { DealsScreenViewState.ToursLoaded(it) }
}
val state = Observable.mergeDelayError(
arrayListOf(
restoreStateObservable,
fetchDeals
fetchDeals,
onStartTours
)
)
.doOnError { Timber.e(it) }
......
......@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.deals
import com.biganto.visual.roompark.conductor.BigantoBaseViewState
import com.biganto.visual.roompark.domain.model.DealPreviewModel
import com.biganto.visual.roompark.domain.model.TourModel
import com.biganto.visual.roompark.util.monades.ExceptionString
/**
......@@ -13,5 +14,6 @@ sealed class DealsScreenViewState : BigantoBaseViewState() {
class Idle : DealsScreenViewState()
class DealsLoaded(val items:List<DealPreviewModel>) : DealsScreenViewState()
class SomeError(val exception: ExceptionString) : DealsScreenViewState()
class ToursLoaded(val tours:List<TourModel>) : DealsScreenViewState()
}
......@@ -34,7 +34,7 @@ class DealsListAdapter : CommonRecyclerAdapter<DealViewHolder, DealPreviewModel>
override fun getVhLayout() = R.layout.deal_card_viewholder
private val onFlatClicked = PublishSubject.create<Int>()
private val onTourClickced = PublishSubject.create<Int>()
private val onTourClickced = PublishSubject.create<DealPreviewModel>()
override fun onBindViewHolder(holder: DealViewHolder, position: Int) {
super.onBindViewHolder(holder, position)
......@@ -73,7 +73,7 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
@BindView(R.id.deal_read) lateinit var dealReadFlag:View
val onStartFlatObs: Observable<Int?> get() = startFlat.clicks().map { bindedModel.estateId }
val onStartTourObs: Observable<Int?> get() = startTour.clicks().map { bindedModel.tourId }
val onStartTourObs: Observable<DealPreviewModel> get() = startTour.clicks().map { bindedModel }
override fun onViewBound(model: DealPreviewModel) {
......
......@@ -270,6 +270,7 @@ class EstateScreenController :
}
private fun render(viewState: EstateScreenViewState.SomeError) =
showError(viewState.exception)
......@@ -318,7 +319,6 @@ class EstateScreenController :
}
private fun render(viewState: EstateScreenViewState.ToursLoaded) {
Timber.d("Wtf")
router.pushController(RouterTransaction.with(
ChooseTourDialogController(ArrayList(viewState.tours)))
.popChangeHandler(DialogChangeHandler())
......
package com.biganto.visual.roompark.presentation.screen.favorites
import com.biganto.visual.roompark.conductor.BigantoBaseContract
import com.biganto.visual.roompark.domain.model.EstateModel
import io.reactivex.Observable
/**
* Created by Vladislav Bogdashkin on 30.09.2019.
*/
interface FavoritesScreen : BigantoBaseContract<FavoritesScreenViewState> {
fun tourCardClicked(): Observable<EstateModel>
}
......@@ -9,13 +9,18 @@ import com.biganto.visual.roompark.base.HeaderToolbarModel
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import com.biganto.visual.roompark.conductor.dialogs.tour_chooser.ChooseTourDialogController
import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.presentation.screen.estate.EstateScreenController
import com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter
import com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import com.bluelinelabs.conductor.RouterTransaction
import com.bluelinelabs.conductor.changehandler.FadeChangeHandler
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import timber.log.Timber
import java.util.concurrent.TimeUnit
import javax.inject.Inject
/**
......@@ -38,6 +43,11 @@ class FavoritesScreenController :
@BindView(R.id.favorites_cards_recycler_view)
lateinit var favoritesRecyclerView: RecyclerView
override fun tourCardClicked(): Observable<EstateModel> =
(favoritesRecyclerView.adapter as FavoritesListAdapter)
.startTour
.debounce(220L, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
override fun onAttach(view: View) {
super.onAttach(view)
......@@ -93,6 +103,7 @@ class FavoritesScreenController :
is FavoritesScreenViewState.Idle -> render(viewState)
is FavoritesScreenViewState.FavoriteEstatesLoaded -> render(viewState)
is FavoritesScreenViewState.SomeError -> render(viewState)
is FavoritesScreenViewState.ToursLoaded -> render(viewState)
}
}
......@@ -100,6 +111,15 @@ class FavoritesScreenController :
}
private fun render(viewState: FavoritesScreenViewState.ToursLoaded) {
router.pushController(RouterTransaction.with(
ChooseTourDialogController(ArrayList(viewState.tours))
)
.popChangeHandler(DialogChangeHandler())
.pushChangeHandler(DialogChangeHandler())
)
}
private fun render(viewState: FavoritesScreenViewState.SomeError) =
showError(viewState.exception)
......
......@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import com.biganto.visual.roompark.conductor.BigantoBasePresenter
import com.biganto.visual.roompark.domain.interactor.FavoritesInteractor
import com.biganto.visual.roompark.domain.interactor.ToursInteractor
import com.biganto.visual.roompark.util.monades.ExceptionString
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -15,7 +16,8 @@ import javax.inject.Inject
class FavoritesScreenPresenter @Inject constructor(
private val interactor: FavoritesInteractor
private val interactor: FavoritesInteractor,
private val toursInteractor: ToursInteractor
)
: BigantoBasePresenter<FavoritesScreen, FavoritesScreenViewState>() {
......@@ -27,10 +29,18 @@ class FavoritesScreenPresenter @Inject constructor(
val prefetchCards = interactor.getFavoritesForCurrentUser()
.map { FavoritesScreenViewState.FavoriteEstatesLoaded(it) }
val onStartTours = intent(FavoritesScreen::tourCardClicked)
.flatMap {estate -> toursInteractor.getEstateTourList(estate)
.map { FavoritesScreenViewState.ToursLoaded(it) }
}
val state = Observable.mergeDelayError(
arrayListOf(
restoreStateObservable,
prefetchCards
prefetchCards,
onStartTours
)
)
.doOnError { Timber.e(it) }
......
......@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import com.biganto.visual.roompark.conductor.BigantoBaseViewState
import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.domain.model.TourModel
import com.biganto.visual.roompark.util.monades.ExceptionString
/**
......@@ -13,4 +14,5 @@ sealed class FavoritesScreenViewState : BigantoBaseViewState() {
class Idle : FavoritesScreenViewState()
class FavoriteEstatesLoaded(val items: List<EstateModel>) : FavoritesScreenViewState()
class SomeError(val exception: ExceptionString) : FavoritesScreenViewState()
class ToursLoaded(val tours:List<TourModel>) : FavoritesScreenViewState()
}
\ No newline at end of file
......@@ -14,6 +14,9 @@ import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyc
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import com.biganto.visual.roompark.util.extensions.setGone
import com.biganto.visual.roompark.util.extensions.startUrl
import com.jakewharton.rxbinding3.view.clicks
import io.reactivex.Observable
import io.reactivex.subjects.PublishSubject
/**
* Created by Vladislav Bogdashkin on 16.10.2019.
......@@ -22,6 +25,15 @@ import com.biganto.visual.roompark.util.extensions.startUrl
class FavoritesListAdapter : CommonRecyclerAdapter<FavoriteViewHolder,EstateModel>() {
override val vhKlazz = FavoriteViewHolder::class
override fun getVhLayout(): Int = R.layout.favorite_card_viewholder
private val onTourClickced = PublishSubject.create<EstateModel>()
override fun onBindViewHolder(holder: FavoriteViewHolder, position: Int) {
super.onBindViewHolder(holder, position)
holder.onStartTourObs.subscribe(onTourClickced)
}
val startTour get() = onTourClickced
}
......@@ -45,10 +57,13 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie
init {
ButterKnife.bind(this, itemView)
}
val onStartTourObs: Observable<EstateModel> get() = startTour.clicks().map { bindedModel }
override fun onViewBound(model: EstateModel) {
estateTitle.text =
itemView.context.resources?.getString(model.type.typeDoubleString(),model.number)
......@@ -57,6 +72,8 @@ class FavoriteViewHolder(itemView: View) : CommonViewHolder<EstateModel>(itemVie
startTour.setGone(model.type != FlatType.FLAT)
startTour.setGone(model.multitourId == null)
siteLink.setGone(model.url == null)
siteLinkDivider.setGone(model.url == null)
model.url?.let {url ->
......
......@@ -41,6 +41,9 @@ class AlbumCardViewHolder(itemView: View) : CommonViewHolder<AlbumPreviewModel>(
articleTitle.text = model.title
articleTitle.text = model.title
articleDate.text = dateFormatter.format(model.published)
Glide.with(preview)
.load(model.previewUrl)
.centerCrop()
......
......@@ -11,6 +11,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import timber.log.Timber
import java.util.concurrent.TimeUnit
import javax.inject.Inject
/**
......@@ -95,10 +96,12 @@ class SettingsScreenPresenter @Inject constructor(
.flatMap {
interactor.deleteCacheFiles()
.map<SettingsScreenViewState> {
Timber.d(" got progress: ${it.first} / ${it.second.toFloat()}")
SettingsScreenViewState.OnCacheDeleting(
it.first / it.second.toFloat()
)
}
.delay(500,TimeUnit.MILLISECONDS)
.startWith(SettingsScreenViewState.OnCacheDeleting(0f))
.doOnError { Timber.e(it) }
}
......
......@@ -9,7 +9,7 @@ import io.reactivex.Observable
interface FindFlatScreen : BigantoBaseContract<FindFlatScreenViewState> {
fun getFlat() : Observable<FlatRequestModel>
fun openFlat() : Observable<Int>
fun openFlat() : Observable<FlatRequestModel>
}
data class FlatRequestModel(val building:Int,val number:Int)
\ No newline at end of file
......@@ -36,11 +36,20 @@ class FindFlatScreenController :
, FindFlatScreenPresenter>()
, FindFlatScreen {
private val flatModel:FlatRequestModel get(){
return FlatRequestModel(
estateTabs[flatTabs.selectedTabPosition].building
, flatNumberInput.editText?.text.toString().toInt()
)
}
override fun openFlat(): Observable<Int> =
override fun openFlat(): Observable<FlatRequestModel> =
findFlatButton.clicks()
.map { 1 }
.mergeWith(flatNumberEditor.keys{ it.keyCode == KeyEvent.KEYCODE_ENTER }.map { 1 })
.map {
flatModel
}
.doOnNext{ flatNumberEditor.hideKeyboard() }
.observeOn(AndroidSchedulers.mainThread())
......@@ -48,12 +57,9 @@ class FindFlatScreenController :
flatNumberEditor.afterTextChangeEvents()// keys{ it.keyCode == KeyEvent.KEYCODE_ENTER }
.filter { flatNumberInput.editText?.text?.isNotEmpty()?:false }
.map {
FlatRequestModel(
estateTabs[flatTabs.selectedTabPosition].building
, flatNumberInput.editText?.text.toString().toInt()
)
flatModel
}
.debounce (300,TimeUnit.MILLISECONDS)
.debounce (120,TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
override fun injectDependencies() {
......@@ -118,6 +124,7 @@ class FindFlatScreenController :
is FindFlatScreenViewState.FlatFounded -> render(viewState)
is FindFlatScreenViewState.FlatNotFound -> render(viewState)
is FindFlatScreenViewState.StartFlat -> render(viewState)
is FindFlatScreenViewState.RestoreView -> render(viewState)
}
}
......@@ -127,6 +134,14 @@ class FindFlatScreenController :
private fun render(viewState: FindFlatScreenViewState.Idle){
}
private fun render(viewState: FindFlatScreenViewState.RestoreView){
val tabIndex = viewState.restore.building-1
Timber.d(":: ${viewState.restore.building} : $tabIndex")
flatTabs.getTabAt(tabIndex)?.select() //zero-based
flatNumberInput.editText?.setText(viewState.restore.number.toString())
}
private fun render(viewState: FindFlatScreenViewState.FlatFounded){
findFlatButton.isEnabled = true
findFlatButton.text = resources?.getString(R.string.flat_ready_to_watch)
......
......@@ -27,6 +27,13 @@ class FindFlatScreenPresenter @Inject constructor(
//estateId
private var recentFlat:Int? =null
private var restoreModel = RestoreModel(-1,-1)
override fun detachView() {
super.detachView()
restoreStateObservable.accept(FindFlatScreenViewState.RestoreView(restoreModel))
}
override fun vsByCode(code: Int): (ExceptionString) -> FindFlatScreenViewState =
when (code) {
304 -> {message:ExceptionString ->FindFlatScreenViewState.FlatNotFound(message)}
......@@ -36,6 +43,7 @@ class FindFlatScreenPresenter @Inject constructor(
override fun bindIntents() {
val getFlatIntent = intent(FindFlatScreen::getFlat)
.doOnNext { restoreModel.building = it.building;restoreModel.number = it.number }
.doOnNext{recentFlat=null}
.doOnNext{Timber.d(" flat is $it")}
.flatMap { request ->
......@@ -47,6 +55,7 @@ class FindFlatScreenPresenter @Inject constructor(
.startWith(Observable.just(FindFlatScreenViewState.RequstFlatProgress()))
val startFlatIntent = intent(FindFlatScreen::openFlat)
.doOnNext { restoreModel.building = it.building;restoreModel.number = it.number }
.map {
if (recentFlat != null) {FindFlatScreenViewState.StartFlat(recentFlat as Int)}
else FindFlatScreenViewState.FlatNotFound(
......@@ -55,6 +64,7 @@ class FindFlatScreenPresenter @Inject constructor(
}
val state = restoreStateObservable
.mergeWith(getFlatIntent)
.mergeWith(startFlatIntent)
......@@ -65,3 +75,6 @@ class FindFlatScreenPresenter @Inject constructor(
subscribeViewState(state.cast(FindFlatScreenViewState::class.java), FindFlatScreen::render)
}
}
data class RestoreModel(
var building:Int,var number:Int)
......@@ -15,4 +15,5 @@ sealed class FindFlatScreenViewState : BigantoBaseViewState() {
class FlatNotFound(val exceptionString:ExceptionString) : FindFlatScreenViewState()
class StartFlat(val esateId:Int) : FindFlatScreenViewState()
class SomeError(val exception: ExceptionString) : FindFlatScreenViewState()
class RestoreView(val restore:RestoreModel) : FindFlatScreenViewState()
}
\ No newline at end of file
......@@ -41,7 +41,7 @@
android:top="5dp"
android:bottom="5dp"
android:src="@drawable/ic_bell_on"
android:mipMap="true"
android:mipMap="false"
android:gravity="start"
android:tintMode="screen"
android:tint="@color/colorPrimaryDark" />
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:width="http://schemas.android.com/apk/res-auto">
<item android:state_checked="false">
<layer-list>
<item>
<shape android:shape="rectangle"
android:dither="true"
android:useLevel="false">
<size android:width="48dp" android:height="24dp"/>
<corners android:radius="12dp"/>
</shape>
</item>
<item
android:right="8dp">
<shape
android:shape="ring"
android:width="14dp"
android:height="15dp"
android:gravity="end"
android:tint="@color/colorPrimaryDark" />
</item>
</layer-list>
</item>
<item android:state_checked="true">
<layer-list>
<item>
<shape android:shape="rectangle"
android:dither="true"
android:useLevel="false">
<size android:width="48dp" android:height="24dp"/>
<solid android:color="#FFFFFFFF"/>
<corners android:radius="12dp" />
</shape>
</item>
<item
android:left="8dp">
<shape
android:shape="ring"
android:right="27dp"
android:top="5dp"
android:bottom="5dp"
android:gravity="start"
android:tintMode="screen"
android:tint="@color/colorPrimaryDark"/>
</item>
</layer-list>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bell_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.switchmaterial.SwitchMaterial
style="@style/Widget.MaterialComponents.CompoundButton.Switch.DefaultSwitchStyle"
android:id="@+id/switch1"
android:layout_width="48dp"
android:layout_height="24dp"
android:height="24dp"
android:checked="false"
app:switchMinWidth="48dp" />
</LinearLayout>
\ No newline at end of file
......@@ -4,7 +4,11 @@
android:layout_width="284dp"
android:layout_height="189dp"
android:layout_margin="16dp"
app:cardElevation="0dp"
app:cardElevation="8dp"
app:cardMaxElevation="12dp"
android:padding="16dp"
app:cardCornerRadius="4dp"
app:cardForegroundColor="#00000000"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="false">
......
......@@ -127,7 +127,7 @@
android:fitsSystemWindows="true"
android:visibility="gone"
app:elevation="0dp"
app:itemBackground="@color/colorOpacityBackgroundInv"
app:itemBackground="@color/colorPrimary"
app:itemHorizontalTranslationEnabled="false"
app:itemIconTint="@drawable/bottom_navigation_icon_selector"
app:labelVisibilityMode="unlabeled"
......
......@@ -35,7 +35,6 @@
android:layout_marginTop="32dp"
android:layout_marginBottom="4dp"
android:includeFontPadding="false"
android:text="Дом №1"
android:textAlignment="center" />
<com.google.android.material.textview.MaterialTextView
......@@ -49,7 +48,6 @@
android:gravity="center"
android:includeFontPadding="false"
android:maxLines="1"
android:text="14 декабря 2019г"
android:textAlignment="center" />
<FrameLayout
......
......@@ -4,9 +4,11 @@
android:layout_width="142dp"
android:layout_height="94dp"
android:layout_margin="16dp"
android:padding="8dp"
app:cardCornerRadius="4dp"
app:cardElevation="4dp"
app:cardMaxElevation="8dp"
app:cardForegroundColor="#00000000"
app:cardMaxElevation="6dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="false"
app:contentPadding="8dp">
......@@ -34,7 +36,6 @@
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginBottom="4dp"
android:text="Дом №1"
android:textAlignment="center" />
<com.google.android.material.textview.MaterialTextView
......@@ -47,7 +48,6 @@
android:layout_marginEnd="8dp"
android:gravity="center"
android:maxLines="1"
android:text="14 декабря 2019г"
android:textAlignment="center" />
<FrameLayout
......
......@@ -37,7 +37,8 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/colorOpacityBackground">
android:background="@color/colorOpacityBackground"
>
<LinearLayout
android:layout_width="match_parent"
......
......@@ -7,6 +7,7 @@
android:orientation="vertical">
<com.google.android.material.switchmaterial.SwitchMaterial
style="@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle"
android:id="@+id/switch1"
android:layout_width="48dp"
android:layout_height="24dp"
......
......@@ -43,7 +43,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="КВАРТИРА\n№452" />
android:text="\n" />
<include
layout="@layout/horizontal_divider"
......@@ -139,8 +139,7 @@
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|end"
android:includeFontPadding="false"
android:text="5 165 301 ₽" />
android:includeFontPadding="false" />
</LinearLayout>
......@@ -173,8 +172,7 @@
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|end"
android:includeFontPadding="false"
android:text="1 332 543 ₽" />
android:includeFontPadding="false" />
</LinearLayout>
......@@ -207,8 +205,7 @@
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|end"
android:includeFontPadding="false"
android:text="32 543 ₽" />
android:includeFontPadding="false" />
</LinearLayout>
<include
......
......@@ -20,7 +20,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="КВАРТИРА\n№452" />
android:text="\n" />
<include
layout="@layout/horizontal_divider"
......@@ -138,8 +138,7 @@
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|end"
android:includeFontPadding="false"
android:text="5 165 301 ₽" />
android:includeFontPadding="false" />
</LinearLayout>
<include
......@@ -178,8 +177,7 @@
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|end"
android:includeFontPadding="false"
android:text="1 332 543 ₽" />
android:includeFontPadding="false" />
</LinearLayout>
......@@ -219,8 +217,7 @@
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:gravity="bottom|end"
android:includeFontPadding="false"
android:text="32 543 ₽" />
android:includeFontPadding="false" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="284dp"
android:layout_height="189dp"
android:layout_margin="16dp"
app:cardElevation="4dp"
app:cardMaxElevation="8dp"
app:cardForegroundColor="#00000000"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="false">
<com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:background="@drawable/default_image_placeholder"
android:cropToPadding="true"
android:foreground="@color/colorOpacityBackground"
android:scaleType="centerCrop"
app:image_corner_radius="4dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/card_title"
style="@style/Header_TextView.Inverted_Header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:layout_marginBottom="4dp"
android:text="Дом №1"
android:textAlignment="center" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/textView6"
style="@style/Common_Text.Inverted"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Последнее обновление"
android:textAlignment="center" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/card_updated"
style="@style/Accent_Minor_TextView.DatePlaceHolder"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_marginStart="64dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="64dp"
android:gravity="center"
android:maxLines="1"
android:text="14 декабря 2019г"
android:textAlignment="center" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
\ No newline at end of file
......@@ -47,7 +47,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="КВАРТИРА\n№ 452"
android:text="\n"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/feed_date_text_view3" />
......
......@@ -74,7 +74,6 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:includeFontPadding="false"
android:text="В «РУМЯНЦЕВО-ПАРК» ПРИСТУПИЛИ К МОНТАЖУ ОКОННЫХ БЛОКОВ"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline"
......
......@@ -44,7 +44,6 @@
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:includeFontPadding="false"
android:text="22 / 02 / 2019"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/feed_read"
......@@ -58,7 +57,6 @@
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:includeFontPadding="false"
android:text="В «РУМЯНЦЕВО-ПАРК» ПРИСТУПИЛИ К МОНТАЖУ ОКОННЫХ БЛОКОВ"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline"
......
......@@ -29,8 +29,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="В ЖК «РУМЯНЦЕВО-ПАРК» ИПОТЕЧНАЯ СТАВКА - 6,5%" />
android:paddingEnd="16dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/articleBodyRecyclerView"
......
......@@ -45,7 +45,6 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:includeFontPadding="false"
android:text="22 / 02 / 2019"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
......@@ -61,7 +60,6 @@
android:layout_marginEnd="32dp"
android:includeFontPadding="false"
android:maxLines="3"
android:text="В «РУМЯНЦЕВО-ПАРК» ПРИСТУПИЛИ К МОН ТАЖУ dadasdasd a 22ЫХ БЛОКОВ"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/guideline"
......
......@@ -97,7 +97,7 @@
<include
android:id="@+id/sizes_switcher"
layout="@layout/bell_switch_view"
layout="@layout/default_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
......@@ -140,7 +140,7 @@
<include
android:id="@+id/furniture_switcher"
layout="@layout/bell_switch_view"
layout="@layout/default_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
......@@ -183,7 +183,7 @@
<include
android:id="@+id/electricity_switcher"
layout="@layout/bell_switch_view"
layout="@layout/default_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
......@@ -227,7 +227,7 @@
<include
android:id="@+id/walls_switcher"
layout="@layout/bell_switch_view"
layout="@layout/default_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
......
......@@ -9,7 +9,7 @@
android:id="@+id/info_ceil_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Цена за м²" />
/>
<com.google.android.material.textview.MaterialTextView
style="@style/Common_Text.Default"
......@@ -17,5 +17,5 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="165 301 ₽" />
/>
</LinearLayout>
\ No newline at end of file
......@@ -22,16 +22,18 @@
<ImageView
android:id="@+id/close_current_button"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_width="56dp"
android:layout_height="64dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="0dp"
android:clickable="true"
android:contentDescription="@string/content_description_close"
android:focusable="true"
android:focusableInTouchMode="true"
android:focusableInTouchMode="false"
android:padding="16dp"
android:paddingEnd="8dp"
android:scaleType="fitXY"
android:src="@drawable/ic_close_circled" />
......
......@@ -22,8 +22,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
android:text="Договор готовится для подачи на гос. регистрацию b,kf,kf,fk">
android:orientation="vertical">
</com.google.android.material.textview.MaterialTextView>
</LinearLayout>
\ No newline at end of file
......@@ -44,7 +44,6 @@
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:fitsSystemWindows="true"
android:text="СВОБОДНА"
app:layout_constraintBottom_toBottomOf="@+id/status_icon"
app:layout_constraintEnd_toStartOf="@+id/back_cross"
app:layout_constraintHorizontal_bias="0.0"
......
......@@ -12,8 +12,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start|center_vertical"
android:text="блабла" />
android:gravity="start|center_vertical" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/descriptionText"
......
......@@ -10,7 +10,7 @@
<item name="colorAccent">@color/colorAccent</item>
<item name="materialCardViewStyle">@style/Widget.Biganto.MaterialCardView</item>
<item name="switchStyle">@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle</item>
<!-- <item name="switchStyle">@style/Widget.MaterialComponents.CompoundButton.Switch.BellSwitchStyle</item>-->
<item name="colorControlActivated">@color/colorAccent</item>
<item name="colorControlHighlight">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorAccent</item>
......@@ -43,6 +43,13 @@
<item name="trackTint">@drawable/bell_switch_track_tint</item>
</style>
<style name="Widget.MaterialComponents.CompoundButton.Switch.DefaultSwitchStyle" >
<item name="track" >@drawable/def_switch_track</item>
<item name="android:thumb" >@drawable/bell_switcher</item>
<item name="thumbTint">@color/colorPrimaryDark</item>
<item name="trackTint">@drawable/bell_switch_track_tint</item>
</style>
<style name="Widget.Biganto.MaterialCardView" parent="Widget.MaterialComponents.CardView">
<item name="cardUseCompatPadding">false</item>
<item name="strokeWidth">0dp</item>
......
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