MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / resolvePage

Method resolvePage

native/events/Preference.cpp:225–253  ·  view source on GitHub ↗

Before exploring page, prune the UI tree of this page if possible \param activity \param rootXML

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 9

cachePageTextsMethod · 0.95
deMixResMappingMethod · 0.95
resolveBlackWidgetsMethod · 0.95
resolveElementMethod · 0.95
emptyMethod · 0.80
c_strMethod · 0.45
sizeMethod · 0.45
getBoundsMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected