[Library] Floating Action Button from Android L on Kitkat and below - IDEs, Libraries, & Programming Tools

FABulous
So, Material Design is here and its beautiful. But wait. Its not here yet. And its not for everyone either. So while Google does its thing and squashes bugs and whatnot, why not give your pre-L apps a Material look? Making the ActionBar 56dp high is the most obvious way to go. But why not take it a step further and add the floating action button like the one that the Google+ app has? Too complicated? This library has got you covered. With just a few lines of code, FABulous allows you to add the button and customize its color and drawable too.
Download
https://github.com/FaizMalkani/FloatingActionButton
Instructions:
Place the FAB in a FrameLayout and add your layouts above the FAB view. For best results, keep the FAB height and width at 72dp and in the bottom right of the FrameLayout
Code:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--
Your layouts here. Do not put anything below the FAB layout
-->
<com.faizmalkani.floatingactionbutton.sample.Fab
android:id="@+id/fabbutton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp" />
</FrameLayout>
Initialize your FAB in your activity's onCreate()
Code:
Fab mFab = (Fab)findViewById(R.id.fabbutton);
Initialize your FAB in your activity's onCreate()
Fab mFab = (Fab)findViewById(R.id.fabbutton);
If needed, call the other methods of the FAB
Code:
mFab.hideFab();
mFab.showFab();
mFab.setAlpha();
mFab.setOnClickListener();

Nice one, what's holding this back from being used on pre jb devices?
Can Sherlock be used to solve some of the comparability dependencies?

