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