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


Java ListView.setFastScrollEnabled方法代碼示例

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


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

示例1: onCreateView

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

    View v = inflater.inflate(R.layout.dialer_digit, container, false);
    // Store the backgrounds objects that will be in use later
    /*
    Resources r = getResources();
    
    digitsBackground = r.getDrawable(R.drawable.btn_dial_textfield_active);
    digitsEmptyBackground = r.getDrawable(R.drawable.btn_dial_textfield_normal);
    */

    // Store some object that could be useful later
    digits = (DigitsEditText) v.findViewById(R.id.digitsText);
    dialPad = (Dialpad) v.findViewById(R.id.dialPad);
    callBar = (DialerCallBar) v.findViewById(R.id.dialerCallBar);
    autoCompleteList = (ListView) v.findViewById(R.id.autoCompleteList);
    rewriteTextInfo = (TextView) v.findViewById(R.id.rewriteTextInfo);
    
    accountChooserButton = (AccountChooserButton) v.findViewById(R.id.accountChooserButton);
    
    accountChooserFilterItem = accountChooserButton.addExtraMenuItem(R.string.apply_rewrite);
    accountChooserFilterItem.setCheckable(true);
    accountChooserFilterItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            setRewritingFeature(!accountChooserFilterItem.isChecked());
            return true;
        }
    });
    setRewritingFeature(prefsWrapper.getPreferenceBooleanValue(SipConfigManager.REWRITE_RULES_DIALER));
    
    dialerLayout = (DialerLayout) v.findViewById(R.id.top_digit_dialer);
    //switchTextView = (ImageButton) v.findViewById(R.id.switchTextView);

    // isTablet = Compatibility.isTabletScreen(getActivity());

    // Digits field setup
    if(savedInstanceState != null) {
        isDigit = savedInstanceState.getBoolean(TEXT_MODE_KEY, isDigit);
    }
    
    digits.setOnEditorActionListener(keyboardActionListener);
    
    // Layout 
    dialerLayout.setForceNoList(mDualPane);
    dialerLayout.setAutoCompleteListVisibiltyChangedListener(this);

    // Account chooser button setup
    accountChooserButton.setShowExternals(true);
    accountChooserButton.setOnAccountChangeListener(accountButtonChangeListener);

    // Dialpad
    dialPad.setOnDialKeyListener(this);

    // We only need to add the autocomplete list if we
    autoCompleteList.setAdapter(autoCompleteAdapter);
    autoCompleteList.setOnItemClickListener(autoCompleteListItemListener);
    autoCompleteList.setFastScrollEnabled(true);

    // Bottom bar setup
    callBar.setOnDialActionListener(this);
    callBar.setVideoEnabled(prefsWrapper.getPreferenceBooleanValue(SipConfigManager.USE_VIDEO));

    //switchTextView.setVisibility(Compatibility.isCompatible(11) ? View.GONE : View.VISIBLE);

    // Init other buttons
    initButtons(v);
    // Ensure that current mode (text/digit) is applied
    setTextDialing(!isDigit, true);
    if(initText != null) {
        digits.setText(initText);
        initText = null;
    }

    // Apply third party theme if any
    applyTheme(v);
    v.setOnKeyListener(this);
    applyTextToAutoComplete();
    return v;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:82,代碼來源:DialerFragment.java

示例2: onActivityCreated

import android.widget.ListView; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    final Intent intent = getActivity().getIntent();
    final String localeFromIntent =
            null == intent ? null : intent.getStringExtra("locale");

    final Bundle arguments = getArguments();
    final String localeFromArguments =
            null == arguments ? null : arguments.getString("locale");

    final String locale;
    if (null != localeFromArguments) {
        locale = localeFromArguments;
    } else if (null != localeFromIntent) {
        locale = localeFromIntent;
    } else {
        locale = null;
    }

    mLocale = locale;
    // WARNING: The following cursor is never closed! TODO: don't put that in a member, and
    // make sure all cursors are correctly closed. Also, this comes from a call to
    // Activity#managedQuery, which has been deprecated for a long time (and which FORBIDS
    // closing the cursor, so take care when resolving this TODO). We should either use a
    // regular query and close the cursor, or switch to a LoaderManager and a CursorLoader.
    mCursor = createCursor(locale);
    TextView emptyView = (TextView) getView().findViewById(android.R.id.empty);
    emptyView.setText(R.string.user_dict_settings_empty_text);

    final ListView listView = getListView();
    listView.setAdapter(createAdapter());
    listView.setFastScrollEnabled(true);
    listView.setEmptyView(emptyView);

    setHasOptionsMenu(true);
    // Show the language as a subtitle of the action bar
    getActivity().getActionBar().setSubtitle(
            UserDictionarySettingsUtils.getLocaleDisplayName(getActivity(), mLocale));
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:42,代碼來源:UserDictionarySettings.java


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