use of com.zhan_dui.download.DownloadHelper in project AnimeTaste by daimajia.
the class PlayActivity method onCreate.
@Override
public void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance);
AVOSCloud.initialize(this, "w43xht9daji0uut74pseeiibax8c2tnzxowmx9f81nvtpims", "86q8251hrodk6wnf4znistay1mva9rm1xikvp1s9mhp5n7od");
mPrettyTime = new PrettyTime();
mContext = this;
if (getIntent().getExtras().containsKey("Animation")) {
mAnimation = getIntent().getParcelableExtra("Animation");
}
mDownloadHelper = new DownloadHelper(this);
if (savedInstance != null && savedInstance.containsKey("Animation")) {
mAnimation = savedInstance.getParcelable("Animation");
mLastPos = savedInstance.getInt("LastPosition");
}
mUser = new User(mContext);
setContentView(R.layout.activity_play);
mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
mCurrentScape = OrientationHelper.PORTRAIT;
mTitleTextView = (TextView) findViewById(R.id.title);
mContentTextView = (TextView) findViewById(R.id.content);
mDetailImageView = (ImageView) findViewById(R.id.detailPic);
mVideoAction = findViewById(R.id.VideoAction);
mAuthorTextView = (TextView) findViewById(R.id.author);
mPrePlayButton = (ImageButton) findViewById(R.id.pre_play_button);
mLoadingGif = (GifMovieView) findViewById(R.id.loading_gif);
mComments = (LinearLayout) findViewById(R.id.comments);
mRecommendView = findViewById(R.id.recommand_view);
mPlayBtn = (Button) findViewById(R.id.play_btn);
mProgress = (SeekBar) findViewById(R.id.media_progress);
mDuration = (TextView) findViewById(R.id.time_total);
mCurPosition = (TextView) findViewById(R.id.time_current);
mController = (RelativeLayout) findViewById(R.id.controlbar);
mViewHolder = (RelativeLayout) findViewById(R.id.view_holder);
mVV = (BVideoView) findViewById(R.id.video_view);
mCommentEditText = (EditText) findViewById(R.id.comment_edit_text);
mHeaderWrapper = (RelativeLayout) findViewById(R.id.header_wrapper);
mZoomButton = (Button) findViewById(R.id.zoom_btn);
mRecomendView = (LinearLayout) findViewById(R.id.recommend_list);
mRobotoBold = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Bold.ttf");
mRobotoThin = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Thin.ttf");
initPlayer();
initContent();
mAnimation.recordWatch();
ApiConnector.instance().getRandom(5, mRandomHandler);
new CommentsTask().execute();
getSupportActionBar().setDisplayUseLogoEnabled(false);
showWhatsNew();
}
Aggregations