Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing functions #4

Closed
GoogleCodeExporter opened this issue Jul 16, 2015 · 5 comments
Closed

missing functions #4

GoogleCodeExporter opened this issue Jul 16, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

I am using this for the first time. I have found some actions that I have 
needed to perform that I could not without combining several method calls 
into one. I'll include the functions that I had to write to complete these 
tasks here...








Original issue reported on code.google.com by mikenere...@gmail.com on 16 Apr 2010 at 2:17

@GoogleCodeExporter
Copy link
Author

I have a form which has persisted data that I'd like to change.

Enter text appended the new text to the end of the existing text. So either 
enter 
text should clear the exiting text first, or I need to be able to call a method 
to 
clear the text.

    /**
     * To clear the value of an edit text
     */
    public void clearEditText(int index)
    {
        final EditText editText = getCurrentEditTexts().get(index);

        getCurrentActivity().runOnUiThread(new Runnable()
        {
            public void run()
            {
                editText.setText("");
            }
        });
    }



Original comment by mikenere...@gmail.com on 16 Apr 2010 at 2:19

@GoogleCodeExporter
Copy link
Author

    /**
     * For when some long running process is working, in order to determine when it 
is done
     */
    public void waitForText(String text)
            throws RuntimeException
    {

        waitForText(text, DEFAULT_TIMEOUT_MILLIS);
    }


    public void waitForText(String text, long millis)
            throws RuntimeException
    {
        long now = System.currentTimeMillis();
        final long timeout = now + millis;

        while (!(searchText(text) && searchEditText(text)) && now < timeout)
        {
            now = System.currentTimeMillis();
        }

        now = System.currentTimeMillis();

        if (now > timeout)
        {
            throw new RuntimeException(format("failed to find text '%s' within 
required time %sm", text, millis));
        }

        return;
    }

Original comment by mikenere...@gmail.com on 16 Apr 2010 at 2:19

@GoogleCodeExporter
Copy link
Author

Thanks for contributing. This will be included into the next release. 

Original comment by renasr...@gmail.com on 19 Apr 2010 at 6:29

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Will be included in the next release.

Original comment by renasr...@gmail.com on 29 Apr 2010 at 9:20

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Original comment by renasr...@gmail.com on 10 May 2010 at 3:52

  • Changed state: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant