Bug 715197 - Robocop: implement isDisplayed(); r=jmaher

This commit is contained in:
Geoff Brown 2012-01-05 10:20:21 -05:00
parent 0f0e7e3dea
commit d0b474e6d9

View File

@ -141,9 +141,29 @@ public class FennecNativeElement implements Element {
return text.toString();
}
private boolean displayed;
@Override
public boolean isDisplayed() {
// TODO Auto-generated method stub
return false;
final SynchronousQueue syncQueue = new SynchronousQueue();
currentActivity = robocop.getCurrentActivity();
displayed = false;
currentActivity.runOnUiThread(
new Runnable() {
public void run() {
View view = (View)currentActivity.findViewById(id);
if(view != null) {
displayed = true;
}
syncQueue.offer(new Object());
}
});
try {
syncQueue.take();
} catch (InterruptedException e) {
e.printStackTrace();
}
return displayed;
}
}