Java Code Examples for android.widget.CompoundButton

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project androidquery, under directory /src/com/androidquery/.

Source file: AbstractAQuery.java

  34 
vote

/** 
 * Set checked state of a compound button.
 * @param checked state
 * @return self
 */
public T checked(boolean checked){
  if (view instanceof CompoundButton) {
    CompoundButton cb=(CompoundButton)view;
    cb.setChecked(checked);
  }
  return self();
}
 

Example 2

From project cw-omnibus, under directory /Location/Periodic/src/com/commonsware/android/perloc/.

Source file: MainActivity.java

  32 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  CompoundButton cb=(CompoundButton)findViewById(R.id.enabled);
  cb.setOnCheckedChangeListener(this);
}
 

Example 3

From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 4

From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 5

From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 6

From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 7

From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 8

From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 9

From project Common-Sense-Net-2, under directory /AndroidBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 10

From project cow, under directory /libs/ActionBarSherlock/library/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 11

From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 12

From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 13

From project dreamDroid, under directory /libraries/ABS/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 14

From project examples_2, under directory /SearchView/actionbarsherlock-lib/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 15

From project farebot, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 16

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/library/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 17

From project GnucashMobile, under directory /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 18

From project Google-Tasks-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 19

From project HSR-Timetable, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 20

From project iosched_3, under directory /libprojects/abs/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 21

From project IRC-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 22

From project MensaUPB, under directory /libs/ActionbarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 23

From project mWater-Android-App, under directory /android/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 24

From project MyHeath-Android, under directory /actionbarlib/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 25

From project onebusaway-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 26

From project open311-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/.

Source file: ListMenuItemView.java

  31 
vote

public void setCheckable(boolean checkable){
  if (!checkable && mRadioButton == null && mCheckBox == null) {
    return;
  }
  if (mRadioButton == null) {
    insertRadioButton();
  }
  if (mCheckBox == null) {
    insertCheckBox();
  }
  final CompoundButton compoundButton;
  final CompoundButton otherCompoundButton;
  if (mItemData.isExclusiveCheckable()) {
    compoundButton=mRadioButton;
    otherCompoundButton=mCheckBox;
  }
 else {
    compoundButton=mCheckBox;
    otherCompoundButton=mRadioButton;
  }
  if (checkable) {
    compoundButton.setChecked(mItemData.isChecked());
    final int newVisibility=checkable ? VISIBLE : GONE;
    if (compoundButton.getVisibility() != newVisibility) {
      compoundButton.setVisibility(newVisibility);
    }
    if (otherCompoundButton.getVisibility() != GONE) {
      otherCompoundButton.setVisibility(GONE);
    }
  }
 else {
    mCheckBox.setVisibility(GONE);
    mRadioButton.setVisibility(GONE);
  }
}
 

Example 27

From project agit, under directory /agit/src/main/java/com/madgag/agit/.

Source file: CloneLauncherActivity.java

  29 
vote

/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  fixImageTilingOn(getSupportActionBar());
  setContentView(R.layout.clone_launcher);
  ActionBar actionBar=getSupportActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setTitle(clone_launcher_activity_title);
  button.setOnClickListener(goCloneButtonListener);
  OnCheckedChangeListener checkBoxChangeListener=new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      updateUIWithValidation();
    }
  }
;
  useDefaultGitDirLocationButton.setOnCheckedChangeListener(checkBoxChangeListener);
  bareRepoCheckbox.setOnCheckedChangeListener(checkBoxChangeListener);
  TextWatcher watcher=new TextWatcher(){
    public void onTextChanged(    CharSequence text,    int arg1,    int arg2,    int arg3){
    }
    public void beforeTextChanged(    CharSequence text,    int arg1,    int arg2,    int arg3){
    }
    public void afterTextChanged(    Editable gitDirEditText){
      updateUIWithValidation();
    }
  }
;
  cloneUrlEditText.addTextChangedListener(watcher);
  gitDirEditText.addTextChangedListener(watcher);
}
 

Example 28

From project Android-automation, under directory /TmtsApp/src/com/taobao/tmts/framework/app/.

Source file: MainActivity.java

  29 
vote

private void setListeners(){
  setOnListener(btn_textview,TextViewActivity.class);
  setOnListener(btn_scrollview,ScrollActivity.class);
  setOnListener(btn_webview,WebViewActivity.class);
  setOnListener(btn_listview,ListViewActivity.class);
  checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      if (isChecked) {
        textView.setText("CheckBox is checked!");
      }
 else {
        textView.setText("default text");
      }
    }
  }
);
  gallery.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> parent,    View view,    int position,    long id){
    }
  }
);
}
 

Example 29

From project android-shuffle, under directory /client/src/org/dodgybits/shuffle/android/editor/activity/.

Source file: TaskEditorActivity.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  if (isChecked) {
    if (mDueTime.hour == 0 && mDueTime.minute == 0) {
      mDueTime.monthDay--;
      if (mDueTime.before(mStartTime)) {
        mDueTime.set(mStartTime);
      }
    }
  }
 else {
    if (mDueTime.hour == 0 && mDueTime.minute == 0) {
      mDueTime.monthDay++;
    }
  }
  mShowStart=true;
  long startMillis=mStartTime.normalize(true);
  setDate(mStartDateButton,startMillis,mShowStart);
  setTime(mStartTimeButton,startMillis,mShowStart);
  mShowDue=true;
  long dueMillis=mDueTime.normalize(true);
  setDate(mDueDateButton,dueMillis,mShowDue);
  setTime(mDueTimeButton,dueMillis,mShowDue);
  updateTimeVisibility(!isChecked);
}
 

Example 30

From project androidtracks, under directory /src/org/sfcta/cycletracks/.

Source file: SaveTrip.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton v,boolean isChecked){
  if (isChecked) {
    for (    Entry<Integer,ToggleButton> e : purpButtons.entrySet()) {
      e.getValue().setChecked(false);
    }
    v.setChecked(true);
    purpose=v.getText().toString();
    ((TextView)findViewById(R.id.TextPurpDescription)).setText(Html.fromHtml(purpDescriptions.get(v.getId())));
  }
}
 

Example 31

From project android_aosp_packages_apps_Settings, under directory /src/com/android/settings/.

Source file: ApnPreference.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Log.i(TAG,"ID: " + getKey() + " :"+ isChecked);
  if (mProtectFromCheckedChange) {
    return;
  }
  if (isChecked) {
    if (mCurrentChecked != null) {
      mCurrentChecked.setChecked(false);
    }
    mCurrentChecked=buttonView;
    mSelectedKey=getKey();
    callChangeListener(mSelectedKey);
  }
 else {
    mCurrentChecked=null;
    mSelectedKey=null;
  }
}
 

Example 32

From project android_packages_apps_CMSettings, under directory /src/com/cyanogenmod/settings/switches/.

Source file: PowerWidgetEnabler.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  if (mStateMachineEvent) {
    return;
  }
  Settings.System.putInt(mContext.getContentResolver(),Settings.System.EXPANDED_VIEW_WIDGET,isChecked ? 1 : 0);
  return;
}
 

Example 33

