Example #1
0
  /*
   * triggered when user chooses to like or follow
   */
  public void doPostAction(View btnAction, ReaderPostActions.PostAction action, ReaderPost post) {
    boolean isSelected = btnAction.isSelected();
    btnAction.setSelected(!isSelected);
    ReaderAniUtils.zoomAction(btnAction);

    if (!ReaderPostActions.performPostAction(this, action, post, null)) {
      btnAction.setSelected(isSelected);
      return;
    }

    // get the post again, since it has changed
    mPost = ReaderPostTable.getPost(mBlogId, mPostId);
    mIsPostChanged = true;

    // call returns before api completes, but local version of post will have been changed
    // so refresh to show those changes
    switch (action) {
      case TOGGLE_LIKE:
        refreshLikes();
        break;
      case TOGGLE_FOLLOW:
        refreshFollowed();
        break;
    }
  }
  private void onFabClick(View v) {
    int x = (v.getLeft() + v.getRight()) / 2;
    int y = (v.getTop() + v.getBottom()) / 2;
    float radiusOfFab = 1f * v.getWidth() / 2f;
    float radiusFromFabToRoot =
        (float)
            Math.hypot(
                Math.max(x, rootLayout.getWidth() - x), Math.max(y, rootLayout.getHeight() - y));

    if (v.isSelected()) {
      hideMenu(x, y, radiusFromFabToRoot, radiusOfFab);
    } else {
      showMenu(x, y, radiusOfFab, radiusFromFabToRoot);
    }
    v.setSelected(!v.isSelected());
  }
Example #3
0
 public void onClick(View paramView) {
   UCropActivity.b(this.a)
       .setTargetAspectRatio(
           ((AspectRatioTextView) ((ViewGroup) paramView).getChildAt(0))
               .a(paramView.isSelected()));
   UCropActivity.b(this.a).c();
   if (!paramView.isSelected()) {
     Iterator localIterator = UCropActivity.c(this.a).iterator();
     if (localIterator.hasNext()) {
       ViewGroup localViewGroup = (ViewGroup) localIterator.next();
       if (localViewGroup == paramView) {}
       for (boolean bool = true; ; bool = false) {
         localViewGroup.setSelected(bool);
         break;
       }
     }
   }
 }
  @Override
  public void onClick(View v) {

    switch (v.getId()) {
      case R.id.bottombar_play:

      case R.id.btn_play:
        if (MediaController.getInstance().getPlayingSongDetail() != null) PlayPauseEvent(v);
        break;

      case R.id.btn_forward:
        if (MediaController.getInstance().getPlayingSongDetail() != null)
          MediaController.getInstance().playNextSong();
        break;

      case R.id.btn_backward:
        if (MediaController.getInstance().getPlayingSongDetail() != null)
          MediaController.getInstance().playPreviousSong();
        break;

      case R.id.btn_suffel:
        break;

      case R.id.btn_toggle:
        break;

      case R.id.bottombar_img_Favorite:
        if (MediaController.getInstance().getPlayingSongDetail() != null) {
          MediaController.getInstance()
              .storeFavoritePlay(
                  context,
                  MediaController.getInstance().getPlayingSongDetail(),
                  v.isSelected() ? 0 : 1);
          v.setSelected(!v.isSelected());
          DMPlayerUtility.animateHeartButton(v);
          findViewById(R.id.like).setSelected(!v.isSelected());
          DMPlayerUtility.animatePhotoLike(findViewById(R.id.big_like), findViewById(R.id.like));
        }
        break;

      default:
        break;
    }
  }
