Java Code Examples for com.facebook.drawee.view.SimpleDraweeView#setOnClickListener()

The following examples show how to use com.facebook.drawee.view.SimpleDraweeView#setOnClickListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JCVideoPlayerStandardFresco.java    From JCVideoPlayer with MIT License 6 votes vote down vote up
@Override
public void init(Context context) {
    super.init(context);
    bottomProgressBar = (ProgressBar) findViewById(R.id.bottom_progressbar);
    titleTextView = (TextView) findViewById(R.id.title);
    backButton = (ImageView) findViewById(R.id.back);
    thumbImageView = (SimpleDraweeView) findViewById(R.id.thumb);
    coverImageView = (ImageView) findViewById(R.id.cover);
    loadingProgressBar = (ProgressBar) findViewById(R.id.loading);
    tinyBackImageView = (ImageView) findViewById(R.id.back_tiny);

    thumbImageView.setOnClickListener(this);
    backButton.setOnClickListener(this);
    tinyBackImageView.setOnClickListener(this);

}
 
Example 2
Source File: WelcomeFragment.java    From fresco with MIT License 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  final SimpleDraweeView draweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
  draweeView.setActualImageResource(R.drawable.logo);
  draweeView.setOnClickListener(
      new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          final RotateAnimation rotateAnimation =
              new RotateAnimation(
                  0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
          rotateAnimation.setDuration(1000);
          rotateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
          draweeView.startAnimation(rotateAnimation);
        }
      });

  final Button buttonGitHub = (Button) view.findViewById(R.id.button_github);
  setUriIntent(buttonGitHub, URL_GITHUB);

  final Button buttonDocumentation = (Button) view.findViewById(R.id.button_documentation);
  setUriIntent(buttonDocumentation, URL_DOCUMENTATION);
}
 
Example 3
Source File: ImagePipelineRegionDecodingFragment.java    From fresco with MIT License 6 votes vote down vote up
@Override
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {
  mUri =
      sampleUris()
          .createSampleUri(ImageUriProvider.ImageSize.L, ImageUriProvider.Orientation.LANDSCAPE);

  mFullDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view_full);
  mFullDraweeView.setController(
      Fresco.newDraweeControllerBuilder()
          .setUri(mUri)
          .setControllerListener(mControllerListener)
          .build());

  mSelectedRegion = (ResizableFrameLayout) view.findViewById(R.id.frame_main);
  mSelectedRegion.init(view.findViewById(R.id.btn_resize));
  mSelectedRegion.setSizeChangedListener(mSizeChangedListener);

  mRegionDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view_region);
  mRegionDraweeView.setOnClickListener(
      new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          updateRegion();
        }
      });
}
 
Example 4
Source File: DraweeTransitionFragment.java    From fresco with MIT License 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  final Uri imageUri = sampleUris().createSampleUri(ImageUriProvider.ImageSize.M);

  final SimpleDraweeView simpleDraweeView =
      (SimpleDraweeView) view.findViewById(R.id.drawee_view);
  // You have to enable legacy visibility handling for the start view in order for this to work
  simpleDraweeView.setLegacyVisibilityHandlingEnabled(true);
  simpleDraweeView.setImageURI(imageUri);
  simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FOCUS_CROP);
  simpleDraweeView.getHierarchy().setActualImageFocusPoint(FOCUS_POINT);
  simpleDraweeView.setOnClickListener(
      new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          startTransition(v, imageUri);
        }
      });
}
 
Example 5
Source File: JCVideoPlayerStandardFresco.java    From JieCaoVideoPlayer-develop with MIT License 5 votes vote down vote up
@Override
protected void init(Context context) {
    super.init(context);
    pbBottom = (ProgressBar) findViewById(R.id.bottom_progressbar);
    tvTitle = (TextView) findViewById(R.id.title);
    ivBack = (ImageView) findViewById(R.id.back);
    ivThumb = (SimpleDraweeView) findViewById(R.id.thumb);
    ivCover = (ImageView) findViewById(R.id.cover);
    pbLoading = (ProgressBar) findViewById(R.id.loading);

    ivThumb.setOnClickListener(this);
    ivBack.setOnClickListener(this);

}
 
