fix TextView::textAppearance

This commit is contained in:
侯歌 2022-02-09 13:03:44 +08:00
parent c647538ab6
commit d5e8fc7fec
3 changed files with 40 additions and 36 deletions

View File

@ -50,7 +50,7 @@ class IDGenerater(object):
i=0
print self.Handler.idlist
for k in self.Handler.idlist:
fr.write("%8s%-24s= 0x%08X"%('',k,self.idstart+i))
fr.write("%8s%-24s= 0x%08X /*%10d*/"%('',k,self.idstart+i,self.idstart+i))
if(i<dsize-1):
fr.write(" ,")
fr.write("\n")

58
src/gui/widget/R.h Executable file → Normal file
View File

@ -7,35 +7,35 @@ namespace cdroid{
class R{
public:
enum id {
parentPanel = 0x000003E8 ,
topPanel = 0x000003E9 ,
titleDividerTop = 0x000003EA ,
title_template = 0x000003EB ,
icon = 0x000003EC ,
alertTitle = 0x000003ED ,
titleDivider = 0x000003EE ,
contentPanel = 0x000003EF ,
scrollView = 0x000003F0 ,
message = 0x000003F1 ,
customPanel = 0x000003F2 ,
custom = 0x000003F3 ,
buttonPanel = 0x000003F4 ,
button2 = 0x000003F5 ,
button3 = 0x000003F6 ,
button1 = 0x000003F7 ,
text1 = 0x000003F8 ,
titleDividerNoCustom = 0x000003F9 ,
textSpacerNoTitle = 0x000003FA ,
textSpacerNoButtons = 0x000003FB ,
increment = 0x000003FC ,
numberpicker_input = 0x000003FD ,
decrement = 0x000003FE ,
leftSpacer = 0x000003FF ,
rightSpacer = 0x00000400 ,
select_dialog_listview = 0x00000401 ,
background = 0x00000402 ,
progress = 0x00000403 ,
secondaryProgress = 0x00000404
parentPanel = 0x000003E8 /* 1000*/ ,
topPanel = 0x000003E9 /* 1001*/ ,
title_template = 0x000003EA /* 1002*/ ,
icon = 0x000003EB /* 1003*/ ,
alertTitle = 0x000003EC /* 1004*/ ,
titleDivider = 0x000003ED /* 1005*/ ,
contentPanel = 0x000003EE /* 1006*/ ,
scrollView = 0x000003EF /* 1007*/ ,
message = 0x000003F0 /* 1008*/ ,
customPanel = 0x000003F1 /* 1009*/ ,
custom = 0x000003F2 /* 1010*/ ,
buttonPanel = 0x000003F3 /* 1011*/ ,
leftSpacer = 0x000003F4 /* 1012*/ ,
button1 = 0x000003F5 /* 1013*/ ,
button3 = 0x000003F6 /* 1014*/ ,
button2 = 0x000003F7 /* 1015*/ ,
rightSpacer = 0x000003F8 /* 1016*/ ,
titleDividerNoCustom = 0x000003F9 /* 1017*/ ,
text1 = 0x000003FA /* 1018*/ ,
select_dialog_listview = 0x000003FB /* 1019*/ ,
increment = 0x000003FC /* 1020*/ ,
numberpicker_input = 0x000003FD /* 1021*/ ,
decrement = 0x000003FE /* 1022*/ ,
textSpacerNoTitle = 0x000003FF /* 1023*/ ,
textSpacerNoButtons = 0x00000400 /* 1024*/ ,
titleDividerTop = 0x00000401 /* 1025*/ ,
background = 0x00000402 /* 1026*/ ,
progress = 0x00000403 /* 1027*/ ,
secondaryProgress = 0x00000404 /* 1028*/
};//endof enum id
};//endof class R

View File

@ -230,9 +230,7 @@ TextAppearanceAttributes::TextAppearanceAttributes(){
mTextColorLink= nullptr;
}
void TextAppearanceAttributes::readTextAppearance(Context*ctx,const AttributeSet&att){
const std::string ta=att.getString("textAppearance");
const AttributeSet atts=ctx->obtainStyledAttributes(ta);
void TextAppearanceAttributes::readTextAppearance(Context*ctx,const AttributeSet&atts){
if(atts.hasAttribute("textColorHighlight"))
mTextColorHighlight = ctx->getColor(atts.getString("textColorHighlight"));
if(atts.hasAttribute("textColor"))
@ -275,11 +273,17 @@ TextView::TextView(Context*ctx,const AttributeSet& attrs)
setMinWidth(attrs.getDimensionPixelSize("minWidth", INT_MIN));
setMaxWidth(attrs.getDimensionPixelSize("maxWidth", INT_MAX));
mSingleLine=attrs.getBoolean("singleline",true);
if(attrs.hasAttribute("textAppearance")){
TextAppearanceAttributes attributes;
const std::string appearance=attrs.getString("textAppearance");
if(appearance.empty()==false){
AttributeSet attrs2=ctx->obtainStyledAttributes(appearance);
attrs2.inherit(attrs);
attributes.readTextAppearance(ctx,attrs2);
}else{
attributes.readTextAppearance(ctx,attrs);
applyTextAppearance(&attributes);
}
applyTextAppearance(&attributes);
setMarqueeRepeatLimit(attrs.getInt("marqueeRepeatLimit",mMarqueeRepeatLimit));
setEllipsize(attrs.getInt("ellipsize",std::map<const std::string,int>{