Search in sources :

Example 26 with ImageView

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();
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint)

Example 27 with ImageView

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;
}
Also used : RectF(android.graphics.RectF) ViewParent(android.view.ViewParent) ImageView(android.widget.ImageView)

Example 28 with ImageView

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);
}
Also used : ImageView(android.widget.ImageView) View(android.view.View) WebView(android.webkit.WebView) Nullable(android.support.annotation.Nullable)

Example 29 with ImageView

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);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) ActivityNotFoundException(android.content.ActivityNotFoundException) TranslateAnimation(android.view.animation.TranslateAnimation) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) ImageView(android.widget.ImageView) AnimationSet(android.view.animation.AnimationSet) ImageView(android.widget.ImageView) View(android.view.View) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 30 with ImageView

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;
}
Also used : OnLongClickListener(android.view.View.OnLongClickListener) Animation(com.zhan_dui.model.Animation) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

ImageView (android.widget.ImageView)2176 View (android.view.View)1100 TextView (android.widget.TextView)963 Drawable (android.graphics.drawable.Drawable)192 Intent (android.content.Intent)191 LinearLayout (android.widget.LinearLayout)187 Bitmap (android.graphics.Bitmap)175 ViewGroup (android.view.ViewGroup)161 LayoutInflater (android.view.LayoutInflater)155 OnClickListener (android.view.View.OnClickListener)142 AdapterView (android.widget.AdapterView)108 ListView (android.widget.ListView)101 RecyclerView (android.support.v7.widget.RecyclerView)97 FrameLayout (android.widget.FrameLayout)95 Button (android.widget.Button)80 BitmapDrawable (android.graphics.drawable.BitmapDrawable)75 Bundle (android.os.Bundle)73 Test (org.junit.Test)70 RelativeLayout (android.widget.RelativeLayout)69 Context (android.content.Context)65