From project android_packages_apps_phone, under directory /src/com/android/phone/.

Source file: SipCallOptionHandler.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  mMakePrimary=isChecked;
  if (isChecked) {
    mUnsetPriamryHint.setVisibility(View.VISIBLE);
  }
 else {
    mUnsetPriamryHint.setVisibility(View.INVISIBLE);
  }
}
 

Example 34

From project android_packages_apps_Superuser, under directory /src/com/noshufou/android/su/.

Source file: InfoFragment.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
switch (buttonView.getId()) {
case R.id.outdated_notification:
    mPrefs.edit().putBoolean(Preferences.OUTDATED_NOTIFICATION,isChecked).commit();
  break;
}
}
 

Example 35

From project Anki-Android, under directory /src/com/ichi2/anki/.

Source file: Reviewer.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean showAnswer){
  Log.i(AnkiDroidApp.TAG,"Flip card changed:");
  Sound.stopSounds();
  if (showAnswer) {
    displayCardAnswer();
  }
 else {
    displayCardQuestion();
  }
}
 

Example 36

From project AnySoftKeyboard, under directory /src/com/anysoftkeyboard/ui/tutorials/.

Source file: TipsActivity.java

  29 
vote

public void onCheckedChanged(CompoundButton checkBox,boolean isChecked){
  Editor e=mAppPrefs.edit();
switch (checkBox.getId()) {
case R.id.settings_key_press_vibration:
    Log.d(TAG,"Vib touched: " + isChecked);
  e.putString(getString(R.string.settings_key_vibrate_on_key_press_duration),isChecked ? "17" : "0");
break;
case R.id.settings_key_press_sound:
Log.d(TAG,"Sound touched: " + isChecked);
e.putBoolean(getString(R.string.settings_key_sound_on),isChecked);
break;
}
e.commit();
}
 

Example 37

From project AquaNotesTest, under directory /src/com/google/android/apps/iosched/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  mRequirements=(TextView)mRootView.findViewById(R.id.session_requirements);
  setupSummaryTab();
  setupNotesTab();
  setupLinksTab();
  return mRootView;
}
 

Example 38

From project beintoo-android-sdk, under directory /BeintooSDK/src/com/beintoo/activities/alliances/.

Source file: UserAllianceAdapter.java

  29 
vote

public CustomAdapterView(Context context,final ListItem l){
  super(context);
  this.setOrientation(LinearLayout.HORIZONTAL);
  this.setGravity(Gravity.CENTER_VERTICAL);
  this.setPadding((int)(ratio * 10),(int)(ratio * 10),0,(int)(ratio * 10));
  TextView left=new TextView(context);
  left.setGravity(Gravity.CENTER_VERTICAL);
  LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
  params.weight=1;
  left.setLayoutParams(params);
  left.setGravity(Gravity.LEFT);
  left.setTextColor(Color.parseColor("#787A77"));
  left.setText(l.leftText);
  addView(left);
  if (l.rightText != null) {
    TextView right=new TextView(context);
    right.setGravity(Gravity.RIGHT);
    right.setPadding(0,0,(int)(ratio * 10),0);
    right.setTextColor(Color.parseColor("#787A77"));
    right.setText(l.rightText);
    addView(right);
  }
  if (l.showCheck) {
    CheckBox cb=new CheckBox(context);
    cb.setGravity(Gravity.RIGHT);
    cb.setLayoutParams(new LinearLayout.LayoutParams(40,40));
    cb.setOnCheckedChangeListener(new OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton buttonView,      boolean isChecked){
        l.isChecked=true;
      }
    }
);
    if (l.isChecked)     cb.setChecked(true);
    addView(cb);
  }
}
 

Example 39

From project Bitcoin-Wallet-for-Android, under directory /wallet/src/de/schildbach/wallet/ui/.

Source file: RequestCoinsFragment.java

  29 
vote

@Override public void onResume(){
  super.onResume();
  amountView.setListener(new CurrencyAmountView.Listener(){
    public void changed(){
      updateView();
    }
    public void done(){
    }
    public void focusChanged(    final boolean hasFocus){
    }
  }
);
  addressView.setOnItemSelectedListener(new OnItemSelectedListener(){
    public void onItemSelected(    final AdapterView<?> parent,    final View view,    final int position,    final long id){
      updateView();
    }
    public void onNothingSelected(    final AdapterView<?> parent){
    }
  }
);
  includeLabelView.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    final CompoundButton buttonView,    final boolean isChecked){
      updateView();
    }
  }
);
  updateView();
}
 

Example 40

From project BombusLime, under directory /src/org/bombusim/lime/activity/.

Source file: LoggerActivity.java

  29 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.log);
  logListView=(ListView)findViewById(R.id.loggerListView);
  logListView.setAdapter(new LogListAdapter(this));
  logListView.setOnItemClickListener(new OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> arg0,    View v,    int position,    long id){
      ListView l=(ListView)arg0;
      ((LogListAdapter)l.getAdapter()).toggle(position);
    }
  }
);
  loggerEnabled=(CheckBox)findViewById(R.id.loggerEnable);
  loggerEnabled.setChecked(LimeLog.getLocalXmlEnabled());
  loggerEnabled.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      LimeLog.setlocalXmlEnabled(isChecked);
    }
  }
);
  noAutoscroll=(CheckBox)findViewById(R.id.loggerFreeze);
  noAutoscroll.setChecked(disableAutoScroll);
  noAutoscroll.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      disableAutoScroll=isChecked;
    }
  }
);
}
 

Example 41

From project Book-Catalogue, under directory /src/com/eleybourn/bookcatalogue/.

Source file: PreferencesBase.java

  29 
vote

/** 
 * Utility routine to setup a checkobox based on a preference.
 * @param prefs		Preferences to use
 * @param cbId		CheckBox ID from XML file
 * @param viewId	Containing ViewGroup from XML file (for clicking and highlighting)
 * @param key		Preferences key associated with this CheckBox
 */
protected void addBooleanPreference(final BookCataloguePreferences prefs,final int cbId,int viewId,final String key,final boolean defaultValue){
{
    CheckBox v=(CheckBox)this.findViewById(cbId);
    v.setChecked(prefs.getBoolean(key,defaultValue));
    v.setOnCheckedChangeListener(new OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton buttonView,      boolean isChecked){
        prefs.setBoolean(key,isChecked);
      }
    }
);
  }
{
    View v=this.findViewById(viewId);
    v.setBackgroundResource(android.R.drawable.list_selector_background);
    v.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        CheckBox cb=(CheckBox)v.findViewById(cbId);
        cb.setChecked(!prefs.getBoolean(key,defaultValue));
      }
    }
);
  }
}
 

Example 42

From project bookmarktodesktop-android-application, under directory /src/be/vbsteven/bmtodesk/.

Source file: RegistrationActivity.java

  29 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  setTheme(android.R.style.Theme_Light_NoTitleBar);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.registration);
  handler=new Handler();
  button=(Button)findViewById(R.id.but_create);
  button.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      register();
    }
  }
);
  button=(Button)findViewById(R.id.but_login);
  button.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      checkLogin();
    }
  }
);
  CheckBox cb=(CheckBox)findViewById(R.id.cb_password);
  cb.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      EditText password=(EditText)findViewById(R.id.et_password);
      if (isChecked) {
        password.setTransformationMethod(null);
      }
 else {
        password.setTransformationMethod(new PasswordTransformationMethod());
      }
    }
  }
);
}
 

