コード例 #1
0
 @Click({R.id.qslide_row})
 void clickRow(View view) {
   switch (view.getId()) {
     case R.id.qslide_row:
       mQslide.toggle();
       break;
   }
 }
コード例 #2
0
ファイル: MainActivity.java プロジェクト: yan96in/Note
  // list中item的监听事件
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    // TODO Auto-generated method stub
    if (editmodel) {
      CheckBox checkBox = (CheckBox) view.findViewById(R.id.multiple_checkbox);

      checkBox.toggle();

      listAdapter.map.put(position, checkBox.isChecked());

      // 记录选中item的数目
      if (checkBox.isChecked()) {
        selectItemNum++;
      } else {
        selectItemNum--;
      }

      showSelectView.setText("已选择" + selectItemNum + "项");

      // 根据选中item数目显示和隐藏相应的btn
      switch (selectItemNum) {
        case 0:
          deleteButton.setVisibility(View.GONE);
          shareButton.setVisibility(View.GONE);
          moveButton.setVisibility(View.GONE);
          lockedButton.setVisibility(View.GONE);
          unlockedButton.setVisibility(View.GONE);
          break;

        case 1:
          deleteButton.setVisibility(View.VISIBLE);
          shareButton.setVisibility(View.VISIBLE);
          moveButton.setVisibility(View.VISIBLE);
          lockedButton.setVisibility(View.VISIBLE);
          unlockedButton.setVisibility(View.VISIBLE);
          break;
        default:
          deleteButton.setVisibility(View.VISIBLE);
          moveButton.setVisibility(View.VISIBLE);
          shareButton.setVisibility(View.GONE);
          lockedButton.setVisibility(View.VISIBLE);
          unlockedButton.setVisibility(View.VISIBLE);

          break;
      }

    } else {
      // 如果该记事本已加密则提示
      if (noteList.get(position).get("locked").toString().equals("1")) {
        // 记录当前position
        nowPosition = position;
        showDialog(INPUT_PASSWD);
      } else {
        Intent intent = new Intent(MainActivity.this, EditNoteActivity.class);
        intent.putExtra("nid", noteList.get(position).get("nid").toString());
        startActivityForResult(intent, EDITNOTE);
      }
    }
  }
コード例 #3
0
  public void reset(View view) {

    coffeeNumber = 0;
    findMyPrice.displayAll(coffeeNumber, cost);
    TextView priceView = (TextView) findViewById(R.id.price_text_view);
    CheckBox milkBox = (CheckBox) findViewById(R.id.milkBox);
    CheckBox creamBox = (CheckBox) findViewById(R.id.creamBox);
    CheckBox sugarBox = (CheckBox) findViewById(R.id.sugarBox);
    if (milkBox.isChecked()) {
      milkBox.toggle();
    }

    if (creamBox.isChecked()) {
      creamBox.toggle();
    }

    if (sugarBox.isChecked()) {
      sugarBox.toggle();
    }

    priceView.setText("");
  }
コード例 #4
0
  /**
   * Handle any clicks on {@link ExpandableListAdapter} children, which usually mean toggling its
   * visible state.
   */
  @Override
  public boolean onChildClick(
      ExpandableListView parent, View view, int groupPosition, int childPosition, long id) {
    final CheckBox checkbox = (CheckBox) view.findViewById(android.R.id.checkbox);

    final AccountDisplay account = (AccountDisplay) mAdapter.getGroup(groupPosition);
    final GroupDelta child = (GroupDelta) mAdapter.getChild(groupPosition, childPosition);
    if (child != null) {
      checkbox.toggle();
      child.putVisible(checkbox.isChecked());
    } else {
      // Open context menu for bringing back unsynced
      this.openContextMenu(view);
    }
    return true;
  }
コード例 #5
0
ファイル: MainActivity.java プロジェクト: yan96in/Note
  public boolean onItemLongClick(AdapterView<?> arg0, View view, int position, long id) {
    // TODO Auto-generated method stub

    if (!editmodel) {
      // 显示checkbox和初始化参数
      CheckBox checkBox = (CheckBox) view.findViewById(R.id.multiple_checkbox);
      checkBox.toggle();
      listAdapter.map.put(position, checkBox.isChecked());

      selectItemNum = 0;
      selectItemNum++;
      showSelectView.setText("已选择" + selectItemNum + "项");
      // 切换到编辑模式
      toEdit();
    }

    return true;
  }
コード例 #6
0
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    // TODO Auto-generated method stub

    CheckBox check = (CheckBox) v.getTag();

    Log.v(TAG, "���click on this : " + position);

    // isSelected.put(position, true);

    check.toggle();

    if (check.isChecked()) {
      isSelected.put(position, true);
    } else {

      isSelected.put(position, false);
    }

    super.onListItemClick(l, v, position, id);
  }
コード例 #7
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.context_add:
        {
          Intent addContextIntent =
              new Intent(Intent.ACTION_INSERT, ContextProvider.Contexts.CONTENT_URI);
          startActivityForResult(addContextIntent, cNewContextCode);
          break;
        }

      case R.id.project_add:
        {
          Intent addProjectIntent =
              new Intent(Intent.ACTION_INSERT, ProjectProvider.Projects.CONTENT_URI);
          startActivityForResult(addProjectIntent, cNewProjectCode);
          break;
        }

      case R.id.scheduling_entry:
        {
          toggleSchedulingSection();
          break;
        }

      case R.id.completed_entry:
        {
          mCompletedCheckBox.toggle();
          break;
        }

      case R.id.deleted_entry:
        {
          mDeletedCheckBox.toggle();
          break;
        }

      case R.id.gcal_entry:
        {
          CheckBox checkBox = (CheckBox) v.findViewById(R.id.update_calendar_checkbox);
          checkBox.toggle();
          break;
        }

      case R.id.clear_dates:
        {
          mAllDayCheckBox.setChecked(false);
          mStartTime = new Time();
          mDueTime = new Time();
          setWhenDefaults();
          populateWhen();
          updateCalendarPanel();
          break;
        }

      case R.id.reminder_remove:
        {
          LinearLayout reminderItem = (LinearLayout) v.getParent();
          LinearLayout parent = (LinearLayout) reminderItem.getParent();
          parent.removeView(reminderItem);
          mReminderItems.remove(reminderItem);
          updateRemindersVisibility();
          break;
        }

      default:
        super.onClick(v);
        break;
    }
  }