Search in sources :

Example 6 with PicUrls

use of org.aisen.weibo.sina.sinasdk.bean.PicUrls in project AisenWeiBo by wangdan.

the class PictureFragment method layoutInit.

@Override
protected void layoutInit(LayoutInflater inflater, Bundle savedInstanceSate) {
    super.layoutInit(inflater, savedInstanceSate);
    mStatus = PictureStatus.wait;
    image = savedInstanceSate == null ? (PicUrls) getArguments().getSerializable("url") : (PicUrls) savedInstanceSate.getSerializable("url");
    Uri uri = Uri.parse(image.getThumbnail_pic());
    if ("file".equals(uri.getScheme().toLowerCase())) {
        origFile = new File(uri.getPath());
    } else {
        origFile = BitmapLoader.getInstance().getCacheFile(getOrigImage());
        setHasOptionsMenu(true);
    }
    photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {

        @Override
        public void onPhotoTap(View view, float v, float v1) {
            getActivity().finish();
        }
    });
    mWebView.addJavascriptInterface(new PictureJavaScriptInterface(), "picturejs");
    layError.setPadding(0, 0, 0, SystemUtils.getNavigationBarHeight(getActivity()));
    loadPicture(viewFailure);
    findViewById(R.id.txtFailure).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            loadPicture(v);
        }
    });
}
Also used : PicUrls(org.aisen.weibo.sina.sinasdk.bean.PicUrls) Uri(android.net.Uri) File(java.io.File) PhotoViewAttacher(uk.co.senab.photoview.PhotoViewAttacher) ImageView(android.widget.ImageView) View(android.view.View) PictureProgressView(org.aisen.weibo.sina.ui.widget.PictureProgressView) WebView(android.webkit.WebView) PhotoView(uk.co.senab.photoview.PhotoView)

Aggregations

PicUrls (org.aisen.weibo.sina.sinasdk.bean.PicUrls)6 StatusContent (org.aisen.weibo.sina.sinasdk.bean.StatusContent)4 DialogInterface (android.content.DialogInterface)2 File (java.io.File)2 JokeBean (org.aisen.weibo.sina.support.bean.JokeBean)2 Uri (android.net.Uri)1 View (android.view.View)1 WebView (android.webkit.WebView)1 ImageView (android.widget.ImageView)1 JSONArray (com.alibaba.fastjson.JSONArray)1 JSONObject (com.alibaba.fastjson.JSONObject)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Setting (org.aisen.android.common.setting.Setting)1 Params (org.aisen.android.network.http.Params)1 TaskException (org.aisen.android.network.task.TaskException)1 ABaseFragment (org.aisen.android.ui.fragment.ABaseFragment)1 PictureProgressView (org.aisen.weibo.sina.ui.widget.PictureProgressView)1