本文整理汇总了Java中kankan.wheel.widget.WheelView类的典型用法代码示例。如果您正苦于以下问题:Java WheelView类的具体用法?Java WheelView怎么用?Java WheelView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WheelView类属于kankan.wheel.widget包,在下文中一共展示了WheelView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setYear
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
private void setYear() {
if (this.maxYear == 0) {
this.maxYear = DateNumericAdapter.DEFAULT_MAX_YEAR;
}
this.year = (WheelView) findViewById(R.id.year);
int curYear = this.calendar.get(1);
if (this.minYear != 0) {
this.year.setViewAdapter(new DateNumericAdapter(this.ctx, this.minYear, this.maxYear,
curYear - this.minYear, false));
this.year.setCurrentItem(this.clone.get(1) - this.minYear);
} else {
this.year.setViewAdapter(new DateNumericAdapter(this, this.ctx, curYear - 1930));
this.year.setCurrentItem(this.clone.get(1) - 1930);
}
this.year.addChangingListener(this.listener);
}
示例2: onCreateView
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// ---Inflate the layout for this fragment---
View rootView = inflater.inflate(R.layout.fragment2, container, false);
wheelView = (WheelView)rootView.findViewById(R.id.wheelView);
wheelView.setVisibleItems(5);
wheelView.setCyclic(true);
wheelView.setViewAdapter(new AbstractWheelTextAdapter(getActivity(), R.layout.wheel_text_view)
{
@Override
protected CharSequence getItemText(int index)
{
return new Date( ( (new Date().getTime())/1000+index)*1000 ).toString();
}
@Override
public int getItemsCount() {
return 60;
}
});
return rootView;
}
示例3: initTargetView
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
private void initTargetView() {
for (int i = 0; i < this.targetIndex.length; i++) {
this.targetList.add(this.targetIndex[i] + "000" + " 步 " + SocializeConstants
.OP_OPEN_PAREN + StepCounterUtil.getCalory(this.targetIndex[i].intValue() *
1000) + " 千卡" + SocializeConstants.OP_CLOSE_PAREN);
}
WheelUtils.setWheelArrayText(this.wheelTarget, this.ctx, (String[]) this.targetList
.toArray(new String[this.targetList.size()]));
this.wheelTarget.addChangingListener(new OnWheelChangedListener() {
public void onChanged(WheelView wheel, int oldValue, int newValue) {
WheelUtils.setHighlightArray(StepHistoryActivity.this.wheelTarget,
StepHistoryActivity.this.ctx, (String[]) StepHistoryActivity.this
.targetList.toArray(new String[StepHistoryActivity.this
.targetList.size()]), newValue);
StepHistoryActivity.this.currentIndex = newValue;
StepHistoryActivity.this.targetValue = StepHistoryActivity.this
.targetIndex[StepHistoryActivity.this.currentIndex].intValue() * 1000;
}
});
}
示例4: inject
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
public void inject(Finder finder, final T target, Object source) {
target.tvTitle = (TextView) finder.castView((View) finder.findRequiredView(source, R.id
.tv_title, "field 'tvTitle'"), R.id.tv_title, "field 'tvTitle'");
target.wheelDate = (WheelView) finder.castView((View) finder.findRequiredView(source, R
.id.wheel_date, "field 'wheelDate'"), R.id.wheel_date, "field 'wheelDate'");
target.wheelTimeType = (WheelView) finder.castView((View) finder.findRequiredView(source,
R.id.wheel_time_type, "field 'wheelTimeType'"), R.id.wheel_time_type, "field " +
"'wheelTimeType'");
View view = (View) finder.findRequiredView(source, R.id.tv_confirm, "field 'tvConfirm' " +
"and method 'onClick'");
target.tvConfirm = (TextView) finder.castView(view, R.id.tv_confirm, "field 'tvConfirm'");
view.setOnClickListener(new DebouncingOnClickListener() {
public void doClick(View p0) {
target.onClick(p0);
}
});
}
示例5: initWheel
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
private void initWheel(View dialog_exitView, Dict dCountry) {
WheelView country = (WheelView) dialog_exitView
.findViewById(R.id.country);
WheelView province = (WheelView) dialog_exitView
.findViewById(R.id.province);
WheelView city = (WheelView) dialog_exitView.findViewById(R.id.city);
country.setViewAdapter(new DictAdapter(countries, UserInfoActivity.this));
country.setVisibleItems(10);
country.setCurrentItem(countries.indexOf(dCountry));
updateProvince(province, provinces);
DictAdapter adapter = new DictAdapter(citys, UserInfoActivity.this);
city.setViewAdapter(adapter);
city.setVisibleItems(10);
if (user != null && user.getArea3() > 0) {
for (Dict dict : citys) {
if (user.getArea3() == dict.getDict_id()) {
city.setCurrentItem(citys.indexOf(dict));
break;
}
}
} else {
city.setCurrentItem(0);
}
removeProgressDialog();
}
示例6: updateProvince
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
private void updateProvince(WheelView dictView, Vector<Dict> dicts) {
DictAdapter adapter = new DictAdapter(dicts, this);
dictView.setViewAdapter(adapter);
dictView.setVisibleItems(10);
if (dicts.size()==0) {
return;
}
if (user != null && user.getArea2() > 0) {
for (Dict dict : dicts) {
if (user.getArea2() == dict.getDict_id()) {
dictView.setCurrentItem(dicts.indexOf(dict));
return;
}
}
} else {
dictView.setCurrentItem(0);
}
}
示例7: PickAdapter
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
public PickAdapter(Context context, int i1, int j1, WheelView wheelview, int k1, int l1, int i2,
boolean flag, int j2, int k2, int l2, int i3, int j3)
{
h = 0;
r = 1;
q = context;
n = i1;
m = j1;
o = wheelview;
p = LayoutInflater.from(context);
k = k1;
l = l1;
f = i2;
j = flag;
android.util.DisplayMetrics displaymetrics = context.getResources().getDisplayMetrics();
g = TypedValue.applyDimension(1, j2, displaymetrics);
c = TypedValue.applyDimension(1, k2, displaymetrics);
d = TypedValue.applyDimension(1, l2, displaymetrics);
e = TypedValue.applyDimension(1, i3, displaymetrics);
setValueGap(j3);
h = 1 + (m - n);
i = h * (0x7fffff / h);
}
示例8: onChanged
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
public void onChanged(WheelView wheelview, int i1, int j1)
{
label0:
{
if (wheelview == d)
{
if (a() < 0)
{
break label0;
}
c.setText(0x7f0d005b);
}
return;
}
c.setText(0x7f0d005e);
}
示例9: b
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
private void b(int i1)
{
Debug.i("NewAlarmActivity", (new StringBuilder()).append("updateAmPmByHour hour=").append(i1).toString());
if (q != null && !r)
{
WheelView wheelview = q;
int j1;
if (i1 >= 12)
{
j1 = 1;
} else
{
j1 = 0;
}
wheelview.setCurrentItem(j1);
}
}
示例10: onCreate
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
protected void onCreate(Bundle bundle)
{
setContentView(0x7f03000c);
super.onCreate(bundle);
b = (WheelView)findViewById(0x7f0a0056);
b.setVisibleItems(5).setCenterDrawable(0x7f0200b9).setCenterStyle(getString(0x7f0d0046), 0x7f090014, 12, 40F, 5.5F).setViewAdapter(new PickAdapter(this, 90, 230, b, getResources().getColor(0x7f090052), getResources().getColor(0x7f090014), getResources().getColor(0x7f090016), false, 50, 16, 15, 15));
if (mPersonInfo.height > 0)
{
b.setCurrentItem(-90 + mPersonInfo.height);
return;
} else
{
b.setCurrentItem(80);
return;
}
}
示例11: onCreate
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
protected void onCreate(Bundle bundle)
{
setContentView(0x7f03000e);
super.onCreate(bundle);
b = (WheelView)findViewById(0x7f0a0059);
b.setVisibleItems(5).setCenterDrawable(0x7f0200b9).setCenterStyle(getString(0x7f0d00da), 0x7f090014, 12, 40F, 5.5F).setViewAdapter(new PickAdapter(this, 20, 205, b, getResources().getColor(0x7f090052), getResources().getColor(0x7f090014), getResources().getColor(0x7f090016), false, 50, 16, 15, 15));
if (mPersonInfo.weight > 0)
{
b.setCurrentItem(-20 + mPersonInfo.weight);
return;
} else
{
b.setCurrentItem(40);
return;
}
}
示例12: TimeSleep
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
public TimeSleep(Context context, AttributeSet attrs) {
super(context, attrs);
setTitle(R.string.sleep_title);
setIcon(Util.getResourceFromAttribute(context, R.attr.ic_sleep_normal_style));
setContent(context, R.layout.expandable_time_sleep);
mHourWheel = (WheelView) findViewById(R.id.hour);
mMinWheel = (WheelView) findViewById(R.id.min);
final Button okButton = (Button) findViewById(R.id.ok);
final Button cancelButton = (Button) findViewById(R.id.cancel);
mHourWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 23, "%02d"));
mHourWheel.setCyclic(true);
mMinWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 59, "%02d"));
mMinWheel.setCyclic(true);
okButton.setOnClickListener(mOnOkListener);
cancelButton.setOnClickListener(mOnCancelListener);
if (mTime != null && mTime.before(Calendar.getInstance()))
mTime = null;
Calendar c = mTime != null ? mTime : Calendar.getInstance();
mHourWheel.setCurrentItem(c.get(Calendar.HOUR_OF_DAY));
mMinWheel.setCurrentItem(c.get(Calendar.MINUTE));
setText();
}
示例13: TimeSleep
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
public TimeSleep(Context context, AttributeSet attrs) {
super(context, attrs);
setTitle(R.string.sleep_title);
setIcon(R.drawable.sleep);
setContent(context, R.layout.expandable_time_sleep);
mHourWheel = (WheelView) findViewById(R.id.hour);
mMinWheel = (WheelView) findViewById(R.id.min);
final Button okButton = (Button) findViewById(R.id.ok);
final Button cancelButton = (Button) findViewById(R.id.cancel);
mHourWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 23, "%02d"));
mHourWheel.setCyclic(true);
mMinWheel.setViewAdapter(new NumericWheelAdapter(context, 0, 59, "%02d"));
mMinWheel.setCyclic(true);
okButton.setOnClickListener(mOnOkListener);
cancelButton.setOnClickListener(mOnCancelListener);
if (mTime != null && mTime.before(Calendar.getInstance()))
mTime = null;
Calendar c = mTime != null ? mTime : Calendar.getInstance();
mHourWheel.setCurrentItem(c.get(Calendar.HOUR_OF_DAY));
mMinWheel.setCurrentItem(c.get(Calendar.MINUTE));
setText();
}
示例14: updateDays
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
/**
* Updates day wheel. Sets max days according to selected month and year
*/
private void updateDays(WheelView year, WheelView month, WheelView day) {
Calendar calendar = Calendar.getInstance();
if(year.getCurrentItem() == MaxYearCount &&
month.getCurrentItem() == calendar.get(Calendar.MONTH)) {
int today = calendar.get(Calendar.DAY_OF_MONTH);
day.setViewAdapter(new DateNumericAdapter(mActivity, 1, today, -1));
day.setCurrentItem(today - 1);
} else {
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + year.getCurrentItem());
calendar.set(Calendar.MONTH, month.getCurrentItem());
int maxDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
day.setViewAdapter(new DateNumericAdapter(mActivity, 1, maxDays, -1));
int curDay = Math.min(maxDays, day.getCurrentItem() + 1);
day.setCurrentItem(curDay - 1);
}
}
示例15: bindObjects
import kankan.wheel.widget.WheelView; //导入依赖的package包/类
@Override
public void bindObjects() {
setDialogView(View.inflate(getContext(), R.layout.dof_limitation_dialog, null));
mWheelMinAperture = (WheelView) getDialogView()
.findViewById(R.id.dofLimitation_minAperture);
mWheelMaxAperture = (WheelView) getDialogView()
.findViewById(R.id.dofLimitation_maxAperture);
mWheelMinFocalLength = (WheelView) getDialogView().findViewById(
R.id.dofLimitation_minFocalLength);
mWheelMaxFocalLength = (WheelView) getDialogView().findViewById(
R.id.dofLimitation_maxFocalLength);
mWheelMinSubjectDistance = (WheelView) getDialogView().findViewById(
R.id.dofLimitation_minSubjectDistance);
mWheelMaxSubjectDistance = (WheelView) getDialogView().findViewById(
R.id.dofLimitation_maxSubjectDistance);
}