various android ui things

20130817_120219

I just finished a small android project this morning. Yesterday evening I came across the code of someone on GitHub who had built a small duel game about Harry Potter. This was java application and you can play this in the console. So I then forked the repo and created the android application for it. You can find my project here: https://github.com/mrwonderman/Harry-Potter-Duel

The application is completely playable but I won’t publish the application to the play store as the game code isn’t from myself. But feel free to check the code out and try it yourself.

Now I learned some nice small things while writing the application. For example, you can append text to a TextView with the following command. So you don’t need to get and set the text manually.

textView.append("yay !");

Another thing is, how to make a TextView scrollable. I added the following lines to the xml layout of the TextView:

android:scrollbars="vertical"

android:singleLine="false"

and in the java code you need to use the following line:

textView.setMovementMethod(ScrollingMovementMethod.getInstance());

To display a Progressbar from right to left is very easy. Just use the following code:

progressBar.setRotation(180);

This then can look like that:

progressbarRTL

Yannick Signer