Commit 180f697f authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

article screen

parent 634a070f
...@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.domain.interactor ...@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.domain.interactor
import com.biganto.visual.roompark.domain.model.ArticleModel import com.biganto.visual.roompark.domain.model.ArticleModel
import io.reactivex.Single import io.reactivex.Single
import java.util.*
import javax.inject.Inject import javax.inject.Inject
/** /**
...@@ -13,9 +14,26 @@ class ArticleInteractor @Inject constructor( ...@@ -13,9 +14,26 @@ class ArticleInteractor @Inject constructor(
fun fetchArticles(articleId: Int): Single<ArticleModel> = Single.just( fun fetchArticles(articleId: Int): Single<ArticleModel> = Single.just(
when (articleId) { when (articleId) {
2 -> article2
else -> error("unknown feedId") else -> error("unknown feedId")
} }
) )
companion object{
val article2 = ArticleModel(
2,
Date(12315536L),
"В ЖК «РУМЯНЦЕВО-ПАРК» ИПОТЕЧНАЯ СТАВКА - 6,5%",
"С марта 2019 года для всех покупателей квартир в жилом комплексе бизнес-класса «Румянцево-Парк» от компании Lexion Development, доступна минимальная ипотечная ставка от банка-партнера ПАО Банк ВТБ в размере 6,5% по программе субсидирования ипотеки от застройщика. \n" +
"\n" +
"Минимальная процентная ставка действительна при покупке любого типа квартир в жилом комплексе – от студий 23,8 кв. м до четырехкомнатных квартир площадью 102,7 кв. м. Минимальный первоначальный взнос составляет от 20%.\n" +
"\n" +
"Более подробная информация доступна в офисе продаж по телефону: +7 (495) 127-86-86",
"https://room-park.ru/assets/news_articles/preview/00/00/00/96-a972cd.jpeg",
false
)
}
} }
......
...@@ -4,7 +4,7 @@ import android.text.Html ...@@ -4,7 +4,7 @@ import android.text.Html
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.MultiAutoCompleteTextView import androidx.core.os.bundleOf
import butterknife.BindView import butterknife.BindView
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
...@@ -21,12 +21,19 @@ import javax.inject.Inject ...@@ -21,12 +21,19 @@ import javax.inject.Inject
* Created by Vladislav Bogdashkin on 30.09.2019. * Created by Vladislav Bogdashkin on 30.09.2019.
*/ */
private const val ARTICLE_ID = "DIRECT_ARTICLE_ID_KEY"
class ArticleScreenController : class ArticleScreenController :
BigantoBaseController<ArticleScreenViewState BigantoBaseController<ArticleScreenViewState
, ArticleScreen , ArticleScreen
, ArticleScreenPresenter>() , ArticleScreenPresenter>
, ArticleScreen { , ArticleScreen {
constructor()
constructor(id:Int):super(bundleOf(ARTICLE_ID to id))
override fun injectDependencies() { override fun injectDependencies() {
getComponent() getComponent()
} }
...@@ -44,19 +51,19 @@ class ArticleScreenController : ...@@ -44,19 +51,19 @@ class ArticleScreenController :
lateinit var contentView: MaterialTextView lateinit var contentView: MaterialTextView
val blurPreview:ImageView by lazy { val blurPreview:ImageView by lazy {
headerBlock.findViewById(R.id.articlePreviewBlurred) headerBlock.findViewById<ImageView>(R.id.articlePreviewBlurred)
} }
val articlePreview:ImageView by lazy { val articlePreview:ImageView by lazy {
headerBlock.findViewById(R.id.articlePreview) headerBlock.findViewById<ImageView>(R.id.articlePreview)
} }
val articleDate:MaterialTextView by lazy { val articleDate:MaterialTextView by lazy {
headerBlock.findViewById(R.id.articleDate) headerBlock.findViewById<MaterialTextView>(R.id.articleDate)
} }
val closeButton:FloatingActionButton by lazy { val closeButton:FloatingActionButton by lazy {
headerBlock.findViewById(R.id.articleCloseButton) headerBlock.findViewById<FloatingActionButton>(R.id.articleCloseButton)
} }
......
package com.biganto.visual.roompark.presentation.screen.favorites package com.biganto.visual.roompark.presentation.screen.favorites
import com.biganto.visual.roompark.conductor.BigantoBaseContract import com.biganto.visual.roompark.conductor.BigantoBaseContract
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenViewState
/** /**
* Created by Vladislav Bogdashkin on 30.09.2019. * Created by Vladislav Bogdashkin on 30.09.2019.
......
...@@ -8,9 +8,6 @@ import com.biganto.visual.roompark.R ...@@ -8,9 +8,6 @@ import com.biganto.visual.roompark.R
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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreen
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenPresenter
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenViewState
import com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter import com.biganto.visual.roompark.presentation.screen.favorites.util.FavoritesListAdapter
import com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration import com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import timber.log.Timber import timber.log.Timber
......
...@@ -4,10 +4,6 @@ import android.content.Context ...@@ -4,10 +4,6 @@ import android.content.Context
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
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
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenComponent
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenController
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenModule
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenPresenter
import dagger.Binds import dagger.Binds
import dagger.BindsInstance import dagger.BindsInstance
import dagger.Component import dagger.Component
......
...@@ -2,8 +2,6 @@ package com.biganto.visual.roompark.presentation.screen.favorites ...@@ -2,8 +2,6 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import com.biganto.visual.roompark.conductor.BigantoBasePresenter import com.biganto.visual.roompark.conductor.BigantoBasePresenter
import com.biganto.visual.roompark.domain.interactor.FavoritesInteractor import com.biganto.visual.roompark.domain.interactor.FavoritesInteractor
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreen
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenViewState
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import timber.log.Timber import timber.log.Timber
......
...@@ -2,7 +2,6 @@ package com.biganto.visual.roompark.presentation.screen.favorites ...@@ -2,7 +2,6 @@ package com.biganto.visual.roompark.presentation.screen.favorites
import com.biganto.visual.roompark.conductor.BigantoBaseViewState import com.biganto.visual.roompark.conductor.BigantoBaseViewState
import com.biganto.visual.roompark.domain.model.EstateModel import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenViewState
/** /**
* Created by Vladislav Bogdashkin on 30.09.2019. * Created by Vladislav Bogdashkin on 30.09.2019.
......
...@@ -10,8 +10,10 @@ import com.biganto.visual.roompark.R ...@@ -10,8 +10,10 @@ import com.biganto.visual.roompark.R
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.conductor.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.presentation.screen.article.ArticleScreenController
import com.biganto.visual.roompark.presentation.screen.feed_list.util.ArticlesAdapter import com.biganto.visual.roompark.presentation.screen.feed_list.util.ArticlesAdapter
import com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration import com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import com.bluelinelabs.conductor.RouterTransaction
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
...@@ -66,6 +68,11 @@ class ArticlesScreenController : ...@@ -66,6 +68,11 @@ class ArticlesScreenController :
CeilsDecoration(1 CeilsDecoration(1
, resources?.getDimensionPixelSize(R.dimen.ceil_grid_padding)) , resources?.getDimensionPixelSize(R.dimen.ceil_grid_padding))
) )
(articlesRecyclerView.adapter as ArticlesAdapter)
.onItemClicked.subscribe {
router.pushController(RouterTransaction.with(ArticleScreenController(it.articleId)))
}
} }
override fun onViewBound(v: View) { override fun onViewBound(v: View) {
......
...@@ -12,7 +12,7 @@ import com.biganto.visual.roompark.base.RoomParkApplication ...@@ -12,7 +12,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.BigantoBaseController import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController import com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenController import com.biganto.visual.roompark.presentation.screen.favorites.FavoritesScreenController
import com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController import com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController import com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController
import com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController import com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
......
...@@ -11,7 +11,7 @@ import com.biganto.visual.roompark.base.ICollapsingToolBar ...@@ -11,7 +11,7 @@ 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.presentation.screen.deals.DealsScreenController import com.biganto.visual.roompark.presentation.screen.deals.DealsScreenController
import com.biganto.visual.roompark.presentation.screen.article.FavoritesScreenController import com.biganto.visual.roompark.presentation.screen.favorites.FavoritesScreenController
import com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController import com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import com.biganto.visual.roompark.presentation.screen.home.DaggerHomeScreenComponent import com.biganto.visual.roompark.presentation.screen.home.DaggerHomeScreenComponent
import com.biganto.visual.roompark.presentation.screen.home.HomeScreenPresenter import com.biganto.visual.roompark.presentation.screen.home.HomeScreenPresenter
......
...@@ -29,6 +29,9 @@ abstract class CommonRecyclerAdapter<VH:CommonViewHolder<M>,M:Any> : RecyclerVie ...@@ -29,6 +29,9 @@ abstract class CommonRecyclerAdapter<VH:CommonViewHolder<M>,M:Any> : RecyclerVie
private val onModelClicked = PublishSubject.create<M>() private val onModelClicked = PublishSubject.create<M>()
val onItemClicked : Observable<M>
get() = onModelClicked
private var list: MutableList<M> = mutableListOf() private var list: MutableList<M> = mutableListOf()
fun setItems(list:List<M>){ fun setItems(list:List<M>){
......
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