add numberpicker::get/set selectionDivider

This commit is contained in:
houzh 2023-05-06 01:21:35 +00:00
parent ff03098954
commit 634abe4daa
2 changed files with 25 additions and 6 deletions

View File

@ -594,6 +594,23 @@ void NumberPicker::setOnLongPressUpdateInterval(long intervalMillis) {
mLongPressUpdateInterval = intervalMillis;
}
void NumberPicker::setSelectionDivider(Drawable*d){
delete mSelectionDivider;
mSelectionDivider = d;
if (mSelectionDivider) {
mSelectionDivider->setCallback(this);
mSelectionDivider->setLayoutDirection(getLayoutDirection());
if (mSelectionDivider->isStateful()) {
mSelectionDivider->setState(getDrawableState());
}
}
invalidate();
}
Drawable*NumberPicker::getSelectionDivider()const{
return mSelectionDivider;
}
void NumberPicker::setSelector(int items){
mMaxSelectorIndices=items;
//mSelectorIndices.resize(items);

View File

@ -155,20 +155,22 @@ public:
void computeScroll()override;
View& setEnabled(bool enabled)override;
void scrollBy(int x, int y)override;
int getSolidColor()const;
int getSolidColor()const;
void setOnValueChangedListener(OnValueChangeListener onValueChangedListener);
void setOnScrollListener(const OnScrollListener& onScrollListener);
void setFormatter(Formatter formatter);
void setSelectionDivider(Drawable*d);
Drawable* getSelectionDivider()const;
void setValue(int value);
int getValue()const;
int getValue()const;
void setMinValue(int value);
int getMinValue()const;
int getMinValue()const;
void setMaxValue(int maxValue);
int getMaxValue()const;
int getMaxValue()const;
void setMinHeight(int h);
void setMaxHeight(int h);
int getMinHeight()const;
int getMaxHeight()const;
int getMinHeight()const;
int getMaxHeight()const;
std::vector<std::string> getDisplayedValues()const;
void setDisplayedValues(const std::vector<std::string>&);
bool performClick()override;