Example 43

From project BSPAN---Bluetooth-Sensor-Processing-for-Android, under directory /AndroidBTService/src/com/t2/biofeedback/activity/.

Source file: BTServiceManager.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  String address=(String)buttonView.getTag();
  if (isChecked) {
    this.deviceManager.setDeviceEnabled(address,true);
  }
 else {
    this.deviceManager.setDeviceEnabled(address,false);
  }
  this.reloadItems();
}
 

Example 44

From project callmeter, under directory /src/de/ub0r/android/callmeter/widget/.

Source file: StatsAppWidgetConfigure.java

  29 
vote

/** 
 * {@inheritDoc}
 */
@Override public void onCreate(final Bundle savedInstanceState){
  Utils.setLocale(this);
  super.onCreate(savedInstanceState);
  this.setTitle(R.string.widget_config_);
  this.setContentView(R.layout.stats_appwidget_config);
  this.spinner=(Spinner)this.findViewById(R.id.spinner);
  this.cbHideName=(CheckBox)this.findViewById(R.id.hide_name);
  this.cbHideName.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    final CompoundButton buttonView,    final boolean isChecked){
      StatsAppWidgetConfigure.this.cbShowShortname.setEnabled(!isChecked);
    }
  }
);
  this.cbShowShortname=(CheckBox)this.findViewById(R.id.shortname);
  this.cbShowShortname.setOnCheckedChangeListener(this);
  this.cbShowCost=(CheckBox)this.findViewById(R.id.cost);
  this.cbShowBillp=(CheckBox)this.findViewById(R.id.pbillp);
  this.cbShowIcon=(CheckBox)this.findViewById(R.id.show_icon);
  this.cbSmallWidget=(CheckBox)this.findViewById(R.id.small_widget);
  this.etPlanTextSize=(EditText)this.findViewById(R.id.widget_plan_textsize);
  this.etStatsTextSize=(EditText)this.findViewById(R.id.widget_stats_textsize);
  this.btnTextColor=(Button)this.findViewById(R.id.textcolor);
  this.btnBgColor=(Button)this.findViewById(R.id.bgcolor);
  this.vTextColor=this.findViewById(R.id.textcolorfield);
  this.vBgColor=this.findViewById(R.id.bgcolorfield);
  this.sbBgTransparency=(SeekBar)this.findViewById(R.id.bgtransparency);
  this.setAdapter();
  this.findViewById(R.id.ok).setOnClickListener(this);
  this.findViewById(R.id.cancel).setOnClickListener(this);
  this.btnTextColor.setOnClickListener(this);
  this.btnBgColor.setOnClickListener(this);
  this.sbBgTransparency.setOnSeekBarChangeListener(this);
  this.setTextColor(DEFAULT_TEXTCOLOR);
  this.setBgColor(DEFAULT_BGCOLOR,false);
}
 

Example 45

From project cicada, under directory /cicada/src/org/cicadasong/cicada/.

Source file: Cicada.java

  29 
vote

/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  display=(SimulatedDisplayView)findViewById(R.id.display);
  serviceToggle=(ToggleButton)findViewById(R.id.service_toggle);
  serviceToggle.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      if (isChecked) {
        if (!checkSettingsAndStart()) {
          serviceToggle.setChecked(false);
        }
      }
 else {
        stopService(new Intent(getBaseContext(),CicadaService.class));
      }
    }
  }
);
  appSettingsButton=(Button)findViewById(R.id.active_app_settings);
  appSettingsButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      if (CicadaService.getActiveApp() != null && CicadaService.getActiveApp().settingsActivityClassName != null) {
        AppDescription app=CicadaService.getActiveApp();
        Intent intent=new Intent();
        intent.setComponent(new ComponentName(app.packageName,app.settingsActivityClassName));
        startActivity(intent);
      }
    }
  }
);
  updateServiceToggleState();
  if (!CicadaService.isRunning()) {
    checkSettingsAndStart();
  }
}
 

Example 46

From project conference-mobile-app, under directory /android-app/src/com/google/android/apps/iosched/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  mRequirements=(TextView)mRootView.findViewById(R.id.session_requirements);
  setupSummaryTab();
  setupNotesTab();
  setupLinksTab();
  return mRootView;
}
 

Example 47

From project creamed_glacier_app_settings, under directory /src/com/android/settings/accounts/.

Source file: ManageAccountsSettings.java

  29 
vote

@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  final Activity activity=getActivity();
  final View view=getView();
  mErrorInfoView=(TextView)view.findViewById(R.id.sync_settings_error_info);
  mErrorInfoView.setVisibility(View.GONE);
  mAutoSyncSwitch=new Switch(activity);
  final int padding=activity.getResources().getDimensionPixelSize(R.dimen.action_bar_switch_padding);
  mAutoSyncSwitch.setPadding(0,0,padding,0);
  mAutoSyncSwitch.setChecked(ContentResolver.getMasterSyncAutomatically());
  mAutoSyncSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      ContentResolver.setMasterSyncAutomatically(isChecked);
      onSyncStateUpdated();
    }
  }
);
  mAuthorities=activity.getIntent().getStringArrayExtra(AUTHORITIES_FILTER_KEY);
  updateAuthDescriptions();
}
 

Example 48

From project cw-android, under directory /Basic/CheckBox/src/com/commonsware/android/checkbox/.

Source file: CheckBoxDemo.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  if (isChecked) {
    cb.setText("This checkbox is: checked");
  }
 else {
    cb.setText("This checkbox is: unchecked");
  }
}
 

Example 49

From project dccsched, under directory /src/com/underhilllabs/dccsched/ui/.

Source file: SessionDetailActivity.java

  29 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_session_detail);
  mTitle=(TextView)findViewById(R.id.session_title);
  mSubtitle=(TextView)findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=findViewById(R.id.list_item_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)findViewById(R.id.session_abstract);
  mRequirements=(TextView)findViewById(R.id.session_requirements);
  final Intent intent=getIntent();
  mSessionUri=intent.getData();
  mSessionId=Sessions.getSessionId(mSessionUri);
  setupSummaryTab();
  setupNotesTab();
  final Uri trackUri=resolveTrackUri(intent);
  final Uri speakersUri=Sessions.buildSpeakersDirUri(mSessionId);
  mHandler=new NotifyingAsyncQueryHandler(getContentResolver(),this);
  mHandler.startQuery(SessionsQuery._TOKEN,mSessionUri,SessionsQuery.PROJECTION);
  mHandler.startQuery(TracksQuery._TOKEN,trackUri,TracksQuery.PROJECTION);
  mHandler.startQuery(SpeakersQuery._TOKEN,speakersUri,SpeakersQuery.PROJECTION);
}
 

Example 50

From project dcnyc10-android, under directory /android/src/com/lullabot/android/apps/iosched/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  setupSummaryTab();
  return mRootView;
}
 

