use of com.aphidmobile.flip.demo.views.NumberButton in project android-flip by openaphid.
the class FlipButtonActivity 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) {
NumberButton button;
if (convertView == null) {
final Context context = parent.getContext();
button = new NumberButton(context, position);
button.setTextSize(context.getResources().getDimension(R.dimen.textSize));
} else {
button = (NumberButton) convertView;
button.setNumber(position);
}
return button;
}
});
setContentView(flipView);
}
Aggregations