Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Friday, May 20, 2016

Glowing Pressed Button Part I

This post will gonna show you steps for making a glowing button when pressed... :)
First let's create new project using android studio 2.1...



Next... Let's create our first button...
Then let's create new drawable xml file for default button gradient, right click on drawable folder, choose "New" then "Drawable resource file" as shown in picture below :
Give a name to that xml file :
Then give a code to default_gradient like this :

Nexxt... Add another drawable gradient {pressed_gradient} :
And then button_selector :
Aaaand.... finally we can assign this style to our button... :D
Result.....
Yeeeei... That's the end of part I... :D
Aaand.... You can download above android studio source code here....

Go to Part II....

Thursday, May 19, 2016

Membuat Kotak EditText di Android

Okiee... Di sini Hisoka punya edittext default kyk gambar di bawah :
Naaah...edittext yang itu tuuh...pengen kita ubah...biar bentuknya jadi kotak, jadi sama kyk textbox di C#-wpf...eheh... :D
Soo...pertama-tama tambain resource drawable, klik kanan di folder drawable, pilih new, terus pilih drawable resource file :
Terus masukin nama file xml-nya terus tekan ok...
Naah...  kita dapat file kyk gini :
Naaah... di file-nya kita taroin kode xml kek gini :
Naaaah... uuudaaaah... terus kita ganti background di editextnya biar ngereference ke kotak.xml yang kita buat
Daaaan... hasilnyaaa.... kyk gini :
Naaah... itu warna tepinya biru... itu bisa diganti2 juga... silahkan dicoba2 tag2 lain di xml-nya terus liad perubahannya... :D

Wednesday, May 18, 2016

Making Captcha In Android Using Android Studio Part II

Okieee... Let's continue part II... In the previous part, we have made two classess, MainCatpchaHysoka & TextCaptchaHyosoka, and now we will gonna make one more class namely MathOperationCaptchaHyosoka eheheh... :D
then extends this class from MainCatpchaHyosoka too....
Let's create variabel and it's contructor :
And change protected Bitmap image() as shown below :
Yeeeeiiiks... Coool.... Let's go to MainActivity.....First thing first.... Let's add some needed variabels for connecting our layout element to mainActivity :
Theen... Initializing our first captcha as plus_minus_multiply :
If we run this project, It should be looked like this :
Okieee... Next.. Let's put a handler for "Refresh" and "Cek" Button....Buut... first let's create a new string variabel called "answer" :

Refresh Button :
Cek Button :

Demo :

You download this project from my github repo righthere....

Making Captcha In Android Using Android Studio Part I

Let's start to make a new project..... :D





 Okieee... Next... We will gonna change main layout as shown below :
XML file :


Next, we will be using captca class from this repo. So thanks so much for the owner of that github repo, we will just gonna use his code here... :)
Sooo...create a new class :
Then change the class to abstract class like this :
Next... Put this code to MainCaptchaHyosoka :
Next.... Add a new class.... name it as you like and extend this class from MainCaptchaHyosoka {this class is for handling text captcha}:
Next.. let's create some variables and constructor for this class as shown below :
Then... put below code to the @override method like this


You can see all of above code from my github here...

Siiipss.... I think it's enough for now... I will continue this post later in part II... :)

Tuesday, May 17, 2016

Ngilangin UnderBar EditText

Tampilan awal kyk gini :
Terus ditaroin kyk gini :
Hasilnya :
Ilaang daaah... ehehe... :D