Example 51

From project devoxx-france-android-in-fine, under directory /src/com/infine/android/devoxx/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mSponsored=(TextView)mRootView.findViewById(R.id.session_sponsored);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mSummary=(TextView)mRootView.findViewById(R.id.session_abstract);
  setupSummaryTab();
  return mRootView;
}
 

Example 52

From project droid-comic-viewer, under directory /src/net/robotmedia/acv/ui/settings/.

Source file: BrightnessPreference.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  final int value;
  if (isChecked) {
    mSeekBar.setEnabled(false);
    value=-1;
  }
 else {
    mSeekBar.setEnabled(true);
    value=mSeekBar.getProgress();
  }
  updateBrightness(value);
}
 

Example 53

From project facebook-android-sdk, under directory /examples/Hackbook/src/com/facebook/android/.

Source file: PermissionsDialog.java

  29 
vote

@Override public View getView(final int position,View convertView,ViewGroup parent){
  View hView=convertView;
  CheckBox checkbox;
  if (hView == null) {
    hView=mInflater.inflate(R.layout.permission_item,null);
    checkbox=(CheckBox)hView.findViewById(R.id.permission_checkbox);
    hView.setTag(checkbox);
  }
 else {
    checkbox=(CheckBox)hView.getTag();
  }
  checkbox.setText(this.permissions[position]);
  checkbox.setId(position);
  if (Utility.currentPermissions.containsKey(this.permissions[position]) && Utility.currentPermissions.get(this.permissions[position]).equals("1")) {
    checkbox.setTextColor(Color.GREEN);
    checkbox.setChecked(true);
    checkbox.setEnabled(false);
    checkbox.setOnCheckedChangeListener(null);
  }
 else {
    checkbox.setTextColor(Color.WHITE);
    checkbox.setChecked(this.isChecked[position]);
    checkbox.setEnabled(true);
    checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton button,      boolean checked){
        isChecked[button.getId()]=checked;
        if (checked) {
          reqPermVector.add(button.getText().toString());
        }
 else         if (reqPermVector.contains(button.getText())) {
          reqPermVector.remove(button.getText());
        }
      }
    }
);
  }
  return hView;
}
 

Example 54

From project forMegaADK, under directory /MegaAdkLed/src/com/tomovwgti/megaadk/.

Source file: MegaAdkLedActivity.java

  29 
vote

@Override protected void showControls(){
  setContentView(R.layout.main);
  final Led led=new Led();
  led.light=0;
  led.sendData();
  ToggleButton button=(ToggleButton)findViewById(R.id.led_button);
  button.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      if (isChecked) {
        led.light=1;
      }
 else {
        led.light=0;
      }
      led.sendData();
    }
  }
);
}
 

Example 55

From project friendica-for-android, under directory /mw-android-friendica-01/src/de/wikilab/android/friendica01/.

Source file: WritePostFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  myView=inflater.inflate(R.layout.writepostinner,container,false);
  viewLatLon=(TextView)myView.findViewById(R.id.viewLatLon);
  sendBtn=(Button)myView.findViewById(R.id.btn_upload);
  sendBtn.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      sendMessage();
    }
  }
);
  ToggleButton sendLatLon=(ToggleButton)myView.findViewById(R.id.sendLatLon);
  sendLatLon.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      if (isChecked) {
        if (!locationListenerAttached) {
          LocationManager lm=(LocationManager)getActivity().getSystemService(Context.LOCATION_SERVICE);
          Location location=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
          lm.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener);
          viewLatLon.setText(getString(R.string.viewLatLon) + "\n" + "Loading...");
          locationListenerAttached=true;
        }
      }
 else {
        detachLocationListener();
      }
    }
  }
);
  return myView;
}
 

Example 56

From project Funf-Ohmage, under directory /src/edu/mit/media/funf/funfohmage/.

Source file: MainActivity.java

  29 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  context=this;
  datasource=new SensorDataSource(this);
  datasource.open();
  CheckBox enabledCheckbox=(CheckBox)findViewById(R.id.enabledCheckbox);
  enabledCheckbox.setChecked(MainPipeline.isEnabled(context));
  enabledCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      Intent archiveIntent=new Intent(context,MainPipeline.class);
      String action=isChecked ? MainPipeline.ACTION_ENABLE : MainPipeline.ACTION_DISABLE;
      archiveIntent.setAction(action);
      startService(archiveIntent);
    }
  }
);
  MainPipeline.getSystemPrefs(this).registerOnSharedPreferenceChangeListener(this);
  updatedbCount();
  Button scanNowButton=(Button)findViewById(R.id.scanNowButton);
  scanNowButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      Intent runOnceIntent=new Intent(context,MainPipeline.class);
      runOnceIntent.setAction(MainPipeline.ACTION_RUN_ONCE);
      runOnceIntent.putExtra(MainPipeline.RUN_ONCE_PROBE_NAME,WifiProbe.class.getName());
      startService(runOnceIntent);
      runOnceIntent.putExtra(MainPipeline.RUN_ONCE_PROBE_NAME,LocationProbe.class.getName());
      startService(runOnceIntent);
      runOnceIntent.putExtra(MainPipeline.RUN_ONCE_PROBE_NAME,AccelerometerSensorProbe.class.getName());
      startService(runOnceIntent);
    }
  }
);
  SharedPreferencesHelper prefs=new SharedPreferencesHelper(this);
}
 

Example 57

From project gddsched2, under directory /trunk/android/src/com/google/android/apps/iosched2/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  mRequirements=(TextView)mRootView.findViewById(R.id.session_requirements);
  mLevel=(TextView)mRootView.findViewById(R.id.session_level);
  setupSummaryTab();
  setupNotesTab();
  setupLinksTab();
  return mRootView;
}
 

Example 58

From project GeekAlarm, under directory /android/src/com/geek_alarm/android/activities/.

Source file: SingleAlarmActivity.java

  29 
vote

private void setUpToggleButton(){
  ToggleButton toggle=(ToggleButton)findViewById(R.id.enabled);
  toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      saveAlarm();
    }
  }
);
  AlarmPreference alarm=AlarmPreferenceDao.INSTANCE.getAll().get(0);
  toggle.setChecked(alarm.isEnabled());
}
 

Example 59

From project GSM-Signal-Tracking-, under directory /gpstracker/src/nl/sogeti/android/gpstracker/viewer/.

Source file: LoggerMap.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  int checkedId;
  checkedId=buttonView.getId();
switch (checkedId) {
case R.id.layer_traffic:
    setTrafficOverlay(isChecked);
  break;
case R.id.layer_speed:
setSpeedOverlay(isChecked);
break;
case R.id.layer_altitude:
setAltitudeOverlay(isChecked);
break;
case R.id.layer_signalstrength:
setSignalStrengthOverlay(isChecked);
break;
case R.id.layer_compass:
setCompassOverlay(isChecked);
break;
case R.id.layer_location:
setLocationOverlay(isChecked);
break;
default :
break;
}
}
 

Example 60

From project hecl, under directory /android/src/org/hecl/android/.

