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


Java Button.setSelected方法代码示例

本文整理汇总了Java中android.widget.Button.setSelected方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setSelected方法的具体用法?Java Button.setSelected怎么用?Java Button.setSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.Button的用法示例。


在下文中一共展示了Button.setSelected方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initFootView

import android.widget.Button; //导入方法依赖的package包/类
private void initFootView(OrderTestModel serializable) {

        calcle = (Button) footView.findViewById(R.id.calcle);
        calcle.setSelected(true);
        calcle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                activity.finish();
            }
        });
        commitBtn = (Button) footView.findViewById(R.id.commitBtn);
        commitBtn.setOnClickListener(this);
        fayPerson = (FaultAnalysisView) footView.findViewById(R.id.fay_person);
        fay_custom = (FaultAnalysisView) footView.findViewById(R.id.fay_custom);
        //设置绘画开关
        fayPerson.setCanPaint(true);
        fay_custom.setCanPaint(true);

    }
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:20,代码来源:TwentyTestFragment.java

示例2: onClick

import android.widget.Button; //导入方法依赖的package包/类
@OnClick({R.id.make_slot_select_1_button, R.id.make_slot_select_2_button, R.id.make_slot_select_3_button})
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.make_slot_select_1_button:
            slotRoom.setHitRatio(0.10);
            break;
        case R.id.make_slot_select_2_button:
            slotRoom.setHitRatio(0.125);
            break;
        case R.id.make_slot_select_3_button:
            slotRoom.setHitRatio(0.15);
            break;
    }

    Button[] buttons = {selectButton1, selectButton2, selectButton3};
    for (Button button: buttons) {
        button.setSelected(view.equals(button));
    }
}
 
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:20,代码来源:MakeSlotStepOneFragment.java

示例3: onClick

import android.widget.Button; //导入方法依赖的package包/类
@OnClick({R.id.make_slot_select_1_button, R.id.make_slot_select_2_button, R.id.make_slot_select_3_button})
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.make_slot_select_1_button:
            slotRoom.setMaxWinPrize(1000);
            break;
        case R.id.make_slot_select_2_button:
            slotRoom.setMaxWinPrize(1500);
            break;
        case R.id.make_slot_select_3_button:
            slotRoom.setMaxWinPrize(2000);
            break;
    }

    Button[] buttons = {selectButton1, selectButton2, selectButton3};
    for (Button button: buttons) {
        button.setSelected(view.equals(button));
    }
}
 
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:20,代码来源:MakeSlotStepThreeFragment.java

示例4: show

import android.widget.Button; //导入方法依赖的package包/类
public void show() {
    super.show();

    int i = 0;
    Button btn = null;
    Iterator<Button> iterator = mButtons.iterator();
    while (iterator.hasNext()) {
        Button button = iterator.next();
        if(button.getVisibility() != View.VISIBLE) {
            continue;
        }
        ++i;
        btn = button;
    }
    if (i == 1) {
        btn.setBackgroundResource(R.drawable.btn_dialog_single);
    }
    if (i == 2) {
        btn.setSelected(true);
        ((ViewGroup.MarginLayoutParams)(this.mButtons.get(0)).getLayoutParams()).rightMargin = 1;
    }
    if (i == 3)  {
        btn.setSelected(true);
        ((ViewGroup.MarginLayoutParams)(this.mButtons.get(2)).getLayoutParams()).leftMargin = 1;
        ((ViewGroup.MarginLayoutParams)(this.mButtons.get(0)).getLayoutParams()).rightMargin = 1;
    }

}
 
开发者ID:NewCasino,项目名称:browser,代码行数:29,代码来源:ECAlertDialog.java

示例5: collapse

import android.widget.Button; //导入方法依赖的package包/类
/**
 * change to collapse image of button and display meal information
 *
 * @param when Integer constant of meal time to collapse
 */
private void collapse(int when) {
    TextView textView = null;
    Button button = null;
    String mealMenu = null;

    switch (when) {
        case BREAKFAST:
            textView = mBreakfastTV;
            button = mBreakfastExpandBtn;
            if (mSelectedDayMeal != null) mealMenu = mSelectedDayMeal.getBreakfast();
            break;
        case LUNCH:
            textView = mLunchTV;
            button = mLunchExpandBtn;
            if (mSelectedDayMeal != null) mealMenu = mSelectedDayMeal.getLunch();
            break;
        case DINNER:
            textView = mDinnerTV;
            button = mDinnerExpandBtn;
            if (mSelectedDayMeal != null) mealMenu = mSelectedDayMeal.getDinner();
            break;
        default:
            break;
    }

    textView.setText(mealMenu);
    button.setText(R.string.meal_allergy);

    Drawable moreDrawable =
            ContextCompat.getDrawable(getContext(), R.drawable.ic_expand_more_white_18dp);
    button.setCompoundDrawablesWithIntrinsicBounds(null, null, moreDrawable, null);

    button.setSelected(false);
}
 
开发者ID:DSM-DMS,项目名称:DMS,代码行数:40,代码来源:MealFragment.java

