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