Source file: HeclCallback.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  try {
    Vector vec=ListThing.get(script.deepcopy());
    vec.add(ObjectThing.create(buttonView));
    vec.add(IntThing.create(isChecked));
    interp.eval(ListThing.create(vec));
  }
 catch (  HeclException he) {
    Hecl.logStacktrace(he);
    Log.v("hecl oncheckedchanged callback",he.toString());
  }
}
 

Example 61

From project ignition, under directory /ignition-support/ignition-support-samples/src/com/github/ignition/samples/support/.

Source file: IgnitedHttpSampleActivity.java

  29 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.ignited_http_sample);
  statusText=(TextView)findViewById(R.id.ignitedhttp_status);
  useCache=(CheckBox)findViewById(R.id.ignitedhttp_chk_use_cache);
  useCache.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      enableCache(isChecked);
      updateCacheStatus();
    }
  }
);
  http=new IgnitedHttp(this);
  enableCache(useCache.isChecked());
}
 

Example 62

From project iosched, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  mRequirements=(TextView)mRootView.findViewById(R.id.session_requirements);
  setupSummaryTab();
  setupNotesTab();
  setupLinksTab();
  return mRootView;
}
 

Example 63

From project iosched2011, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  mRequirements=(TextView)mRootView.findViewById(R.id.session_requirements);
  setupSummaryTab();
  setupNotesTab();
  setupLinksTab();
  return mRootView;
}
 

Example 64

From project iosched_1, under directory /src/com/google/android/apps/iosched/ui/.

Source file: SessionDetailActivity.java

  29 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_session_detail);
  mTitle=(TextView)findViewById(R.id.session_title);
  mSubtitle=(TextView)findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=findViewById(R.id.list_item_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)findViewById(R.id.session_abstract);
  mRequirements=(TextView)findViewById(R.id.session_requirements);
  final Intent intent=getIntent();
  mSessionUri=intent.getData();
  mSessionId=Sessions.getSessionId(mSessionUri);
  setupSummaryTab();
  setupNotesTab();
  final Uri trackUri=resolveTrackUri(intent);
  final Uri speakersUri=Sessions.buildSpeakersDirUri(mSessionId);
  mHandler=new NotifyingAsyncQueryHandler(getContentResolver(),this);
  mHandler.startQuery(SessionsQuery._TOKEN,mSessionUri,SessionsQuery.PROJECTION);
  mHandler.startQuery(TracksQuery._TOKEN,trackUri,TracksQuery.PROJECTION);
  mHandler.startQuery(SpeakersQuery._TOKEN,speakersUri,SpeakersQuery.PROJECTION);
}
 

Example 65

From project iosched_2, under directory /android/src/com/google/android/apps/iosched/ui/.

Source file: SessionDetailFragment.java

  29 
vote

@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  mRootView=(ViewGroup)inflater.inflate(R.layout.fragment_session_detail,null);
  mTabHost=(TabHost)mRootView.findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mTitle=(TextView)mRootView.findViewById(R.id.session_title);
  mSubtitle=(TextView)mRootView.findViewById(R.id.session_subtitle);
  mStarred=(CompoundButton)mRootView.findViewById(R.id.star_button);
  mStarred.setFocusable(true);
  mStarred.setClickable(true);
  final View starParent=mRootView.findViewById(R.id.header_session);
  FractionalTouchDelegate.setupDelegate(starParent,mStarred,new RectF(0.6f,0f,1f,0.8f));
  mAbstract=(TextView)mRootView.findViewById(R.id.session_abstract);
  mRequirements=(TextView)mRootView.findViewById(R.id.session_requirements);
  setupSummaryTab();
  setupNotesTab();
  setupLinksTab();
  return mRootView;
}
 

Example 66

From project Juggernaut_SystemUI, under directory /src/com/android/systemui/usb/.

Source file: UsbConfirmActivity.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  if (mClearDefaultHint == null)   return;
  if (isChecked) {
    mClearDefaultHint.setVisibility(View.VISIBLE);
  }
 else {
    mClearDefaultHint.setVisibility(View.GONE);
  }
}
 

Example 67

From project k-9, under directory /src/com/fsck/k9/fragment/.

Source file: MessageListFragment.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  if (position != -1) {
    MessageInfoHolder message=(MessageInfoHolder)mAdapter.getItem(position);
    toggleMessageSelect(message);
  }
}
 

Example 68

From project keepassdroid, under directory /src/com/keepassdroid/.

Source file: PasswordActivity.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  String newDefaultFileName;
  if (isChecked) {
    newDefaultFileName=mFileName;
  }
 else {
    newDefaultFileName="";
  }
  SharedPreferences.Editor editor=prefs.edit();
  editor.putString(KEY_DEFAULT_FILENAME,newDefaultFileName);
  EditorCompat.apply(editor);
  BackupManagerCompat backupManager=new BackupManagerCompat(PasswordActivity.this);
  backupManager.dataChanged();
}
 

Example 69

From project liquidroid, under directory /src/liqui/droid/activity/.

Source file: AreaListSelect.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Uri MEMBERSHIP_URI=dbUri(DBProvider.MEMBERSHIP_CONTENT_URI);
  if (isChecked) {
    ContentValues values=new ContentValues();
    values.put(DB.Membership.COLUMN_MEMBER_ID,getMemberId());
    values.put(DB.Membership.COLUMN_AREA_ID,String.valueOf(buttonView.getTag()));
    Uri uri=mContext.getContentResolver().insert(MEMBERSHIP_URI,values);
    Log.d("XXXX","Joined area " + buttonView.getTag() + " "+ uri);
  }
 else {
    Uri.Builder ub=MEMBERSHIP_URI.buildUpon();
    ub=ub.appendQueryParameter("member_id",getMemberId());
    ub=ub.appendQueryParameter("area_id",String.valueOf(buttonView.getTag()));
    int nr=getContentResolver().delete(ub.build(),null,null);
    Log.d("XXXX","Unjoined area " + buttonView.getTag() + " "+ nr);
  }
}
 

Example 70

From project ListViewTipsAndTricks, under directory /src/com/cyrilmottier/android/listviewtipsandtricks/.

Source file: AccessoriesListActivity.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  final int position=getListView().getPositionForView(buttonView);
  if (position != ListView.INVALID_POSITION) {
    mStarStates[position]=isChecked;
  }
}
 

Example 71

From project MicDroid, under directory /src/com/intervigil/micdroid/.

Source file: Mic.java

  29 
vote

public void onCheckedChanged(CompoundButton btn,boolean isChecked){
  if (!hasWindowFocus()) {
    return;
  }
 else   if (!canWriteToSdCard()) {
    btn.setChecked(false);
    DialogHelper.showWarning(Mic.this,R.string.no_external_storage_title,R.string.no_external_storage_warning);
  }
 else   if (!AudioHelper.isValidRecorderConfiguration(Mic.this)) {
    btn.setChecked(false);
    DialogHelper.showWarning(Mic.this,R.string.unconfigured_audio_title,R.string.unconfigured_audio_warning);
  }
 else {
    if (btn.isChecked()) {
      boolean isLiveMode=PreferenceHelper.getLiveMode(Mic.this);
      if (isLiveMode && !HeadsetHelper.isHeadsetPluggedIn(Mic.this)) {
        btn.setChecked(false);
        DialogHelper.showWarning(Mic.this,R.string.no_headset_plugged_in_title,R.string.no_headset_plugged_in_warning);
      }
 else {
        timer.reset();
        if (isLiveMode) {
          updateAutoTalentPreferences();
        }
        if (recorder == null) {
          recorder=new SimpleRecorder(Mic.this,postRecordTask,isLiveMode);
        }
        recorder.start();
        timer.start();
      }
    }
 else {
      if (recorder != null && recorder.isRunning()) {
        recorder.stop();
        timer.stop();
      }
    }
  }
}
 

