rename createiItemDrawable to createWrappedDrawable

This commit is contained in:
houzh 2023-07-11 16:58:54 +08:00
parent 323a52051b
commit 5404d4feb2
8 changed files with 8 additions and 12 deletions

View File

@ -196,7 +196,7 @@ Drawable*AnimatedRotateDrawable::inflate(Context*ctx,const AttributeSet&atts){
ad->setPivotYRelative(true);
ad->setFramesCount(atts.getInt("framesCount"));
ad->setFramesDuration(atts.getInt("frameDuration"));
Drawable*child = createItemDrawable(ctx,atts);
Drawable*child = createWrappedDrawable(ctx,atts);
ad->setDrawable(child);
return ad;

View File

@ -101,7 +101,7 @@ void ClipDrawable::draw(Canvas& canvas){
}
Drawable*ClipDrawable::inflate(Context*ctx,const AttributeSet&atts){
Drawable*d = Drawable::createItemDrawable(ctx,atts);
Drawable*d = Drawable::createWrappedDrawable(ctx,atts);
const int gravity= atts.getGravity("gravity",Gravity::LEFT);
const std::string sOrientation = atts.getString("clipOrientation");
const int orientation = (sOrientation.compare("vertical")==0)?VERTICAL:HORIZONTAL;

View File

@ -303,7 +303,7 @@ class ParseData {
};
Drawable*Drawable::createItemDrawable(Context*ctx,const AttributeSet&atts) {
Drawable*Drawable::createWrappedDrawable(Context*ctx,const AttributeSet&atts) {
RefPtr<ImageSurface> img;
std::string resname = atts.getString("color");
if(!resname.empty()) {
@ -335,7 +335,7 @@ static std::map<const std::string,DrawableParser>drawableParsers= {
{"layer-list", LayerDrawable::inflate},
{"level-list", LevelListDrawable::inflate},
{"selector", StateListDrawable::inflate},
{"item", Drawable::createItemDrawable },
{"item", Drawable::createWrappedDrawable },
{"ripple", RippleDrawable::inflate},
{"animated-rotate", AnimatedRotateDrawable::inflate},
{"animation-list", AnimationDrawable::inflate}

View File

@ -133,7 +133,7 @@ public:
static int resolveOpacity(int op1,int op2);
static float scaleFromDensity(float pixels, int sourceDensity, int targetDensity);
static int scaleFromDensity(int pixels, int sourceDensity, int targetDensity, bool isSize);
static Drawable*createItemDrawable(Context* ctx,const AttributeSet&atts);
static Drawable*createWrappedDrawable(Context* ctx,const AttributeSet&atts);
static Drawable*fromStream(Context*ctx,std::istream&stream,const std::string& basePath=std::string(),
const std::string&package=std::string());
static Drawable*inflate(Context* ctx,const std::string& pathName);

View File

@ -112,7 +112,7 @@ Drawable*InsetDrawable::inflate(Context*ctx,const AttributeSet&atts){
const int insetTop = atts.getInt("insetTop",inset);
const int insetRight = atts.getInt("insetRight",inset);
const int insetBottom= atts.getInt("insetBottom",inset);
Drawable*d = createItemDrawable(ctx,atts);
Drawable*d = createWrappedDrawable(ctx,atts);
return new InsetDrawable(d,insetLeft,insetTop,insetRight,insetBottom);
}

View File

@ -154,7 +154,7 @@ void RotateDrawable::draw(Canvas& canvas) {
}
Drawable*RotateDrawable::inflate(Context*ctx,const AttributeSet&atts){
Drawable*d = createItemDrawable(ctx,atts);
Drawable*d = createWrappedDrawable(ctx,atts);
RotateDrawable*rd = new RotateDrawable(d);
rd->setPivotX(atts.getFraction("pivotX",1,1,0));
rd->setPivotY(atts.getFraction("pivotY",1,1,0));

View File

@ -94,7 +94,7 @@ Drawable*ScaleDrawable::inflate(Context*ctx,const AttributeSet&atts){
const int sw = getDimensionOrFraction(atts,"scaleWidth",100,0);
const int sh = getDimensionOrFraction(atts,"scaleHeight",100,0);
const int gravity = atts.getGravity("scaleGravity",Gravity::LEFT);
Drawable*d = createItemDrawable(ctx,atts);
Drawable*d = createWrappedDrawable(ctx,atts);
return new ScaleDrawable(d,gravity,float(sw)/100.f,float(sh)/100.f);
}
}

View File

@ -444,10 +444,6 @@ void ProgressBar::setProgressDrawable(Drawable*d){
mMaxHeight = drawableHeight;
requestLayout();
}
if(dynamic_cast<LayerDrawable*>(d)){
ClipDrawable*cd = dynamic_cast<ClipDrawable*>(((LayerDrawable*)d)->findDrawableByLayerId(R::id::progress));
LOGD("Orientation=%d",cd->getOrientation());
}
applyProgressTints();
}