Android Open Source - AdvancedPlayer View Controller






From Project

Back to project page AdvancedPlayer.

License

The source code is released under:

Apache License

If you think the Android project AdvancedPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.huilan.library_videoplay.util;
//from  w  ww  . j a v  a2  s .  com
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.huilan.library_videoplay.R;

/**
 * Created by liujigang on 2014/12/15 0015.
 */
public class ViewController {
    private Context context;
    private Toast mToast;
    private ProgressBar mProgressbar;
    private ImageView mImage;

    /**
     * ??????
     *
     * @param context ???
     */
    public ViewController(Context context) {
        this.context = context;
        init();
    }

    private void init() {
        mToast = new Toast(context);
        View view = LayoutInflater.from(context).inflate(R.layout.layout_controller, null);
        mImage = (ImageView) view.findViewById(R.id.iv_image);
        mProgressbar = (ProgressBar) view.findViewById(R.id.pb_progressbar);
        mToast.setView(view);
        mToast.setGravity(Gravity.CENTER, 0, 0);
        mToast.setDuration(Toast.LENGTH_SHORT);
    }

    /**
     * ????????????
     *
     * @param context ???
     * @param resId   ?????ID
     * @param max     ?????????
     */
    public ViewController(Context context, int resId, int max) {
        this.context = context;
        init();
        mImage.setImageResource(resId);
        mProgressbar.setMax(max);
    }

    public void show(int progress) {
        mProgressbar.setProgress(progress);
        mToast.show();
    }

    public void setMax(int max) {
        mProgressbar.setMax(max);
    }

    public void setImage(int resId) {
        mImage.setImageResource(resId);
    }

    public void cancel() {
        mToast.cancel();
    }

}




Java Source Code List

com.huilan.library_videoplay.AdvancedPlayerSimple.java
com.huilan.library_videoplay.AdvancedPlayer.java
com.huilan.library_videoplay.VideoViewPlay.java
com.huilan.library_videoplay.sample.LightnessController.java
com.huilan.library_videoplay.sample.MainActivity.java
com.huilan.library_videoplay.sample.TextActivity.java
com.huilan.library_videoplay.util.LightnessController.java
com.huilan.library_videoplay.util.ParseHtmlToUrl.java
com.huilan.library_videoplay.util.ViewController.java
com.huilan.library_videoplay.view.FullScreenVideoView.java
com.huilan.library_videoplay.view.SuperVideoView.java