当前位置: 首页>>代码示例>>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;未经允许,请勿转载。