Example 72

From project mixare, under directory /src/org/mixare/data/.

Source file: DataSourceList.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  int position=(Integer)buttonView.getTag();
  if (isChecked) {
    buttonView.setChecked(true);
  }
 else {
    buttonView.setChecked(false);
  }
  mDataSource.get(position).setEnabled(isChecked);
}
 

Example 73

From project mobilis, under directory /MXA/src/de/tudresden/inf/rn/mobilis/mxa/activities/.

Source file: ServiceMonitor.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton btn,boolean isChecked){
  if (btn == mTBtnConnection) {
    if (isChecked) {
      try {
        MXAController.get().getXMPPService().connect(mStdAckMessenger);
      }
 catch (      RemoteException e) {
        e.printStackTrace();
      }
    }
 else {
      try {
        MXAController.get().getXMPPService().disconnect(mStdAckMessenger);
      }
 catch (      RemoteException e) {
        e.printStackTrace();
      }
    }
    mTBtnConnection.setEnabled(false);
  }
}
 

Example 74

From project nantes-mobi-parkings, under directory /android/src/main/java/fr/ippon/android/opendata/android/.

Source file: ParkingCursorAdapter.java

  29 
vote

/** 
 * {@inheritDoc}
 */
public void onCheckedChanged(CompoundButton view,boolean isChecked){
  if (view != null && view.isShown()) {
    ParkingViewHolder holder=(ParkingViewHolder)view.getTag();
    if (holder.currentPark != null) {
      if (isChecked) {
        activity.favorisDao.addFavori(activity,holder.currentPark);
      }
 else {
        activity.favorisDao.removeFavori(activity,holder.currentPark);
      }
    }
  }
}
 

Example 75

From project NineOldAndroids, under directory /sample/src/com/jakewharton/nineoldandroids/sample/droidflakes/.

Source file: Droidflakes.java

  29 
vote

static void setup(final Droidflakes activity){
  CheckBox accelerated=(CheckBox)activity.findViewById(R.id.accelerated);
  accelerated.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      activity.flakeView.setLayerType(isChecked ? View.LAYER_TYPE_NONE : View.LAYER_TYPE_SOFTWARE,null);
    }
  }
);
}
 

Example 76

From project Notes, under directory /src/net/micode/notes/ui/.

Source file: NoteEditActivity.java

  29 
vote

private View getListItem(String item,int index){
  View view=LayoutInflater.from(this).inflate(R.layout.note_edit_list_item,null);
  final NoteEditText edit=(NoteEditText)view.findViewById(R.id.et_edit_text);
  edit.setTextAppearance(this,TextAppearanceResources.getTexAppearanceResource(mFontSizeId));
  CheckBox cb=((CheckBox)view.findViewById(R.id.cb_edit_item));
  cb.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      if (isChecked) {
        edit.setPaintFlags(edit.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
      }
 else {
        edit.setPaintFlags(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG);
      }
    }
  }
);
  if (item.startsWith(TAG_CHECKED)) {
    cb.setChecked(true);
    edit.setPaintFlags(edit.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    item=item.substring(TAG_CHECKED.length(),item.length()).trim();
  }
 else   if (item.startsWith(TAG_UNCHECKED)) {
    cb.setChecked(false);
    edit.setPaintFlags(Paint.ANTI_ALIAS_FLAG | Paint.DEV_KERN_TEXT_FLAG);
    item=item.substring(TAG_UNCHECKED.length(),item.length()).trim();
  }
  edit.setOnTextViewChangeListener(this);
  edit.setIndex(index);
  edit.setText(getHighlightQueryResult(item,mUserQuery));
  return view;
}
 

Example 77

From project npr-android-app, under directory /src/org/npr/android/news/.

Source file: PlaylistActivity.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  if (!isChecked) {
    return;
  }
switch (buttonView.getId()) {
case R.id.RadioButton01:
    filterUnread=isChecked;
  refreshList();
break;
case R.id.RadioButton02:
filterUnread=!isChecked;
refreshList();
break;
}
trackNow();
}
 

Example 78

From project ohmagePhone, under directory /src/org/ohmage/triggers/types/location/.

Source file: LocTrigMapsActivity.java

  29 
vote

private void showHelpDialog(){
  Dialog dialog=new Dialog(this);
  dialog.setContentView(R.layout.trigger_loc_maps_tips);
  dialog.setTitle(R.string.trigger_loc_defining_locations);
  dialog.setOwnerActivity(this);
  dialog.show();
  WebView webView=(WebView)dialog.findViewById(R.id.web_view);
  webView.loadUrl("file:///android_asset/trigger_loc_maps_help.html");
  CheckBox checkBox=(CheckBox)dialog.findViewById(R.id.check_do_not_show);
  checkBox.setChecked(shouldSkipToolTip());
  checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      SharedPreferences pref=LocTrigMapsActivity.this.getSharedPreferences(TOOL_TIP_PREF_NAME,Context.MODE_PRIVATE);
      SharedPreferences.Editor editor=pref.edit();
      editor.putBoolean(KEY_TOOL_TIP_DO_NT_SHOW,isChecked);
      editor.commit();
    }
  }
);
  Button button=(Button)dialog.findViewById(R.id.button_close);
  button.setTag(dialog);
  button.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      Object tag=v.getTag();
      if (tag != null && tag instanceof Dialog) {
        ((Dialog)tag).dismiss();
      }
    }
  }
);
}
 

Example 79

From project Ohmage_Phone, under directory /src/org/ohmage/storagemonitor/.

Source file: StorageMonitorSettingsActivity.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
switch (buttonView.getId()) {
case R.id.is_monitoring_check_box:
    if (isChecked) {
      SharedPreferences.Editor prefsEdit=getSharedPreferences("STORAGE_MONITOR_PREFS",Activity.MODE_PRIVATE).edit();
      prefsEdit.putBoolean("IS_MONITORING",true);
      prefsEdit.commit();
      Intent startIntent=new Intent(StorageMonitorSettingsActivity.this,StorageMonitorService.class);
      StorageMonitorSettingsActivity.this.startService(startIntent);
      Log.i(TAG,"Starting StorageMonitorService.");
    }
 else {
      SharedPreferences.Editor prefsEdit=getSharedPreferences("STORAGE_MONITOR_PREFS",Activity.MODE_PRIVATE).edit();
      prefsEdit.putBoolean("IS_MONITORING",false);
      prefsEdit.commit();
    }
}
}
 

Example 80

From project OpenAndroidWeather, under directory /OpenAndroidWeather/src/no/firestorm/ui/.

