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


Java ListView.setItemsCanFocus方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:20,代碼來源:ConversationsListFragment.java

示例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);
}
 
開發者ID:rtr-nettest,項目名稱:open-rmbt,代碼行數:26,代碼來源:RMBTMapFilterFragment.java

示例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);
}
 
開發者ID:mkulesh,項目名稱:microMathematics,代碼行數:20,代碼來源:FileListView.java

示例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);
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:13,代碼來源:AccountList.java

示例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;
        }
    });
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:34,代碼來源:CallLogListFragment.java

示例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();
    }
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:67,代碼來源:Accounts.java

示例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);
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:75,代碼來源:VideoPicker.java


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