本文整理汇总了Java中com.roughike.swipeselector.SwipeItem类的典型用法代码示例。如果您正苦于以下问题:Java SwipeItem类的具体用法?Java SwipeItem怎么用?Java SwipeItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SwipeItem类属于com.roughike.swipeselector包,在下文中一共展示了SwipeItem类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelection
import com.roughike.swipeselector.SwipeItem; //导入依赖的package包/类
/**
* Gets the selection of the user
*
* @return StandaloneMode -
*/
private StandaloneActivity.StandaloneMode getSelection(){
SwipeSelector swipeSelector = (SwipeSelector) findViewById(R.id.ssStandaloneModeSelector);
SwipeItem selectedItem = swipeSelector.getSelectedItem();
int value = (Integer) selectedItem.value;
// Refer to values/arrays.xml
final int ALL_POINTS = 0;
final int ALL_POINTS_ACCORDING_SCREEN = 1;
switch ( value ){
case ALL_POINTS:
return StandaloneActivity.StandaloneMode.ALL_POINTS_WITH_CONFIG;
case ALL_POINTS_ACCORDING_SCREEN:
return StandaloneActivity.StandaloneMode.ALL_POINTS_WITH_CONFIG_ACCORDING_SCREEN;
}
return StandaloneActivity.StandaloneMode.ALL_POINTS_WITH_CONFIG;
}
示例2: initEventTypeSwipeSelector
import com.roughike.swipeselector.SwipeItem; //导入依赖的package包/类
private void initEventTypeSwipeSelector(MaterialDialog dialog, Activity activity) {
eventTypeSwipeSelector = (SwipeSelector) dialog.getCustomView().findViewById(R.id.event_type_swipe_selector);
swipeList = new SwipeItem[6];
swipeList[0] = new SwipeItem(0, activity.getResources().getString(R.string.note), activity.getResources().getString(R.string.add_note_description));
swipeList[1] = new SwipeItem(1, activity.getResources().getString(R.string.intubation), activity.getResources().getString(R.string.intubation_description));
swipeList[2] = new SwipeItem(2, activity.getResources().getString(R.string.wakeup), activity.getResources().getString(R.string.wakeup_time_description));
swipeList[3] = new SwipeItem(3, activity.getResources().getString(R.string.cramp), activity.getResources().getString(R.string.cramp_description));
swipeList[4] = new SwipeItem(4, activity.getResources().getString(R.string.narcosis_stop), activity.getResources().getString(R.string.norcosis_stop_description));
//swipeList[2] = new SwipeItem(2, activity.getResources().getString(R.string.extubation), activity.getResources().getString(R.string.extubation_description));
//swipeList[3] = new SwipeItem(3, activity.getResources().getString(R.string.sedation), activity.getResources().getString(R.string.sedation_description));
//Add new event "cramp" (krampf) and "narcosis stop"
swipeList[5] = new SwipeItem(5, activity.getResources().getString(R.string.operation_finished), activity.getResources().getString(R.string.operation_finished_description));
eventTypeSwipeSelector.setItems(swipeList);
}
示例3: getTestTypesList
import com.roughike.swipeselector.SwipeItem; //导入依赖的package包/类
public static SwipeItem[] getTestTypesList(Activity activity) {
List<TestTypes> testTypeList = Arrays.asList(TestTypes.values());
SwipeItem[] ret = new SwipeItem[testTypeList.size()];
String[] descriptions = new String[4];
descriptions[0] = activity.getResources().getString(R.string.pre_operation_description);
descriptions[1] = activity.getResources().getString(R.string.in_operation_description);
descriptions[2] = activity.getResources().getString(R.string.post_operation_description);
descriptions[3] = activity.getResources().getString(R.string.trial_description);
for (int i = 0; i < testTypeList.size(); i++) {
ret[i] = new SwipeItem(i, Type.getTranslatedType(testTypeList.get(i), activity), descriptions[i]);
}
return ret;
}
示例4: getGameTypesList
import com.roughike.swipeselector.SwipeItem; //导入依赖的package包/类
/**
* Get the gametypes and its descriptions
*
* @param activity the running activity
* @return an array on game types supported by the app
*/
public static SwipeItem[] getGameTypesList(Activity activity) {
String[] descriptions = new String[1];
descriptions[0] = activity.getResources().getString(R.string.go_game_description);
//descriptions[1] = activity.getResources().getString(R.string.go_no_go_game_description);
List<GameTypes> gameTypeList = Arrays.asList(GameTypes.values());
SwipeItem[] ret = new SwipeItem[gameTypeList.size()-1];
for (int i = 0; i < gameTypeList.size()-1; i++) {
ret[i] = new SwipeItem(i, Type.getTranslatedGameType(gameTypeList.get(i), activity), descriptions[i]);
}
return ret;
}
示例5: getInOpEventByUI
import com.roughike.swipeselector.SwipeItem; //导入依赖的package包/类
/**
* Reads all attributes of the event, which is displayed in the UI
*
* @return the InOpEvent
*/
private InOpEvent getInOpEventByUI(InOpEvent event) {
SwipeItem selectedItem = eventTypeSwipeSelector.getSelectedItem();
String eventType = null;
String note = null;
if (selectedItem != null)
eventType = selectedItem.title;
Date timestamp = DialogHelper.getDateTimeFromUI(new Date(), timePickerEditText);
if (noteEditText != null)
note = noteEditText.getText().toString();
InOpEvent inOpEvent = new InOpEvent(operationIssue, timestamp, eventType, note);
if (event != null)
inOpEvent.setCreationDate(event.getCreationDate());
return inOpEvent;
}