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);
}
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();
}
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);
}
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;
}
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;
}
Aggregations