use of me.ccrama.redditslide.Views.ExoVideoView in project Slide by ccrama.
the class MediaView method doLoadGif.
public void doLoadGif(final String dat) {
isGif = true;
videoView = (ExoVideoView) findViewById(R.id.gif);
findViewById(R.id.black).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (findViewById(R.id.gifheader).getVisibility() == View.GONE) {
AnimatorUtil.animateIn(findViewById(R.id.gifheader), 56);
AnimatorUtil.fadeOut(findViewById(R.id.black));
}
}
});
videoView.clearFocus();
findViewById(R.id.gifarea).setVisibility(View.VISIBLE);
findViewById(R.id.submission_image).setVisibility(View.GONE);
final ProgressBar loader = (ProgressBar) findViewById(R.id.gifprogress);
findViewById(R.id.progress).setVisibility(View.GONE);
gif = new GifUtils.AsyncLoadGif(this, videoView, loader, findViewById(R.id.placeholder), doOnClick, true, true, ((TextView) findViewById(R.id.size)), subreddit, submissionTitle);
videoView.attachMuteButton((ImageView) findViewById(R.id.mute));
videoView.attachHqButton((ImageView) findViewById(R.id.hq));
gif.execute(dat);
findViewById(R.id.more).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showBottomSheetImage();
}
});
}
use of me.ccrama.redditslide.Views.ExoVideoView in project Slide by ccrama.
the class ForceTouchLink method onCreate.
@Override
public void onCreate(Bundle savedInstance) {
overridePendingTransition(0, 0);
super.onCreate(savedInstance);
applyColorTheme();
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_force_touch_content);
findViewById(android.R.id.content).setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_POINTER_UP) {
finish();
}
return false;
}
});
final String url = getIntent().getExtras().getString("url");
ContentType.Type t = ContentType.getContentType(url);
final ImageView mainImage = (ImageView) findViewById(R.id.image);
ExoVideoView mainVideo = (ExoVideoView) findViewById(R.id.gif);
mainVideo.setVisibility(View.GONE);
switch(t) {
case REDDIT:
case IMGUR:
case ALBUM:
case REDDIT_GALLERY:
case VIDEO:
break;
case IMAGE:
((Reddit) getApplication()).getImageLoader().displayImage(url, mainImage);
break;
case GIF:
mainVideo.setVisibility(View.VISIBLE);
new GifUtils.AsyncLoadGif(this, mainVideo, null, null, false, true, "").execute(url);
break;
case LINK:
new AsyncTask<Void, Void, Void>() {
String urlGotten;
@Override
protected Void doInBackground(Void... params) {
/*try {
urlGotten = ImageExtractor.extractImageUrl(url);
} catch (IOException e) {
e.printStackTrace();
}*/
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
((Reddit) getApplication()).getImageLoader().displayImage(urlGotten, mainImage);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
break;
}
}
Aggregations