use of com.aphidmobile.flip.demo.views.NumberTextView 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 com.aphidmobile.flip.demo.views.NumberTextView 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 com.aphidmobile.flip.demo.views.NumberTextView in project android-flip by openaphid.
the class FlipTextViewFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
flipView = new FlipViewController(inflater.getContext());
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;
}
});
return flipView;
}
Aggregations