Hi @Faiz Malkani
I managed to backport this to 2.1+, sources are here:
https://github.com/Quinny898/FloatingActionButton-Compat
Here's what the sample project looks like (not included, it's the same + AppCompat, which is complicated to add):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Thanks Faiz!
One question: it auto-hides while scrolling the page? (the sample app doesn't let me be sure of that)

Jeeko said:
Thanks Faiz!
One question: it auto-hides while scrolling the page? (the sample app doesn't let me be sure of that)
Click to expand...
Click to collapse
You can do something like this, with a scrollview or a list view if you like:
http://android-ed.blogspot.co.uk/2013/09/hiding-bottom-actionbar-during-scrolling.html
Replace the setVisibility calls with show and hide though

This app had it before them https://play.google.com/store/apps/details?id=ee.ioc.phon.android.arvutaja

Laur3nt1u said:
I don't know how Google came with this button but this app had it before them https://play.google.com/store/apps/details?id=ee.ioc.phon.android.arvutaja
Click to expand...
Click to collapse
tho that button looks bad XD, google does copy a lot of stuff from different sources so dont worry bout it

this is probably a dumb question, but could somebody give me a easier tutorial on how to do this? i would really like to try it but i dont really understand how it should be done. im all new to android again after som years with crapple.
thanks in advanced

Thanks for the library, the sample apk looks great.
Importing in Android Studio (I tried many ways) I always have this error, looks like corrupted .png's
Someone else?
h**p://i.gyazo.com/2d17ddabae4e5502bd6fed109e788d68.png

Try copying the FAB Class to your projects src.
Alternatively, if you can wait a few days, I'll be merging a pull request that adds Gradle support

Quinny899 said:
Hi @Faiz Malkani
I managed to backport this to 2.1+, sources are here:
https://github.com/Quinny898/FloatingActionButton-Compat
Here's what the sample project looks like (not included, it's the same + AppCompat, which is complicated to add):
Click to expand...
Click to collapse
great work

looks FABULOUS :laugh: using it in my next app .. thanks :good:

Idea
Hey, thank you for your effort. The FAB looks really good.
To further follow the new design guideline I would suggest that you extend your
Code:
setFabDrawable(Drawable fabDrawable)
method by one line.
Code:
public void setFabDrawable(Drawable fabDrawable)
{
Drawable myDrawable = fabDrawable;
mBitmap = ((BitmapDrawable) myDrawable).getBitmap();
[COLOR="Red"]mBitmap = Bitmap.createScaledBitmap(mBitmap, dpToPx(24), dpToPx(24), true);[/COLOR]
invalidate();
}
This makes the fabIcon as big as it should be regardless the source.
Thanks anyways.

Thanks

For some reason I keep getting this error, although I think all files are in the right place..
"Rendering Problems The following classes could not be found:
-*com.faizmalkani.floatingactionbutton.Fab (Fix Build Path, Create Class)
Tip: Try to build the project. "
What could I do to fix this?

Thanks for your contribution.
But can you teach me how to import the class?
I have imported the jar but I can't use the Fab in .XML file.
There is no mistake but log told me that 1. com.faizmalkani.floatingactionbutton.FloatingActionButton failed to instantiate
and 2. Paint.setShadowLayer is not supported...
So I need a hand. Can anyone help me?

I can test an apk if its ready. drop me a load don't be shy

ywwynm said:
Thanks for your contribution.
But can you teach me how to import the class?
I have imported the jar but I can't use the Fab in .XML file.
There is no mistake but log told me that 1. com.faizmalkani.floatingactionbutton.FloatingActionButton failed to instantiate
and 2. Paint.setShadowLayer is not supported...
So I need a hand. Can anyone help me?
Click to expand...
Click to collapse
It's working, it just doesn't render in the XML builder
Sent from my Nexus 7 using Tapatalk

Faiz Malkani said:
FABulous
So, Material Design is here and its beautiful. But wait. Its not here yet. And its not for everyone either. So while Google does its thing and squashes bugs and whatnot, why not give your pre-L apps a Material look? Making the ActionBar 56dp high is the most obvious way to go. But why not take it a step further and add the floating action button like the one that the Google+ app has? Too complicated? This library has got you covered. With just a few lines of code, FABulous allows you to add the button and customize its color and drawable too.
Click to expand...
Click to collapse
It seems you completely miss to recycle the typed array with a try finally block in the constructor of your custom view.

Problem with Android Studio
Hey, thank you very much for this library, on eclipse all works fine, but in android studio, the little image in the floating action button doesn't display, this is a part of my xml layout file:
Code:
<com.faizmalkani.floatingactionbutton.FloatingActionButton
android:id="@+id/fabbutton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|end"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:onClick="fabClicked"
android:drawable="@drawable/ic_action_new"/>
All this is at the end of a framelayout, where is the error? Thank you in advance
Sorry for my bad english

Related

ThrottleLauncher Widgets (Sample: S2P Widget)

Hi!!
I've released a prebeta of 0.9.4 version to public. This version has the posibility to include moveable widgets. I post this thread to show an example on how to build simple but powerfull widgets.
For example I've done in about 20 minutes this S2P widget:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The code is this one:
Code:
<?xml version="1.0" encoding="utf-8"?>
<panel name="S2PWidget" width="116" height="106">
<icon X="0" Y="0" path="widgets\S2PWidget\back.png"/>
<panel name="Cover" X="3" Y="3" width="70" height="70">
<icon path="widgets\S2PWidget\album.png" exec="#@S2PPath#" height="70" width="70">
<event type="MouseDown"><action execute=":Script" parameters="S2PWidget:Set(MoveLock,true)"/></event>
</icon>
<icon path="#$Registry,HKEY_CURRENT_USER\Software\A_C\S2P\CurrentAlbum#" exec="#@S2PPath#" height="70" width="70">
<event type="MouseDown"><action execute=":Script" parameters="S2PWidget:Set(MoveLock,true)"/></event>
</icon>
</panel>
<icon X="83" Y="5" name="Prev" exec="#$THROTTLE#\Util\S2PControl.exe" params="Previous" path="widgets\S2PWidget\previous.png"/>
<icon X="78" Y="35" name="Play" exec="#$THROTTLE#\Util\S2PControl.exe" params="PlayPause" path="widgets\S2PWidget\#$Registry,HKEY_CURRENT_USER\Software\A_C\S2P\Status,map,[0-pause|default-play]#.png"/>
<icon X="83" Y="75" name="Next" exec="#$THROTTLE#\Util\S2PControl.exe" params="Next" path="widgets\S2PWidget\next.png" />
<text name="Artist" X="3" Y="70" width="70" height="30" alignment="Near" fontcolor="255,255,255" fonttype="7,true" text="#$Registry,HKEY_CURRENT_USER\Software\A_C\S2P\CurrentTitle#" leftmargin="0" textheight="30" textwidth="70" topmargin="2" spacing="0" />
</panel>
As you see it's 16 lines of code for a realtively complex widget that controls S2P .
To install the widget just un compress the zip file to \Program Files\ThrottleLauncher\Widgets and it should now appear when you click the plus button of the widgets page.
If you include Mortscripts in the ecuation.... you can have almost anything done!! .
Hope you'll find this interesting and contribute if you develop cool widgets .
edit: I forgot. You can also include any widget in any page you want by adding <widget name="NAME"/> where name is the folder of the widget. This way you can design module based themes and you can reuse components from one theme to another!
Thanks!!
i'm gonna hardreset and start exploring your new beta.. try to write something of my own as well..
thanks man.
Thanks! I think I'm going to ditch M2D for this
-Arturo- said:
Thanks! I think I'm going to ditch M2D for this
Click to expand...
Click to collapse
nir36 said:
i'm gonna hardreset and start exploring your new beta.. try to write something of my own as well..
thanks man.
Click to expand...
Click to collapse
Thanks to both... . I know it's bad that I'm the one telling it.... but I really thing this is worth a try.
Nice work, keep it up!
made it little bigger and placed buttons under album image and placed on home tab?looks great?tnx
LeAdReW said:
made it little bigger and placed buttons under album image and placed on home tab?looks great?tnx
Click to expand...
Click to collapse
You mean that you've done that?... or is it a request? It's really eassy to do it , hope you've managed to do it...
I just installed the release and I can't find how to get the widgets, sry about the noob question
pgiuoco said:
I just installed the release and I can't find how to get the widgets, sry about the noob question
Click to expand...
Click to collapse
Widgets are in the last tab of the footer. You should see a page with a [+] icon on it... click on the [+] and a dialog must show with the available widgets. Select wichever you want and hit ok, they should appear after a little delay....
nice work mate, keep it up
lol i accidentally installed the old verson off my sdcard, thx again for for your help
Techie87 said:
nice work mate, keep it up
Click to expand...
Click to collapse
Thanks!!
pgiuoco said:
lol i accidentally installed the old verson off my sdcard, thx again for for your help
Click to expand...
Click to collapse
Hehehe, you have scared me for a moment . Glad it was such a simple thing .
!!!
Posted More Plz Thx And New Ideas
Gosh
Will you ever stop improving your software ?
Amazing job, this app just gets better with every release
I will try some tweaks myself asap
Thx for your job !
i have done it,its really easy to customize,tnx,now i delete album art to make it less in height,only track info and buttons
AP, can you describe some more Event types? I cant seem to find the documentation on that. Also can you describe the scripts as well that are mentioned in this line of code:
execute=":Script" parameters="S2PWidget:Set(MoveLock,true)
jdiperla said:
AP, can you describe some more Event types? I cant seem to find the documentation on that. Also can you describe the scripts as well that are mentioned in this line of code:
execute=":Script" parameters="S2PWidget:Set(MoveLock,true)
Click to expand...
Click to collapse
Sorry... I know this is not documented still... that's what the wiki on my web is for .
This is what I can give you right now....
You can specify event's inside Elements and inside pages. Inside each event you can specify as much actions as you want. Here you have an example you can place inside a Page to make it lauch an app:
Code:
<event type="PageShow">
<action execute="#$THROTTLE#\Util\PruebaMAPI\Message2Reg.e xe" parameters="#@SMSAccount# Refresh"/>
</event>
Possible events are:
- For pages: PageLoad,PageUnload,PageShow,PageHide,UpDownGesture,DownUpGesture,LeftRightGesture,RightLeftGesture,ChangeToLandscape,ChangeToPortraitvalid for pages.
- For elements: Click,ElementUpdate
- For elements inside rows with advancedevents="true" (like the widgets page): MouseDown,MouseOver,MouseUp.
Possible actions are (the same that for icons and texts)
- Any executable file with params
- age (parameter is the page name to load)
- :Exit
- :Apps2Cat (parameter is the category to assign)
- :Reload
- :OthersPage (parameter is the page number)
- :Minimize
- :Config
- :ConfigSetup
- :Script: this is the most complicated. execute=":Script" and the param must match this pattern XXXXXX:YYYY(args). for example: <action execute=":Script" parameters="Battery:Refresh()"/>
XXXXXX is the name of the element to change
YYYY is the method to call. Methods supported are:
o Set: Set(Property,value) will set the property to the target value. Valid properties are Name,X,Y,Width,Height,Visible. LocketState is also valid, if set to true the element will follow the finger arround the screen and inside it's containing row until it's released.
o Refresh: supports:
+ (). Will update the whole XXXXXX element
+ (num) will update the XXXXX and the num pixels arround it.
+ (numX,numY) numX means margin in X and numY means margin Y.
+ (x,Y,Width,Height) all the numbers represent margin. To update an especific area watch the next command.
o RefreshRectangle: suports (X,Y,Width,Height)
o Add. Supports (Property,number) will set the property to the property value plus number. Only valid for numeric properties.
o Complement. Supports (property). Only valid for boolean properties (Visible). Will complement it.
WOW!
This totally makes ThrottleLauncher very customizable, especially with MortScript!
Thanks for the help.
jdiperla said:
WOW!
This totally makes ThrottleLauncher very customizable, especially with MortScript!
Thanks for the help.
Click to expand...
Click to collapse
That's the target .
Thank you for your interest!

[Library] Color picker (Open Source)

Hi guys,
I don't know if this is the right forum, so please forgive me if it isn't
During the development of Minimalistic Text I came across the lack of a good color picker view for Android.
In the first attempt I used the one from the samples (The "Ring").
The second attempt has been to integrate this one and add the possibility to change the alpha channel.
In the end I decided to build my own.
To let you use this color picker and - if you like to and are able to - improve it, I've extracted it into an Android library project and made it open source.
It's hosted at Google Code:
http://code.google.com/p/devmil-android-color-picker/
The code has almost no code comments. I will add them if I have time.
At the moment it is localized to German and English.
Please let me know what you think and write me an email if you want to contribute.
Thanks
Devmil
Here are some screenshots (in German):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I guess you never found hxxp://code.google.com/p/color-picker-view/ which has been around for a while now. It got an optional alpha slider too.
But on the other hand it doesn't support HEX input or RGB sliders like yours.
afzkl said:
I guess you never found hxxp://code.google.com/p/color-picker-view/ which has been around for a while now. It got an optional alpha slider too.
But on the other hand it doesn't support HEX input or RGB sliders like yours.
Click to expand...
Click to collapse
no, I haven't found this one. But the one I have used before is quite similar. I added the alpha slider to it.
The main difference for the new selector is the choice between the three input methods.
Working on project created ColorPickerPreference.
Shared it here github.com/attenzione/android-ColorPickerPreference (sorry, can't post links)
Why not RGB sliders or HEX input field?
because regular users will not use them. this is our project group opinion
OP Thanks, this is just what i was looking for. I wanted a color picker where you could choose a color like in photoshop but also input exact values for the more advanced users. Is it alright if i take a look at the code and see if I can get it all on one tab. Ill probably just end up using your stock one though.
Smasher816 said:
OP Thanks, this is just what i was looking for. I wanted a color picker where you could choose a color like in photoshop but also input exact values for the more advanced users. Is it alright if i take a look at the code and see if I can get it all on one tab. Ill probably just end up using your stock one though.
Click to expand...
Click to collapse
Yes, of course! This is why it is open source
Devmil
Thank you!
When I was programming for WM in c# I had occasion to need a colour picker, but never really found one and couldn't be bothered to create it myself (the program was intensive enough by itself not to want to add something like this to it). Now I have transitioned to android I'm sure that I'll need this at one point. so thank you for sharing this! I might never need it (although I'm pretty sure I will use it), but if and when I do, I'll be damn thankful that you put in the effort!
So again, thanks!
-edit-
I'm having some trouble getting the code...seems I need some kind of version control software, but I wouldn't know which one (Mercurial?). Could you add a source download (.zip or .rar) for me to download so I could use (link/include) it in Eclipse? Or am I really being a noob at this (I have successfully used other libraries in c#, so I'm not a total noob ).
On further inspection: I can access the sourcecode, but I guess I just don't know code.google.com AT ALL. I can create a server side clone (don't want to do that, I think), and I can go through all the files in the source and copy/paste to local files, but do I really have to do that to integrate this? Could someone tell me (or point to a tutorial) the best way to get all the code local so I cn use it? Or is the best way just to check out the source online (source file by source file) and copy/paste it into my own project as and how I need it?
Sorry for being a noob, but as I mentioned, I come from c# and have zero experience with code.google.com. I know enough to get everything into my Eclipse project through copy/paste, but there must be a better way!
PS: on winxp sp3, eclipse 3.6 (android 2.2, targetting 1.6, but that's beside the point, if I'm at all in the right ballpark )
Awesome library! I hacked it up a bit, adding a recent colors list, turning it into a activity, and added it to my app https://market.android.com/details?id=com.rj.pixelesque
Amazing Work
Thanks so much for the color picker, this improved the function of my app if a big way. Thanks YOU!
can i use this in my paid app??
Yes, you can use it for whatever you like. Including paid apps.
a stupid question but how to include it in my code??
You can download the source code using a Mercurial client.
I have pushed a compiled library into the downloads section. So if you don't want to have the source code and build it on your own you can simply use the library.
thnx for the help and the color picker
I've just checked the download section, but there is no compiled library. AND is there the chance to have a sample app, how to use it simply?
noob question
op , how to use this as library after downloading ?

[APP] TimeTracker - track your tasks

A month ago i desided to go to magistracy. To be accepted I needed to pass three exams: logistic, computer science and english language. I created schedule for a week where I distributed time for practise for each lesson. But soon I noticed that I'm catching nothing. On this step I decided to track on what I was spending my time. Searching in the Market gave me nothing that can help me solve my problem. I needed a little functionality from an app:
1. Creating tasks
2. Creating tasks for different projects
3. Tracking time spent on task
4. Userfriendly grafs
So, I decide to write this app by myself and that's what I got.
It's not release version. It's beta and it needs some sort of tests.
By this time this app can do everything I wrote above. Soon I'll finish it by version 1.0. I'm waiting for your comments.
Roadmap
1. Will add new types of graphs. Particularly graph for task's mark and so on.
2. Got a few bugs which I'll fix.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Link for download: on google play
Need your feedback.
Please download new version and write feedback)
I really needed something like this, will report back after a few days!
Do you've written the graph renderer by yourself? I've written a pretty similiar app, i'd love to see this in it too
Fantastic app, look fits right in with the ICS design. Looks quite like actually the Google+ app. This should help all the teenagers such as me get coursework in on time
Great app. Keep it up.
Sent from my Galaxy Nexus using xda premium
Hi, I'm trying to use your app on my Xoom running ice cream sandwich.
I was able to add task, but i can't figure out how to edit or delete my task.
Thanks I'm looking forward to use this app to keep track of my spent hours studying.
The app looks great so far.
but please the deactivate the menubtton.
i hat the emulated one on my galaxy nexus
Hi there, love the idea, simple but effective.
I'm using a desire z and whenever I slide open my keyboard to add tasks and the screen goes into landscape, I get a error and it closes the task entry dialog.
App itself keeps running btw.
Hey just installed your app!
Looks great so far.
But under "task>new" task the font color in the "Tag"-textbox is white.
White font on white background is not really advantageous
I think the "New Task"-window is really small, too.
android_owl said:
Do you've written the graph renderer by yourself? I've written a pretty similiar app, i'd love to see this in it too
Click to expand...
Click to collapse
I am using achartengine lib for rendering graphs
EL_G15 said:
Hi, I'm trying to use your app on my Xoom running ice cream sandwich.
I was able to add task, but i can't figure out how to edit or delete my task.
Thanks I'm looking forward to use this app to keep track of my spent hours studying.
Click to expand...
Click to collapse
Thanks for your feedback! I will add this features in the near feature
EndOfSource said:
Hey just installed your app!
Looks great so far.
But under "task>new" task the font color in the "Tag"-textbox is white.
White font on white background is not really advantageous
I think the "New Task"-window is really small, too.
Click to expand...
Click to collapse
I will fix it.
nmx said:
Hi there, love the idea, simple but effective.
I'm using a desire z and whenever I slide open my keyboard to add tasks and the screen goes into landscape, I get a error and it closes the task entry dialog.
App itself keeps running btw.
Click to expand...
Click to collapse
I will fix it, thanks for the report.
Totally awesome and very useful app. It looks great on my T-Mobile Galaxy SII. I'll test and give feedback in a few.
1st thing I noticed is, there is no home screen widget to lists tasks. Also, I wish something like this can integrate with Google Tasks.
Anyway, i LOVE the way it looks right now, and I'll get back to you.
lawalty said:
Totally awesome and very useful app. It looks great on my T-Mobile Galaxy SII. I'll test and give feedback in a few.
1st thing I noticed is, there is no home screen widget to lists tasks. Also, I wish something like this can integrate with Google Tasks.
Anyway, i LOVE the way it looks right now, and I'll get back to you.
Click to expand...
Click to collapse
I think about adding this features
Please download new version from the first post.
CHANGELOG
Fixed some bugs.
Added new graph types.
Hey, cool app!
But would it be possible to add a feature to edit and delete tasks?
When I long press on the task or if I press the menu button, nothing happens.
Apart from that, this app is really good and looks fantastic!
Sent from my NexusHD2 using xda premium
While in "New Task" - Window
*Open Hardware Keyboard*
=> Error
Code:
app_vercode:1
device_model:vision
build_version:201130
condition:1
processName:az.mecid.timetracker
pid:10645
uid:10103
tag:null
shortMsg:java.lang.IllegalStateException
longMsg:java.lang.IllegalStateException: Fragment az.mecid.timetracker.TaskListFragment did not create a view.
stackTrace:java.lang.RuntimeException: Unable to start activity ComponentInfo{az.mecid.timetracker/az.mecid.timetracker.TaskListActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
Errormessage:
http://dl.dropbox.com/u/16346629/Bugs/TimeTracker.txt
Edit:
Found a second one:
Goto "Task" and press "Menu"
Errormessage:
http://dl.dropbox.com/u/16346629/Bu...s.ActionBarHelperBase.onCreateOptionsMenu.txt
Code:
app_vercode:1
device_model:vision
build_version:201130
condition:1
processName:az.mecid.timetracker
pid:10742
uid:10103
tag:null
shortMsg:java.lang.NullPointerException
longMsg:java.lang.NullPointerException
stackTrace:java.lang.NullPointerException
at az.mecid.timetracker.utils.ActionBarHelperBase.onCreateOptionsMenu(ActionBarHelperBase.java:133)
at az.mecid.timetracker.ActionBarActivity.onCreateOptionsMenu(ActionBarActivity.java:65)
Edit 2:
Reports => Tags:
I get "ubi" (blue) at 02/01 (2nd Jan.) but I installed you app yesterday *_*
And tested it yesterday for about 4 minutes.
geenyous said:
Hey, cool app!
But would it be possible to add a feature to edit and delete tasks?
When I long press on the task or if I press the menu button, nothing happens.
Apart from that, this app is really good and looks fantastic!
Sent from my NexusHD2 using xda premium
Click to expand...
Click to collapse
Yes, offcourse) i will this features.
EndOfSource said:
While in "New Task" - Window
*Open Hardware Keyboard*
=> Error
Code:
app_vercode:1
device_model:vision
build_version:201130
condition:1
processName:az.mecid.timetracker
pid:10645
uid:10103
tag:null
shortMsg:java.lang.IllegalStateException
longMsg:java.lang.IllegalStateException: Fragment az.mecid.timetracker.TaskListFragment did not create a view.
stackTrace:java.lang.RuntimeException: Unable to start activity ComponentInfo{az.mecid.timetracker/az.mecid.timetracker.TaskListActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
Errormessage:
http://dl.dropbox.com/u/16346629/Bugs/TimeTracker.txt
Edit:
Found a second one:
Goto "Task" and press "Menu"
Errormessage:
http://dl.dropbox.com/u/16346629/Bu...s.ActionBarHelperBase.onCreateOptionsMenu.txt
Code:
app_vercode:1
device_model:vision
build_version:201130
condition:1
processName:az.mecid.timetracker
pid:10742
uid:10103
tag:null
shortMsg:java.lang.NullPointerException
longMsg:java.lang.NullPointerException
stackTrace:java.lang.NullPointerException
at az.mecid.timetracker.utils.ActionBarHelperBase.onCreateOptionsMenu(ActionBarHelperBase.java:133)
at az.mecid.timetracker.ActionBarActivity.onCreateOptionsMenu(ActionBarActivity.java:65)
Click to expand...
Click to collapse
Thanks man! i attempt to fix it.

[Library][Fork] HoloGraphLibrary

If you need to display graphs and/or charts in your application in a stylish, holo-compliant way, this is your go-to library.
I especially needed the BarGraph view for a project I am preparing for the Samsung Smart App Challenge 2013, but unfortunately, the base library by Daniel Nadeau was hardcoding the prepended $ unit, while my project requires several different other units to be displayed.
So I forked the library and added a couple features (I will be adding more over time), so I thought I would share:
Defining the unit programmatically, using BarGraph.setUnit(String unit)
Code:
// Example
BarGraph bg = (BarGraph) findViewById(R.id.bargraph);
bg.setUnit("m");
Appending or prepending the unit programmatically using #BarGraph.appendUnit(Boolean doAppend)
Code:
// Example
BarGraph bg = (BarGraph) findViewById(R.id.bargraph);
bg.appendUnit(true);
==> The result would be :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Additionnally, I converted the library for proper compatibility with Gradle & Android Studio (IntelliJ).
You can find my fork on Github at the following url: https://github.com/Androguide/HoloGraphLibrary
If you haven't heard of this library before, it currently offers the following views:
You can use them in your project as follows:
LineGraph:
XML
Code:
<com.echo.holographlibrary.LineGraph
android:layout_width="match_parent"
android:layout_height="200dp"
android:id="@+id/graph" />
Java
Code:
Line l = new Line();
LinePoint p = new LinePoint();
p.setX(0);
p.setY(5);
l.addPoint(p);
p = new LinePoint();
p.setX(8);
p.setY(8);
l.addPoint(p);
p = new LinePoint();
p.setX(10);
p.setY(4);
l.addPoint(p);
l.setColor(Color.parseColor("#FFBB33"));
LineGraph li = (LineGraph)findViewById(R.id.graph);
li.addLine(l);
li.setRangeY(0, 10);
li.setLineToFill(0);
BarGraph:
XML
Code:
<com.echo.holographlibrary.BarGraph
android:layout_width="match_parent"
android:layout_height="200dp"
android:id="@+id/graph" />
Java
Code:
ArrayList<Bar> points = new ArrayList<Bar>();
Bar d = new Bar();
d.setColor(Color.parseColor("#99CC00"));
d.setName("Test1");
d.setValue(10);
Bar d2 = new Bar();
d2.setColor(Color.parseColor("#FFBB33"));
d2.setName("Test2");
d2.setValue(20);
points.add(d);
points.add(d2);
BarGraph g = (BarGraph)findViewById(R.id.graph);
g.setBars(points);
g.setUnit("$");
g.appendUnit(true);
PieGraph:
XML
Code:
<com.echo.holographlibrary.PieGraph
android:layout_width="match_parent"
android:layout_height="200dp"
android:id="@+id/graph" />
Java
Code:
PieGraph pg = (PieGraph)findViewById(R.id.graph);
PieSlice slice = new PieSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(2);
pg.addSlice(slice);
slice = new PieSlice();
slice.setColor(Color.parseColor("#FFBB33"));
slice.setValue(3);
pg.addSlice(slice);
slice = new PieSlice();
slice.setColor(Color.parseColor("#AA66CC"));
slice.setValue(8);
pg.addSlice(slice);
If you guys have ideas or feature requests, please share. Pull-requests are obviously welcome.
BTW, anyone else participating in the SSAC this year? The $800k prize-money is mindblowing.
1st place is $200k. Considering the fact that it's Samsung, I would expect a higher prize, but I guess it's a specific contest with the Chord SDK. The venture capital pitch and marketing promotion are equally valuable imo.
This is very cool! Thank you for sharing!
Hi this is a cool library. As you asked for feature requests. How about stacked bar charts. So one is able to show a distribution of values in a group over time or categories?
Gesendet von meinem Nexus 7 mit Tapatalk 4 Beta
mickru said:
Hi this is a cool library. As you asked for feature requests. How about stacked bar charts. So one is able to show a distribution of values in a group over time or categories?
Gesendet von meinem Nexus 7 mit Tapatalk 4 Beta
Click to expand...
Click to collapse
That's a very good idea, I'll try to implement it as soon as I have some time. Thanks.
I'll also soon add the possibility to add a dynamic line chart, updated every X milliseconds cleanly in a separate thread
I've added this library to one of my apps that I'm working on. Here is a quick screenshot.
I've had to modify the LineGraph to be able to show the range lines between max and min.
I see a lot more apps and even infographics using the pie graph format. I personally think it looks more clean and easier to digest. I was looking at the challenge you're looking into, and it sounds interesting enough. It might be a perfect opportunity to enter, and just to learn about the whole process of bringing an app to market. We haven't integrated the Chord SDK, but I think it can be easily implemented since our game concept is related to live interactions. I'm more interested in the Venture Capital pitch with Samsung VC - that company has ridiculous amounts of money - it's ridiculous!
Great post!:good:
H3R3T1C said:
I've added this library to one of my apps that I'm working on. Here is a quick screenshot.
I've had to modify the LineGraph to be able to show the range lines between max and min.
Click to expand...
Click to collapse
Nice, very clean UI.
If you feel like submitting a pull-request for your LIneGraph modifications please do so.
Androguide.fr said:
Nice, very clean UI.
If you feel like submitting a pull-request for your LIneGraph modifications please do so.
Click to expand...
Click to collapse
I plan on sharing my code for the graph as soon as I clean up the code and add some more stuff !
Edit: pull request sent!
This looks great - don't have the need for it at the moment but have favourited it for future use! Thanks!
I there anyone figured out how to add bars to barGraph in a loop ? I click on a item from a listview in left slidingmenu, then retrieve data by this dateItem from database and put values in to arrays. than in a loop, I add bar data to points, and eventually setting this points as bars. But graph doesn't changes. anyone got idea ?
Wow, I have been using this lib and I had to do what you have done for showing some other units.
But this lib has a strange behavior in some devices, it's like it doesn't get the screen sizes or layout sizes correctly and shows out of scale characters and wierd shapes on pie charts sometimes (I'm talking about the original HoloGraph lib).
Someone has an a idea of why this happens?
Help using your lib
Hi,
I downloaded your library and sample project from Github but when I'm not able to see the jar file under the library folder. Can you please tell me how to use your library?
Thanks
is there is any onclick listner or event trigrring on click
Hi,
This is realy looking very clean and nice UI graph presentation, i am going to use it in my next project, but before that want ot confirm that,
does it supports events, i mean i want to give an option like drill down for detail reports.
so like on home page, just bar or pie chart with data, and on click of any of the bar, i can open the other activity with Detail information on the selected bar. is it possible to do that using this Lib ???
anyway i will be trying by myself in some time and post my findings.
yogi.306 said:
Hi,
This is realy looking very clean and nice UI graph presentation, i am going to use it in my next project, but before that want ot confirm that,
does it supports events, i mean i want to give an option like drill down for detail reports.
so like on home page, just bar or pie chart with data, and on click of any of the bar, i can open the other activity with Detail information on the selected bar. is it possible to do that using this Lib ???
anyway i will be trying by myself in some time and post my findings.
Click to expand...
Click to collapse
Amazing library, anyone knows how many "lines" its the max to draw? im using LineGraph, but seems dont draw all the lines i need, so what should i do? Thanks
Thanks
Nice job! Very nice
I'll try it soon
Nice very good library
Can I use it for commercial useage?
I am new to Android programming. How do I import this library to a new sample project in Android Studio?
Hi, can I ask if its possible to add a feature where you can click on the individual bars on a Bar Graph? A simple click listener for the bars will do, I just need to display more detail per point in the bar.
Thanks a lot for your library.

Use Omniswitch instead of default Recent Apps switcher?

Some other ROMs have started to package Omniswitch in their releases. But so far I haven't seen anyone else integrate Omniswitch into the ROM so there is an option to use it to replace the default Recent Apps switcher. And there is no setting for this in Omniswitch itself. Is there something the enduser could change to accomplish this? I even tried decompilng the settings.apk from OmniROM and looking at the appropriate smali but I'm not too familar with the dex format.
On the Oppo Find 5 version of Omni, the option to use omniswitch instead of the default recent is in the "Interface/more... " part of the ROM settings.
Sent from my Find 5 using XDA Premium 4 mobile app
Well yeah, that's OmniROM it's built in to Omni's settings.apk/moreinterfacesettings.smali. I want to know know if there's a way to manually change the recents apps switcher to Omniswitch.
bobbarker2 said:
Well yeah, that's OmniROM it's built in to Omni's settings.apk/moreinterfacesettings.smali. I want to know know if there's a way to manually change the recents apps switcher to Omniswitch.
Click to expand...
Click to collapse
Omni switch is so fluid and smooth..
I even dont know why it is so smoth on Nexus 5 :cyclops:
As AngryHapposai pointed out, the feature is already available and source code is in the repository.
---
Posted from whatever phone booted today
Ok that's one avenue for me to explore. But I was looking for a solution that's more along the lines of directly modifying a setting in an Android system that's already up and running. I'm an enduser not a developer, and It would be a lot less overhead for me to do that as oppose to trying to merge and compile source. I'll take a look at the source and see if I can make heads or tails of what it's doing.
Edit: Could someone point me in a direction of which package to look? I grep'd through settings and couldn't find any relevant strings. I figured if I could find what is changed when "Use Omniswitch for Recent Apps" is checked I could find what I'm looking for.
Look into the OmniGears repo for the settings part.
Sent from my N1 using Tapatalk
maxwen said:
Look into the OmniGears repo for the settings part.
Sent from my N1 using Tapatalk
Click to expand...
Click to collapse
Well yes as I' said already I've established that much but I haven't been able to find the relevant code in android_packages_apps_OmniGears-android-4.4\src\org\omnirom\omnigears\interfacesettings\MoreInterfaceSettings.java. This doesn't look like the area where the settings are actually applied and I don't know java very well where I can easily eyeball where the code goes. So I could use a bit more specific direction.
Someone please port it for xperia neo
Sent from my Xperia Neo using XDA Premium 4 mobile app
bobbarker2 said:
Well yes as I' said already I've established that much but I haven't been able to find the relevant code in android_packages_apps_OmniGears-android-4.4\src\org\omnirom\omnigears\interfacesettings\MoreInterfaceSettings.java. This doesn't look like the area where the settings are actually applied and I don't know java very well where I can easily eyeball where the code goes. So I could use a bit more specific direction.
Click to expand...
Click to collapse
https://github.com/omnirom/android_frameworks_base/commit/2fe1f0f24e23d84df1f321a9ded28b3a25256f22
maxwen said:
https://github.com/omnirom/android_frameworks_base/commit/2fe1f0f24e23d84df1f321a9ded28b3a25256f22
Click to expand...
Click to collapse
Thank you for the link, I saw tis already after looking through the gerrit. The relevant code is this:
Code:
private boolean isOmniSwitchEnabled() {
// TODO no user specific value here
int settingsValue = Settings.System.getInt(
mContext.getContentResolver(), Settings.System.RECENTS_USE_OMNISWITCH, 0);
boolean omniSwitchStarted = false;
if (mOmniSwitchStarted.containsKey(mCurrentUserId)){
omniSwitchStarted = mOmniSwitchStarted.get(mCurrentUserId);
}
return (settingsValue == 1) && omniSwitchStarted;
}
It doesn't look it's setting anything here but it does show where Omni stores the flag that tells it to use Omniswitch for Recent Apps. Is the Settings.System table accessible through means other than programmatically? Is that all there is to it, set a flag in a table and Omniswitch knows to use itself for Recent Apps? I grep'd through the Omniswitch code and didn't find any references to recents_use_omniswitch so I don't know how the flag is checked and then the preference enforced.
Ok the Settings.System table is located in data\data\com.android.providers.settings\databases\settings.db.
I tried adding "RECENTS_USE_OMNISWITCH" = 1 record to the "system" table and "global" table in the settings.db, but no joy. I'm running out of threads to follow trying to trace this. Would love someone more experienced than me to help out.
You should write some real code for this
Sent from my N1 using Tapatalk
maxwen said:
You should write some real code for this
Sent from my N1 using Tapatalk
Click to expand...
Click to collapse
Nice idea but need to know what to do before you write code....
bobbarker2 said:
Nice idea but need to know what to do before you write code....
Click to expand...
Click to collapse
the answer is already in the code I linked above
OmniSwitch can be "remoteley controlled" by using broadcast intents
this will "toggle" OmniSwitch
Code:
Intent showIntent = new Intent(OmniSwitchConstants.ACTION_TOGGLE_OVERLAY);
mContext.sendBroadcastAsUser(showIntent, UserHandle.CURRENT);
Since sendBroadcastAsUser requires priviledged system permissions
you can only do that from a system app by default
maxwen said:
the answer is already in the code I linked above
OmniSwitch can be "remoteley controlled" by using broadcast intents
this will "toggle" OmniSwitch
Code:
Intent showIntent = new Intent(OmniSwitchConstants.ACTION_TOGGLE_OVERLAY);
mContext.sendBroadcastAsUser(showIntent, UserHandle.CURRENT);
Since sendBroadcastAsUser requires priviledged system permissions
you can only do that from a system app by default
Click to expand...
Click to collapse
Hi @maxwen, I'm a complete noob regarding intents and activities, I am trying to create a shortcut that toggles omniswitch, can you please tell me what should I fill in the app?, attached screenshot.
Thanks for your help and patience.
Edit: I can use Llama and select to start action, service or broadcast but I am lost on the proper values for the fields Like action, activity, etc.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my GT-I9300 using Tapatalk
I am also looking for a method to launch Omniswitch (not the settings) from the NavBar. Has anyone found a solution?
I found the implementation
I found the implementation on omnirom implementation here: https://github.com/omnirom/android_frameworks_base/commit/13d9f74a72136786a8ddcf3fd02bf07ab2a02073
And other change here(not merged): https://github.com/omnirom/android_frameworks_base/commit/2fe1f0f24e23d84df1f321a9ded28b3a25256f22
But you need recompile frameworks_base of your rom with this modifications.
I made a alternative...
Looking in this link: https://github.com/omnirom/android_f...2bf07ab2a02073 we can see how ominirom system call ominiswitch overlay. Thinking that I did a app that call the overlay and and you can use in a custom gesture of your launcher.
If can help improve this alternite, help me on github: https://github.com/augustoicaro/Toggle-OmniSwitch
Note: Its only work if you really use omniswitch app(org.omnirom.omniswitch)
kikuto said:
The unique problem for this solution is when I call the app its go to home(Like press the home button) and afterbthat call the overlay.
Click to expand...
Click to collapse
This is because you are calling finish()
Just let the activity run in the background

Categories

Resources