Пример #1
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
   Log.d(
       TAG,
       "positiveResult = "
           + positiveResult
           + " mIndex = "
           + mIndex
           + " mClickedDialogEntryIndex = "
           + mClickedDialogEntryIndex);
   // / M: Dialog dismiss is asynchronous, so hot-swap may reset the
   // mEntryValues
   if (positiveResult
       && mIndex != mClickedDialogEntryIndex
       && mEntryValues.size() > mClickedDialogEntryIndex) {
     // get the selected values --- simId
     long simId = mEntryValues.get(mClickedDialogEntryIndex);
     // pass simId to onPreferenceChangeListener
     if (callChangeListener(simId)) {
       mIndex = mClickedDialogEntryIndex;
       mAdapter.notifyDataSetChanged();
     }
   }
 }
Пример #2
0
 private CharSequence getPrefSummary(int index) {
   String summary = null;
   Object item = mAdapter.getItem(index);
   if (item instanceof SubInfoRecord) {
     SubInfoRecord simItem = (SubInfoRecord) item;
     summary = simItem.displayName;
   } else if (item instanceof AccountElements) {
     summary = ((AccountElements) item).getName();
   }
   return summary;
 }
Пример #3
0
 public void updateSubStatus(long subId, Boolean status) {
   int listIndex = 0;
   for (SubInfoRecord item : mSubItems) {
     if (item.subId == subId) {
       if (mItemStatus.size() != 0) {
         mItemStatus.set(listIndex, status);
         mAdapter.notifyDataSetChanged();
       }
     }
     listIndex++;
   }
 }
Пример #4
0
 /**
  * Sets the index of given value
  *
  * @param value one values of the entries
  */
 public void setValue(long value) {
   mIndex = findIndexOfValue(value);
   if (mIndex >= 0) {
     setSummary(getPrefSummary(mIndex));
   } else {
     // / M: if can not find the Index Value, means the subcard has all
     // plug out,
     // just reset the summary to null. @{
     setSummary(null);
   }
   mAdapter.notifyDataSetChanged();
   // @}
 }
Пример #5
0
 public void setEnableNormalItem(boolean isEnabled) {
   mEnableNormalItem = isEnabled;
   mAdapter.notifyDataSetChanged();
 }
Пример #6
0
 public int getItemCount() {
   return mAdapter.getCount();
 }
Пример #7
0
 public void updateSubInfoList(List<SubInfoRecord> simValues) {
   mSubItems = simValues;
   mAdapter.notifyDataSetChanged();
 }