use of android.widget.BaseAdapter in project PreLollipopTransition by takahirom.
the class ListViewFragment method onCreateView.
@Nullable
@Override
public View onCreateView(final LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View inflate = inflater.inflate(R.layout.fragment_list_view, container, false);
final ListView listView = (ListView) inflate.findViewById(R.id.list);
listView.setAdapter(new BaseAdapter() {
@Override
public int getCount() {
return 10;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return inflater.inflate(R.layout.list_row, parent, false);
}
});
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final Intent intent = new Intent(getContext(), SubActivity.class);
ActivityTransitionLauncher.with(getActivity()).from(view.findViewById(R.id.image)).launch(intent);
}
});
return inflate;
}
use of android.widget.BaseAdapter in project xabber-android by redsolution.
the class PreferencesFragment method onResume.
@Override
public void onResume() {
super.onResume();
BaseAdapter adapter = (BaseAdapter) getPreferenceScreen().getRootAdapter();
adapter.notifyDataSetChanged();
PreferenceManager.getDefaultSharedPreferences(getActivity()).registerOnSharedPreferenceChangeListener(this);
}
use of android.widget.BaseAdapter in project SuperRecyclerView by Malinskiy.
the class SwipeLayout method isDisabledInAdapterView.
/**
* if working in {@link android.widget.AdapterView}, we should response {@link android.widget.Adapter}
* isEnable(int position).
*
* @return true when item is enabled, else disabled.
*/
private boolean isDisabledInAdapterView() {
AdapterView adapterView = getAdapterView();
boolean enable = true;
if (adapterView != null) {
Adapter adapter = adapterView.getAdapter();
if (adapter != null) {
int p = adapterView.getPositionForView(SwipeLayout.this);
if (adapter instanceof BaseAdapter) {
enable = ((BaseAdapter) adapter).isEnabled(p);
} else if (adapter instanceof ListAdapter) {
enable = ((ListAdapter) adapter).isEnabled(p);
}
}
}
return !enable;
}
Aggregations