Example #5
0
 public View getSelectedTab() {
   final int count = getTabCount();
   for (int i = 0; i < count; ++i) {
     View v = getChildTabViewAt(i);
     if (v.isSelected()) {
       return v;
     }
   }
   return null;
 }
  @Override
  public void onClick(View view) {
    if (view == modelsTextView) {
      view.setSelected(!view.isSelected());
      if (view.isSelected() && opacityTextView.isSelected()) {
        opacityTextView.setSelected(false);
      }
      if (actionsListener != null) {
        actionsListener.onModelsClicked(view.isSelected());
      }

    } else if (view == opacityTextView) {
      view.setSelected(!view.isSelected());
      if (view.isSelected() && modelsTextView.isSelected()) {
        modelsTextView.setSelected(false);
      }
      if (actionsListener != null) {
        actionsListener.onOpacityClicked(view.isSelected());
      }

    } else if (view == moveModeView) {
      moveModeView.toNextState();
      if (actionsListener != null) {
        actionsListener.onMoveModeClicked(moveModeView.getState());
      }

    } else if (view == cancelView) {
      modelsTextView.setSelected(false);
      opacityTextView.setSelected(false);
      setVisibility(GONE);
      if (actionsListener != null) {
        actionsListener.onCancelClicked();
      }
    }
  }
  /**
   * 获取当前选中的item
   *
   * @return
   */
  public int getSelected() {

    for (int i = 0; i < time_item_layout.getChildCount(); i++) {

      View child = time_item_layout.getChildAt(i);
      if (child.getTag() != null) {

        if (child.isSelected()) {
          return i;
        }
      }
    }
    return 0;
  }
