1
0
Fork 0
forked from len0rd/rockbox

Android: Use wakeup objects instead of polling for the dialog results in the keyboard and yesno dialog, allowing a lot of code to be removed.

First part of FS#11708

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28512 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-11-06 01:01:01 +00:00
parent be51be6a99
commit 988bdc1cc4
5 changed files with 74 additions and 81 deletions

View file

@ -26,15 +26,8 @@ import android.content.Intent;
public class RockboxYesno
{
private boolean result;
private boolean have_result;
public RockboxYesno()
{
have_result = false;
}
public void yesno_display(String text)
@SuppressWarnings("unused")
private void yesno_display(String text)
{
RockboxActivity a = (RockboxActivity) RockboxService.get_instance().get_activity();
Intent kbd = new Intent(a, YesnoActivity.class);
@ -43,30 +36,16 @@ public class RockboxYesno
{
public void onComplete(int resultCode, Intent data)
{
if (resultCode == Activity.RESULT_OK)
{
result = true;
have_result = true;
}
else {
result = false;
have_result = true;
}
put_result(resultCode == Activity.RESULT_OK);
}
});
}
public boolean result_ready()
{
return have_result;
}
public boolean get_result()
{
return result;
}
public boolean is_usable()
@SuppressWarnings("unused")
private boolean is_usable()
{
return RockboxService.get_instance().get_activity() != null;
}
private native void put_result(boolean result);
}