use of android.widget.BaseAdapter in project bee by orhanobut.
the class UiHandler method initSettingsContent.
void initSettingsContent(List<MethodInfo> list) {
BaseAdapter adapter = SettingsAdapter.newInstance(context, list);
listView.setAdapter(adapter);
}
use of android.widget.BaseAdapter in project android-flip by openaphid.
the class FlipTextViewActivity method onCreate.
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(R.string.activity_title);
flipView = new FlipViewController(this);
flipView.setAdapter(new BaseAdapter() {
@Override
public int getCount() {
return 10;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
NumberTextView view;
if (convertView == null) {
final Context context = parent.getContext();
view = new NumberTextView(context, position);
view.setTextSize(context.getResources().getDimension(R.dimen.textSize));
} else {
view = (NumberTextView) convertView;
view.setNumber(position);
}
return view;
}
});
setContentView(flipView);
}
use of android.widget.BaseAdapter in project android-flip by openaphid.
the class FlipTextViewXmlActivity method onCreate.
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(R.string.activity_title);
setContentView(R.layout.xml_layout);
flipView = (FlipViewController) findViewById(R.id.flipView);
flipView.setAdapter(new BaseAdapter() {
@Override
public int getCount() {
return 10;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
NumberTextView view;
if (convertView == null) {
final Context context = parent.getContext();
view = new NumberTextView(context, position);
view.setTextSize(context.getResources().getDimension(R.dimen.textSize));
} else {
view = (NumberTextView) convertView;
view.setNumber(position);
}
return view;
}
});
}
use of android.widget.BaseAdapter in project android-vertical-slide-view by xmuSistone.
the class VerticalFragment2 method initView.
/**
* 初始化ListView
*
* @param rootView
* 根View
*/
private void initView(View rootView) {
ListView listview = (ListView) rootView.findViewById(R.id.fragment2_listview);
ListAdapter adapter = new BaseAdapter() {
private LayoutInflater inflater;
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (inflater == null) {
inflater = LayoutInflater.from(getActivity());
}
if (null == convertView) {
convertView = inflater.inflate(R.layout.fragment2_list_item, null);
}
return convertView;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public int getCount() {
return 100;
}
};
listview.setAdapter(adapter);
}
use of android.widget.BaseAdapter in project android_frameworks_base by ResurrectionRemix.
the class AppWidgetHostView method viewDataChanged.
/**
* Process data-changed notifications for the specified view in the specified
* set of {@link RemoteViews} views.
*/
void viewDataChanged(int viewId) {
View v = findViewById(viewId);
if ((v != null) && (v instanceof AdapterView<?>)) {
AdapterView<?> adapterView = (AdapterView<?>) v;
Adapter adapter = adapterView.getAdapter();
if (adapter instanceof BaseAdapter) {
BaseAdapter baseAdapter = (BaseAdapter) adapter;
baseAdapter.notifyDataSetChanged();
} else if (adapter == null && adapterView instanceof RemoteAdapterConnectionCallback) {
// If the adapter is null, it may mean that the RemoteViewsAapter has not yet
// connected to its associated service, and hence the adapter hasn't been set.
// In this case, we need to defer the notify call until it has been set.
((RemoteAdapterConnectionCallback) adapterView).deferNotifyDataSetChanged();
}
}
}
Aggregations