Before exploring page, prune the UI tree of this page if possible \param activity \param rootXML
| 223 | /// \param activity |
| 224 | /// \param rootXML |
| 225 | void Preference::resolvePage(const std::string &activity, const ElementPtr &rootXML) { |
| 226 | // cache page texts |
| 227 | this->cachePageTexts(rootXML); |
| 228 | |
| 229 | BDLOG("preference resolve page: %s black widget %lu tree pruning %lu", activity.c_str(), |
| 230 | this->_blackWidgetActions.size(), this->_treePrunings.size()); |
| 231 | // deMixResMapping |
| 232 | this->deMixResMapping(rootXML); |
| 233 | |
| 234 | // get root size |
| 235 | if (nullptr == this->_rootScreenSize |
| 236 | || (this->_rootScreenSize->left + this->_rootScreenSize->top) != 0) { |
| 237 | RectPtr rootSize = rootXML->getBounds(); |
| 238 | if (!rootSize || rootSize->isEmpty()) { |
| 239 | auto &children = rootXML->getChildren(); |
| 240 | if (!children.empty()) |
| 241 | rootSize = children[0]->getBounds(); |
| 242 | } |
| 243 | this->_rootScreenSize = rootSize; |
| 244 | } |
| 245 | if (!this->_rootScreenSize || this->_rootScreenSize->isEmpty()) { |
| 246 | BLOGE("%s", "No root size in current page"); |
| 247 | } |
| 248 | // recursively resolve black widgets |
| 249 | this->resolveBlackWidgets(rootXML, activity); |
| 250 | // recursively deal all rootXML tree |
| 251 | this->resolveElement(rootXML, activity); |
| 252 | |
| 253 | } |
| 254 | |
| 255 | void Preference::resolveElement(const ElementPtr &element, const std::string &activity) { |
| 256 | // resolve tree pruning |
no test coverage detected