當前位置: 首頁>>代碼示例>>Java>>正文


Java Spinner.setEnabled方法代碼示例

本文整理匯總了Java中android.widget.Spinner.setEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Spinner.setEnabled方法的具體用法?Java Spinner.setEnabled怎麽用?Java Spinner.setEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.Spinner的用法示例。


在下文中一共展示了Spinner.setEnabled方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onFinishInflate

import android.widget.Spinner; //導入方法依賴的package包/類
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    tvAmountA = (TextView) findViewById(R.id.tvAmountA);
    tvAmountB = (TextView) findViewById(R.id.tvAmountB);
    sCurrencyA = (Spinner) findViewById(R.id.sCurrencyA);
    sCurrencyB = (Spinner) findViewById(R.id.sCurrencyB);

    ArrayAdapter<String> btcAdapter = new ArrayAdapter<String>(getContext(),
            android.R.layout.simple_spinner_item,
            new String[]{"BTC"});
    sCurrencyA.setAdapter(btcAdapter);
    sCurrencyA.setEnabled(false);
    ArrayAdapter<String> xmrAdapter = new ArrayAdapter<String>(getContext(),
            android.R.layout.simple_spinner_item,
            new String[]{"XMR"});
    sCurrencyB.setAdapter(xmrAdapter);
    sCurrencyB.setEnabled(false);
}
 
開發者ID:m2049r,項目名稱:xmrwallet,代碼行數:20,代碼來源:ExchangeBtcTextView.java

示例2: fillData

import android.widget.Spinner; //導入方法依賴的package包/類
public void fillData(View view, int type, int selection) {
	TGSelectableItem[] selectableItems = createDataValues(type);
	ArrayAdapter<TGSelectableItem> adapter = new ArrayAdapter<TGSelectableItem>(getActivity(), android.R.layout.simple_spinner_item, selectableItems);
	
	Spinner spinner = (Spinner) view.findViewById(R.id.harmonic_dlg_data_value);
	spinner.setAdapter(adapter);
	spinner.setEnabled(selectableItems.length > 0);
	spinner.setVisibility(selectableItems.length > 0 ? View.VISIBLE : View.GONE);
	if( selectableItems.length > 0 ) {
		spinner.setSelection(adapter.getPosition(new TGSelectableItem(Integer.valueOf(selection), null)));
	}
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:13,代碼來源:TGHarmonicDialog.java

示例3: updateTuningValues

import android.widget.Spinner; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
public void updateTuningValues(View view, int spinnerId, int value, boolean enabled, int visibility) {
	TGSelectableItem selection = new TGSelectableItem(Integer.valueOf(value), null);
	Spinner spinner = (Spinner) view.findViewById(spinnerId);
	spinner.setSelection(((ArrayAdapter<TGSelectableItem>)spinner.getAdapter()).getPosition(selection), false);
	spinner.setVisibility(visibility);
	spinner.setEnabled(enabled);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:9,代碼來源:TGTrackTuningDialog.java

示例4: setUp

import android.widget.Spinner; //導入方法依賴的package包/類
/**
 * This function sets up the dialog with the proper values.  If the speedOff parameters
 * has a -1 value disable both spinners
 *
 * @param color - the color to set
 * @param speedOn - the flash time in ms
 * @param speedOff - the flash length in ms
 */
private void setUp(int color, int speedOn, int speedOff, boolean onOffChangeable) {
    mInflater = (LayoutInflater) getContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = mInflater.inflate(R.layout.dialog_light_settings, null);

    mColorPicker = (ColorPickerView) layout.findViewById(R.id.color_picker_view);
    mColorPanel = (LinearLayout) layout.findViewById(R.id.color_panel_view);
    mHexColorInput = (EditText) layout.findViewById(R.id.hex_color_input);
    mNewColor = (ColorPanelView) layout.findViewById(R.id.color_panel);
    mLightsDialogDivider = (View) layout.findViewById(R.id.lights_dialog_divider);
    mPulseSpeedOn = (Spinner) layout.findViewById(R.id.on_spinner);
    mPulseSpeedOff = (Spinner) layout.findViewById(R.id.off_spinner);

    mColorPicker.setOnColorChangedListener(this);
    mColorPicker.setColor(color, true);

    mHexColorInput.setOnFocusChangeListener(this);

    if (onOffChangeable) {
        PulseSpeedAdapter pulseSpeedAdapter = new PulseSpeedAdapter(
                R.array.notification_pulse_length_entries,
                R.array.notification_pulse_length_values,
                speedOn);
        mPulseSpeedOn.setAdapter(pulseSpeedAdapter);
        mPulseSpeedOn.setSelection(pulseSpeedAdapter.getTimePosition(speedOn));
        mPulseSpeedOn.setOnItemSelectedListener(mPulseSelectionListener);

        pulseSpeedAdapter = new PulseSpeedAdapter(R.array.notification_pulse_speed_entries,
                R.array.notification_pulse_speed_values,
                speedOff);
        mPulseSpeedOff.setAdapter(pulseSpeedAdapter);
        mPulseSpeedOff.setSelection(pulseSpeedAdapter.getTimePosition(speedOff));
        mPulseSpeedOff.setOnItemSelectedListener(mPulseSelectionListener);
    } else {
        View speedSettingsGroup = layout.findViewById(R.id.speed_title_view);
        speedSettingsGroup.setVisibility(View.GONE);
    }

    mPulseSpeedOn.setEnabled(onOffChangeable);
    mPulseSpeedOff.setEnabled((speedOn != 1) && onOffChangeable);

    setView(layout);
    setTitle(R.string.edit_light_settings);

    if (!getContext().getResources().getBoolean(
            com.android.internal.R.bool.config_multiColorNotificationLed)) {
        mColorPicker.setVisibility(View.GONE);
        mColorPanel.setVisibility(View.GONE);
        mLightsDialogDivider.setVisibility(View.GONE);
    }

    mReadyForLed = true;
    updateLed();
}
 
開發者ID:ric96,項目名稱:lineagex86,代碼行數:63,代碼來源:LightSettingsDialog.java

示例5: updateOffset

import android.widget.Spinner; //導入方法依賴的package包/類
public void updateOffset(View view, boolean enabled) {
	Spinner spinner = (Spinner) view.findViewById(R.id.track_tuning_dlg_offset_value);
	spinner.setEnabled(enabled);
}
 
開發者ID:axlecho,項目名稱:tuxguitar,代碼行數:5,代碼來源:TGTrackTuningDialog.java


注:本文中的android.widget.Spinner.setEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。