Example 6
Source File: JCVideoPlayerStandard.java    From SprintNBA with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(Context context) {
    super.init(context);
    bottomProgressBar = (ProgressBar) findViewById(R.id.bottom_progressbar);
    titleTextView = (TextView) findViewById(R.id.title);
    backButton = (ImageView) findViewById(R.id.back);
    backButton.setVisibility(View.INVISIBLE);
    thumbImageView = (SimpleDraweeView) findViewById(R.id.thumb);
    coverImageView = (ImageView) findViewById(R.id.cover);
    loadingProgressBar = (ProgressBar) findViewById(R.id.loading);

    thumbImageView.setOnClickListener(this);
    backButton.setOnClickListener(this);

}
 
Example 7
Source File: RegisterMoreFragment.java    From nono-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    head_img_view = (SimpleDraweeView)getView().findViewById(R.id.head_img_view);
    head_img_sex_mask = (TextView)getView().findViewById(R.id.head_img_sex_mask);
    male = (TextView)getView().findViewById(R.id.male);
    female = (TextView)getView().findViewById(R.id.female);
    head_img_view.setOnClickListener(this);
    head_img_sex_mask.setOnClickListener(this);
    male.setOnClickListener(this);
    female.setOnClickListener(this);

}
 
Example 8
Source File: DateDetailActivity.java    From Fishing with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setData(Date data) {
    getExpansion().dismissProgressPage();
    avatar.setImageURI(Uri.parse(data.getAuthorAvatar()));
    name.setText(data.getAuthorName());
    title.setText(data.getTitle());
    strTitle = data.getTitle();
    time.setText(new JTimeTransform(data.getTime()).toString(new JTimeTransform.RecentDateFormat()));
    dateTime.setText(new SimpleDateFormat("yyyy年MM月dd日").format(new java.util.Date(data.getAcTime())));
    content.setText(data.getContent());
    int uid = AccountModel.getInstance().getAccount().getUID();
    for (PersonBrief personBrief : data.getEnrollMember()) {
        if (personBrief.getUID() == uid) {
            joined = true;
            join.setText("进入");
        }
        SimpleDraweeView draweeView = new SimpleDraweeView(DateDetailActivity.this);
        draweeView.setLayoutParams(new ViewGroup.LayoutParams(JUtils.dip2px(40), JUtils.dip2px(40)));
        draweeView.setImageURI(Uri.parse(personBrief.getAvatar()));
        draweeView.getHierarchy().setRoundingParams(RoundingParams.asCircle());
        draweeView.setOnClickListener(v -> {
            Intent i = new Intent(DateDetailActivity.this, UserDetailActivity.class);
            i.putExtra("id", personBrief.getUID());
            startActivity(i);
        });
        joinMember.addView(draweeView);
    }
}
 
Example 9
Source File: NetImageAdapter.java    From Fishing with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    SimpleDraweeView draweeView = new SimpleDraweeView(getContext());
    draweeView.getHierarchy().setPlaceholderImage(new ColorDrawable(Color.rgb(252,242,230)));
    draweeView.getHierarchy().setFadeDuration(300);
    draweeView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    draweeView.setImageURI(ImageModel.getInstance().getSmallImage(getItem(position)));
    draweeView.setTag(position);
    draweeView.setOnClickListener(this);
    return draweeView;
}
 
