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

Dagger 2 lifecycle of a component, module and scope
Send sensing data on Android to Amazon Web Services
java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
Draw on SurfaceView with Bitmap as background
Android Handling orientation changes - no change if rotation occurs
Google Sign in Error -Firebase android codelab
How to do Firebase query(.equalTo(key))on childListener and map to String
Different response from Volley request when Internet connecting 4G and 2G
Alpha to layout make all it's children have alpha ?Android
FragmentGridPagerAdapter together with support fragment
Dexter Library for Android permission handling always is always triggering callback onPermissionDenied
Keeping a TileService active?
Custom xml converter with Retrofit 2.0.2 is never called
Add on-device instrumented tests to a project with Robolectric tests
Espresso UI Test Issue
How to show content of Activity in full screen without flicker

Categories

HOME
scikit-learn
deep-learning
linkedin
telegram
spring-data-redis
appcelerator
replace
rom
limit
settings
boto3
pkcs#11
recordrtc
extjs4.2
spin
windows-ce
php-5.6
cumulocity
mongodb-csharp
package.json
imessage
google-container-registry
cfml
enterprise-miner
windows-xp
spring-async
jquery-ias
dpdk
gulp-watch
react-toolbox
direct3d11
draft-js-plugins
firebase-analytics
genexus-sd
ntp
corenlp-server
mustache
parse-tree
flatmap
health-monitoring
signals-slots
mcustomscrollbar
ogc
android-ibeacon
preloader
print-css
magento-2.0.7
spring-integration-sftp
globalize
activeperl
google-cse
magic-draw
compiler-design
headless
d3-force-directed
juice-ui
envi
greatest-n-per-group
macaulay2
wso2developerstudio
hclust
xdoclet
firebase-security
data-protection
ikiwiki
upx
yajsw
tfs-workitem
vigenere
actionfilterattribute
public-html
ejb-2.x
dbaccess
jbake
iiop
easyrtc
imagefilter
gii
unix-socket
mobility
mintty
websphere-esb
clickbank
getopt
scrypt
inputmismatchexception
windows-phone-8-sdk
scringo
node-blade
fb.ui
fragmenttransaction
saleslogix
httponly
predicatebuilder
hibernateexception
user-tracking
u2netdk
tournament
mbeans
collectionviewsource
pbcopy

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