コード例 #1
0
  private void setEnableSynchronization(int position) {

    boolean isChecked = objAdapter.getItem(position).isChecked();

    objAdapter.getItem(position).setChecked(!isChecked);
    SharedPreferencesHelper.saveBoolean(
        SharedPreferencesHelper.ENABLE_SYNCHRONIZATION, !isChecked, context);

    objAdapter.notifyDataSetChanged();
  }
コード例 #2
0
 private void setAskForLocationPermission(int position) {
   if (objAdapter.getItem(position).isChecked()) {
     objAdapter.getItem(position).setChecked(false);
     SharedPreferencesHelper.saveBoolean(
         SharedPreferencesHelper.LOCATION_PERMISSION_SHOW_AGAIN_MSG, false, getActivity());
   } else {
     objAdapter.getItem(position).setChecked(true);
     SharedPreferencesHelper.saveBoolean(
         SharedPreferencesHelper.LOCATION_PERMISSION_SHOW_AGAIN_MSG, true, getActivity());
   }
   objAdapter.notifyDataSetChanged();
 }
コード例 #3
0
 private void setRecipeAddDefaultSetting(int position) {
   if (objAdapter.getItem(position).isChecked()) {
     objAdapter.getItem(position).setChecked(false);
     SharedPreferencesHelper.saveBoolean(
         SharedPreferencesHelper.ASK_TO_ADD_DEFAULT_RECIPES, false, getActivity());
   } else {
     objAdapter.getItem(position).setChecked(true);
     SharedPreferencesHelper.saveBoolean(
         SharedPreferencesHelper.ASK_TO_ADD_DEFAULT_RECIPES, true, getActivity());
   }
   objAdapter.notifyDataSetChanged();
 }
コード例 #4
0
 private void setRecipeDeletionSetting(int position) {
   if (objAdapter.getItem(position).isChecked()) {
     objAdapter.getItem(position).setChecked(false);
     SharedPreferencesHelper.saveBoolean(
         SharedPreferencesHelper.RECIPE_DELETION_SHOW_AGAIN_MSG, false, getActivity());
   } else {
     objAdapter.getItem(position).setChecked(true);
     SharedPreferencesHelper.saveBoolean(
         SharedPreferencesHelper.RECIPE_DELETION_SHOW_AGAIN_MSG, true, getActivity());
   }
   objAdapter.notifyDataSetChanged();
 }