7 package com.google.appinventor.components.runtime.util;
9 import android.content.Context;
10 import android.util.Log;
11 import android.view.MotionEvent;
12 import android.view.View;
13 import android.view.ViewGroup;
14 import android.widget.MediaController;
27 View.OnTouchListener {
30 private View mAnchorView;
35 private int mShowTime = 3000;
48 public void show(
int timeout) {
49 setVisibility(VISIBLE);
59 setVisibility(VISIBLE);
75 public boolean addTo(ViewGroup parent, ViewGroup.LayoutParams params) {
76 Object mParent = getParent();
77 if (mParent !=
null && mParent instanceof ViewGroup) {
78 ((ViewGroup) mParent).removeView(
this);
79 parent.addView(
this, params);
82 Log.e(
"CustomMediaController.addTo",
83 "MediaController not available in fullscreen.");
94 mAnchorView = anchorView;
95 mAnchorView.setOnTouchListener(
this);
96 super.setAnchorView(anchorView);
106 setVisibility(INVISIBLE);
115 public boolean onTouch(View v, MotionEvent event) {
116 if (v == mAnchorView) {