Source file: Settings.java

  29 
vote

private void setDownloadOnlyOnWifi(){
  final CheckBox checkbox=(CheckBox)findViewById(R.id.only_download_on_wifi);
  final boolean checked=WeatherNotificationSettings.getDownloadOnlyOnWifi(Settings.this);
  checkbox.setChecked(checked);
  checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      WeatherNotificationSettings.setDownloadOnlyOnWifi(Settings.this,isChecked);
    }
  }
);
}
 

Example 81

From project OpenBike, under directory /src/fr/openbike/android/ui/widget/.

Source file: BalloonOverlayView.java

  29 
vote

/** 
 * Create a new BalloonOverlayView.
 * @param context - The activity context.
 * @param balloonBottomOffset - The bottom padding (in pixels) to be applied when rendering this view.
 */
public BalloonOverlayView(Context context,int offset){
  super(context);
  mContext=context;
  mLinearLayout=new LinearLayout(context);
  mLinearLayout.setVisibility(VISIBLE);
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View v=inflater.inflate(R.layout.balloon_overlay,mLinearLayout);
  mTextViewTitle=(TextView)v.findViewById(R.id.balloon_name);
  mBikesTextView=(TextView)v.findViewById(R.id.balloon_bikes);
  mSlotsTextView=(TextView)v.findViewById(R.id.balloon_slots);
  mClosedTextView=(TextView)v.findViewById(R.id.balloon_closed);
  mDistanceTextView=(TextView)v.findViewById(R.id.balloon_distance);
  mFavoriteCheckBox=(CheckBox)v.findViewById(R.id.balloon_item_favorite);
  mFavoriteCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton checkBox,    boolean checked){
      OpenBikeDBAdapter.getInstance(mContext).updateFavorite(Integer.parseInt(mId),checked);
    }
  }
);
  FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  params.gravity=Gravity.NO_GRAVITY;
  addView(mLinearLayout,params);
}
 

Example 82

From project opensudoku, under directory /OpenSudoku/src/cz/romario/opensudoku/gui/inputmethod/.

Source file: IMPopupDialog.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Integer number=(Integer)buttonView.getTag();
  if (isChecked) {
    mNoteSelectedNumbers.add(number);
  }
 else {
    mNoteSelectedNumbers.remove(number);
  }
}
 

Example 83

From project opensudoku-blackberry, under directory /opensudoku/src/net/bmagro/blackberry/opensudoku/gui/inputmethod/.

Source file: IMPopupDialog.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Integer number=(Integer)buttonView.getTag();
  if (isChecked) {
    mNoteSelectedNumbers.add(number);
  }
 else {
    mNoteSelectedNumbers.remove(number);
  }
}
 

Example 84

From project Orweb, under directory /src/info/guardianproject/browser/.

Source file: SiteListAdapter.java

  29 
vote

@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  String site=(String)buttonView.getTag();
  if (isChecked) {
    try {
      mCookieManager.addToWhitelist(site,mContext);
      mCookieManager.acceptBlockedCookies(site);
    }
 catch (    URISyntaxException e) {
    }
  }
 else   mCookieManager.removeFromWhitelist(site);
}
 

Example 85

From project packages_apps_Phone_1, under directory /src/com/android/phone/.

Source file: InCallTouchUi.java

  29 
vote

@Override protected void onFinishInflate(){
  super.onFinishInflate();
  if (DBG)   log("InCallTouchUi onFinishInflate(this = " + this + ")...");
  mIncomingCallWidget=(MultiWaveView)findViewById(R.id.incomingCallWidget);
  mIncomingCallWidget.setOnTriggerListener(this);
  mInCallControls=findViewById(R.id.inCallControls);
  mAddButton=(ImageButton)mInCallControls.findViewById(R.id.addButton);
  mAddButton.setOnClickListener(this);
  mMergeButton=(ImageButton)mInCallControls.findViewById(R.id.mergeButton);
  mMergeButton.setOnClickListener(this);
  mEndButton=(ImageButton)mInCallControls.findViewById(R.id.endButton);
  mEndButton.setOnClickListener(this);
  mDialpadButton=(CompoundButton)mInCallControls.findViewById(R.id.dialpadButton);
  mDialpadButton.setOnClickListener(this);
  mMuteButton=(CompoundButton)mInCallControls.findViewById(R.id.muteButton);
  mMuteButton.setOnClickListener(this);
  mAudioButton=(CompoundButton)mInCallControls.findViewById(R.id.audioButton);
  mAudioButton.setOnClickListener(this);
  mHoldButton=(CompoundButton)mInCallControls.findViewById(R.id.holdButton);
  mHoldButton.setOnClickListener(this);
  mSwapButton=(ImageButton)mInCallControls.findViewById(R.id.swapButton);
  mSwapButton.setOnClickListener(this);
  mHoldSwapSpacer=mInCallControls.findViewById(R.id.holdSwapSpacer);
  mExtraButtonRow=(ViewGroup)mInCallControls.findViewById(R.id.extraButtonRow);
  mCdmaMergeButton=(ViewGroup)mInCallControls.findViewById(R.id.cdmaMergeButton);
  mCdmaMergeButton.setOnClickListener(this);
  mManageConferenceButton=(ViewGroup)mInCallControls.findViewById(R.id.manageConferenceButton);
  mManageConferenceButton.setOnClickListener(this);
  mManageConferenceButtonImage=(ImageButton)mInCallControls.findViewById(R.id.manageConferenceButtonImage);
  View.OnTouchListener smallerHitTargetTouchListener=new SmallerHitTargetTouchListener();
  mEndButton.setOnTouchListener(smallerHitTargetTouchListener);
}
 

Example 86

From project PinDroid, under directory /src/com/pindroid/fragment/.

Source file: AddBookmarkFragment.java

  29 
vote

@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  base=(FragmentBaseActivity)getActivity();
  setHasOptionsMenu(true);
  mEditUrl=(EditText)getView().findViewById(R.id.add_edit_url);
  mEditDescription=(EditText)getView().findViewById(R.id.add_edit_description);
  mDescriptionProgress=(ProgressBar)getView().findViewById(R.id.add_description_progress);
  mEditNotes=(EditText)getView().findViewById(R.id.add_edit_notes);
  mEditTags=(MultiAutoCompleteTextView)getView().findViewById(R.id.add_edit_tags);
  mRecommendedTags=(TextView)getView().findViewById(R.id.add_recommended_tags);
  mRecommendedProgress=(ProgressBar)getView().findViewById(R.id.add_recommended_tags_progress);
  mPopularTags=(TextView)getView().findViewById(R.id.add_popular_tags);
  mPopularProgress=(ProgressBar)getView().findViewById(R.id.add_popular_tags_progress);
  mPrivate=(CompoundButton)getView().findViewById(R.id.add_edit_private);
  mToRead=(CompoundButton)getView().findViewById(R.id.add_edit_toread);
  mRecommendedTags.setMovementMethod(LinkMovementMethod.getInstance());
  mPopularTags.setMovementMethod(LinkMovementMethod.getInstance());
  if (base.mAccount != null) {
    String[] tagArray=new String[5];
    tagArray=TagManager.GetTagsAsArray(base.mAccount.name,Tag.Name + " ASC",base).toArray(tagArray);
    ArrayAdapter<String> autoCompleteAdapter=new ArrayAdapter<String>(base,R.layout.autocomplete_view,tagArray);
    mEditTags.setAdapter(autoCompleteAdapter);
    mEditTags.setTokenizer(new SpaceTokenizer());
  }
  mEditUrl.setOnFocusChangeListener(new OnFocusChangeListener(){
    public void onFocusChange(    View v,    boolean hasFocus){
      if (!hasFocus) {
        String url=mEditUrl.getText().toString();
        if (mEditDescription.getText().toString().equals("")) {
          titleTask=new GetTitleTask().execute(url);
        }
        tagTask=new GetTagSuggestionsTask().execute(url);
      }
    }
  }
);
}
 

