diff --git a/app/src/main/java/fishrungames/yelpmapapp/DetailFragment.kt b/app/src/main/java/fishrungames/yelpmapapp/DetailFragment.kt index 0448227..e50a699 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/DetailFragment.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/DetailFragment.kt @@ -2,6 +2,7 @@ package fishrungames.yelpmapapp import android.support.v4.app.Fragment import android.os.Bundle +import android.support.design.widget.AppBarLayout import android.support.v7.widget.LinearLayoutCompat import android.support.v7.widget.LinearLayoutManager @@ -11,7 +12,12 @@ import android.view.View import fishrungames.yelpmapapp.records.BusinessDetailRecord import fishrungames.yelpmapapp.records.ReviewListRecord import android.support.v7.widget.RecyclerView +import android.util.Log +import android.widget.ImageView +import android.widget.TextView +import com.koushikdutta.ion.Ion import fishrungames.yelpmapapp.records.MapMarkerRecord +import org.w3c.dom.Text /** @@ -25,19 +31,62 @@ class DetailFragment : Fragment() var mapMarkerRecord : MapMarkerRecord? = null + var backdropImageView : ImageView? = null + + var backgroundTitleTextView : TextView? = null + var toolbarTitleTextView : TextView? = null + + var detailCoordinatorChangeOffset : Int = 0 + var detailCoordinatorOffset : Int = 0 + override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? { + detailCoordinatorChangeOffset = context.resources.getInteger(R.integer.detailCoordinatorChangeOffset) + detailCoordinatorOffset = context.resources.getInteger(R.integer.detailCoordinatorOffset) + val rootView = inflater!!.inflate(R.layout.detail_fragment, container, false) + val appBarLayout = rootView.findViewById(R.id.appBarLayout) as AppBarLayout + + appBarLayout.addOnOffsetChangedListener { + _, verticalOffset -> + run { + if (-verticalOffset > detailCoordinatorChangeOffset) { + val alpha = (-verticalOffset - detailCoordinatorChangeOffset).toFloat() / (detailCoordinatorOffset - detailCoordinatorChangeOffset).toFloat() + toolbarTitleTextView?.alpha = alpha + backgroundTitleTextView?.alpha = 1F - alpha + } + else + { + toolbarTitleTextView?.alpha = 0F + backgroundTitleTextView?.alpha = 1F + } + } + } + val detailRecyclerView = rootView.findViewById(R.id.detailRecyclerView) as RecyclerView + backdropImageView = rootView.findViewById(R.id.backdropImageView) as ImageView + + backgroundTitleTextView = rootView.findViewById(R.id.backgroundTitleTextView) as TextView + toolbarTitleTextView = rootView.findViewById(R.id.toolbarTitleTextView) as TextView + detailRecyclerView.layoutManager = LinearLayoutManager(this.context) mapMarkerRecord = arguments?.getSerializable("mapMarkerRecord") as? MapMarkerRecord if (mapMarkerRecord != null && mapMarkerRecord!!.id != null) { - detailRecyclerAdapter = DetailRecyclerAdapter() + Ion.with(backdropImageView) + .placeholder(R.drawable.placeholder) + .error(R.drawable.placeholder) + .fadeIn(true) + .load(mapMarkerRecord!!.image_url) + + toolbarTitleTextView?.text = mapMarkerRecord!!.name + backgroundTitleTextView?.text = mapMarkerRecord!!.name + + detailRecyclerAdapter = DetailRecyclerAdapter(context, mapMarkerRecord!!) detailRecyclerView.adapter = detailRecyclerAdapter @@ -51,11 +100,29 @@ class DetailFragment : Fragment() fun updateBusinessDetail(businessDetailRecord : BusinessDetailRecord) { - detailRecyclerAdapter?.notifyDataSetChanged() + if (businessDetailRecord.id != null && businessDetailRecord.id == mapMarkerRecord?.id) { + + Ion.with(backdropImageView) + .error(R.drawable.placeholder) + .fadeIn(true) + .load(businessDetailRecord.image_url) + + toolbarTitleTextView?.text = businessDetailRecord.name + backgroundTitleTextView?.text = mapMarkerRecord!!.name + + detailRecyclerAdapter?.businessDetailRecord = businessDetailRecord + + detailRecyclerAdapter?.notifyDataSetChanged() + } } fun updateReviewList(reviewListRecordPair : Pair) { - detailRecyclerAdapter?.notifyDataSetChanged() + if (reviewListRecordPair.first == mapMarkerRecord?.id) { + + detailRecyclerAdapter?.reviewListRecordPair = reviewListRecordPair + + detailRecyclerAdapter?.notifyDataSetChanged() + } } } \ No newline at end of file diff --git a/app/src/main/java/fishrungames/yelpmapapp/DetailRecyclerAdapter.kt b/app/src/main/java/fishrungames/yelpmapapp/DetailRecyclerAdapter.kt index cc88a81..a4ca9c8 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/DetailRecyclerAdapter.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/DetailRecyclerAdapter.kt @@ -1,15 +1,21 @@ package fishrungames.yelpmapapp +import android.content.Context +import android.support.v4.content.ContextCompat import android.support.v7.widget.RecyclerView import android.view.View import android.view.ViewGroup import android.widget.TextView import android.view.LayoutInflater - - - - - +import android.view.View.GONE +import android.view.View.VISIBLE +import android.widget.ImageView +import android.widget.ProgressBar +import com.koushikdutta.ion.Ion +import fishrungames.yelpmapapp.records.BusinessDetailRecord +import fishrungames.yelpmapapp.records.MapMarkerRecord +import fishrungames.yelpmapapp.records.ReviewListRecord +import java.text.DecimalFormat /** @@ -17,8 +23,11 @@ import android.view.LayoutInflater */ -class DetailRecyclerAdapter : RecyclerView.Adapter() { +class DetailRecyclerAdapter(val context : Context, val mapMarkerRecord : MapMarkerRecord) : RecyclerView.Adapter() { + var businessDetailRecord : BusinessDetailRecord? = null + + var reviewListRecordPair : Pair? = null internal class PhoneViewHolder(v: View) : RecyclerView.ViewHolder(v) { @@ -32,42 +41,182 @@ class DetailRecyclerAdapter : RecyclerView.Adapter() { } + internal class ReviewTitleViewHolder(v: View) : RecyclerView.ViewHolder(v) { + + var noReviewsTextView: TextView = v.findViewById(R.id.noReviewsTextView) as TextView + + var progressBar: ProgressBar = v.findViewById(R.id.progressBar) as ProgressBar + + + + } + + internal class RatingViewHolder(v: View) : RecyclerView.ViewHolder(v) { + + var ratingTextView : TextView = v.findViewById(R.id.ratingTextView) as TextView + + val starImageView1 = v.findViewById(R.id.starImageView1) as ImageView + val starImageView2 = v.findViewById(R.id.starImageView2) as ImageView + val starImageView3 = v.findViewById(R.id.starImageView3) as ImageView + val starImageView4 = v.findViewById(R.id.starImageView4) as ImageView + val starImageView5 = v.findViewById(R.id.starImageView5) as ImageView + + } + + internal class ReviewViewHolder(v: View) : RecyclerView.ViewHolder(v) { + + var nameTextView : TextView = v.findViewById(R.id.nameTextView) as TextView + + var messageTextView : TextView = v.findViewById(R.id.messageTextView) as TextView + + var dateTextView : TextView = v.findViewById(R.id.dateTextView) as TextView + + var ratingTextView : TextView = v.findViewById(R.id.ratingTextView) as TextView + + val starImageView1 = v.findViewById(R.id.starImageView1) as ImageView + val starImageView2 = v.findViewById(R.id.starImageView2) as ImageView + val starImageView3 = v.findViewById(R.id.starImageView3) as ImageView + val starImageView4 = v.findViewById(R.id.starImageView4) as ImageView + val starImageView5 = v.findViewById(R.id.starImageView5) as ImageView + + val profilePictureImageView = v.findViewById(R.id.profilePictureImageView) as ImageView + + + + } + + + override fun getItemViewType(position: Int): Int { - // Just as an example, return 0 or 2 depending on position - // Note that unlike in ListView adapters, types don't have to be contiguous - return position % 2 + return position } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { when (viewType) { 0 -> { + val v = LayoutInflater.from(parent.context).inflate(R.layout.recycler_rating, parent, false) + return RatingViewHolder(v) + } + 1 -> { val v = LayoutInflater.from(parent.context).inflate(R.layout.recycler_phone, parent, false) return PhoneViewHolder(v) } - else -> { + 2 -> { val v = LayoutInflater.from(parent.context).inflate(R.layout.recycler_address, parent, false) return AddressViewHolder(v) } + 3 -> { + val v = LayoutInflater.from(parent.context).inflate(R.layout.recycler_review_title, parent, false) + return ReviewTitleViewHolder(v) + } + else -> { + val v = LayoutInflater.from(parent.context).inflate(R.layout.recycler_review, parent, false) + return ReviewViewHolder(v) + } } } override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { when (holder.itemViewType) { 0 -> { + val ratingViewHolder = holder as RatingViewHolder + + val rating = businessDetailRecord?.rating ?: (mapMarkerRecord.rating ?: 0.0) + + val formatter = DecimalFormat("#0.00") + + ratingViewHolder.ratingTextView.text = formatter.format(rating) + + ratingViewHolder.starImageView1.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 0.0))) + ratingViewHolder.starImageView2.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 1.0))) + ratingViewHolder.starImageView3.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 2.0))) + ratingViewHolder.starImageView4.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 3.0))) + ratingViewHolder.starImageView5.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 4.0))) + + } + 1 -> { val phoneViewHolder = holder as PhoneViewHolder - phoneViewHolder.phoneTextView.text = "+86 15000929180" + if (businessDetailRecord?.display_phone != null) { + + phoneViewHolder.phoneTextView.text = businessDetailRecord?.display_phone + } + else + { + phoneViewHolder.phoneTextView.text = mapMarkerRecord.display_phone + } } - 1 -> { + 2 -> { val addressViewHolder = holder as AddressViewHolder - addressViewHolder.addressTextView.text = "555 First avenue" + if (businessDetailRecord?.location?.display_address != null) { + + addressViewHolder.addressTextView.text = businessDetailRecord?.location?.display_address?.joinToString(" ") + } + else + { + addressViewHolder.addressTextView.text = mapMarkerRecord.location?.display_address?.joinToString(" ") + } + + } + + 3 -> { + val reviewTitleViewHolder = holder as ReviewTitleViewHolder + + if (reviewListRecordPair == null) + { + reviewTitleViewHolder.progressBar.visibility = VISIBLE + reviewTitleViewHolder.noReviewsTextView.visibility = GONE + } + else + { + reviewTitleViewHolder.progressBar.visibility = GONE + reviewTitleViewHolder.noReviewsTextView.visibility = if (getReviewCount() > 0) GONE else VISIBLE + } + + } + + else -> { + val reviewViewHolder = holder as ReviewViewHolder + + val reviewRecord = reviewListRecordPair?.second?.reviews?.get(position - 4) + + if (reviewRecord != null) { + + reviewViewHolder.nameTextView.text = reviewRecord.user?.name + + reviewViewHolder.messageTextView.text = reviewRecord.text + + reviewViewHolder.dateTextView.text = reviewRecord.time_created + + val rating = reviewRecord.rating ?: 0.0 + val formatter = DecimalFormat("#0.00") + + reviewViewHolder.ratingTextView.text = formatter.format(rating) + + reviewViewHolder.starImageView1.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 0.0))) + reviewViewHolder.starImageView2.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 1.0))) + reviewViewHolder.starImageView3.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 2.0))) + reviewViewHolder.starImageView4.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 3.0))) + reviewViewHolder.starImageView5.setImageDrawable(ContextCompat.getDrawable(context, Utils.getStarRatingId(rating, 4.0))) + + Ion.with(reviewViewHolder.profilePictureImageView) + .placeholder(R.drawable.placeholder) + .error(R.drawable.placeholder) + .fadeIn(true) + .load(reviewRecord.user?.image_url) + } } } } override fun getItemCount(): Int { - return 2 + + return 4 + getReviewCount() + } + + private fun getReviewCount() : Int { + return reviewListRecordPair?.second?.reviews?.count() ?: 0 } } \ No newline at end of file diff --git a/app/src/main/java/fishrungames/yelpmapapp/Utils.kt b/app/src/main/java/fishrungames/yelpmapapp/Utils.kt new file mode 100755 index 0000000..268e865 --- /dev/null +++ b/app/src/main/java/fishrungames/yelpmapapp/Utils.kt @@ -0,0 +1,26 @@ +package fishrungames.yelpmapapp + +/** + * Created by mephi on 10.06.2017. + */ + + +class Utils { + companion object { + fun getStarRatingId(rating : Double, s : Double) : Int { + + if (rating < 0.25 + s) + { + return R.drawable.ic_star_border_black_48dp + } + if (rating < 0.75 + s) + { + return R.drawable.ic_star_half_black_48dp + } + + return R.drawable.ic_star_black_48dp + + } + + } +} \ No newline at end of file diff --git a/app/src/main/java/fishrungames/yelpmapapp/YelpInfoWindowProvider.kt b/app/src/main/java/fishrungames/yelpmapapp/YelpInfoWindowProvider.kt index e2ec812..927ef32 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/YelpInfoWindowProvider.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/YelpInfoWindowProvider.kt @@ -1,16 +1,19 @@ package fishrungames.yelpmapapp +import android.annotation.SuppressLint import android.app.Activity import android.content.Context +import android.support.v4.content.ContextCompat +import android.view.LayoutInflater import android.view.View +import android.widget.ImageView import android.widget.LinearLayout import com.google.android.gms.maps.model.Marker import android.widget.TextView import com.google.android.gms.maps.GoogleMap.InfoWindowAdapter import android.widget.RelativeLayout - - - +import fishrungames.yelpmapapp.Utils.Companion.getStarRatingId +import java.text.DecimalFormat /** @@ -21,15 +24,43 @@ class YelpInfoWindowProvider(val activity: Activity) : InfoWindowAdapter { private val myContentsView: View = activity.layoutInflater.inflate(R.layout.yelp_info_contents, null) + var lastClickedMapMarker : MapMarkerClusterItem? = null + override fun getInfoContents(marker: Marker): View { + if (lastClickedMapMarker != null) + { + val nameTextView = myContentsView.findViewById(R.id.nameTextView) as TextView + val addressTextView = myContentsView.findViewById(R.id.addressTextView) as TextView + val ratingTextView = myContentsView.findViewById(R.id.ratingTextView) as TextView - //val contentsView = activity.layoutInflater.inflate(R.layout.yelp_info_contents, null) - //myContentsView.layoutParams = LinearLayout.LayoutParams(500, RelativeLayout.LayoutParams.WRAP_CONTENT) + val starImageView1 = myContentsView.findViewById(R.id.starImageView1) as ImageView + val starImageView2 = myContentsView.findViewById(R.id.starImageView2) as ImageView + val starImageView3 = myContentsView.findViewById(R.id.starImageView3) as ImageView + val starImageView4 = myContentsView.findViewById(R.id.starImageView4) as ImageView + val starImageView5 = myContentsView.findViewById(R.id.starImageView5) as ImageView - //myContentsView.findViewById(R.id.title) = marker.title - //myContentsView.findViewById(R.id.snippet).text = marker.snippet + nameTextView.text = lastClickedMapMarker?.mapMarkerRecord?.name + + addressTextView.text = lastClickedMapMarker?.mapMarkerRecord?.location?.display_address?.joinToString(" ") + + + if (lastClickedMapMarker?.mapMarkerRecord?.rating != null) { + + val rating = lastClickedMapMarker?.mapMarkerRecord?.rating!! + + val formatter = DecimalFormat("#0.00") + ratingTextView.text = formatter.format(rating) + + starImageView1.setImageDrawable(ContextCompat.getDrawable(activity, getStarRatingId(rating, 0.0))) + starImageView2.setImageDrawable(ContextCompat.getDrawable(activity, getStarRatingId(rating, 1.0))) + starImageView3.setImageDrawable(ContextCompat.getDrawable(activity, getStarRatingId(rating, 2.0))) + starImageView4.setImageDrawable(ContextCompat.getDrawable(activity, getStarRatingId(rating, 3.0))) + starImageView5.setImageDrawable(ContextCompat.getDrawable(activity, getStarRatingId(rating, 4.0))) + + } + } return myContentsView } @@ -38,4 +69,4 @@ class YelpInfoWindowProvider(val activity: Activity) : InfoWindowAdapter { return null } -} \ No newline at end of file + } \ No newline at end of file diff --git a/app/src/main/java/fishrungames/yelpmapapp/YelpMapActivity.kt b/app/src/main/java/fishrungames/yelpmapapp/YelpMapActivity.kt index 58cee4a..f6825cd 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/YelpMapActivity.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/YelpMapActivity.kt @@ -152,10 +152,11 @@ class YelpMapActivity : MapsActivity(), ClusterManager.OnClusterItemInfoWindowCl } override fun onClusterItemClick(item: MapMarkerClusterItem): Boolean { - // Does nothing, but you could go into the user's profile page, for example. lastClickedMapMarker = item + yelpInfoWindowProvider?.lastClickedMapMarker = item + return false } diff --git a/app/src/main/java/fishrungames/yelpmapapp/asyncTasks/HandleReviewListResponseAsyncTask.kt b/app/src/main/java/fishrungames/yelpmapapp/asyncTasks/HandleReviewListResponseAsyncTask.kt index dcabd2b..d1062b3 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/asyncTasks/HandleReviewListResponseAsyncTask.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/asyncTasks/HandleReviewListResponseAsyncTask.kt @@ -24,7 +24,7 @@ class HandleReviewListResponseAsyncTask(val id: String, val onUpdateReviewList : try { - val recordType = object : TypeToken() {}.type + val recordType = object : TypeToken() {}.type val result = Gson().fromJson(response[0], recordType) diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/BusinessDetailRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/BusinessDetailRecord.kt index 7f251a0..df54098 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/BusinessDetailRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/BusinessDetailRecord.kt @@ -1,5 +1,7 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ @@ -20,4 +22,4 @@ data class BusinessDetailRecord( val location : LocationRecord?, val coordinates: CoordinatesRecord?, val photos : List? - ) + ) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/CategoryRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/CategoryRecord.kt index fdb3232..e5b8881 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/CategoryRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/CategoryRecord.kt @@ -1,8 +1,10 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ data class CategoryRecord(val alias: String?, - val title: String?) + val title: String?) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/CoordinatesRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/CoordinatesRecord.kt index e74d16b..a2e9920 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/CoordinatesRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/CoordinatesRecord.kt @@ -1,8 +1,10 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ data class CoordinatesRecord(val latitude: Double?, - val longitude: Double?) + val longitude: Double?) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/LocationRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/LocationRecord.kt index 1320d01..7f91f3e 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/LocationRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/LocationRecord.kt @@ -1,5 +1,7 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ @@ -14,4 +16,4 @@ data class LocationRecord( val state: String?, val display_address: List?, val cross_streets: String? -) +) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/MapMarkerRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/MapMarkerRecord.kt index debf494..b986311 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/MapMarkerRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/MapMarkerRecord.kt @@ -11,8 +11,12 @@ import com.google.gson.annotations.SerializedName data class MapMarkerRecord ( - @SerializedName("id") val id: String?, - @SerializedName("name") val name: String?, - @SerializedName("image_url") val image_url: String?, - @SerializedName("coordinates") val coordinates: CoordinatesRecord? + val id: String?, + val name: String?, + val image_url: String?, + val coordinates: CoordinatesRecord?, + val location: LocationRecord?, + val rating: Double?, + val phone : String?, + val display_phone : String? ) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/ReviewListRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/ReviewListRecord.kt index 41568ce..b530b47 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/ReviewListRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/ReviewListRecord.kt @@ -1,9 +1,11 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ data class ReviewListRecord( val reviews: List?, - val total: Int?) + val total: Int?) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/ReviewRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/ReviewRecord.kt index 3e0f839..d833855 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/ReviewRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/ReviewRecord.kt @@ -1,5 +1,7 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ @@ -9,4 +11,4 @@ data class ReviewRecord( val user: ReviewUserRecord?, val text: String?, val time_created: String?, - val url: String?) + val url: String?) : Serializable diff --git a/app/src/main/java/fishrungames/yelpmapapp/records/ReviewUserRecord.kt b/app/src/main/java/fishrungames/yelpmapapp/records/ReviewUserRecord.kt index 2684032..530c8c1 100755 --- a/app/src/main/java/fishrungames/yelpmapapp/records/ReviewUserRecord.kt +++ b/app/src/main/java/fishrungames/yelpmapapp/records/ReviewUserRecord.kt @@ -1,9 +1,11 @@ package fishrungames.yelpmapapp.records +import java.io.Serializable + /** * Created by mephi on 10.06.2017. */ data class ReviewUserRecord( val image_url: String?, - val name: String?) + val name: String?) : Serializable diff --git a/app/src/main/res/drawable/bkgtest.jpg b/app/src/main/res/drawable/bkgtest.jpg deleted file mode 100755 index fcf2b4e..0000000 Binary files a/app/src/main/res/drawable/bkgtest.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/empty_profile.png b/app/src/main/res/drawable/empty_profile.png new file mode 100755 index 0000000..64a6f4c Binary files /dev/null and b/app/src/main/res/drawable/empty_profile.png differ diff --git a/app/src/main/res/drawable/placeholder.png b/app/src/main/res/drawable/placeholder.png new file mode 100755 index 0000000..3234502 Binary files /dev/null and b/app/src/main/res/drawable/placeholder.png differ diff --git a/app/src/main/res/layout/detail_fragment.xml b/app/src/main/res/layout/detail_fragment.xml index f31915f..e99af4b 100755 --- a/app/src/main/res/layout/detail_fragment.xml +++ b/app/src/main/res/layout/detail_fragment.xml @@ -10,7 +10,7 @@ > + app:expandedTitleMarginStart="48dp" + app:layout_scrollFlags="scroll|exitUntilCollapsed"> + android:scaleType="centerCrop" + android:src="@drawable/placeholder" + app:layout_collapseMode="parallax" /> + + + app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> + + + diff --git a/app/src/main/res/layout/recycler_address.xml b/app/src/main/res/layout/recycler_address.xml index ebddeee..4b929cc 100755 --- a/app/src/main/res/layout/recycler_address.xml +++ b/app/src/main/res/layout/recycler_address.xml @@ -1,7 +1,7 @@ + android:layout_height="wrap_content"> + android:layout_height="wrap_content"> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/recycler_review.xml b/app/src/main/res/layout/recycler_review.xml new file mode 100755 index 0000000..6bdd89f --- /dev/null +++ b/app/src/main/res/layout/recycler_review.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/recycler_review_title.xml b/app/src/main/res/layout/recycler_review_title.xml new file mode 100755 index 0000000..11ab767 --- /dev/null +++ b/app/src/main/res/layout/recycler_review_title.xml @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/yelp_info_contents.xml b/app/src/main/res/layout/yelp_info_contents.xml index 1f19224..f2ed9b5 100755 --- a/app/src/main/res/layout/yelp_info_contents.xml +++ b/app/src/main/res/layout/yelp_info_contents.xml @@ -11,7 +11,7 @@ android:orientation="vertical"> + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/dim.xml b/app/src/main/res/values/dim.xml new file mode 100755 index 0000000..c4ffdb8 --- /dev/null +++ b/app/src/main/res/values/dim.xml @@ -0,0 +1,5 @@ + + + 300dp + + \ No newline at end of file diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml new file mode 100755 index 0000000..adf95b8 --- /dev/null +++ b/app/src/main/res/values/integers.xml @@ -0,0 +1,9 @@ + + + + 300 + 488 + + + + \ No newline at end of file