Set cursor drawable programmatically in android This below method is use for change cursor drawable programmatically in android. Pass two parameter as argument. 1) Object of EditText. 2) Cursor color. private void setCursorDrawableColor(EditText editText, int color) { try { Field fCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes"); fCursorDrawableRes.setAccessible(true); int mCursorDrawableRes = fCursorDrawableRes.getInt(editText); Field fEditor = TextView.class.getDeclaredField("mEditor"); fEditor.setAccessible(true); Object editor = fEditor.get(editText); ...
Create custom toast message in android Download Code Hello friends, Maybe you would like to create custom toast message. In the following image you can see how our custom toast message will look like. If you wont to create custom toast message like this, kindly download demo and use this code. I hope this code will help you… Thanks! Download Code
Download Code Create custom button in android Maybe you would like to create custom button. We can use custom android buttons for a better layout. Here I’m going to show how to customize Android buttons. In the following image you can see how our buttons will look like. 1) Create button_disable_yellow.xml file in drawable folder. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <corners android:radius="25dp" /> <solid android:color="#ACAFAF" /> </shape> 2) Create button_enable_yellow.xml file in drawable folder. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item><layer-list> ...
It's working...
ReplyDelete