mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 13:48:02 +08:00
fix an uninint var
This commit is contained in:
parent
a2246eb543
commit
12610644cf
@ -189,7 +189,6 @@ void LayerDrawable::LayerState::invalidateCache(){
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LayerDrawable::LayerDrawable():LayerDrawable(nullptr){
|
||||
mSuspendChildInvalidation=false;
|
||||
}
|
||||
|
||||
LayerDrawable::LayerDrawable(const std::vector<Drawable*>&drawables)
|
||||
@ -204,19 +203,20 @@ LayerDrawable::LayerDrawable(const std::vector<Drawable*>&drawables)
|
||||
refreshPadding();
|
||||
}
|
||||
|
||||
std::shared_ptr<LayerDrawable::LayerState> LayerDrawable::createConstantState(LayerState* state){
|
||||
return std::make_shared<LayerState>(state, this);
|
||||
}
|
||||
|
||||
LayerDrawable::LayerDrawable(std::shared_ptr<LayerState>state){
|
||||
mMutated = false;
|
||||
mLayerState = createConstantState(state.get());
|
||||
mSuspendChildInvalidation = false;
|
||||
mLayerState = createConstantState(state.get(),nullptr);
|
||||
if (mLayerState->mChildren.size()) {
|
||||
ensurePadding();
|
||||
refreshPadding();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<LayerDrawable::LayerState> LayerDrawable::createConstantState(LayerState* state,const AttributeSet*){
|
||||
return std::make_shared<LayerState>(state, this);
|
||||
}
|
||||
|
||||
void LayerDrawable::setLayerSize(int index, int w, int h){
|
||||
ChildDrawable* childDrawable = mLayerState->mChildren.at(index);
|
||||
childDrawable->mWidth = w;
|
||||
@ -936,7 +936,7 @@ Drawable* LayerDrawable::getFirstNonNullDrawable()const{
|
||||
|
||||
Drawable*LayerDrawable::mutate(){
|
||||
if (!mMutated && Drawable::mutate() == this) {
|
||||
mLayerState = createConstantState(mLayerState.get());
|
||||
mLayerState = createConstantState(mLayerState.get(),nullptr);
|
||||
for (auto child:mLayerState->mChildren) {
|
||||
Drawable*dr=child->mDrawable;
|
||||
if (dr != nullptr) {
|
||||
|
@ -74,7 +74,7 @@ private:
|
||||
ChildDrawable* createLayer(Drawable* dr);
|
||||
Drawable*getFirstNonNullDrawable()const;
|
||||
protected:
|
||||
virtual std::shared_ptr<LayerState> createConstantState(LayerState* state);
|
||||
virtual std::shared_ptr<LayerState> createConstantState(LayerState* state,const AttributeSet*);
|
||||
void onBoundsChange(const Rect& bounds)override;
|
||||
bool onLevelChange(int level)override;
|
||||
bool onStateChange(const std::vector<int>& state)override;
|
||||
|
@ -45,7 +45,7 @@ TransitionDrawable::TransitionDrawable(std::shared_ptr<TransitionState> state)
|
||||
mTransitionState=TRANSITION_NONE;
|
||||
}
|
||||
|
||||
std::shared_ptr<LayerDrawable::LayerState> TransitionDrawable::createConstantState(LayerState* state){
|
||||
std::shared_ptr<LayerDrawable::LayerState> TransitionDrawable::createConstantState(LayerState* state,const AttributeSet*attrs){
|
||||
return std::make_shared<TransitionState>((TransitionState*) state, this);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ private:
|
||||
};
|
||||
|
||||
TransitionDrawable(std::shared_ptr<TransitionState> state);
|
||||
std::shared_ptr<LayerDrawable::LayerState> createConstantState(LayerState* state)override;
|
||||
std::shared_ptr<LayerDrawable::LayerState> createConstantState(LayerState* state,const AttributeSet*)override;
|
||||
TransitionDrawable(Context*,const AttributeSet&);
|
||||
public:
|
||||
TransitionDrawable();
|
||||
|
Loading…
Reference in New Issue
Block a user