Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 16828d0

Browse files
committed
[ADDED] Scroll view to scroll the content.
1 parent 756d3b1 commit 16828d0

File tree

4 files changed

+301
-174
lines changed

4 files changed

+301
-174
lines changed

app/src/main/java/com/hossainkhan/android/demo/ui/functionaldemo/MovieDetailsPreviewActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package com.hossainkhan.android.demo.ui.functionaldemo
1818

1919
import android.os.Bundle
2020
import android.view.View
21+
import android.widget.Button
2122
import android.widget.ImageButton
2223
import android.widget.Toast
2324
import com.hossainkhan.android.demo.R
@@ -38,11 +39,15 @@ class MovieDetailsPreviewActivity : LayoutPreviewBaseActivity() {
3839

3940
val ratingThumbsUp = findViewById<ImageButton>(R.id.rating_thumbs_up)
4041
val ratingThumbsDown = findViewById<ImageButton>(R.id.rating_thumbs_down)
42+
val addToFav = findViewById<ImageButton>(R.id.rating_add_fav)
43+
val rentButton = findViewById<Button>(R.id.button_rent)
44+
val buyButton = findViewById<Button>(R.id.button_buy)
4145

42-
applyToastListener(ratingThumbsUp, ratingThumbsDown)
46+
// Apply generic toast listener to touchable views so that user gets feedback when they tap it
47+
applyToastListener(ratingThumbsUp, ratingThumbsDown, addToFav, rentButton, buyButton)
4348
}
4449

45-
fun applyToastListener(vararg views: View) {
50+
private fun applyToastListener(vararg views: View) {
4651
views.forEach {
4752
it.setOnClickListener(generalClickListener)
4853
}

0 commit comments

Comments
 (0)