Java Code Examples for android.widget.ListView.setFastScrollEnabled()

The following are Jave code examples for showing how to use setFastScrollEnabled() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: CSipSimple   File: DialerFragment.java   View Source Code Vote up 4 votes
@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;
}
 
Example 2
Project: AOSP-Kayboard-7.1.2   File: UserDictionarySettings.java   View Source Code Vote up 4 votes
@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));
}