本文整理汇总了Java中kankan.wheel.widget.WheelView.setCyclic方法的典型用法代码示例。如果您正苦于以下问题:Java WheelView.setCyclic方法的具体用法?Java WheelView.setCyclic怎么用?Java WheelView.setCyclic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kankan.wheel.widget.WheelView
的用法示例。
在下文中一共展示了WheelView.setCyclic方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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();
}
示例3: 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();
}
示例4: bindObjects
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
@Override
public void bindObjects() {
mLimitationButton = (ImageView) mView.findViewById(R.id.evdiff_limitation);
mFullStopButton = (TextView) mView.findViewById(R.id.evdiff_label_stepFull);
mHalfStopButton = (TextView) mView.findViewById(R.id.evdiff_label_stepHalf);
mThirdStopButton = (TextView) mView.findViewById(R.id.evdiff_label_stepThird);
mCalculationResultLabel = (TextView) mView.findViewById(R.id.evdiff_result);
mCurrentApertureWheel = (WheelView) mView.findViewById(R.id.evdiff_wheel_currentAperture);
mCurrentIsoWheel = (WheelView) mView.findViewById(R.id.evdiff_wheel_currentIso);
mCurrentShutterSpeedWheel = (WheelView) mView.findViewById(R.id.evdiff_wheel_currentShutter);
mNewApertureWheel = (WheelView) mView.findViewById(R.id.evdiff_wheel_newAperture);
mNewIsoWheel = (WheelView) mView.findViewById(R.id.evdiff_wheel_newIso);
mNewShutterSpeedWheel = (WheelView) mView.findViewById(R.id.evdiff_wheel_newShutter);
mCurrentApertureWheel.setCyclic(true);
mCurrentIsoWheel.setCyclic(true);
mCurrentShutterSpeedWheel.setCyclic(true);
mNewApertureWheel.setCyclic(true);
mNewIsoWheel.setCyclic(true);
mNewShutterSpeedWheel.setCyclic(true);
}
示例5: JumpToTime
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public JumpToTime(Context context, AttributeSet attrs) {
super(context, attrs);
setTitle(R.string.jump_to_time);
setIcon(Util.getResourceFromAttribute(context, R.attr.ic_jumpto_normal_style));
setContent(context, R.layout.expandable_jump_to_time);
mHourWheel = (WheelView) findViewById(R.id.hour);
mMinWheel = (WheelView) findViewById(R.id.min);
mSecWheel = (WheelView) findViewById(R.id.sec);
final View colon = findViewById(R.id.colon);
final Button okButton = (Button) findViewById(R.id.ok);
okButton.setOnClickListener(mOnOkListener);
long currentTime = !isInEditMode() ? AudioServiceController.getInstance().getTime() : 0;
int length = !isInEditMode() ? AudioServiceController.getInstance().getLength() : 0;
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
// Limit wheel values
c.setTimeInMillis(length);
int hours = c.get(Calendar.HOUR_OF_DAY);
int minutes = c.get(Calendar.MINUTE);
int seconds = c.get(Calendar.SECOND);
boolean isCyclic = false;
mHourWheel.setCyclic(isCyclic);
mHourWheel.setViewAdapter(new NumericWheelAdapter(context, 0, isCyclic ? 23 : hours, "%02d"));
mMinWheel.setCyclic(isCyclic = isCyclic || hours > 0);
mMinWheel.setViewAdapter(new NumericWheelAdapter(context, 0, isCyclic ? 59 : minutes, "%02d"));
mSecWheel.setCyclic(isCyclic = isCyclic || minutes > 0);
mSecWheel.setViewAdapter(new NumericWheelAdapter(context, 0, isCyclic ? 59 : seconds, "%02d"));
if (hours == 0) {
mHourWheel.setVisibility(View.GONE);
colon.setVisibility(View.GONE);
}
// Set current time
c.setTimeInMillis(currentTime);
mHourWheel.setCurrentItem(c.get(Calendar.HOUR_OF_DAY));
mMinWheel.setCurrentItem(c.get(Calendar.MINUTE));
mSecWheel.setCurrentItem(c.get(Calendar.SECOND));
}
示例6: JumpToTime
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
public JumpToTime(Context context, AttributeSet attrs) {
super(context, attrs);
setTitle(R.string.jump_to_time);
setIcon(R.drawable.ic_menu_goto);
setContent(context, R.layout.expandable_jump_to_time);
mHourWheel = (WheelView) findViewById(R.id.hour);
mMinWheel = (WheelView) findViewById(R.id.min);
mSecWheel = (WheelView) findViewById(R.id.sec);
final View colon = findViewById(R.id.colon);
final Button okButton = (Button) findViewById(R.id.ok);
okButton.setOnClickListener(mOnOkListener);
long currentTime = !isInEditMode() ? AudioServiceController.getInstance().getTime() : 0;
int length = !isInEditMode() ? AudioServiceController.getInstance().getLength() : 0;
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
// Limit wheel values
c.setTimeInMillis(length);
int hours = c.get(Calendar.HOUR_OF_DAY);
int minutes = c.get(Calendar.MINUTE);
int seconds = c.get(Calendar.SECOND);
boolean isCyclic = false;
mHourWheel.setCyclic(isCyclic);
mHourWheel.setViewAdapter(new NumericWheelAdapter(context, 0, isCyclic ? 23 : hours, "%02d"));
mMinWheel.setCyclic(isCyclic = isCyclic || hours > 0);
mMinWheel.setViewAdapter(new NumericWheelAdapter(context, 0, isCyclic ? 59 : minutes, "%02d"));
mSecWheel.setCyclic(isCyclic = isCyclic || minutes > 0);
mSecWheel.setViewAdapter(new NumericWheelAdapter(context, 0, isCyclic ? 59 : seconds, "%02d"));
if (hours == 0) {
mHourWheel.setVisibility(View.GONE);
colon.setVisibility(View.GONE);
}
// Set current time
c.setTimeInMillis(currentTime);
mHourWheel.setCurrentItem(c.get(Calendar.HOUR_OF_DAY));
mMinWheel.setCurrentItem(c.get(Calendar.MINUTE));
mSecWheel.setCurrentItem(c.get(Calendar.SECOND));
}
示例7: initWheel
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
/**
* Initializes wheel
* @param id the wheel widget Id
*/
private void initWheel(int id) {
WheelView wheel = getWheel(id);
wheel.setViewAdapter(new NumericWheelAdapter(this, 0, 9));
wheel.setCurrentItem((int)(Math.random() * 10));
wheel.addChangingListener(changedListener);
wheel.addScrollingListener(scrolledListener);
wheel.setCyclic(true);
wheel.setInterpolator(new AnticipateOvershootInterpolator());
}
示例8: initWheel
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
/**
* Initializes wheel
* @param id the wheel widget Id
*/
private void initWheel(int id) {
WheelView wheel = getWheel(id);
wheel.setViewAdapter(new SlotMachineAdapter(this));
wheel.setCurrentItem((int)(Math.random() * 10));
wheel.addChangingListener(changedListener);
wheel.addScrollingListener(scrolledListener);
wheel.setCyclic(true);
wheel.setEnabled(false);
}
示例9: onCreate
import kankan.wheel.widget.WheelView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.time2_layout);
final WheelView hours = (WheelView) findViewById(R.id.hour);
NumericWheelAdapter hourAdapter = new NumericWheelAdapter(this, 0, 23);
hourAdapter.setItemResource(R.layout.wheel_text_item);
hourAdapter.setItemTextResource(R.id.text);
hours.setViewAdapter(hourAdapter);
final WheelView mins = (WheelView) findViewById(R.id.mins);
NumericWheelAdapter minAdapter = new NumericWheelAdapter(this, 0, 59, "%02d");
minAdapter.setItemResource(R.layout.wheel_text_item);
minAdapter.setItemTextResource(R.id.text);
mins.setViewAdapter(minAdapter);
mins.setCyclic(true);
final WheelView ampm = (WheelView) findViewById(R.id.ampm);
ArrayWheelAdapter<String> ampmAdapter =
new ArrayWheelAdapter<String>(this, new String[] {"AM", "PM"});
ampmAdapter.setItemResource(R.layout.wheel_text_item);
ampmAdapter.setItemTextResource(R.id.text);
ampm.setViewAdapter(ampmAdapter);
// set current time
Calendar calendar = Calendar.getInstance(Locale.US);
hours.setCurrentItem(calendar.get(Calendar.HOUR));
mins.setCurrentItem(calendar.get(Calendar.MINUTE));
ampm.setCurrentItem(calendar.get(Calendar.AM_PM));
final WheelView day = (WheelView) findViewById(R.id.day);
day.setViewAdapter(new DayArrayAdapter(this, calendar));
}