当前位置: 首页>>代码示例>>Java>>正文


Java SwipeItem类代码示例

本文整理汇总了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;

}
 
开发者ID:pylapp,项目名称:SmoothClicker,代码行数:26,代码来源:StandaloneModeDialog.java

示例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);
}
 
开发者ID:lidox,项目名称:reaction-test,代码行数:15,代码来源:OperationModeView.java

示例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;
}
 
开发者ID:lidox,项目名称:reaction-test,代码行数:14,代码来源:Type.java

示例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;
}
 
开发者ID:lidox,项目名称:reaction-test,代码行数:18,代码来源:Type.java

示例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;
}
 
开发者ID:lidox,项目名称:reaction-test,代码行数:27,代码来源:OperationModeView.java


注:本文中的com.roughike.swipeselector.SwipeItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。