This repository was archived by the owner on Aug 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
app/src/main/java/com/hossainkhan/android/demo/ui/functionaldemo Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ package com.hossainkhan.android.demo.ui.functionaldemo
18
18
19
19
import android.os.Bundle
20
20
import android.view.View
21
+ import android.widget.ImageButton
21
22
import android.widget.Toast
23
+ import com.hossainkhan.android.demo.R
22
24
import com.hossainkhan.android.demo.ui.layoutpreview.LayoutPreviewBaseActivity
23
25
24
26
class TedTalkPlaybackActivity : LayoutPreviewBaseActivity () {
@@ -29,5 +31,19 @@ class TedTalkPlaybackActivity : LayoutPreviewBaseActivity() {
29
31
override fun onCreate (savedInstanceState : Bundle ? ) {
30
32
super .onCreate(savedInstanceState)
31
33
34
+ // Apply generic toast listener to touchable views so that user gets feedback when they tap it
35
+ applyToastListener(
36
+ findViewById<ImageButton >(R .id.action_prev_track),
37
+ findViewById<ImageButton >(R .id.action_rewind15),
38
+ findViewById<ImageButton >(R .id.action_play_pause),
39
+ findViewById<ImageButton >(R .id.action_forward15),
40
+ findViewById<ImageButton >(R .id.action_next_track)
41
+ )
42
+ }
43
+
44
+ private fun applyToastListener (vararg views : View ) {
45
+ views.forEach {
46
+ it.setOnClickListener(generalClickListener)
47
+ }
32
48
}
33
49
}
You can’t perform that action at this time.
0 commit comments