Search in sources :

Example 1 with ListView

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

the class PreferenceScreen method showDialog.

@SuppressLint("NewApi")
protected void showDialog(Bundle state) {
    Context preferenceContext = getContext();
    Context context = PreferenceInit.unwrap(getContext());
    final int contextTheme = getThemeResId(context);
    if (mListView != null) {
        mListView.setAdapter(null);
    }
    View childPrefScreen = LayoutInflater.inflate(preferenceContext, R.layout.preference_list_fragment);
    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(context, contextTheme);
    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);
    onPrepareDialog(dialog);
    if (state != null) {
        dialog.onRestoreInstanceState(state);
    }
    getPreferenceManager().addPreferencesScreen(dialog);
    dialog.show();
}
Also used : Context(android.content.Context) Dialog(org.holoeverywhere.app.Dialog) ListView(org.holoeverywhere.widget.ListView) ActionBarView(android.support.v7.internal.widget.ActionBarView) View(android.view.View) AdapterView(android.widget.AdapterView) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 2 with ListView

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

the class OtherFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mAdapter = new OtherAdapter(getSupportActivity());
    onHandleData();
    boolean handleLongClick = false;
    for (int i = 0; i < mAdapter.getCount(); i++) {
        if (mAdapter.getItem(i).longClickable) {
            handleLongClick = true;
            break;
        }
    }
    ListView list = getListView();
    onPrepareListView(list);
    setListAdapter(mAdapter);
    list.setOnItemClickListener(mAdapter);
    if (handleLongClick) {
        list.setOnItemLongClickListener(mAdapter);
    }
}
Also used : ListView(org.holoeverywhere.widget.ListView)

Example 3 with ListView

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

the class ListActivity method onSupportContentChanged.

@Override
public void onSupportContentChanged() {
    super.onSupportContentChanged();
    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)

Example 4 with ListView

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

the class ListFragment method ensureList.

private void ensureList() {
    if (mList != null) {
        return;
    }
    View root = getView();
    if (root == null) {
        throw new IllegalStateException("Content view not yet created");
    }
    if (root instanceof ListView) {
        mList = (ListView) root;
    } else {
        mStandardEmptyView = (TextView) root.findViewById(R.id.internalEmpty);
        if (mStandardEmptyView == null) {
            mEmptyView = root.findViewById(android.R.id.empty);
        } else {
            mStandardEmptyView.setVisibility(View.GONE);
        }
        mProgressContainer = root.findViewById(R.id.progressContainer);
        mListContainer = root.findViewById(R.id.listContainer);
        View rawListView = root.findViewById(android.R.id.list);
        if (!(rawListView instanceof ListView)) {
            if (rawListView == null) {
                throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
            }
            throw new RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class");
        }
        mList = (ListView) rawListView;
        if (mEmptyView != null) {
            mList.setEmptyView(mEmptyView);
        } else if (mEmptyText != null) {
            mStandardEmptyView.setText(mEmptyText);
            mList.setEmptyView(mStandardEmptyView);
        }
    }
    mListShown = true;
    mList.setOnItemClickListener(mOnClickListener);
    if (mAdapter != null) {
        ListAdapter adapter = mAdapter;
        mAdapter = null;
        setListAdapter(adapter);
    } else {
        if (mProgressContainer != null) {
            setListShown(false, false);
        }
    }
    mHandler.post(mRequestFocus);
}
Also used : ListView(org.holoeverywhere.widget.ListView) ListView(org.holoeverywhere.widget.ListView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListAdapter(android.widget.ListAdapter)

Example 5 with ListView

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

the class ListFragment method ensureList.

private void ensureList() {
    if (mList != null) {
        return;
    }
    View root = getView();
    if (root == null) {
        throw new IllegalStateException("Content view not yet created");
    }
    if (root instanceof ListView) {
        mList = (ListView) root;
    } else {
        mStandardEmptyView = (TextView) root.findViewById(R.id.internalEmpty);
        if (mStandardEmptyView == null) {
            mEmptyView = root.findViewById(android.R.id.empty);
        } else {
            mStandardEmptyView.setVisibility(View.GONE);
        }
        mProgressContainer = root.findViewById(R.id.progressContainer);
        mListContainer = root.findViewById(R.id.listContainer);
        View rawListView = root.findViewById(android.R.id.list);
        if (!(rawListView instanceof ListView)) {
            if (rawListView == null) {
                throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
            }
            throw new RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class");
        }
        mList = (ListView) rawListView;
        if (mEmptyView != null) {
            mList.setEmptyView(mEmptyView);
        } else if (mEmptyText != null) {
            mStandardEmptyView.setText(mEmptyText);
            mList.setEmptyView(mStandardEmptyView);
        }
    }
    mListShown = true;
    mList.setOnItemClickListener(mOnClickListener);
    if (mAdapter != null) {
        ListAdapter adapter = mAdapter;
        mAdapter = null;
        setListAdapter(adapter);
    } else {
        if (mProgressContainer != null) {
            setListShown(false, false);
        }
    }
    mHandler.post(mRequestFocus);
}
Also used : ListView(org.holoeverywhere.widget.ListView) ListView(org.holoeverywhere.widget.ListView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListAdapter(android.widget.ListAdapter)

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