<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools...
Make app with translucent background
To make your app with translucent background, apply the following code in your theme. <item name="android:windowIsTranslucent"...
Determine event source in event listener
Last example demonstrate a " Simple example of Button and OnClickListener ", with individual OnClickListener for each View. Altern...
Example to specify View with half width
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools...
Add shadow for TextView, using Java code.
To add shadow on TextView using Java code, call setShadowLayer() method. package com.example.androidtextview; import android.os.Bundle; impo...
Add shadow for TextView, using XML.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools...
Implement custom shape for background
To implement our custom shape, create xml file to define our shape in res/drawable/ folder, /res/drawable/myshape.xml. <shape xmlns:a...
Implement vertical TextView by calling setRotation()
API Level 11 provide setRotation(float rotation) method to rotate a View. We can call the method of TextView object to make it display in ve...