Initial commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.aigestudio.wheelpicker.widgets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import com.aigestudio.wheelpicker.WheelPicker;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class WheelMonthPicker extends WheelPicker implements IWheelMonthPicker {
|
||||
private int k0;
|
||||
|
||||
public WheelMonthPicker(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
private void a() {
|
||||
setSelectedItemPosition(this.k0 - 1);
|
||||
}
|
||||
|
||||
public int getCurrentMonth() {
|
||||
return Integer.parseInt(String.valueOf(getData().get(getCurrentItemPosition())));
|
||||
}
|
||||
|
||||
public int getSelectedMonth() {
|
||||
return this.k0;
|
||||
}
|
||||
|
||||
@Override // com.aigestudio.wheelpicker.WheelPicker
|
||||
public void setData(List list) {
|
||||
throw new UnsupportedOperationException("You can not invoke setData in WheelMonthPicker");
|
||||
}
|
||||
|
||||
public void setSelectedMonth(int i) {
|
||||
this.k0 = i;
|
||||
a();
|
||||
}
|
||||
|
||||
public WheelMonthPicker(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (int i = 1; i <= 12; i++) {
|
||||
arrayList.add(Integer.valueOf(i));
|
||||
}
|
||||
super.setData(arrayList);
|
||||
this.k0 = Calendar.getInstance().get(2) + 1;
|
||||
a();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user