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


Java Spinner.setVisibility方法代碼示例

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


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

示例1: onCreateView

import android.widget.Spinner; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    View rootView = super.onCreateView(inflater, container, savedInstanceState);

    Button addSpellButton = rootView.findViewById(R.id.addSpellButton);
    Spinner chooseSpellSpinner = rootView
            .findViewById(R.id.chooseSpellSpinner);
    View separator = rootView.findViewById(R.id.spellChooserSeparator);

    chooseSpellSpinner.setVisibility(View.INVISIBLE);
    addSpellButton.setVisibility(View.INVISIBLE);
    separator.setVisibility(View.INVISIBLE);

    return rootView;
}
 
開發者ID:joaomneto,項目名稱:TitanCompanion,代碼行數:18,代碼來源:POFAdventureSpellsFragment.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: checkEventBus

import android.widget.Spinner; //導入方法依賴的package包/類
public void checkEventBus(View v) {
    Spinner spinnerThread = (Spinner) findViewById(R.id.spinnerThread);
    CheckBox checkBoxEventBus = (CheckBox) findViewById(R.id.checkBoxEventBus);
    int visibility = checkBoxEventBus.isChecked() ? View.VISIBLE : View.GONE;
    spinnerThread.setVisibility(visibility);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:TestSetupActivity.java

示例5: prepareRestoreWalletDialog

import android.widget.Spinner; //導入方法依賴的package包/類
private void prepareRestoreWalletDialog(final Dialog dialog) {
    final AlertDialog alertDialog = (AlertDialog) dialog;

    final String path;
    final String backupPath = Constants.Files.EXTERNAL_WALLET_BACKUP_DIR.getAbsolutePath();
    final String storagePath = Constants.Files.EXTERNAL_STORAGE_DIR.getAbsolutePath();
    if (backupPath.startsWith(storagePath))
        path = backupPath.substring(storagePath.length());
    else
        path = backupPath;

    final List<File> files = new LinkedList<File>();

    // external storage
    final File[] externalFiles = Constants.Files.EXTERNAL_WALLET_BACKUP_DIR.listFiles();
    if (externalFiles != null)
        for (final File file : externalFiles)
            if (Crypto.OPENSSL_FILE_FILTER.accept(file))
                files.add(file);

    // internal storage
    for (final String filename : fileList())
        if (filename.startsWith(Constants.Files.WALLET_KEY_BACKUP_PROTOBUF + '.'))
            files.add(new File(getFilesDir(), filename));

    // sort
    Collections.sort(files, new Comparator<File>() {
        @Override
        public int compare(final File lhs, final File rhs) {
            return lhs.getName().compareToIgnoreCase(rhs.getName());
        }
    });

    final TextView messageView = (TextView) alertDialog.findViewById(R.id.restore_wallet_dialog_message);
    messageView.setText(getString(
            !files.isEmpty() ? R.string.import_keys_dialog_message : R.string.restore_wallet_dialog_message_empty,
            path));

    final Spinner fileView = (Spinner) alertDialog.findViewById(R.id.import_keys_from_storage_file);
    fileView.setVisibility(!files.isEmpty() ? View.VISIBLE : View.GONE);
    final FileAdapter adapter = (FileAdapter) fileView.getAdapter();
    adapter.setFiles(files);

    final EditText passwordView = (EditText) alertDialog.findViewById(R.id.import_keys_from_storage_password);
    passwordView.setVisibility(!files.isEmpty() ? View.VISIBLE : View.GONE);
    passwordView.setText(null);

    final CheckBox showView = (CheckBox) alertDialog.findViewById(R.id.import_keys_from_storage_show);
    showView.setVisibility(!files.isEmpty() ? View.VISIBLE : View.GONE);
    showView.setOnCheckedChangeListener(new ShowPasswordCheckListener(passwordView));

    final View replaceWarningView = alertDialog
            .findViewById(R.id.restore_wallet_from_storage_dialog_replace_warning);
    final boolean hasCoins = wallet.getBalance(BalanceType.ESTIMATED).signum() > 0;
    replaceWarningView.setVisibility(hasCoins ? View.VISIBLE : View.GONE);

    final ImportDialogButtonEnablerListener dialogButtonEnabler = new ImportDialogButtonEnablerListener(
            passwordView, alertDialog) {
        @Override
        protected boolean hasFile() {
            return fileView.getSelectedItem() != null;
        }

        @Override
        protected boolean needsPassword() {
            final File selectedFile = (File) fileView.getSelectedItem();
            return selectedFile != null ? Crypto.OPENSSL_FILE_FILTER.accept(selectedFile) : false;
        }
    };
    passwordView.addTextChangedListener(dialogButtonEnabler);
    fileView.setOnItemSelectedListener(dialogButtonEnabler);
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:73,代碼來源:WalletActivity.java


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