modify idgen.py

This commit is contained in:
houzh 2023-12-14 11:50:58 +08:00
parent 59d4a9bb6c
commit d838a2eafc
5 changed files with 225 additions and 3 deletions

View File

@ -44,6 +44,8 @@ class CDROIDHandler( xml.sax.ContentHandler ):
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'))
def addID(self,name):
pos=name.find('/')
@ -74,7 +76,7 @@ class IDGenerater(object):
def __init__(self,idstart,namespace):
self.idstart=idstart
self.namespace=namespace
self.processDirs=['layout','drawable','navigation']
self.processDirs=['layout','drawable','navigation','values']
self.parser = xml.sax.make_parser()
self.parser.setFeature(xml.sax.handler.feature_namespaces, 0)
self.Handler = CDROIDHandler(namespace)

View File

@ -1,4 +1,5 @@
#include <drawables/rippledrawable.h>
#include <widget/R.h>
namespace cdroid{
RippleDrawable::RippleState::RippleState(LayerState* orig, RippleDrawable* owner)
@ -61,7 +62,7 @@ RippleDrawable::RippleDrawable(std::shared_ptr<RippleState> state) {
RippleDrawable::RippleDrawable(const ColorStateList* color,Drawable* content,Drawable* mask)
:RippleDrawable(std::make_shared<RippleState>(nullptr,nullptr)){
if(content)addLayer(content,{0},-1,0,0,0,0);
if(mask)addLayer(mask,{0},MASK_LAYER_ID,0,0,0,0);
if(mask)addLayer(mask,{0},cdroid::R::id::mask,0,0,0,0);
setColor(color);
ensurePadding();
refreshPadding();

View File

@ -13,7 +13,6 @@ public:
static constexpr int MASK_CONTENT = 1;
static constexpr int MASK_EXPLICIT = 2;
static constexpr int MAX_RIPPLES = 10;
static constexpr int MASK_LAYER_ID=0;
private:
class RippleState:public LayerDrawable::LayerState{
public:

View File

@ -47,5 +47,115 @@
<id name="body">0x00000414</id>
<id name="select_dialog_listview">0x00000415</id>
<id name="text1">0x00000416</id>
<id name="hint_alpha_material_dark">0x00000417</id>
<id name="hint_alpha_material_light">0x00000418</id>
<id name="hint_pressed_alpha_material_dark">0x00000419</id>
<id name="hint_pressed_alpha_material_light">0x0000041a</id>
<id name="disabled_alpha_material_light">0x0000041b</id>
<id name="disabled_alpha_material_dark">0x0000041c</id>
<id name="primary_content_alpha_material_dark">0x0000041d</id>
<id name="primary_content_alpha_material_light">0x0000041e</id>
<id name="secondary_content_alpha_material_dark">0x0000041f</id>
<id name="secondary_content_alpha_material_light">0x00000420</id>
<id name="highlight_alpha_material_light">0x00000421</id>
<id name="highlight_alpha_material_dark">0x00000422</id>
<id name="highlight_alpha_material_colored">0x00000423</id>
<id name="default_lock_wallpaper">0x00000424</id>
<id name="config_screen_magnification_scaling_threshold">0x00000425</id>
<id name="config_pictureInPictureDefaultSizePercent">0x00000426</id>
<id name="config_pictureInPictureDefaultAspectRatio">0x00000427</id>
<id name="config_pictureInPictureAspectRatioLimitForMinSize">0x00000428</id>
<id name="config_pictureInPictureMinAspectRatio">0x00000429</id>
<id name="config_pictureInPictureMaxAspectRatio">0x0000042a</id>
<id name="config_appTransitionAnimationDurationScaleDefault">0x0000042b</id>
<id name="config_inCallNotificationVolume">0x0000042c</id>
<id name="checkbox">0x0000042d</id>
<id name="content">0x0000042e</id>
<id name="empty">0x0000042f</id>
<id name="hint">0x00000430</id>
<id name="icon_frame">0x00000431</id>
<id name="icon_badge">0x00000432</id>
<id name="icon1">0x00000433</id>
<id name="icon2">0x00000434</id>
<id name="input">0x00000435</id>
<id name="left_icon">0x00000436</id>
<id name="list">0x00000437</id>
<id name="list_container">0x00000438</id>
<id name="menu">0x00000439</id>
<id name="primary">0x0000043a</id>
<id name="right_icon">0x0000043b</id>
<id name="summary">0x0000043c</id>
<id name="selectedIcon">0x0000043d</id>
<id name="tabcontent">0x0000043e</id>
<id name="tabhost">0x0000043f</id>
<id name="tabs">0x00000440</id>
<id name="text2">0x00000441</id>
<id name="title">0x00000442</id>
<id name="title_container">0x00000443</id>
<id name="lock_screen">0x00000444</id>
<id name="edit">0x00000445</id>
<id name="widget_frame">0x00000446</id>
<id name="switch_widget">0x00000447</id>
<id name="extractArea">0x00000448</id>
<id name="candidatesArea">0x00000449</id>
<id name="inputArea">0x0000044a</id>
<id name="inputExtractEditText">0x0000044b</id>
<id name="selectAll">0x0000044c</id>
<id name="cut">0x0000044d</id>
<id name="copy">0x0000044e</id>
<id name="paste">0x0000044f</id>
<id name="copyUrl">0x00000450</id>
<id name="selectTextMode">0x00000451</id>
<id name="switchInputMethod">0x00000452</id>
<id name="keyboardView">0x00000453</id>
<id name="closeButton">0x00000454</id>
<id name="startSelectingText">0x00000455</id>
<id name="stopSelectingText">0x00000456</id>
<id name="addToDictionary">0x00000457</id>
<id name="accountPreferences">0x00000458</id>
<id name="smallIcon">0x00000459</id>
<id name="home">0x0000045a</id>
<id name="fillInIntent">0x0000045b</id>
<id name="rowTypeId">0x0000045c</id>
<id name="up">0x0000045d</id>
<id name="action_menu_divider">0x0000045e</id>
<id name="icon_menu_presenter">0x0000045f</id>
<id name="list_menu_presenter">0x00000460</id>
<id name="action_menu_presenter">0x00000461</id>
<id name="overflow_menu_presenter">0x00000462</id>
<id name="popup_submenu_presenter">0x00000463</id>
<id name="action_bar_spinner">0x00000464</id>
<id name="current_scene">0x00000465</id>
<id name="scene_layoutid_cache">0x00000466</id>
<id name="mask">0x00000467</id>
<id name="transitionPosition">0x00000468</id>
<id name="transitionTransform">0x00000469</id>
<id name="parentMatrix">0x0000046a</id>
<id name="statusBarBackground">0x0000046b</id>
<id name="navigationBarBackground">0x0000046c</id>
<id name="pasteAsPlainText">0x0000046d</id>
<id name="undo">0x0000046e</id>
<id name="redo">0x0000046f</id>
<id name="replaceText">0x00000470</id>
<id name="shareText">0x00000471</id>
<id name="textAssist">0x00000472</id>
<id name="selection_start_handle">0x00000473</id>
<id name="selection_end_handle">0x00000474</id>
<id name="insertion_handle">0x00000475</id>
<id name="floating_toolbar_menu_item_image_button">0x00000476</id>
<id name="accessibilityActionShowOnScreen">0x00000477</id>
<id name="accessibilityActionScrollToPosition">0x00000478</id>
<id name="accessibilityActionScrollUp">0x00000479</id>
<id name="accessibilityActionScrollLeft">0x0000047a</id>
<id name="accessibilityActionScrollDown">0x0000047b</id>
<id name="accessibilityActionScrollRight">0x0000047c</id>
<id name="accessibilityActionSetProgress">0x0000047d</id>
<id name="accessibilityActionContextClick">0x0000047e</id>
<id name="remote_input_tag">0x0000047f</id>
<id name="cross_task_transition">0x00000480</id>
<id name="accessibilityActionClickOnClickableSpan">0x00000481</id>
<id name="item_touch_helper_previous_elevation">0x00000482</id>
<id name="accessibilityActionMoveWindow">0x00000483</id>
<id name="autofill">0x00000484</id>
</resources>

View File

@ -53,6 +53,116 @@ namespace R{
static constexpr int body = 0x00000414 ;/*1044*/
static constexpr int select_dialog_listview = 0x00000415 ;/*1045*/
static constexpr int text1 = 0x00000416 ;/*1046*/
static constexpr int hint_alpha_material_dark= 0x00000417 ;/*1047*/
static constexpr int hint_alpha_material_light= 0x00000418 ;/*1048*/
static constexpr int hint_pressed_alpha_material_dark= 0x00000419 ;/*1049*/
static constexpr int hint_pressed_alpha_material_light= 0x0000041A ;/*1050*/
static constexpr int disabled_alpha_material_light= 0x0000041B ;/*1051*/
static constexpr int disabled_alpha_material_dark= 0x0000041C ;/*1052*/
static constexpr int primary_content_alpha_material_dark= 0x0000041D ;/*1053*/
static constexpr int primary_content_alpha_material_light= 0x0000041E ;/*1054*/
static constexpr int secondary_content_alpha_material_dark= 0x0000041F ;/*1055*/
static constexpr int secondary_content_alpha_material_light= 0x00000420 ;/*1056*/
static constexpr int highlight_alpha_material_light= 0x00000421 ;/*1057*/
static constexpr int highlight_alpha_material_dark= 0x00000422 ;/*1058*/
static constexpr int highlight_alpha_material_colored= 0x00000423 ;/*1059*/
static constexpr int default_lock_wallpaper = 0x00000424 ;/*1060*/
static constexpr int config_screen_magnification_scaling_threshold= 0x00000425 ;/*1061*/
static constexpr int config_pictureInPictureDefaultSizePercent= 0x00000426 ;/*1062*/
static constexpr int config_pictureInPictureDefaultAspectRatio= 0x00000427 ;/*1063*/
static constexpr int config_pictureInPictureAspectRatioLimitForMinSize= 0x00000428 ;/*1064*/
static constexpr int config_pictureInPictureMinAspectRatio= 0x00000429 ;/*1065*/
static constexpr int config_pictureInPictureMaxAspectRatio= 0x0000042A ;/*1066*/
static constexpr int config_appTransitionAnimationDurationScaleDefault= 0x0000042B ;/*1067*/
static constexpr int config_inCallNotificationVolume= 0x0000042C ;/*1068*/
static constexpr int checkbox = 0x0000042D ;/*1069*/
static constexpr int content = 0x0000042E ;/*1070*/
static constexpr int empty = 0x0000042F ;/*1071*/
static constexpr int hint = 0x00000430 ;/*1072*/
static constexpr int icon_frame = 0x00000431 ;/*1073*/
static constexpr int icon_badge = 0x00000432 ;/*1074*/
static constexpr int icon1 = 0x00000433 ;/*1075*/
static constexpr int icon2 = 0x00000434 ;/*1076*/
static constexpr int input = 0x00000435 ;/*1077*/
static constexpr int left_icon = 0x00000436 ;/*1078*/
static constexpr int list = 0x00000437 ;/*1079*/
static constexpr int list_container = 0x00000438 ;/*1080*/
static constexpr int menu = 0x00000439 ;/*1081*/
static constexpr int primary = 0x0000043A ;/*1082*/
static constexpr int right_icon = 0x0000043B ;/*1083*/
static constexpr int summary = 0x0000043C ;/*1084*/
static constexpr int selectedIcon = 0x0000043D ;/*1085*/
static constexpr int tabcontent = 0x0000043E ;/*1086*/
static constexpr int tabhost = 0x0000043F ;/*1087*/
static constexpr int tabs = 0x00000440 ;/*1088*/
static constexpr int text2 = 0x00000441 ;/*1089*/
static constexpr int title = 0x00000442 ;/*1090*/
static constexpr int title_container = 0x00000443 ;/*1091*/
static constexpr int lock_screen = 0x00000444 ;/*1092*/
static constexpr int edit = 0x00000445 ;/*1093*/
static constexpr int widget_frame = 0x00000446 ;/*1094*/
static constexpr int switch_widget = 0x00000447 ;/*1095*/
static constexpr int extractArea = 0x00000448 ;/*1096*/
static constexpr int candidatesArea = 0x00000449 ;/*1097*/
static constexpr int inputArea = 0x0000044A ;/*1098*/
static constexpr int inputExtractEditText = 0x0000044B ;/*1099*/
static constexpr int selectAll = 0x0000044C ;/*1100*/
static constexpr int cut = 0x0000044D ;/*1101*/
static constexpr int copy = 0x0000044E ;/*1102*/
static constexpr int paste = 0x0000044F ;/*1103*/
static constexpr int copyUrl = 0x00000450 ;/*1104*/
static constexpr int selectTextMode = 0x00000451 ;/*1105*/
static constexpr int switchInputMethod = 0x00000452 ;/*1106*/
static constexpr int keyboardView = 0x00000453 ;/*1107*/
static constexpr int closeButton = 0x00000454 ;/*1108*/
static constexpr int startSelectingText = 0x00000455 ;/*1109*/
static constexpr int stopSelectingText = 0x00000456 ;/*1110*/
static constexpr int addToDictionary = 0x00000457 ;/*1111*/
static constexpr int accountPreferences = 0x00000458 ;/*1112*/
static constexpr int smallIcon = 0x00000459 ;/*1113*/
static constexpr int home = 0x0000045A ;/*1114*/
static constexpr int fillInIntent = 0x0000045B ;/*1115*/
static constexpr int rowTypeId = 0x0000045C ;/*1116*/
static constexpr int up = 0x0000045D ;/*1117*/
static constexpr int action_menu_divider = 0x0000045E ;/*1118*/
static constexpr int icon_menu_presenter = 0x0000045F ;/*1119*/
static constexpr int list_menu_presenter = 0x00000460 ;/*1120*/
static constexpr int action_menu_presenter = 0x00000461 ;/*1121*/
static constexpr int overflow_menu_presenter = 0x00000462 ;/*1122*/
static constexpr int popup_submenu_presenter = 0x00000463 ;/*1123*/
static constexpr int action_bar_spinner = 0x00000464 ;/*1124*/
static constexpr int current_scene = 0x00000465 ;/*1125*/
static constexpr int scene_layoutid_cache = 0x00000466 ;/*1126*/
static constexpr int mask = 0x00000467 ;/*1127*/
static constexpr int transitionPosition = 0x00000468 ;/*1128*/
static constexpr int transitionTransform = 0x00000469 ;/*1129*/
static constexpr int parentMatrix = 0x0000046A ;/*1130*/
static constexpr int statusBarBackground = 0x0000046B ;/*1131*/
static constexpr int navigationBarBackground = 0x0000046C ;/*1132*/
static constexpr int pasteAsPlainText = 0x0000046D ;/*1133*/
static constexpr int undo = 0x0000046E ;/*1134*/
static constexpr int redo = 0x0000046F ;/*1135*/
static constexpr int replaceText = 0x00000470 ;/*1136*/
static constexpr int shareText = 0x00000471 ;/*1137*/
static constexpr int textAssist = 0x00000472 ;/*1138*/
static constexpr int selection_start_handle = 0x00000473 ;/*1139*/
static constexpr int selection_end_handle = 0x00000474 ;/*1140*/
static constexpr int insertion_handle = 0x00000475 ;/*1141*/
static constexpr int floating_toolbar_menu_item_image_button= 0x00000476 ;/*1142*/
static constexpr int accessibilityActionShowOnScreen= 0x00000477 ;/*1143*/
static constexpr int accessibilityActionScrollToPosition= 0x00000478 ;/*1144*/
static constexpr int accessibilityActionScrollUp= 0x00000479 ;/*1145*/
static constexpr int accessibilityActionScrollLeft= 0x0000047A ;/*1146*/
static constexpr int accessibilityActionScrollDown= 0x0000047B ;/*1147*/
static constexpr int accessibilityActionScrollRight= 0x0000047C ;/*1148*/
static constexpr int accessibilityActionSetProgress= 0x0000047D ;/*1149*/
static constexpr int accessibilityActionContextClick= 0x0000047E ;/*1150*/
static constexpr int remote_input_tag = 0x0000047F ;/*1151*/
static constexpr int cross_task_transition = 0x00000480 ;/*1152*/
static constexpr int accessibilityActionClickOnClickableSpan= 0x00000481 ;/*1153*/
static constexpr int item_touch_helper_previous_elevation= 0x00000482 ;/*1154*/
static constexpr int accessibilityActionMoveWindow= 0x00000483 ;/*1155*/
static constexpr int autofill = 0x00000484 ;/*1156*/
};/*namespace id*/
namespace strings{