本文整理匯總了Java中com.eveningoutpost.dexdrip.Models.UserError.bySeverity方法的典型用法代碼示例。如果您正苦於以下問題:Java UserError.bySeverity方法的具體用法?Java UserError.bySeverity怎麽用?Java UserError.bySeverity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.eveningoutpost.dexdrip.Models.UserError
的用法示例。
在下文中一共展示了UserError.bySeverity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateErrors
import com.eveningoutpost.dexdrip.Models.UserError; //導入方法依賴的package包/類
public void updateErrors(boolean from_timer) {
List<Integer> severitiesList = new ArrayList<>();
PersistentStore.setBoolean("events-highcheckbox", highCheckboxView.isChecked());
PersistentStore.setBoolean("events-mediumcheckbox", mediumCheckboxView.isChecked());
PersistentStore.setBoolean("events-lowcheckbox", lowCheckboxView.isChecked());
PersistentStore.setBoolean("events-userlowcheckbox", userEventLowCheckboxView.isChecked());
PersistentStore.setBoolean("events-userhighcheckbox", userEventHighCheckboxView.isChecked());
if (highCheckboxView.isChecked()) severitiesList.add(3);
if (mediumCheckboxView.isChecked()) severitiesList.add(2);
if (lowCheckboxView.isChecked()) severitiesList.add(1);
if (userEventLowCheckboxView.isChecked()) severitiesList.add(5);
if (userEventHighCheckboxView.isChecked()) severitiesList.add(6);
if(errors == null) {
errors = UserError.bySeverity(severitiesList.toArray(new Integer[severitiesList.size()]));
if (adapter != null) adapter.notifyDataSetChanged();
} else {
if (from_timer) {
errors_tmp.clear();
errors_tmp.addAll(UserError.bySeverity(severitiesList.toArray(new Integer[severitiesList.size()])));
if (errors_tmp.size()!=errors.size())
{
errors.clear();
errors.addAll(errors_tmp);
if (adapter != null) adapter.notifyDataSetChanged();
if (d) UserError.Log.d(TAG,"Updating list with new data");
} else {
if (d) UserError.Log.d(TAG,"List sizes the same: "+errors.size());
}
} else {
errors.clear();
errors.addAll(UserError.bySeverity(severitiesList.toArray(new Integer[severitiesList.size()])));
if (adapter != null) adapter.notifyDataSetChanged();
}
}
}