use of android.widget.ImageView in project SimplifyReader by chentao0707.
the class PluginSimplePlayer method initPlayLayout.
// 初始化播放区控件
/**
* 找到相关的layout
*/
private void initPlayLayout() {
if (null == containerView)
return;
seekLoadingContainerView = containerView.findViewById(R.id.seek_loading_bg);
seekLoadingContainerView.setVisibility(View.GONE);
mContainerLayout = (LinearLayout) containerView.findViewById(R.id.ll_detail_container);
mContainerLayout.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
onContainerClick();
}
});
if (UIUtils.hasHoneycomb()) {
mContainerLayout.setOnSystemUiVisibilityChangeListener(new OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int visibility) {
hideShowControl();
}
});
}
interactFrameLayout = (FrameLayout) containerView.findViewById(R.id.fl_interact);
mContainerLayout.setClickable(false);
controlLayout = (RelativeLayout) containerView.findViewById(R.id.layout_play_control);
if (null != controlLayout)
controlLayout.setVisibility(View.GONE);
videoBar = (SeekBar) containerView.findViewById(R.id.sb_detail_play_progress);
totalTime = (TextView) containerView.findViewById(R.id.total_time);
currentTime = (TextView) containerView.findViewById(R.id.current_time);
if (null != videoBar)
videoBar.setOnSeekBarChangeListener(mBarChangeListener);
play_pauseButton = (ImageButton) containerView.findViewById(R.id.ib_detail_play_control);
play_pauseButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (null == mMediaPlayerDelegate)
return;
if (isLoading) {
play_pauseButton.setImageResource(R.drawable.play_btn_pause_big_detail_down);
return;
}
if (mMediaPlayerDelegate.isPlaying()) {
mMediaPlayerDelegate.pause();
if (!isLoading) {
play_pauseButton.setImageResource(R.drawable.play_btn_play_big_detail);
} else {
play_pauseButton.setImageResource(R.drawable.play_btn_play_big_detail_down);
}
} else {
mMediaPlayerDelegate.start();
if (null != play_pauseButton)
if (!isLoading) {
play_pauseButton.setImageResource(R.drawable.play_btn_pause_big_detail);
} else {
play_pauseButton.setImageResource(R.drawable.play_btn_pause_big_detail_down);
}
}
if (isBack) {
isBack = false;
isLoading = true;
play_pauseButton.setImageResource(R.drawable.play_btn_pause_big_detail_down);
}
userAction();
}
});
full_screenButton = (ImageButton) containerView.findViewById(R.id.ib_detail_play_full);
full_screenButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mMediaPlayerDelegate.isFullScreen) {
mMediaPlayerDelegate.goSmall();
} else {
mMediaPlayerDelegate.goFullScreen();
}
}
});
playTitleTextView = (TextView) containerView.findViewById(R.id.tv_detail_play_title);
titleLayoutPort = (LinearLayout) containerView.findViewById(R.id.layout_title);
titleLayoutPort.setOnClickListener(null);
initSeekLoading();
if (null != mMediaPlayerDelegate && null != mMediaPlayerDelegate.videoInfo) {
int duration = mMediaPlayerDelegate.videoInfo.getDurationMills();
videoBar.setMax(duration);
}
userPlayButton = (ImageView) containerView.findViewById(R.id.ib_user_play);
if (null != userPlayButton) {
userPlayButton.setOnClickListener(userPlayClickListener);
userPlayButton.setVisibility(View.GONE);
}
// videoBar.setMax(240000);
if (null != mMediaPlayerDelegate)
if (mMediaPlayerDelegate.isPlaying())
play_pauseButton.setImageResource(R.drawable.play_btn_pause_big_detail);
else {
play_pauseButton.setImageResource(R.drawable.play_btn_play_big_detail);
}
initRetry();
initEndPage();
initLoadInfoPage();
}
use of android.widget.ImageView in project PhotoView by chrisbanes.
the class PhotoViewAttacher method onTouch.
@Override
public boolean onTouch(View v, MotionEvent ev) {
boolean handled = false;
if (mZoomEnabled && Util.hasDrawable((ImageView) v)) {
switch(ev.getAction()) {
case MotionEvent.ACTION_DOWN:
ViewParent parent = v.getParent();
// event
if (parent != null) {
parent.requestDisallowInterceptTouchEvent(true);
}
// If we're flinging, and the user presses down, cancel
// fling
cancelFling();
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
// to min scale
if (getScale() < mMinScale) {
RectF rect = getDisplayRect();
if (rect != null) {
v.post(new AnimatedZoomRunnable(getScale(), mMinScale, rect.centerX(), rect.centerY()));
handled = true;
}
}
break;
}
// Try the Scale/Drag detector
if (mScaleDragDetector != null) {
boolean wasScaling = mScaleDragDetector.isScaling();
boolean wasDragging = mScaleDragDetector.isDragging();
handled = mScaleDragDetector.onTouchEvent(ev);
boolean didntScale = !wasScaling && !mScaleDragDetector.isScaling();
boolean didntDrag = !wasDragging && !mScaleDragDetector.isDragging();
mBlockParentIntercept = didntScale && didntDrag;
}
// Check to see if the user double tapped
if (mGestureDetector != null && mGestureDetector.onTouchEvent(ev)) {
handled = true;
}
}
return handled;
}
use of android.widget.ImageView in project cw-omnibus by commonsguy.
the class DetailsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View result = inflater.inflate(R.layout.details, container, false);
webView = (WebView) result.findViewById(R.id.webview);
flag = (ImageView) result.findViewById(R.id.flag);
toolbar = (Toolbar) result.findViewById(R.id.toolbar);
if (toolbar == null) {
setHasOptionsMenu(true);
} else {
toolbar.inflateMenu(R.menu.webview);
getNavItems(toolbar.getMenu());
toolbar.setOnMenuItemClickListener(this);
}
return (result);
}
use of android.widget.ImageView in project OneClickAndroid by cyngn.
the class UsbActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OneClickStats.sendEvent(this, OneClickStats.Categories.PAGE_SHOWN, OneClickStats.Actions.PAGE_ADB);
if (adbIsEnabled()) {
startActivity(new Intent(getBaseContext(), PtpActivity.class));
finish();
return;
}
setContentView(R.layout.usb);
ImageView instructionView = (ImageView) findViewById(R.id.usb_instructions);
DecelerateInterpolator interpolator = new DecelerateInterpolator(2.0f);
AnimationSet instructionAnimations = new AnimationSet(true);
instructionAnimations.setInterpolator(interpolator);
TranslateAnimation instructionMoveAnimation = new TranslateAnimation(0, 0, 250, 0);
instructionMoveAnimation.setDuration(1000);
instructionMoveAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
instructionAnimations.addAnimation(instructionMoveAnimation);
// we want them to read the instructions first! so we give them a few seconds
AlphaAnimation instructionFadeAnimation = new AlphaAnimation(0.0f, 1.0f);
instructionFadeAnimation.setDuration(1000);
instructionFadeAnimation.setStartOffset(500);
instructionFadeAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
instructionAnimations.addAnimation(instructionFadeAnimation);
instructionView.setAnimation(instructionAnimations);
// continue button should take even longer
AlphaAnimation buttonAnimation = new AlphaAnimation(0.0f, 1.0f);
buttonAnimation.setDuration(750);
buttonAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
buttonAnimation.setStartOffset(1000);
findViewById(R.id.next).setAnimation(buttonAnimation);
OnClickListener openUsbListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings");
try {
OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.BUTTON_CLICK, OneClickStats.Actions.BTN_ADB);
startActivity(intent);
startService(new Intent(getBaseContext(), UsbDebuggingMonitorService.class));
} catch (ActivityNotFoundException e) {
// we want to know if this happens, right?
OneClickStats.sendEvent(view.getContext(), OneClickStats.Categories.SWITCH_ERROR, OneClickStats.Actions.ERR_ADB);
}
}
};
findViewById(R.id.next).setOnClickListener(openUsbListener);
}
use of android.widget.ImageView in project AnimeTaste by daimajia.
the class AnimationListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView titleTextView;
TextView contentTextView;
ImageView thumbImageView;
ViewHolder holder;
if (convertView == null) {
convertView = mLayoutInflater.inflate(R.layout.video_item, parent, false);
titleTextView = (TextView) convertView.findViewById(R.id.title);
contentTextView = (TextView) convertView.findViewById(R.id.content);
thumbImageView = (ImageView) convertView.findViewById(R.id.thumb);
titleTextView.setTypeface(mRobotoTitle);
holder = new ViewHolder(titleTextView, contentTextView, thumbImageView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
titleTextView = holder.titleText;
contentTextView = holder.contentText;
thumbImageView = holder.thumbImageView;
}
Animation animation = (Animation) getItem(position);
Picasso.with(mContext).load(animation.HomePic).placeholder(R.drawable.placeholder_thumb).error(R.drawable.placeholder_fail).into(thumbImageView);
titleTextView.setText(animation.Name);
contentTextView.setText(animation.Brief);
convertView.setOnClickListener(new AnimationItemOnClickListener(animation));
convertView.setOnLongClickListener(new OnLongClickListener() {
// 保证长按事件传递
@Override
public boolean onLongClick(View v) {
return false;
}
});
titleTextView.setTextColor(animation.isWatched() ? mWatchedTitleColor : mUnWatchedTitleColor);
return convertView;
}
Aggregations