示例6: expand

import android.widget.Button; //导入方法依赖的package包/类
/**
 * change to expand image of button and display allergy information
 *
 * @param when Integer constant of meal time to expand
 */
private void expand(int when) {
    TextView textView = null;
    Button button = null;
    String mealAllergy = null;

    switch (when) {
        case BREAKFAST:
            textView = mBreakfastTV;
            button = mBreakfastExpandBtn;
            if (mSelectedDayMeal != null) mealAllergy = mSelectedDayMeal.getBreakfastAllergy();
            break;
        case LUNCH:
            textView = mLunchTV;
            button = mLunchExpandBtn;
            if (mSelectedDayMeal != null) mealAllergy = mSelectedDayMeal.getLunchAllergy();
            break;
        case DINNER:
            textView = mDinnerTV;
            button = mDinnerExpandBtn;
            if (mSelectedDayMeal != null) mealAllergy = mSelectedDayMeal.getDinnerAllergy();
            break;
        default:
            break;
    }

    textView.setText(mealAllergy);
    button.setText(R.string.meal_meal);

    Drawable lessDrawable =
            ContextCompat.getDrawable(getContext(), R.drawable.ic_expand_less_white_18dp);
    lessDrawable.setColorFilter(
            ContextCompat.getColor(getContext(), R.color.colorPrimary), PorterDuff.Mode.MULTIPLY);
    button.setCompoundDrawablesWithIntrinsicBounds(null, null, lessDrawable, null);

    button.setSelected(true);
}
 
开发者ID:DSM-DMS,项目名称:DMS,代码行数:42,代码来源:MealFragment.java

示例7: onCreate

import android.widget.Button; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // 取得地圖物件
    setContentView(R.layout.activity_maps);
    mLayoutContainer = (ViewGroup) findViewById(R.id.layout_container);
    mMapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mMapFragment.getMapAsync(this);

    // For tracking, Create an instance of GoogleAPIClient and LocationRequest.
    configGoogleApiClient();
    configLocationRequest();

    // Buttons on map
    mSwitchBtn = (Button) findViewById(R.id.btn_switch);
    mTrackingBtn = (Button) findViewById(R.id.btn_tracking);
    mPickTilesBtn = (Button) findViewById(R.id.btn_pick_tiles);
    mGpxManagerBtn = (Button) findViewById(R.id.btn_gpx_files_list);
    mPoiSearchBtn = (Button) findViewById(R.id.btn_search);

    mBtnsSet.add(mPickTilesBtn);
    mBtnsSet.add(mTrackingBtn);
    mBtnsSet.add(mGpxManagerBtn);
    mBtnsSet.add(mPoiSearchBtn);

    mSwitchBtn.setOnClickListener(this);
    for (View btn : mBtnsSet) {
        btn.setOnClickListener(this);
    }

    // Add center cross into main map
    mCrossSet.add(MAP_CODE_MAIN, (ImageView) findViewById(R.id.cross));

    // 取得ActionBar
    mActionBar = getSupportActionBar();

    // 還原各項設定
    SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);
    // 檢查是否紀錄航跡中
    mTrackingBtn.setSelected(prefs.getBoolean("isTracking", false));
    if (mTrackingBtn.isSelected()) {
        // bind TrackingService
        Intent bindIntent = new Intent(this, TrackingService.class);
        bindService(bindIntent, this, BIND_AUTO_CREATE);
    }

    // 取得上次相機位置
    LatLng lastTarget = new LatLng(prefs.getFloat(
            "cameraLat", (float) TAIWAN_CENTER.latitude),
            prefs.getFloat("cameraLon", (float) TAIWAN_CENTER.longitude));
    Float lastZoom = prefs.getFloat("cameraZoom", STARTING_ZOOM);
    lastCameraPosition = new CameraPosition(lastTarget, lastZoom, 0, 0);

    // 取得已開啟的GPX檔案
    mGpxFileList = prefs.getStringSet("gpxFiles", mGpxFileList);

    // 取得POI檔案
    poiFile = prefs.getString("poiFile", null);

    // 取得離線地圖檔案
    mapFile = prefs.getString("mapFile", null);
    themeFile = prefs.getString("themeFile", null);

    // 還原座標表示設定
    CoorSysList.coorSetting = prefs.getInt("coorSetting", COOR_WGS84_D);
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:68,代码来源:MapsActivity.java

示例8: clearSelectedState

import android.widget.Button; //导入方法依赖的package包/类
private void clearSelectedState(Button item) {
    item.setSelected(false);
}
 
开发者ID:parkingwang,项目名称:vehicle-keyboard-android,代码行数:4,代码来源:InputView.java

示例9: setSelectedState

import android.widget.Button; //导入方法依赖的package包/类
private void setSelectedState(Button cell) {
    for (Button btn : mButtonItems) {
        btn.setSelected((btn == cell));
    }
}
 
开发者ID:parkingwang,项目名称:vehicle-keyboard-android,代码行数:6,代码来源:InputView.java


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