Esempio n. 1
0
 protected void init() {
   mImageView = new TouchImageView(mContext);
   {
     LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
     mImageView.setLayoutParams(params);
     this.addView(mImageView);
   }
   {
     mProgressBar = new ProgressBar(mContext, null, android.R.attr.progressBarStyle);
     LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
     params.addRule(RelativeLayout.CENTER_IN_PARENT);
     mProgressBar.setLayoutParams(params);
     mProgressBar.setIndeterminate(true);
     this.addView(mProgressBar);
   }
 }
Esempio n. 2
0
  private void initViewPager() {
    if (mImgIds != null && mImgIds.length > 0) {
      List<View> listImgs = new ArrayList<View>();
      for (int i = 0; i < mImgIds.length; i++) {
        TouchImageView iv = new TouchImageView(mContext);
        LayoutParams params =
            new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        iv.setLayoutParams(params);
        listImgs.add(iv);
        // iv.setOnClickListener(this);
        iv.setOnDoubleTapListener(
            new OnDoubleTapListener() {

              @Override
              public boolean onSingleTapConfirmed(MotionEvent e) {
                return true;
              }

              @Override
              public boolean onDoubleTapEvent(MotionEvent e) {
                return true;
              }

              @Override
              public boolean onDoubleTap(MotionEvent e) {
                dismiss();
                return true;
              }
            });
        iv.setImageResource(mImgIds[i]);
        // 加载网络图片
        // BitmapHelper.getInstance(mContext).display(iv,
        // mListImgUrls.get(i));
      }
      if (listImgs.size() > 0) {
        CommonPageAdapter pageAdapter = new CommonPageAdapter(listImgs);
        mViewPager.setAdapter(pageAdapter);
        mViewPager.setCurrentItem(mClickItem);
      }
    }
  }
Esempio n. 3
0
 protected void init() {
   mImageView = new TouchImageView(mContext);
   LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
   mImageView.setLayoutParams(params);
   this.addView(mImageView);
 }