本文整理匯總了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;
}
示例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)));
}
}
示例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);
}
示例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);
}
示例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);
}