chrisrenke / drawerarrowdrawable Goto Github PK
View Code? Open in Web Editor NEWVisual back-port of the rotating drawer-to-arrow drawable from Android L
License: Apache License 2.0
Visual back-port of the rotating drawer-to-arrow drawable from Android L
License: Apache License 2.0
Error message - Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.
How can i change arrow to right , i want to use DrawerArrowDrawable in right to left layout. is it possible ?
This sdk should not use a different version(20) than the compile sdk version(19)
I ported this library to Xamarin.Android, it can be found here:
When I touch the left side of screen, the drawer appears a little. If I wait to the drawer to stop at that point, I could not move the drawer ever. It is frozen, and I see the log of offset, the value is 0.0833333.
can i use this library on my eclipse workspace?
Edit: DrawerArrowDrawable
needs to override getConstantState
or it will throw a NullPointerException
here: https://github.com/android/platform_frameworks_base/blob/kitkat-release/core/java/com/android/internal/widget/ActionBarView.java#L1637
I am using DrawerArrowDrawable
with SlidingMenu and it works great. However, when I tried adding android.widget.SearchView
in the menu it crashes the app.
E/AndroidRuntime( 4635): java.lang.NullPointerException
E/AndroidRuntime( 4635): at com.android.internal.widget.ActionBarView$ExpandedActionViewMenuPresenter.expandItemActionView(ActionBarView.java:1711)
E/AndroidRuntime( 4635): at com.android.internal.view.menu.MenuBuilder.expandItemActionView(MenuBuilder.java:1236)
E/AndroidRuntime( 4635): at com.android.internal.view.menu.MenuItemImpl.expandActionView(MenuItemImpl.java:625)
E/AndroidRuntime( 4635): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:879)
E/AndroidRuntime( 4635): at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:558)
E/AndroidRuntime( 4635): at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:187)
E/AndroidRuntime( 4635): at com.htc.internal.widget.HtcScaleAnimController.onClick(HtcScaleAnimController.java:334)
E/AndroidRuntime( 4635): at android.view.View.performClick(View.java:4480)
E/AndroidRuntime( 4635): at android.view.View$PerformClick.run(View.java:18686)
E/AndroidRuntime( 4635): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 4635): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 4635): at android.os.Looper.loop(Looper.java:157)
E/AndroidRuntime( 4635): at android.app.ActivityThread.main(ActivityThread.java:5872)
E/AndroidRuntime( 4635): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4635): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 4635): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:852)
E/AndroidRuntime( 4635): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:668)
E/AndroidRuntime( 4635): at dalvik.system.NativeStart.main(Native Method)
To reproduce this issue:
Activity
.getActionBar().setIcon(new DrawerArrowDrawable(getResources()));
SearchView
to the ActionBar
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/search"
android:actionViewClass="android.widget.SearchView"
android:icon="@drawable/ic_action_search"
android:showAsAction="ifRoom|collapseActionView"
android:title="@string/search"/>
</menu>
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.options_menu, menu);
return true;
}
MenuItem
that should display the SearchView
in the action bar,The GIF linked in the readme is 1.6 MB, and playback is super stuttery on my machine.
I ran it through ImageOptim, and it came out pixel-for-pixel identical, but 6ร smaller and with much smoother playback. I would submit a pull request, but the gif isn't hosted in this repo (perhaps it should be?).
I mean when the drawer was set to be the right side of the screen , we needs DrawerArrow to like this ->
can you add the public function that can set the direction of the arrow . Thanks
Would you be interested in something like this:
public class DrawerIndicatorDrawable extends DrawerArrowDrawable implements ValueAnimator.AnimatorUpdateListener {
private final ValueAnimator mValueAnimator;
public DrawerIndicatorDrawable(final Resources resources) {
super(resources);
mValueAnimator = new ValueAnimator();
mValueAnimator.addUpdateListener(this);
}
public DrawerIndicatorDrawable(final Resources resources, final boolean rounded) {
super(resources, rounded);
mValueAnimator = new ValueAnimator();
mValueAnimator.addUpdateListener(this);
}
public void setToArrow() {
super.setFlip(true);
restartAnimatorTo(1f);
}
public void setToDrawer() {
super.setFlip(false);
restartAnimatorTo(0f);
}
public void restartAnimatorTo(final float targetParameter) {
mValueAnimator.cancel();
mValueAnimator.setObjectValues(this.parameter, targetParameter);
mValueAnimator.start();
}
@Override
public void onAnimationUpdate(final ValueAnimator animation) {
final float value = (Float) animation.getAnimatedValue();
super.setParameter(value);
}
@Override
public void setFlip(final boolean flip) {
mValueAnimator.cancel();
super.setFlip(flip);
}
@Override public void setParameter(final float parameter) {
mValueAnimator.cancel();
super.setParameter(parameter);
}
}
I have a use case where I want to animate to or from the arrow whenever the drawer is locked/unlocked.
steps to repro:
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.