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

The following are Jave code examples for showing how to use setTextFilterEnabled() 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: QuranAndroid   File: TranslationsActivity.java   View Source Code Vote up 5 votes
/**
 * Function to init activity view
 */
private void init() {

    //init views
    adapter = new TranslationAdapter(this);
    translationManagmentList = (ListView) findViewById(R.id.download);
    translationManagmentList.setOnItemClickListener(this);
    translationManagmentList.setTextFilterEnabled(true);
    translationManagmentList.setEmptyView(findViewById(R.id.progressBar3));
    translationManagmentList.setAdapter(adapter);

    //async thread to load translations
    new TafaseerLists().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
 
Example 2
Project: QuranAndroid   File: TranslationsActivity.java   View Source Code Vote up 5 votes
/**
 * Function to init activity view
 */
private void init() {

    //init views
    adapter = new TranslationAdapter(this);
    translationManagmentList = (ListView) findViewById(R.id.download);
    translationManagmentList.setOnItemClickListener(this);
    translationManagmentList.setTextFilterEnabled(true);
    translationManagmentList.setEmptyView(findViewById(R.id.progressBar3));
    translationManagmentList.setAdapter(adapter);

    //async thread to load translations
    new TafaseerLists().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
 
Example 3
Project: ThunderMusic   File: WeekSelector.java   View Source Code Vote up 5 votes
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);

    setContentView(R.layout.weekpicker);
    ListView mWeeks = getListView();
    mWeeks.setTextFilterEnabled(true);
    setTitle(R.string.weekpicker_title);
}
 
Example 4
Project: ZhiHuIndex-master   File: SearchActivity.java   View Source Code Vote up 5 votes
private void initView() {
        searchView=(SearchView)findViewById(R.id.search_view);
        tv_tip=(TextView)findViewById(R.id.tv_tip);
        tv_clear=(TextView)findViewById(R.id.tv_clear);
        listview=(ListView)findViewById(R.id.listView);
        listview.setTextFilterEnabled(true);
}
 
Example 5
Project: aos-Video   File: VideoPicker.java   View Source Code Vote up 4 votes
/******************************************************************
** 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);
}
 
Example 6
Project: aos-Video   File: AutoScraperActivity.java   View Source Code Vote up 4 votes
@Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        getWindow().setFlags(LayoutParams.FLAG_NOT_TOUCH_MODAL, LayoutParams.FLAG_NOT_TOUCH_MODAL);
        getWindow().setFlags(LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH);

        // Notify the application that the activity has started
        CustomApplication app = (CustomApplication)getApplication();
        app.setAutoScraperActive(true);
        mScraper = new Scraper(this);

        // Check if the intent which created this activity contains a folder path
        Uri folderUri = getIntent().getData();
        if (folderUri != null) {
            mFolderMode = true;
            // FIXME: this is broken for smb:// files
            mFolderPath = folderUri.getPath();
            if (DBG) Log.d(TAG, "onCreate : search in folder " + mFolderPath);
        }
        else {
            mFolderMode = false;
            mFolderPath = null;
            if (DBG) Log.d(TAG, "onCreate : search in the full database");
        }

        setContentView(R.layout.auto_scraper_main);

        mMainView = findViewById(R.id.main_view);
        mAbortButton = (Button)findViewById(R.id.abort_button);
        mAbortButton.setOnClickListener(this);
        mExitButton = (Button)findViewById(R.id.exit_button);
        mExitButton.setOnClickListener(this);

        mListView = (ListView) findViewById(R.id.list_items);
        mListView.setTextFilterEnabled(true);
        mListView.setCacheColorHint(0);
        mListView.setSelector(R.drawable.list_selector_no_background);
        mListView.setOnCreateContextMenuListener(this);
        mListView.setOnScrollListener(this);
        mListView.setOnKeyListener(this);

        mActivityFileCursor = getFileListCursor();
        getColumnIndices(mActivityFileCursor);
        buildFileProperties(mActivityFileCursor);
        mAdapterFileCursor = buildAdapterCursor(mActivityFileCursor);

        mAdapter = new AutoScraperAdapter(getApplication(), this,
                                          R.layout.auto_scraper_item,
                                          mAdapterFileCursor);
        mListView.setAdapter(mAdapter);
/*
        if (!mListView.isInTouchMode()) {
            // The application is remotely controlled => set the focus by default
            // on the Cancel button so that the user can abort the task with a 
            // single click instead of navigating the full ListView
            mAbortButton.requestFocus();
        }
*/
        mEmptyView = buildEmptyView();
        mListView.setEmptyView(mEmptyView);
        updateControlButtons(false);
        if (mFileCount > 0) {
            mMainView.setVisibility(View.VISIBLE);
        }
        else {
            mMainView.setVisibility(View.GONE);
        }

        mIsLargeScreen = getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE)|| TVUtils.isTV(this);

        PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, "AutoScraperActivity");
    }