Example #8
0
 private static String m91a(View view) {
   char c = 'F';
   char c2 = '.';
   StringBuilder stringBuilder = new StringBuilder(128);
   stringBuilder.append(view.getClass().getName());
   stringBuilder.append('{');
   stringBuilder.append(Integer.toHexString(System.identityHashCode(view)));
   stringBuilder.append(' ');
   switch (view.getVisibility()) {
     case 0:
       stringBuilder.append('V');
       break;
     case 4:
       stringBuilder.append('I');
       break;
     case 8:
       stringBuilder.append('G');
       break;
     default:
       stringBuilder.append('.');
       break;
   }
   stringBuilder.append(view.isFocusable() ? 'F' : '.');
   stringBuilder.append(view.isEnabled() ? 'E' : '.');
   stringBuilder.append(view.willNotDraw() ? '.' : 'D');
   stringBuilder.append(view.isHorizontalScrollBarEnabled() ? 'H' : '.');
   stringBuilder.append(view.isVerticalScrollBarEnabled() ? 'V' : '.');
   stringBuilder.append(view.isClickable() ? 'C' : '.');
   stringBuilder.append(view.isLongClickable() ? 'L' : '.');
   stringBuilder.append(' ');
   if (!view.isFocused()) {
     c = '.';
   }
   stringBuilder.append(c);
   stringBuilder.append(view.isSelected() ? 'S' : '.');
   if (view.isPressed()) {
     c2 = 'P';
   }
   stringBuilder.append(c2);
   stringBuilder.append(' ');
   stringBuilder.append(view.getLeft());
   stringBuilder.append(',');
   stringBuilder.append(view.getTop());
   stringBuilder.append('-');
   stringBuilder.append(view.getRight());
   stringBuilder.append(',');
   stringBuilder.append(view.getBottom());
   int id = view.getId();
   if (id != -1) {
     stringBuilder.append(" #");
     stringBuilder.append(Integer.toHexString(id));
     Resources resources = view.getResources();
     if (!(id == 0 || resources == null)) {
       String str;
       switch (-16777216 & id) {
         case 16777216:
           str = "android";
           break;
         case 2130706432:
           str = "app";
           break;
         default:
           try {
             str = resources.getResourcePackageName(id);
             break;
           } catch (NotFoundException e) {
             break;
           }
       }
       String resourceTypeName = resources.getResourceTypeName(id);
       String resourceEntryName = resources.getResourceEntryName(id);
       stringBuilder.append(" ");
       stringBuilder.append(str);
       stringBuilder.append(":");
       stringBuilder.append(resourceTypeName);
       stringBuilder.append("/");
       stringBuilder.append(resourceEntryName);
     }
   }
   stringBuilder.append("}");
   return stringBuilder.toString();
 }
 private static String a(View paramView)
 {
   char c3 = 'F';
   char c2 = '.';
   StringBuilder localStringBuilder = new StringBuilder(128);
   localStringBuilder.append(paramView.getClass().getName());
   localStringBuilder.append('{');
   localStringBuilder.append(Integer.toHexString(System.identityHashCode(paramView)));
   localStringBuilder.append(' ');
   char c1;
   label118:
   label135:
   label152:
   label169:
   label186:
   label203:
   label220:
   label244:
   label261:
   int n;
   Object localObject;
   switch (paramView.getVisibility())
   {
   default: 
     localStringBuilder.append('.');
     if (paramView.isFocusable())
     {
       c1 = 'F';
       localStringBuilder.append(c1);
       if (!paramView.isEnabled()) {
         break label562;
       }
       c1 = 'E';
       localStringBuilder.append(c1);
       if (!paramView.willNotDraw()) {
         break label568;
       }
       c1 = '.';
       localStringBuilder.append(c1);
       if (!paramView.isHorizontalScrollBarEnabled()) {
         break label574;
       }
       c1 = 'H';
       localStringBuilder.append(c1);
       if (!paramView.isVerticalScrollBarEnabled()) {
         break label580;
       }
       c1 = 'V';
       localStringBuilder.append(c1);
       if (!paramView.isClickable()) {
         break label586;
       }
       c1 = 'C';
       localStringBuilder.append(c1);
       if (!paramView.isLongClickable()) {
         break label592;
       }
       c1 = 'L';
       localStringBuilder.append(c1);
       localStringBuilder.append(' ');
       if (!paramView.isFocused()) {
         break label598;
       }
       c1 = c3;
       localStringBuilder.append(c1);
       if (!paramView.isSelected()) {
         break label604;
       }
       c1 = 'S';
       localStringBuilder.append(c1);
       c1 = c2;
       if (paramView.isPressed()) {
         c1 = 'P';
       }
       localStringBuilder.append(c1);
       localStringBuilder.append(' ');
       localStringBuilder.append(paramView.getLeft());
       localStringBuilder.append(',');
       localStringBuilder.append(paramView.getTop());
       localStringBuilder.append('-');
       localStringBuilder.append(paramView.getRight());
       localStringBuilder.append(',');
       localStringBuilder.append(paramView.getBottom());
       n = paramView.getId();
       if (n != -1)
       {
         localStringBuilder.append(" #");
         localStringBuilder.append(Integer.toHexString(n));
         localObject = paramView.getResources();
         if ((n != 0) && (localObject != null)) {
           switch (0xFF000000 & n)
           {
           }
         }
       }
     }
     break;
   }
   for (;;)
   {
     try
     {
       paramView = ((Resources)localObject).getResourcePackageName(n);
       String str = ((Resources)localObject).getResourceTypeName(n);
       localObject = ((Resources)localObject).getResourceEntryName(n);
       localStringBuilder.append(" ");
       localStringBuilder.append(paramView);
       localStringBuilder.append(":");
       localStringBuilder.append(str);
       localStringBuilder.append("/");
       localStringBuilder.append((String)localObject);
     }
     catch (Resources.NotFoundException paramView)
     {
       label562:
       label568:
       label574:
       label580:
       label586:
       label592:
       label598:
       label604:
       continue;
     }
     localStringBuilder.append("}");
     return localStringBuilder.toString();
     localStringBuilder.append('V');
     break;
     localStringBuilder.append('I');
     break;
     localStringBuilder.append('G');
     break;
     c1 = '.';
     break label118;
     c1 = '.';
     break label135;
     c1 = 'D';
     break label152;
     c1 = '.';
     break label169;
     c1 = '.';
     break label186;
     c1 = '.';
     break label203;
     c1 = '.';
     break label220;
     c1 = '.';
     break label244;
     c1 = '.';
     break label261;
     paramView = "app";
     continue;
     paramView = "android";
   }
 }
Example #10
0
 public void onMenuClick(View v) {
   if (!v.isSelected()) {
     mPager.setCurrentItem(Arrays.binarySearch(menuIds, v.getId()));
     // setActiveMenu(Arrays.binarySearch(menuIds, v.getId()));
   }
 }