Search in sources :

Example 1 with Shadowbox

use of me.ccrama.redditslide.Activities.Shadowbox in project Slide by ccrama.

the class SelftextFull method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle bundle = this.getArguments();
    i = bundle.getInt("page", 0);
    sub = bundle.getString("sub");
    if (((Shadowbox) getActivity()).subredditPosts == null || ((Shadowbox) getActivity()).subredditPosts.getPosts().size() < bundle.getInt("page", 0)) {
        getActivity().finish();
    } else {
        s = ((Shadowbox) getActivity()).subredditPosts.getPosts().get(bundle.getInt("page", 0));
    }
}
Also used : Shadowbox(me.ccrama.redditslide.Activities.Shadowbox) Bundle(android.os.Bundle)

Example 2 with Shadowbox

use of me.ccrama.redditslide.Activities.Shadowbox in project Slide by ccrama.

the class AlbumFull method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle bundle = this.getArguments();
    i = bundle.getInt("page", 0);
    if (((Shadowbox) getActivity()).subredditPosts == null || ((Shadowbox) getActivity()).subredditPosts.getPosts().size() < bundle.getInt("page", 0)) {
        getActivity().finish();
    } else {
        s = ((Shadowbox) getActivity()).subredditPosts.getPosts().get(bundle.getInt("page", 0));
    }
}
Also used : Shadowbox(me.ccrama.redditslide.Activities.Shadowbox) Bundle(android.os.Bundle)

Example 3 with Shadowbox

use of me.ccrama.redditslide.Activities.Shadowbox in project Slide by ccrama.

the class MediaFragment method doLoadGif.

public void doLoadGif(final Submission s) {
    isGif = true;
    videoView = (MediaVideoView) rootView.findViewById(R.id.gif);
    videoView.clearFocus();
    rootView.findViewById(R.id.gifarea).setVisibility(View.VISIBLE);
    rootView.findViewById(R.id.submission_image).setVisibility(View.GONE);
    final ProgressBar loader = (ProgressBar) rootView.findViewById(R.id.gifprogress);
    gif = new GifUtils.AsyncLoadGif(getActivity(), (MediaVideoView) rootView.findViewById(R.id.gif), loader, rootView.findViewById(R.id.placeholder), false, false, !(getActivity() instanceof Shadowbox) || ((Shadowbox) (getActivity())).pager.getCurrentItem() == i, sub);
    GifUtils.AsyncLoadGif.VideoType t = GifUtils.AsyncLoadGif.getVideoType(s.getUrl());
    String toLoadURL;
    if (t.shouldLoadPreview() && s.getDataNode().has("preview") && s.getDataNode().get("preview").get("images").get(0).has("variants") && s.getDataNode().get("preview").get("images").get(0).get("variants").has("mp4")) {
        toLoadURL = StringEscapeUtils.unescapeJson(s.getDataNode().get("preview").get("images").get(0).get("variants").get("mp4").get("source").get("url").asText()).replace("&amp;", "&");
    } else if (t == GifUtils.AsyncLoadGif.VideoType.DIRECT && s.getDataNode().has("media") && s.getDataNode().get("media").has("reddit_video") && s.getDataNode().get("media").get("reddit_video").has("fallback_url")) {
        toLoadURL = StringEscapeUtils.unescapeJson(s.getDataNode().get("media").get("reddit_video").get("fallback_url").asText()).replace("&amp;", "&");
    } else if (t != GifUtils.AsyncLoadGif.VideoType.OTHER) {
        toLoadURL = s.getUrl();
    } else {
        doLoadImage(firstUrl);
        return;
    }
    gif.execute(toLoadURL);
    rootView.findViewById(R.id.progress).setVisibility(View.GONE);
}
Also used : Shadowbox(me.ccrama.redditslide.Activities.Shadowbox) GifUtils(me.ccrama.redditslide.util.GifUtils) ProgressBar(android.widget.ProgressBar) MediaVideoView(me.ccrama.redditslide.Views.MediaVideoView)

Example 4 with Shadowbox

use of me.ccrama.redditslide.Activities.Shadowbox in project Slide by ccrama.

the class MediaFragment method doLoadGifDirect.

public void doLoadGifDirect(final String s) {
    isGif = true;
    videoView = (MediaVideoView) rootView.findViewById(R.id.gif);
    videoView.clearFocus();
    rootView.findViewById(R.id.gifarea).setVisibility(View.VISIBLE);
    rootView.findViewById(R.id.submission_image).setVisibility(View.GONE);
    final ProgressBar loader = (ProgressBar) rootView.findViewById(R.id.gifprogress);
    gif = new GifUtils.AsyncLoadGif(getActivity(), (MediaVideoView) rootView.findViewById(R.id.gif), loader, rootView.findViewById(R.id.placeholder), false, false, !(getActivity() instanceof Shadowbox) || ((Shadowbox) (getActivity())).pager.getCurrentItem() == i, sub);
    gif.execute(s);
    rootView.findViewById(R.id.progress).setVisibility(View.GONE);
}
Also used : Shadowbox(me.ccrama.redditslide.Activities.Shadowbox) GifUtils(me.ccrama.redditslide.util.GifUtils) ProgressBar(android.widget.ProgressBar) MediaVideoView(me.ccrama.redditslide.Views.MediaVideoView)

Example 5 with Shadowbox

use of me.ccrama.redditslide.Activities.Shadowbox in project Slide by ccrama.

the class TitleFull method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle bundle = this.getArguments();
    i = bundle.getInt("page", 0);
    sub = bundle.getString("sub");
    if (((Shadowbox) getActivity()).subredditPosts == null || ((Shadowbox) getActivity()).subredditPosts.getPosts().size() < bundle.getInt("page", 0)) {
        getActivity().finish();
    } else {
        s = ((Shadowbox) getActivity()).subredditPosts.getPosts().get(bundle.getInt("page", 0));
    }
}
Also used : Shadowbox(me.ccrama.redditslide.Activities.Shadowbox) Bundle(android.os.Bundle)

Aggregations

Shadowbox (me.ccrama.redditslide.Activities.Shadowbox)6 Bundle (android.os.Bundle)4 ProgressBar (android.widget.ProgressBar)2 MediaVideoView (me.ccrama.redditslide.Views.MediaVideoView)2 GifUtils (me.ccrama.redditslide.util.GifUtils)2