Search in sources :

Example 6 with ListView

use of org.holoeverywhere.widget.ListView in project little-bear-dictionary by daimajia.

the class PreferenceFragment method ensureList.

private void ensureList() {
    if (mList != null) {
        return;
    }
    View root = getView();
    if (root == null) {
        throw new IllegalStateException("Content view not yet created");
    }
    View rawListView = root.findViewById(android.R.id.list);
    if (!(rawListView instanceof ListView)) {
        throw new RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class");
    }
    mList = (ListView) rawListView;
    if (mList == null) {
        throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
    }
    mList.setOnKeyListener(mListOnKeyListener);
    mHandler.post(mRequestFocus);
}
Also used : ListView(org.holoeverywhere.widget.ListView) ListView(org.holoeverywhere.widget.ListView) View(android.view.View)

Example 7 with ListView

use of org.holoeverywhere.widget.ListView in project little-bear-dictionary by daimajia.

the class PreferenceScreen method showDialog.

@SuppressLint("NewApi")
private void showDialog(Bundle state) {
    Context context = getContext();
    if (mListView != null) {
        mListView.setAdapter(null);
    }
    final int theme = getThemeResId(context);
    LayoutInflater inflater = LayoutInflater.from(context);
    View childPrefScreen = inflater.inflate(R.layout.preference_list_fragment, null);
    mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
    bind(mListView);
    final CharSequence title = getTitle();
    final boolean titleEmpty = TextUtils.isEmpty(title);
    Dialog dialog = mDialog = new PreferenceDialog(theme);
    if (titleEmpty) {
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    } else {
        if (VERSION.SDK_INT >= 11) {
            dialog.requestWindowFeature(Window.FEATURE_ACTION_BAR);
        }
        dialog.setContentView(childPrefScreen);
        dialog.setTitle(title);
    }
    dialog.setOnDismissListener(this);
    if (state != null) {
        dialog.onRestoreInstanceState(state);
    }
    getPreferenceManager().addPreferencesScreen(dialog);
    dialog.show();
}
Also used : Context(android.content.Context) Dialog(org.holoeverywhere.app.Dialog) LayoutInflater(org.holoeverywhere.LayoutInflater) ActionBarView(com.actionbarsherlock.internal.widget.ActionBarView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(org.holoeverywhere.widget.ListView) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 8 with ListView

use of org.holoeverywhere.widget.ListView in project HoloEverywhere by Prototik.

the class PreferenceFragment method ensureList.

private void ensureList() {
    if (mList != null) {
        return;
    }
    View root = getView();
    if (root == null) {
        throw new IllegalStateException("Content view not yet created");
    }
    View rawListView = root.findViewById(android.R.id.list);
    if (!(rawListView instanceof ListView)) {
        throw new RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class");
    }
    mList = (ListView) rawListView;
    if (mList == null) {
        throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
    }
    mList.setOnKeyListener(mListOnKeyListener);
    mHandler.post(mRequestFocus);
}
Also used : ListView(org.holoeverywhere.widget.ListView) ListView(org.holoeverywhere.widget.ListView) View(android.view.View)

Example 9 with ListView

use of org.holoeverywhere.widget.ListView in project HoloEverywhere by Prototik.

the class AboutFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    ((ListView) view.findViewById(android.R.id.list)).setForceHeaderListAdapter(true);
    return view;
}
Also used : ListView(org.holoeverywhere.widget.ListView) ListView(org.holoeverywhere.widget.ListView) View(android.view.View)

Example 10 with ListView

use of org.holoeverywhere.widget.ListView in project little-bear-dictionary by daimajia.

the class ListActivity method onContentChanged.

@Override
public void onContentChanged() {
    super.onContentChanged();
    View emptyView = findViewById(android.R.id.empty);
    mList = (ListView) findViewById(android.R.id.list);
    if (mList == null) {
        throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
    }
    if (emptyView != null) {
        mList.setEmptyView(emptyView);
    }
    mList.setOnItemClickListener(mOnClickListener);
    if (mFinishedStart) {
        setListAdapter(mAdapter);
    }
    mHandler.post(mRequestFocus);
    mFinishedStart = true;
}
Also used : ListView(org.holoeverywhere.widget.ListView) View(android.view.View) AdapterView(android.widget.AdapterView)

Aggregations

ListView (org.holoeverywhere.widget.ListView)10 View (android.view.View)9 AdapterView (android.widget.AdapterView)6 SuppressLint (android.annotation.SuppressLint)2 Context (android.content.Context)2 ListAdapter (android.widget.ListAdapter)2 TextView (android.widget.TextView)2 Dialog (org.holoeverywhere.app.Dialog)2 ActionBarView (android.support.v7.internal.widget.ActionBarView)1 ActionBarView (com.actionbarsherlock.internal.widget.ActionBarView)1 LayoutInflater (org.holoeverywhere.LayoutInflater)1