예제 #1
0
 @Override
 public void onClick(View v) {
   if (mHomeButton == v) {
     openHomepage();
   } else if (mBackButton == v) {
     if (!back()) return;
     RecordUserAction.record("MobileToolbarBack");
     RecordUserAction.record("MobileTabClobbered");
   } else if (mForwardButton == v) {
     forward();
     RecordUserAction.record("MobileToolbarForward");
     RecordUserAction.record("MobileTabClobbered");
   } else if (mReloadButton == v) {
     stopOrReloadCurrentTab();
   } else if (mBookmarkButton == v) {
     if (mBookmarkListener != null) {
       mBookmarkListener.onClick(mBookmarkButton);
       RecordUserAction.record("MobileToolbarToggleBookmark");
     }
   } else if (mAccessibilitySwitcherButton == v) {
     if (mTabSwitcherListener != null) {
       cancelAppMenuUpdateBadgeAnimation();
       mTabSwitcherListener.onClick(mAccessibilitySwitcherButton);
     }
   }
 }
예제 #2
0
 @Override
 public void onClick(final View v) {
   AnimationUtils.startViewImageAnim(v);
   if (null != listener) {
     listener.onClick(v);
   }
 }
 public void zhuag() {
   if (mOnclickListener != null) mOnclickListener.onClick(v);
   initTimer();
   this.setText(time / 1000 + textafter);
   this.setEnabled(false);
   t.schedule(tt, 0, 1000);
   // t.scheduleAtFixedRate(task, delay, period);
 }
 @Override
 public boolean onChildClick(
     ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
   Object child = listAdapter.getChild(groupPosition, childPosition);
   if (child instanceof DownloadResourceGroup) {
     String uniqueId = ((DownloadResourceGroup) child).getUniqueId();
     final DownloadResourceGroupFragment regionDialogFragment =
         DownloadResourceGroupFragment.createInstance(uniqueId);
     ((DownloadActivity) getActivity()).showDialog(getActivity(), regionDialogFragment);
     return true;
   } else if (child instanceof IndexItem) {
     IndexItem indexItem = (IndexItem) child;
     DownloadResourceGroup groupObj = listAdapter.getGroupObj(groupPosition);
     ItemViewHolder vh = (ItemViewHolder) v.getTag();
     OnClickListener ls =
         vh.getRightButtonAction(indexItem, vh.getClickAction(indexItem), groupObj);
     ls.onClick(v);
     return true;
   }
   return false;
 }
  private void addTemporaryWallpaperTile(final Uri uri, boolean fromRestore) {
    mTempWallpaperTiles.add(uri);
    // Add a tile for the image picked from Gallery
    final FrameLayout pickedImageThumbnail =
        (FrameLayout)
            getLayoutInflater().inflate(R.layout.wallpaper_picker_item, mWallpapersView, false);
    pickedImageThumbnail.setVisibility(View.GONE);
    setWallpaperItemPaddingToZero(pickedImageThumbnail);
    mWallpapersView.addView(pickedImageThumbnail, 0);

    // Load the thumbnail
    final ImageView image = (ImageView) pickedImageThumbnail.findViewById(R.id.wallpaper_image);
    final Point defaultSize = getDefaultThumbnailSize(this.getResources());
    final Context context = this;
    new AsyncTask<Void, Bitmap, Bitmap>() {
      protected Bitmap doInBackground(Void... args) {
        int rotation = WallpaperCropActivity.getRotationFromExif(context, uri);
        return createThumbnail(defaultSize, context, uri, null, null, 0, rotation, false);
      }

      protected void onPostExecute(Bitmap thumb) {
        if (thumb != null) {
          image.setImageBitmap(thumb);
          Drawable thumbDrawable = image.getDrawable();
          thumbDrawable.setDither(true);
          pickedImageThumbnail.setVisibility(View.VISIBLE);
        } else {
          Log.e(TAG, "Error loading thumbnail for uri=" + uri);
        }
      }
    }.execute();

    UriWallpaperInfo info = new UriWallpaperInfo(uri);
    pickedImageThumbnail.setTag(info);
    info.setView(pickedImageThumbnail);
    addLongPressHandler(pickedImageThumbnail);
    updateTileIndices();
    pickedImageThumbnail.setOnClickListener(mThumbnailOnClickListener);
    if (!fromRestore) {
      mThumbnailOnClickListener.onClick(pickedImageThumbnail);
    }
  }
예제 #6
0
 public void onClick(View v) {
   if (v == mOkButton && mListener != null) {
     mListener.onClick(this, DialogInterface.BUTTON_POSITIVE);
   }
   dismiss();
 }
 public void performOnClickListener(View v) {
   mOnClickListener.onClick(v);
 }
예제 #8
0
 @Override
 public void onClick(View v) {
   if (listener != null) {
     listener.onClick(v);
   }
 }
 @Override
 public void onClick(View v) {
   if (listener != null) listener.onClick(this);
 }
예제 #10
0
 public boolean onLongClick(View v) {
   if (mUi != null) mUi.onClick(v);
   return true;
 }