Tag Archives: Color

Introduction to Android Canvas – Simple Example

By | December 17, 2016

The Canvas can be used to draw graphics in android. It provides methods to draw oval, rectangle, picture, text, line etc. The Paint class is used with canvas to draw objects. It holds the information of color and style. In this example, we will draw some 2D Shapes. We will create class that extends View and use Canvas… Read More »

How to create a Slide from Left animation while deleting a row from a ListView in Android?

By | September 12, 2012

Hello all…… I have written a lost of posts on Listviews. You can see that by just searching Listviews in my site. Today I will show you how to create a slide out animation while we delete a row from a ListView. So this is the xml that contains the ListView. Let it be in the main.xml main.xml… Read More »

How to change the hint text color in android?

By | April 20, 2012

Hello all.. This simple example will show you how to change the hint text color in android Here is the java code to simply do this. [java] youredittext.setHint(Html.fromHtml("<font color=’#FF0000′>Hello</font> ")); [/java] here is a sample project to view the difference. This is the contents of the main java file. [java] package com.coderzheaven.pack; import android.app.Activity; import android.os.Bundle; import android.text.Html;… Read More »

ListView with Sections in android.

By | February 24, 2012

Hello all………. We have seen many posts about ListViews like creating a listview, adding data to it, customizing a listview etc. Take a look at some of these examples 1. Single Selection ListView in android 2. Flitering a ListView using an input from an EditText in Android. 3. How to create a custom ListView in android? 4. Android… Read More »

Digital Clock Widget in Android.

By | February 12, 2012

Digital Clock is a very useful widget in android to show time in your application. Here is a simple demo on using digital Clock widget. First In the layout file copy this file. [xml] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center|center_vertical" android:background="@drawable/android_3" > <DigitalClock android:text="Digital Clock" android:id="@+id/DigitalClock01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/header_bg" android:gravity="center|center_vertical" android:layout_gravity="center|center_vertical" android:layout_margin="10dp"> </DigitalClock> </LinearLayout> [/xml]… Read More »

Show data in columns in a TableView dynamically in Android.

By | December 26, 2011

Hello all, Often we need to show data from a source such as a database in a tableView like we see in an HTML Page. In Android also we can do this with the help of TableLayout. We can create dynamic rows and add data to it. MainActivity [java] package table_demo.coderzheaven.com.tabledemo; import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; import… Read More »