Commit 4732c15a authored by Administrator's avatar Administrator

update

parent 15a6e4a3
......@@ -18,6 +18,7 @@ public class SuperAppium {
public static final String index = "index";
public static final String hash = "hash";
public static final String visible = "visible";
public static final String shown = "shown";
public static String TAG = "SuperAppium";
}
......@@ -76,6 +76,24 @@ public class ViewImage {
return (T) valueGetter.get();
}
private int[] location = null;
public int[] locationOnScreen() {
if (location != null) {
return location;
}
location = new int[2];
originView.getLocationOnScreen(location);
return location;
}
public int X() {
return locationOnScreen()[0];
}
public int Y() {
return locationOnScreen()[1];
}
public View getOriginView() {
return originView;
......
......@@ -18,6 +18,7 @@ import com.virjar.ratel.api.extension.superappium.xmodel.view.IndexGetter;
import com.virjar.ratel.api.extension.superappium.xmodel.view.LongClickableValueGetter;
import com.virjar.ratel.api.extension.superappium.xmodel.view.PackageNameValueGetter;
import com.virjar.ratel.api.extension.superappium.xmodel.view.SelectedValueGetter;
import com.virjar.ratel.api.extension.superappium.xmodel.view.ShownValueGetter;
import com.virjar.ratel.api.extension.superappium.xmodel.view.VisibleValueGetter;
import java.util.ArrayList;
......@@ -51,6 +52,7 @@ public class ValueGetters {
valueGetters.add(new IdGetter());
valueGetters.add(new IndexGetter());
valueGetters.add(new HashCodeGetter());
valueGetters.add(new ShownValueGetter());
}
private static void registerBasic() {
......
package com.virjar.ratel.api.extension.superappium.xmodel.view;
import com.virjar.ratel.api.extension.superappium.SuperAppium;
import com.virjar.ratel.api.extension.superappium.ViewImage;
import com.virjar.ratel.api.extension.superappium.xmodel.ValueGetter;
public class ShownValueGetter implements ValueGetter<Boolean> {
@Override
public Boolean get(ViewImage viewImage) {
return viewImage.getOriginView().isShown();
}
@Override
public boolean support(Class type) {
return true;
}
@Override
public String attr() {
return SuperAppium.shown;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment