- Регистрация
- 23.11.2019
- Сообщения
- 581
- Благодарностей
- 45
- Баллы
- 28
Имею переменную со значением:
Мне нужно получить значение только со строкой которая начинается на /></node><node NAF="true" а заканчивается следующими координатами: bounds="[335,599][564,661]"
Проще говоря нужно найти значение Index элемента по координатам.
Такой код:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><hierarchy rotation="0"><node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][900,1440]"><node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][900,1440]"><node index="0" text="" resource-id="android:id/content" class="android.widget.FrameLayout" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]"><node index="0" text="" resource-id="com.facebook.lite:id/main_layout" class="android.widget.FrameLayout" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]"><node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]" /><node index="1" text="" resource-id="" class="android.widget.FrameLayout" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]"><node index="1" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]" /><node index="1" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][1,48]" /><node index="2" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[394,69][505,101]" /><node index="3" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[7,136][449,168]" /><node NAF="true" index="4" text="" resource-id="" class="android.widget.MultiAutoCompleteTextView" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="true" password="false" selected="false" bounds="[8,176][889,239]" /><node index="5" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[7,258][892,290]" /><node NAF="true" index="6" text="" resource-id="" class="android.widget.MultiAutoCompleteTextView" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="true" password="true" selected="false" bounds="[8,298][889,361]" /><node NAF="true" index="7" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[7,380][892,442]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[412,395][487,427]" /></node><node NAF="true" index="8" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[7,464][892,496]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[7,464][198,496]" /></node><node index="9" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[425,544][473,576]" /><node NAF="true" index="10" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[335,599][564,661]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[350,614][549,646]" /></node><node index="11" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[30,705][129,737]" /><node NAF="true" index="12" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,760][195,837]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[30,782][165,814]" /></node><node NAF="true" index="13" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,837][195,914]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[30,859][162,891]" /></node><node NAF="true" index="14" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,914][195,991]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[30,936][104,968]" /></node><node NAF="true" index="15" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,991][195,1068]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[30,1013][140,1045]" /></node><node NAF="true" index="16" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,1068][195,1145]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[30,1090][124,1122]" /></node><node NAF="true" index="17" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,1160][195,1192]"><node index="0" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,1160][195,1192]" /></node></node><node index="2" text="" resource-id="" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,47][900,1440]" /></node></node></node></node><node index="1" text="" resource-id="android:id/statusBarBackground" class="android.view.View" package="com.facebook.lite" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][900,47]" /></node></hierarchy>
Проще говоря нужно найти значение Index элемента по координатам.