lorensiuswlt / newquickaction Goto Github PK
View Code? Open in Web Editor NEWAndroid QuickAction
Home Page: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
License: Apache License 2.0
Android QuickAction
Home Page: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
License: Apache License 2.0
I found out an issue on Android 2.2/2.3. After click the popup item fast, the item background will disappear. The whole quick action item displayed transparent background.
Till 3.0 the animation of QuickAction are fine, starting ICS there are sliding problems
Hello lorensiuswlt!
You have a great app, unfortunately this app does not have a logo yet, may I donate a logo for your app?
Hi,
I'm just running side-by-side fragments in an activity on my tablet (android.support.v4.app.ListFragment on right) with QuickAction called using onListItemClick(). However when this is done, the location of the QA is over the left fragment. Issue arise from QuickAction class mRootview width being a number in the millions (as opposed to the actual screenwidth being 1280)
Let me know if you need anything else.
Hi Loren,
Superb code. In my project, I use custom font and use following code to apply my custom font to all controls in the layout.
public static void applyFont(final Context context, final View root, final String fontPath) {
try {
if (root instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) root;
int childCount = viewGroup.getChildCount();
for (int i = 0; i < childCount; i++)
applyFont(context, viewGroup.getChildAt(i), fontPath);
} else if (root instanceof TextView)
((TextView) root).setTypeface(Typeface.createFromAsset(context.getAssets(), fontPath));
} catch (Exception e) {
Log.e(TAG, String.format("Error occured when trying to apply %s font for %s view", fontPath, root));
e.printStackTrace();
}
I tried this introducing in your code but couldn't find the appropriate place. Can you pls guide me?
Thanks
Is this library known to work with ICS (4.0) ? I get the following stacktrace when I try to use this library on 4.0+
02-25 11:41:29.047: E/AndroidRuntime(535): FATAL EXCEPTION: main
02-25 11:41:29.047: E/AndroidRuntime(535): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.towson.snackoverflow/com.towson.snackoverflow.activities.BountyDetailsActivity}: android.view.InflateException: Binary XML file line #40: Error inflating class
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.os.Handler.dispatchMessage(Handler.java:99)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.os.Looper.loop(Looper.java:137)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-25 11:41:29.047: E/AndroidRuntime(535): at java.lang.reflect.Method.invokeNative(Native Method)
02-25 11:41:29.047: E/AndroidRuntime(535): at java.lang.reflect.Method.invoke(Method.java:511)
02-25 11:41:29.047: E/AndroidRuntime(535): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-25 11:41:29.047: E/AndroidRuntime(535): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-25 11:41:29.047: E/AndroidRuntime(535): at dalvik.system.NativeStart.main(Native Method)
02-25 11:41:29.047: E/AndroidRuntime(535): Caused by: android.view.InflateException: Binary XML file line #40: Error inflating class
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.createView(LayoutInflater.java:606)
02-25 11:41:29.047: E/AndroidRuntime(535): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-25 11:41:29.047: E/AndroidRuntime(535): at net.londatiga.android.QuickAction.setRootViewId(QuickAction.java:102)
02-25 11:41:29.047: E/AndroidRuntime(535): at net.londatiga.android.QuickAction.(QuickAction.java:78)
02-25 11:41:29.047: E/AndroidRuntime(535): at com.towson.snackoverflow.activities.BountyDetailsActivity.setupQuickActions(BountyDetailsActivity.java:110)
02-25 11:41:29.047: E/AndroidRuntime(535): at com.towson.snackoverflow.activities.BountyDetailsActivity.onCreate(BountyDetailsActivity.java:51)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.Activity.performCreate(Activity.java:4465)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-25 11:41:29.047: E/AndroidRuntime(535): ... 11 more
02-25 11:41:29.047: E/AndroidRuntime(535): Caused by: java.lang.reflect.InvocationTargetException
02-25 11:41:29.047: E/AndroidRuntime(535): at java.lang.reflect.Constructor.constructNative(Native Method)
02-25 11:41:29.047: E/AndroidRuntime(535): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.view.LayoutInflater.createView(LayoutInflater.java:586)
02-25 11:41:29.047: E/AndroidRuntime(535): ... 25 more
02-25 11:41:29.047: E/AndroidRuntime(535): Caused by: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f010022 a=-1}
02-25 11:41:29.047: E/AndroidRuntime(535): at android.content.res.Resources.loadColorStateList(Resources.java:2042)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.widget.TextView.(TextView.java:774)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.widget.Button.(Button.java:108)
02-25 11:41:29.047: E/AndroidRuntime(535): at android.widget.Button.(Button.java:104)
02-25 11:41:29.047: E/AndroidRuntime(535): ... 28 more
Hello,
I have encountered a unique bug, I have a list of say 100 records which the user generates itself, on longpress on a row i show the quick action menus.
Problem is when i scroll once, and if i longpress on 1st showing row after sroll, the quickaction shifts 2 positions below,
When i scroll twice and if i longpress on 1st showing row after sroll, the quickaction shifts say 3 or 4 positions below, that means the quick action menu is shown but below 4 rows that was actually long pressed.
When i long press the last item in my list i.e. the 100th item, since after each scroll the quick action menus shift position, as per your algorithm written in QuickAction.java class, the show() method is called but due to 4-5 scrolls the quickaction menu is way below the last item in the list, which obstructs it from Showing.
I hope you will help me in this .
Thanks,
Varun Thakur.
See title.
There is a gap to the right on a galaxy nexus. I don't have an idea why. Can somone confirm this?
I have tried in the emulator with tablet sizes and this works well. Just the Galaxy Nexus resolution of 720x1184 320dpi has this strange gap.
It is displayed as http://pan.baidu.com/share/link?shareid=165232&uk=2737455925, Would you like to have a look and provide your solution to me? Thanks.
The outside touch and the back button dismisses the quick action view but i want to override the back button.
Hi Lorensius,
Android recreates the view on change orientation but dont manage it for us.
If you open the quickaction and changes orientation, you ll see an 'activity leaked a window' exception.
Log:
10-25 04:30:47.686: E/WindowManager(221): Activity test has leaked window android.widget.PopupWindow$PopupViewContainer@44e0ab60 that was originally added here
10-25 04:30:47.686: E/WindowManager(221): android.view.WindowLeaked: Activity test has leaked window android.widget.PopupWindow$PopupViewContainer@44e0ab60 that was originally added here
10-25 04:30:47.686: E/WindowManager(221): at android.view.ViewRoot.(ViewRoot.java:227)
10-25 04:30:47.686: E/WindowManager(221): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
10-25 04:30:47.686: E/WindowManager(221): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
10-25 04:30:47.686: E/WindowManager(221): at android.view.Window$LocalWindowManager.addView(Window.java:424)
A possible solution, dismiss the quickaction:
Mark Murphy said "Move that logic out of the the View and into the Activity. Then, dismiss
them in whichever of onPause/onStop/onDestroy fits your needs best. Save a
flag or something in onSaveInstanceState() to let you know to re-open them
after the orientation change."
http://comments.gmane.org/gmane.comp.handhelds.android.devel/60167
A better explanation of the problem and the two possible solutions:
Avoid dialog leak issue:
http://androiddev.orkitra.com/?p=111
Handle configuration or orientation change:
http://androiddev.orkitra.com/?p=108
Please add the maven support in the same way as SherlockActionBar.
You can only copy pom.xml from SherlockActionBar and modify it for your project
Next step should be upload your library to any public maven repository, but pom.xml make this simple for everyone.
Hi Lorensius, Thanks for your great work.
I'm still using your July-16 commit and one of my users encountered the following exception. Has this been fixed in the latest release? Thanks!
java.lang.NullPointerException
at android.widget.PopupWindow$PopupViewContainer.dispatchKeyEvent(PopupWindow.java:1340)
at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2471)
at android.view.ViewRoot.deliverKeyEvent(ViewRoot.java:2431)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1741)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
The quickaction_slider_background.png drawable files are 8-bit, but a gradient like this could stand to be exported in 24-bit so it looks more smooth.
Thanks for a great library.
Is there a way to change action item icon or title after it was initialized? i need to show different options depending on the list item in the LisView, but i don't see the way to do it
?
Hi Lorensius, I found out the new version still has transparent background issue.
I clicked the item for 2 ways, one is click item quickly, and other is hold about 1s then release.
In previous version, the 1st way to click item, the background transparent, but the 2nd way(hold way) is ok.
But In current version, it reversed, the 1st way is ok, and 2nd way is wrong.
The issue only occur on Android 2.2 and above. Both of two ways on Android 2.1 - updated are OK.
Thanks.
The pop-up menu is not being displayed properly with the device (a Samsung Galaxy Tab 3 in this case) in landscape orientation. The full list appears correctly when the device is in portrait orientation.
I am trying to set background image selector for the actionItem's icon, but i want to change the image only, not the background, it seems that the parent view do not pass selected/focused and so on states to the childs. Any ideas?
Can you post the transparent background solution?
10x
The default implementation looks like it was made for 4+ items to be in the bar. I'm using 3, and so I have grey space to the right. I tried using the modification for the HD screen code (one of your pull requests) but this slides the action bar to the left of the screen instead of the middle.
Please see the stackoverflow post here:http://stackoverflow.com/questions/16828210/struggling-with-quickaction-not-displaying-correctly
Any help would be greatly appreciated as this is delaying an alpha test of an app i was commissioned to work on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.