Example 87

From project platform_packages_apps_browser, under directory /src/com/android/browser/.

Source file: HistoryItem.java

  29 
vote

HistoryItem(Context context,boolean showStar){
  super(context);
  mStar=(CompoundButton)findViewById(R.id.star);
  mStar.setOnCheckedChangeListener(this);
  if (showStar) {
    mStar.setVisibility(View.VISIBLE);
  }
 else {
    mStar.setVisibility(View.GONE);
  }
}
 

Example 88

From project platform_packages_apps_CytownPhone, under directory /src/com/android/phone/.

Source file: SipCallOptionHandler.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  mMakePrimary=isChecked;
  if (isChecked) {
    mUnsetPriamryHint.setVisibility(View.VISIBLE);
  }
 else {
    mUnsetPriamryHint.setVisibility(View.INVISIBLE);
  }
}
 

Example 89

From project platform_packages_apps_phone, under directory /src/com/android/phone/.

Source file: InCallTouchUi.java

  29 
vote

@Override protected void onFinishInflate(){
  super.onFinishInflate();
  if (DBG)   log("InCallTouchUi onFinishInflate(this = " + this + ")...");
  mIncomingCallWidget=(GlowPadView)findViewById(R.id.incomingCallWidget);
  mIncomingCallWidget.setOnTriggerListener(this);
  mInCallControls=findViewById(R.id.inCallControls);
  mAddButton=(ImageButton)mInCallControls.findViewById(R.id.addButton);
  mAddButton.setOnClickListener(this);
  mAddButton.setOnLongClickListener(this);
  mMergeButton=(ImageButton)mInCallControls.findViewById(R.id.mergeButton);
  mMergeButton.setOnClickListener(this);
  mMergeButton.setOnLongClickListener(this);
  mEndButton=(ImageButton)mInCallControls.findViewById(R.id.endButton);
  mEndButton.setOnClickListener(this);
  mDialpadButton=(CompoundButton)mInCallControls.findViewById(R.id.dialpadButton);
  mDialpadButton.setOnClickListener(this);
  mDialpadButton.setOnLongClickListener(this);
  mMuteButton=(CompoundButton)mInCallControls.findViewById(R.id.muteButton);
  mMuteButton.setOnClickListener(this);
  mMuteButton.setOnLongClickListener(this);
  mAudioButton=(CompoundButton)mInCallControls.findViewById(R.id.audioButton);
  mAudioButton.setOnClickListener(this);
  mAudioButton.setOnLongClickListener(this);
  mHoldButton=(CompoundButton)mInCallControls.findViewById(R.id.holdButton);
  mHoldButton.setOnClickListener(this);
  mHoldButton.setOnLongClickListener(this);
  mSwapButton=(ImageButton)mInCallControls.findViewById(R.id.swapButton);
  mSwapButton.setOnClickListener(this);
  mSwapButton.setOnLongClickListener(this);
  mHoldSwapSpacer=mInCallControls.findViewById(R.id.holdSwapSpacer);
  mExtraButtonRow=(ViewStub)mInCallControls.findViewById(R.id.extraButtonRow);
  View.OnTouchListener smallerHitTargetTouchListener=new SmallerHitTargetTouchListener();
  mEndButton.setOnTouchListener(smallerHitTargetTouchListener);
}
 

Example 90

From project platform_packages_apps_settings, under directory /src/com/android/settings/.

Source file: ApnPreference.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  Log.i(TAG,"ID: " + getKey() + " :"+ isChecked);
  if (mProtectFromCheckedChange) {
    return;
  }
  if (isChecked) {
    if (mCurrentChecked != null) {
      mCurrentChecked.setChecked(false);
    }
    mCurrentChecked=buttonView;
    mSelectedKey=getKey();
    callChangeListener(mSelectedKey);
  }
 else {
    mCurrentChecked=null;
    mSelectedKey=null;
  }
}
 

Example 91

From project proxydroid, under directory /src/org/proxydroid/.

Source file: AppManager.java

  29 
vote

/** 
 * Called an application is check/unchecked
 */
@Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  final ProxyedApp app=(ProxyedApp)buttonView.getTag();
  if (app != null) {
    app.setProxyed(isChecked);
  }
  saveAppSettings(this);
}
 

Example 92

From project rbb, under directory /src/com/btmura/android/reddit/app/.

Source file: AddAccountFragment.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  TransformationMethod method=null;
  if (!isChecked) {
    method=PasswordTransformationMethod.getInstance();
  }
  password.setTransformationMethod(method);
}
 

Example 93

From project RebeLauncher, under directory /src/com/dirtypepper/rebelauncher/catalogue/.

Source file: AppInfoMList.java

  29 
vote

@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  int GroupIndex=intent.getIntExtra(EXTRA_CATALOGUE_INDEX,AppCatalogueFilters.getInstance().getDrawerFilter().getCurrentFilterIndex());
  mCatalogue=AppCatalogueFilters.getInstance().getCatalogue(GroupIndex);
  if (mCatalogue == null) {
    setResult(RESULT_CANCELED);
    finish();
    return;
  }
  requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
  setContentView(R.layout.app_group_conf_list);
  getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title1);
  List<AppListInfo> appInfos=new ArrayList<AppListInfo>();
  mAppInfoAdapter=new ApplicationListAdapter(this,appInfos);
  mAppInfoList=getListView();
  setListAdapter(mAppInfoAdapter);
  mAppInfoList.setOnCreateContextMenuListener(this);
  mAppInfoList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  mOkButton=((Button)findViewById(R.id.Button_Ok_App));
  mOkButton.setOnClickListener(this);
  CheckBox cb=(CheckBox)findViewById(R.id.checkAll);
  cb.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton buttonView,    boolean isChecked){
      updateAppList(isChecked);
    }
  }
);
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  updateAppList();
}
 

Example 94

From project reddit-is-fun, under directory /src/com/andrewshu/android/reddit/comments/.

Source file: CommentsListActivity.java

  29 
vote

public void onCheckedChanged(CompoundButton buttonView,boolean isChecked){
  removeDialog(Constants.DIALOG_COMMENT_CLICK);
  String thingFullname=mVoteTargetThing.getName();
  if (isChecked)   new VoteTask(thingFullname,1).execute();
 else   new VoteTask(thingFullname,0).execute();
}