android


Android percentage bar with info popup


I have to create a view like below in my app. Can anyone give some idea how to create it? The color, percentage, text must be dynamic.
Why not defining it as a normal xml-layout like this?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:id="#+id/progress_done"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:orientation="vertical" >
<TextView
android:id="#+id/progress_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:background="#FF33B5E5"
android:text="Review"/>
<TextView
android:id="#+id/progress_done_percentage"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center"
android:background="#FF33B5E5"
android:text="30%"
android:singleLine="true"/>
</LinearLayout>
<LinearLayout
android:id="#+id/progress_todo"
android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="0.7"
android:orientation="vertical" >
<TextView
android:id="#+id/progress_todo_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:background="#FFFFBB33"
android:text="Go Ahead"/>
<TextView
android:id="#+id/progress_todo_percentage"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center"
android:background="#FFFFBB33"
android:text="70%"
android:singleLine="true"/>
</LinearLayout>
</LinearLayout>
You just have to put your bubbles in as background-images. Then you can access the views per id in your code and change text, color and the weights accordingly.
Edit: just noticed, you want the "Recent" and "Go ahead" as popups. Easy. Set them to android:visibility="gone" or "invisible" (whatever fits you best) and then back to android:visibility="visible" into the onClickListener or onTouchListener or whatever of the textviews progress_done_percentage and progress_todo_percentage. Don't forget to set android:clickable="true" for them.

Related Links

Custom GridAdapter with 2 columns doesn't works
creating a method that will be used to display query results on android sqlite
General Failure Sending SMS
avoid auto-killing activity in android
How to delete or add imageviews to layout in android?
Tesseract - Help me understand datapath
Upgrading Phonegap Android from 2.5 to 2.6 and 2.7 step
YouTube iframe embeds cannot autoplay on Android
animating a view in Android
how to add clipboard option to action_send intent
Fixed size textview in table layout
Activity vs Fragment : performance differences?
Android SQLite select * from table where name like %key% using prepared statements [duplicate]
How to develop a local user login in an Android Application, is there an API or I must develop it from scratch?
Android Error: android.widget.TextView.<init>
update Widget Non periodiccally

Categories

HOME
embedded
turing-machines
ns-3
angular-formly
3d
battery
requirements
grafana
entity-framework-core
ado.net
x264
crystal-reports-2013
jax-ws
pkcs#11
dkim
openpyxl
datastage
qsqlquery
mongodb-csharp
event-sourcing
aws-sdk
fileserver
vuejs
delphi-xe5
sar
dataflow-diagram
windows-server-2003
pic32
fragment-backstack
oculus
ntp
boost-asio
mobx
deltaspike
login-script
carriage-return
batching
roblox
hivemq
cd
release
jvmti
naming
clang++
apache-spark-dataset
dapper-simplecrud
double-click
jboss-4.2.x
robomongo
rserve
oozie-coordinator
template-toolkit
objectscript
choice
vcloud-director-rest-api
rocks
node-request
atlas
reporting-services-2012
i386
respondcms
bizagi
turbo-prolog
design-principles
user-management
oracle-spatial
rubaxa-sortable
android-launcher
sony-lifelog-api
shopizer
cakephp-2.7
java-security
beatsmusic
jbake
crowd
spy++
grails-domain-class
android-framework
websphere-esb
inputmismatchexception
away3d
tlf
scringo
facebook-timeline
pagedown
onload-event
web-farm
iboutlet
multiplexing
cross-database
htdocs
google-ajax-api
lr
cgbitmapcontextcreate
ruby-1.8
cfwindow
mathematical-notation
escrow
todos
int64
xslcompiledtransform

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App