Added stroke and cache for data

This commit is contained in:
Vladislav Khorev 2017-06-11 00:36:59 +03:00
parent ad3b15db3b
commit 6a51f72da4
3 changed files with 19 additions and 3 deletions

View File

@ -106,6 +106,10 @@ class DataProvider(
fun requestBusinessDetail(id: String) fun requestBusinessDetail(id: String)
{ {
if (reviewListCache.containsKey(id) && reviewListCache[id] != null)
{
onUpdateReviewList(reviewListCache[id]!!)
}
Ion.with(context) Ion.with(context)
.load("https://api.yelp.com/v3/businesses/${id}") .load("https://api.yelp.com/v3/businesses/${id}")
@ -129,6 +133,10 @@ class DataProvider(
fun requestReviewList(id: String) fun requestReviewList(id: String)
{ {
if (businessDetailCache.containsKey(id) && businessDetailCache[id] != null)
{
onUpdateBusinessDetail(businessDetailCache[id]!!)
}
Ion.with(context) Ion.with(context)
.load("https://api.yelp.com/v3/businesses/${id}/reviews") .load("https://api.yelp.com/v3/businesses/${id}/reviews")

View File

@ -43,7 +43,7 @@ class DetailFragment : Fragment()
detailCoordinatorChangeOffset = context.resources.getInteger(R.integer.detailCoordinatorChangeOffset) detailCoordinatorChangeOffset = context.resources.getInteger(R.integer.detailCoordinatorChangeOffset)
detailCoordinatorOffset = context.resources.getInteger(R.integer.detailCoordinatorOffset) detailCoordinatorOffset = context.resources.getInteger(R.integer.detailCoordinatorOffset)
val rootView = inflater!!.inflate(R.layout.detail_fragment, container, false) val rootView = inflater!!.inflate(R.layout.detail_fragment, container, false)
val appBarLayout = rootView.findViewById(R.id.appBarLayout) as AppBarLayout val appBarLayout = rootView.findViewById(R.id.appBarLayout) as AppBarLayout

View File

@ -46,7 +46,11 @@
android:text="Toolbar Title" android:text="Toolbar Title"
android:textColor="#ffffff" android:textColor="#ffffff"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold"
android:shadowColor="#000000"
android:shadowDx="1.5"
android:shadowDy="1.3"
android:shadowRadius="1.6"/>
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
@ -63,7 +67,11 @@
android:text="Toolbar Title" android:text="Toolbar Title"
android:textColor="#ffffff" android:textColor="#ffffff"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold"
android:shadowColor="#000000"
android:shadowDx="1.5"
android:shadowDy="1.3"
android:shadowRadius="1.6"/>
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>