modify RippleDrawable,change macro MASK_LAYER_ID to cdroid::R:🆔:mask

This commit is contained in:
houzh 2023-12-14 11:58:18 +08:00
parent d838a2eafc
commit 4adabdcfd3
2 changed files with 3 additions and 4 deletions

View File

@ -42,7 +42,6 @@ class CDROIDHandler( xml.sax.ContentHandler ):
if self.isMyNS(value):
self.addID(value)
if 'string/' in value:
#value = self.normalizeXMLString(value),this is done in cdroid Assets::getString
self.addString(value)
if 'type' in attributes and 'name' in attributes:
self.addID("@id/"+attributes.get('name'))

View File

@ -232,7 +232,7 @@ int RippleDrawable::getRadius()const{
bool RippleDrawable::setDrawableByLayerId(int id, Drawable* drawable){
if (LayerDrawable::setDrawableByLayerId(id, drawable)) {
if (id == MASK_LAYER_ID/*R.id.mask*/) {
if (id == cdroid::R::id::mask) {
mMask = drawable;
mHasValidMask = false;
}
@ -393,7 +393,7 @@ void RippleDrawable::drawContent(Canvas& canvas) {
std::vector<ChildDrawable*> &array = mLayerState->mChildren;
const int count = mLayerState->mChildren.size();
for (int i = 0; i < count; i++) {
if (array[i]->mId != MASK_LAYER_ID) {
if (array[i]->mId != cdroid::R::id::mask) {
array[i]->mDrawable->draw(canvas);
}
}
@ -471,6 +471,6 @@ Drawable*RippleDrawable::inflate(Context*ctx,const AttributeSet&atts){
void RippleDrawable::updateLocalState() {
// Initialize from constant state.
mMask = findDrawableByLayerId(MASK_LAYER_ID);//R.id.mask);
mMask = findDrawableByLayerId(cdroid::R::id::mask);
}
}