Example 10
Source File: FrescoVitoLithoRegionDecodeFragment.java    From fresco with MIT License 5 votes vote down vote up
@Override
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {
  mUri =
      sampleUris()
          .createSampleUri(ImageUriProvider.ImageSize.L, ImageUriProvider.Orientation.LANDSCAPE);

  mFullDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view_full);
  mFullDraweeView.setController(
      Fresco.newDraweeControllerBuilder()
          .setUri(mUri)
          .setControllerListener(mControllerListener)
          .build());

  mSelectedParentBounds = (ResizableFrameLayout) view.findViewById(R.id.frame_parent_bounds);
  mSelectedParentBounds.init(view.findViewById(R.id.btn_resize_parent_bounds));
  mSelectedParentBounds.setSizeChangedListener(mSizeChangedListener);

  mSelectedFocusPoint = (ResizableFrameLayout) view.findViewById(R.id.frame_focus_point);
  mSelectedFocusPoint.init(view.findViewById(R.id.btn_resize_focus_point));
  mSelectedFocusPoint.setSizeChangedListener(mSizeChangedListener);

  mRegionDraweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view_region);
  mRegionDraweeView.setOnClickListener(
      new View.OnClickListener() {
        @Override
        public void onClick(View v) {
          updateRegion();
        }
      });
}
 
Example 11
Source File: NewsDetailActivity.java    From LiuAGeAndroid with MIT License 4 votes vote down vote up
/**
     * 准备UI
     */
    private void prepareUI() {
        mTopBar = findViewById(R.id.v_cell_news_detail_top_bar);
        mContentView = (ViewGroup) findViewById(R.id.activity_news_detail);
        mProgressBar = (ProgressBar) findViewById(R.id.pb_news_detail_progressbar);
        mScrollView = (ScrollView) findViewById(R.id.bsv_news_detail_scrollview);
        mContentWebView = (WebView) findViewById(R.id.wv_news_detail_webview);
        mShareQQButton = findViewById(R.id.ll_article_content_share_qq);
        mShareWxButton = findViewById(R.id.ll_article_content_share_weixin);
        mSharePyqButton = findViewById(R.id.ll_article_content_share_pyq);
        mBackButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_back);
        mEditButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_edit);
        mFontButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_font);
        mCollectionButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_collection);
        mShareButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_share);
        mLinkLayout = (LinearLayout) findViewById(R.id.ll_news_detail_links);
        mLinkRecyclerView = (RecyclerView) findViewById(R.id.rv_news_detail_links_recyclerview);
        mCommentLayout = (LinearLayout) findViewById(R.id.ll_news_detail_comment);
        mCommentRecyclerView = (RecyclerView) findViewById(R.id.rv_news_detail_comment_recyclerview);
        mMoreCommentButton = (Button) findViewById(R.id.btn_news_detail_comment_more);
        mAdImageView = (SimpleDraweeView) findViewById(R.id.iv_news_detail_ad_image);
        mAdTextView = (TextView) findViewById(R.id.tv_news_detail_ad_text);

        // 如果未能修改掉状态栏的颜色,就修改状态栏的背景颜色
        if (!isStatusChanged) {
            mTopBar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
            mTopBar.setAlpha(1);
        }

        // 新闻正文
        WebSettings webSettings = mContentWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        // 开启硬件加速后,webView内容太大会crash 还在寻求最终解决办法
//        mContentWebView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        mContentWebView.addJavascriptInterface(new ArticleJavascriptInterface(), "ARTICLE");
        mContentWebView.setWebChromeClient(new WebChromeClient() {
        });
        mContentWebView.setWebViewClient(new WebViewClient() {

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                // 隐藏加载进度条
                mProgressBar.setVisibility(View.INVISIBLE);
                // 网页加载完成才去加载其他UI
                setupDetailData();
                // 加载网页缓存图片
                getImageFromDownloaderOrDiskByImageUrlArray();
                // 页面滑动到顶部
                mScrollView.fullScroll(ScrollView.FOCUS_UP);
            }

        });

        // 底部工具条按钮点击事件
        mBackButton.setOnClickListener(this);
        mEditButton.setOnClickListener(this);
        mFontButton.setOnClickListener(this);
        mCollectionButton.setOnClickListener(this);
        mShareButton.setOnClickListener(this);
        mShareQQButton.setOnClickListener(this);
        mShareWxButton.setOnClickListener(this);
        mSharePyqButton.setOnClickListener(this);
        mAdImageView.setOnClickListener(this);

        // 更多评论
        mMoreCommentButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到评论列表
                CommentListActivity.start(mContext, classid, id, commentBeanList, "news");
            }
        });

    }