本文整理汇总了Java中android.widget.ListView.setItemsCanFocus方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.setItemsCanFocus方法的具体用法?Java ListView.setItemsCanFocus怎么用?Java ListView.setItemsCanFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ListView
的用法示例。
在下文中一共展示了ListView.setItemsCanFocus方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// View management
mDualPane = getResources().getBoolean(R.bool.use_dual_panes);
// Modify list view
ListView lv = getListView();
lv.setVerticalFadingEdgeEnabled(true);
// lv.setCacheColorHint(android.R.color.transparent);
if (mDualPane) {
lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
lv.setItemsCanFocus(false);
} else {
lv.setChoiceMode(ListView.CHOICE_MODE_NONE);
lv.setItemsCanFocus(true);
}
}
示例2: populateList
import android.widget.ListView; //导入方法依赖的package包/类
protected void populateList(List<ServerOption> optionList, boolean isRoot)
{
this.isRoot = isRoot;
this.currentOptionList = optionList;
final RMBTMainActivity activity = getRMBTMainActivity();
final SectionListAdapter sectionListAdapter = new SectionListAdapter(activity, R.layout.preferences_category, !isRoot);
// add filter options
if (optionList != null && optionList.size() > 0) {
for (final ServerOption option : optionList) {
if (option.isEnabled()) {
if (option.getOptionList() != null && option.getOptionList().size() > 0 && !options.isAnyChildSelected(option)) {
options.select(option.getOptionList().get(0));
}
sectionListAdapter.addSection(option.getTitle(), new MapListSectionAdapter(activity, option, isRoot));
}
}
}
final ListView listView = (ListView) view.findViewById(R.id.valueList);
listView.setAdapter(sectionListAdapter);
listView.setItemsCanFocus(true);
listView.setOnItemClickListener(this);
}
示例3: FileListView
import android.widget.ListView; //导入方法依赖的package包/类
FileListView(Commander c)
{
commander = c;
listView = (ListView) commander.findViewById(R.id.fman_list_view);
listView.setItemsCanFocus(false);
listView.setFocusableInTouchMode(true);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
listView.setOnItemClickListener(this);
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
{
TypedValue outValue = new TypedValue();
commander.getContext().getTheme().resolveAttribute(R.attr.selectableItemBackground, outValue, true);
listView.setSelector(outValue.resourceId);
}
commander.registerForContextMenu(listView);
statusPanel = (LinearLayout) commander.findViewById(R.id.fman_status_panel);
statusPanelDivider = commander.findViewById(R.id.fman_status_panel_divider);
statusBar = (TextView) commander.findViewById(R.id.fman_status_bar);
}
示例4: onCreate
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setResult(RESULT_CANCELED);
setContentView(R.layout.account_list);
ListView listView = getListView();
listView.setOnItemClickListener(this);
listView.setItemsCanFocus(false);
}
示例5: onViewCreated
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// View management
mDualPane = getResources().getBoolean(R.bool.use_dual_panes);
// Modify list view
ListView lv = getListView();
lv.setVerticalFadingEdgeEnabled(true);
// lv.setCacheColorHint(android.R.color.transparent);
if (mDualPane) {
lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
lv.setItemsCanFocus(false);
} else {
lv.setChoiceMode(ListView.CHOICE_MODE_NONE);
lv.setItemsCanFocus(true);
}
// Map long press
lv.setLongClickable(true);
lv.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> ad, View v, int pos, long id) {
turnOnActionMode();
getListView().setItemChecked(pos, true);
mMode.invalidate();
return true;
}
});
}
示例6: onCreate
import android.widget.ListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
if (!QMail.isHideSpecialAccounts()) {
createSpecialAccounts();
}
List<Account> accounts = Preferences.getPreferences(this).getAccounts();
Intent intent = getIntent();
//onNewIntent(intent);
// see if we should show the welcome message
if (ACTION_IMPORT_SETTINGS.equals(intent.getAction())) {
onImport();
} else if (accounts.size() < 1) {
WelcomeMessage.showWelcomeMessage(this);
finish();
return;
}
if (UpgradeDatabases.actionUpgradeDatabases(this, intent)) {
finish();
return;
}
boolean startup = intent.getBooleanExtra(EXTRA_STARTUP, true);
if (startup && QMail.startIntegratedInbox() && !QMail.isHideSpecialAccounts()) {
onOpenAccount(mUnifiedInboxAccount);
finish();
return;
} else if (startup && accounts.size() == 1 && onOpenAccount(accounts.get(0))) {
finish();
return;
}
requestWindowFeature(Window.FEATURE_PROGRESS);
mActionBar = getActionBar();
initializeActionBar();
setContentView(R.layout.accounts);
ListView listView = getListView();
listView.setOnItemClickListener(this);
listView.setItemsCanFocus(false);
listView.setScrollingCacheEnabled(false);
registerForContextMenu(listView);
if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) {
String accountUuid = icicle.getString("selectedContextAccount");
mSelectedContextAccount = Preferences.getPreferences(this).getAccount(accountUuid);
}
restoreAccountStats(icicle);
mHandler.setViewTitle();
// Handle activity restarts because of a configuration change (e.g. rotating the screen)
mNonConfigurationInstance = (NonConfigurationInstance) getLastNonConfigurationInstance();
if (mNonConfigurationInstance != null) {
mNonConfigurationInstance.restore(this);
}
ChangeLog cl = new ChangeLog(this);
if (cl.isFirstRun()) {
cl.getLogDialog().show();
}
}
示例7: onCreate
import android.widget.ListView; //导入方法依赖的package包/类
/******************************************************************
** Activity life cycle
******************************************************************/
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Log.d(TAG, "onCreate : intent=" + getIntent());
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
if (icicle != null) {
// Restore former activity state
mListState = icicle.getParcelable(LIST_STATE_KEY);
mListHasFocus = icicle.getBoolean(FOCUS_KEY);
}
if (Intent.ACTION_GET_CONTENT.equals(getIntent().getAction())) {
mBaseUri = VideoStore.Video.Media.EXTERNAL_CONTENT_URI;
} else {
mBaseUri = getIntent().getData();
if (mBaseUri == null) {
Log.e(TAG, "No data URI given to GET_CONTENT action");
setResult(RESULT_CANCELED);
finish();
return;
}
}
setContentView(R.layout.video_picker);
final ListView listView = getListView();
listView.setItemsCanFocus(false);
listView.setTextFilterEnabled(true);
listView.setOnItemClickListener(this);
mAdapter = new VideoListAdapter(this, listView,
R.layout.video_picker_item, new String[] {},
new int[] {});
setListAdapter(mAdapter);
// We manually save/restore the listview state
listView.setSaveEnabled(false);
mQueryHandler = new QueryHandler(this);
mProgressContainer = findViewById(R.id.progressContainer);
mListContainer = findViewById(R.id.listContainer);
mCancelButton = findViewById(R.id.cancelButton);
mCancelButton.setOnClickListener(this);
// If there is a currently selected Uri, then try to determine who it is.
if (mSelectedUri != null) {
Uri.Builder builder = mSelectedUri.buildUpon();
String path = mSelectedUri.getEncodedPath();
int idx = path.lastIndexOf('/');
if (idx >= 0) {
path = path.substring(0, idx);
}
builder.encodedPath(path);
Uri baseSelectedUri = builder.build();
if (DBG) Log.v(TAG, "Selected Uri: " + mSelectedUri);
if (DBG) Log.v(TAG, "Selected base Uri: " + baseSelectedUri);
if (DBG) Log.v(TAG, "Base Uri: " + mBaseUri);
if (baseSelectedUri.equals(mBaseUri)) {
// If the base Uri of the selected Uri is the same as our
// content's base Uri, then use the selection!
mSelectedId = ContentUris.parseId(mSelectedUri);
}
}
doQuery(false, null);
}