Use Omniswitch instead of default Recent Apps switcher? - Omni Q&A

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

Related

[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.

[DEV][GUIDE] Adding Widgets Inside App

I was making an app a few weeks ago but couldn't finish it as I'm short on time. So I'm sharing a bit of sample code from my app.
Basically you can add widgets anywhere in your app. Its completely open source and can be found on my Github.
Some people are asking me if this is a tutorial about adding widgets to an app. It is not. This will show you how to add widgets inside your app. That means in any Activity.
A few notable features:
1. Does not need android.permission.BIND_APPWIDGET which can only be accessed by system apps.
2. Can handle clicks just like homescreen widgets.
This has been tested on GB, ICS, JB, KK. Older versions are not tested but it should work on API 3+.
Screenies:
{
"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"
}
Click to expand...
Click to collapse
Source code is on my Github here.
Licensed under WTFPL.
Read more about WTFPL here.
nice Bro...
--------Hit Thanks--------
--------------OR-------------
Visit Some Cool Guides Hmpshah Guides
Zeuscluts said:
nice Bro...
Click to expand...
Click to collapse
It's nice indeed.
I also like the licence. :good:
nikwen said:
It's nice indeed.
I also like the licence. :good:
Click to expand...
Click to collapse
Haha..thanks. I was going to develop a lockscreen with widget support, but won't be able to do so coz of exams as I'm short on time. So thought about sharing the source in case someone else can make use of it.
EatHeat said:
Haha..thanks. I was going to develop a lockscreen with widget support, but won't be able to do so coz of exams as I'm short on time. So thought about sharing the source in case someone else can make use of it.
Click to expand...
Click to collapse
Maybe this is something for you: https://play.google.com/store/apps/details?id=com.teslacoilsw.widgetlocker
And good luck for the exams. :good:
Fajna
Fajna appka. Brawo!
You should make a library for this....
Awesome du de. Thanks
yashade2001 said:
You should make a library for this....
Click to expand...
Click to collapse
I will as soon as I have some time on my hands.
@EatHeat i have added this code to my app
but when i press add widget nothing happens.
but when i compile ur app it works fine .
also this is more simply an app source instead of guide
so i think changing the title would be better
but thats just my opinion
Really nice, good job!:thumbup:
I tried that before, but if you had posted it a few weeks earlier I'd not have to spend so much time on it!
@SpaceCaker: Without any code, nobody can help u.
Regards
EmptinessFiller said:
Really nice, good job!:thumbup:
I tried that before, but if you had posted it a few weeks earlier I'd not have to spend so much time on it!
@SpaceCaker: Without any code, nobody can help u.
Regards
Click to expand...
Click to collapse
what i did was because i didnt understand what he did
was add it as second
SpaceActivity.java
and his
MainAcitivy.java
i assigned all ids properly and suhc
the code is just the stock code from eclipse
when starting new project
and used the include layout tags to include his layout.xml
SpaceCaker said:
@EatHeat i have added this code to my app
but when i press add widget nothing happens.
but when i compile ur app it works fine .
also this is more simply an app source instead of guide
so i think changing the title would be better
but thats just my opinion
Click to expand...
Click to collapse
No guide can be complete without source right? This is just a guide. Not a source to any app.
And what happens when you press the button?
yeah but a guide is for what i know that a guide is.
is that it explains what u did and why and such
when i press the button nothing happens.
ive removed my folders and redid it once again but same thing happens.
Sent from my S500 using xda app-developers app
SpaceCaker said:
yeah but a guide is for what i know that a guide is.
is that it explains what u did and why and such
when i press the button nothing happens.
ive removed my folders and redid it once again but same thing happens.
Sent from my S500 using xda app-developers app
Click to expand...
Click to collapse
Put a log at the end of each method to see which one is getting called and which one is not.
Or post your code.
here is my source code
i also added the signed and compiled APK inside
also i noticed that when i set the SpacedActivity to MainActivity from yours in manifest
then it works fine .
but i wanted to load it from includelayout": thing
so i can implement it on like a second view or on second tab
awesome tutorial. i thought that this was yet another widget (on the home screen) tutorial. im glad that im wrong.
Hi, thank you so much for the tutorial! Could you help me, I am trying to make it so the widget appears on a fragment in my main activity but i can only get it to show in the widget activity.
Thanks

[Library] Floating Action Button from Android L on Kitkat and below

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

Categories

Resources