Bulk Emailing

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 7 August 2010

Overlay on Android ListView

Posted on 18:58 by Unknown
I was searching for some solution to display an Overlay on ListView, just like what I can do over the MapView. As Android Framework doesn't support multi-hierarchy views in Z-Axis, so it looks challenging. The solution lies behind overwriting standard ListView. The benefit from this feature is multiple, you can display your custom popup over list and there are many more use cases.
In the above screen shot, I have displayed my "selection palette" (Map Pin Icon and List Icon) at the bottom. You can hide/show the palette by clicking the "green triangle" section.


How I can do that-
There are 2 steps-

1. Drawing-
The trick is overriding dispatchDraw(Canvas canvas) method of ListView. This method gets called from Android Framework once List drawing is over. So, whatever you draw inside of dispatchDraw(Canvas canvas), comes in the foreground. You get drawing control over the whole screen, so you can draw popup at anywhere on the screen.

2. Click Event Handling-
To intercept user click events, you need to define Region and need to restrict ListView to handle clicks which falls under your custom Region. You can read my previous post on Region handling in Canvas.
To intercept click events, you need to overwrite onTouchEvent(MotionEvent e).

You can download the complete source from here.
Email ThisBlogThis!Share to XShare to Facebook
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Weekend at Yeouido (Han River Cruise)
    Yeouido is one of the Han River Cruise boarding points. It has a wonderful river side park (Yeouido P...
  • CityWeather
    Update: Release 1.1 has been uploaded. It will now provide weekly forecast of your selected cities. Download   CityWeather is an Android...
  • Few Multi-Threading Implementations
    Sequential Producer & Consumer In my first example, I will demonstrate an implementation to solve ...
  • Accessing Yahoo Finance API
    Since last few days I was wondering the right set of Web Service to read Country wise Stock Exchange index information . I found a bunch of ...
  • Regular Expression in JavaScript
    I was struggling to get familiar with JavaScript's Regular expression handling and thought my learning might help others. Here I'll...
  • Alphanumeric Random Number
    Sometime basic things becomes tricky :-) Was trying to find out ways to generate some alphanumeric random number whose size (i.e. number of ...
  • Binary Search Tree in Java
    This post is a part of my continuous effort to just implement few of the important data structures in ...
  • QuickSort in Java
    This post is a part of my continuous effort to just implement few of the important data structures in Java. Please find my previous post on ...
  • InDroid- Access to Android's Hidden API
    I have started one project " InDroid " to expose and share Hidden and Internal methods and variables of Android platform which are...
  • Image Geo Tagging for Android
    " onMap " is an Image Geo Tagging application, which can read EXIF header of images stored in your Android device and Map them ov...

Blog Archive

  • ►  2013 (6)
    • ►  September (2)
    • ►  May (1)
    • ►  April (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2012 (4)
    • ►  July (2)
    • ►  March (1)
    • ►  January (1)
  • ►  2011 (11)
    • ►  November (1)
    • ►  October (2)
    • ►  August (1)
    • ►  June (1)
    • ►  April (2)
    • ►  March (3)
    • ►  January (1)
  • ▼  2010 (27)
    • ►  December (2)
    • ►  November (3)
    • ►  September (2)
    • ▼  August (4)
      • Overlay on Android Layout
      • Overlay on Android ListView
      • Region Handling in Android Canvas
      • Image Geo Tagging for Android
    • ►  July (4)
    • ►  June (7)
    • ►  May (5)
Powered by Blogger.

About Me

Unknown
View my complete profile