GithubHelp home page GithubHelp logo

fab's People

Contributors

chenzhang22 avatar vbaidak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fab's Issues

Question - Pressed State

Hi
In Google guidelines, it says that default elevation for FAB is 8dp and in pressed state the elevation is 14dp(+6dp). is this libs deffault properties are same as google guidelines?

Sorry For My Bad English And ThnQ For Ur Awesome Lib :)

Changing size of button

Hi,

Great library. The only issue I have run into is that the size of the button is seemingly not customizable beyond Normal or Mini. Setting the height and width of the button in XML does nothing as far as I can tell. I saw from your video that this was on purpose in order to comply with Material Design guidelines, however it would be nice to be able to not have this limitation. Would it be possible to add custom sizing?

Default shadow offset does conform to material design guidelines

The light source in material design is always directly above the element, so shadows do not ordinarily have an x offset.

http://www.google.com/design/spec/what-is-material/environment.html#environment-3d-world
http://www.google.com/design/spec/components/buttons.html#buttons-floating-action-button

Would you please consider changing the default x offset to zero, as the typical user likely just wants a button with the recommended style?

Move button up and down

Would be nice if we had methods (with a parameter for height) for moving the button up (animated) when a snackbar is shown, and move it back after snackbar is dismissed.

Icon is outside the circle

Android 2.3 (4+ is ok), it's also visible in Android Studio's layout preview
It's caused by fab:rippleEffect_enabled="true". When I set it to false, it's ok again.

device-2015-05-25-154417

Can't render XML

I was using Android Studio 2.1.2 and my JDK was 1.8 ,my system was 64bit Win7 .

When I add this sample to my XML ,it just keep throwing an error that I can't understand.

<com.software.shell.fab.ActionButton
android:id="@+id/action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
/>

java.lang.VerifyError: Expecting a stackmap frame at branch target 12
Exception Details:
Location:
com/software/shell/fab/ActionButton.isHidden()Z @5: if_icmpne
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 2ab6 022b 07a0 0007 04a7 0004 03ac

at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.getConstructor(Class.java:1825)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:396)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:176)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:247)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:171)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:317)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:520)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:508)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:967)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:508)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:75)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:620)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:371)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:639)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:519)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Could you help me?

I love this awesome project ,whereas I'm new in programme : )

Remove deprecated API, fix unknown API references

Hi when I start my app, I get a
"Could not find class 'com.software.shell.fab.ActionButtonOutlineProvider', referenced from method com.software.shell.fab.ActionButton.drawElevation" exeption, but the Action button works fine.

Maybe you can help me with this issue.

BR
Emeriko

Both buttons show up when I only want one at a time

I have a edit and save button. When editButton is clicked the editButton hides and the saveButton shows. The problem I am having is when the activity is first loaded saveButton.hide() does not hide the button. I made a if statement to switch between the buttons but they dont work the way i want it to. I have began to make the code more redundant and nothing still works. It seems to me that my logic is correct, but the application is not doing what I want it to do.

ActionButton editButton = (ActionButton) findViewById(R.id.edit_button);
ActionButton saveButton = (ActionButton) findViewById(R.id.save_button);
editButton.show();
saveButton.hide(); // saveButton.hide(); does not work initially on load up

editButton.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
editButton.hide();
saveButton.show();
if(saveButton.isHidden()) {
saveButton.show();
}
}
});

move() method smearing on KitKat with snackbar.

The FAB seems to be smearing (leaving a image trail behind) under certain conditions in KitKat when move is called.

I'm using your FAB in conjunction with nispok's Snackbar library https://github.com/nispok/snackbar,
and when the snackbar slides up, I move my FAB up by the snackbar height. However, when I SWIPE AWAY the snackbar (very important detail), the FAB comes back down, but it leaves a trail of itself.

I made my own translation animation and the smearing is gone, so it's a good chance that it's a bug in your library. I thought it should be something you should look at.

Note: I've only tested this on the emulator. ICS and Lollipop work fine.
Edit: Jellybean works fine, did not test ICS.

fab smearing

tiny problems

  1. Please generate a gradlew file by running gradle wrapper
  2. Please include sample projects.

A really cool and useful project.

Won't load in fragment

Inflated it

    View view = inflater.inflate(R.layout.fragment_pocetna, container, false);
    listview = (ListView) view.findViewById(R.id.pocetna_listview);
    ActionButton actionButton = (ActionButton) view.findViewById(R.id.action_button);
    actionButton.show();

Here's my layout fragment_pocetna:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ECECEC">

<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/pocetna_swipe"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

<ListView
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:divider="@null"
    android:dividerHeight="0dp"
    android:transcriptMode="normal"
    android:id="@+id/pocetna_listview"
   />

</android.support.v4.widget.SwipeRefreshLayout>

<com.software.shell.fab.ActionButton
    android:id="@+id/action_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_marginRight="@dimen/fab_margin"
    android:layout_marginBottom="@dimen/fab_margin"
    />

</LinearLayout>

But doesn't seem to show. There's no errors in logcat. Thanks

FAB position not exactly correct

First of all thank you for this wonderful library. I tried it and it is working great but I noticed a small bug when I am using it with almost the default settings. The fab is upper and more to the left side than most of the Google native apps (Gmail, Keep, Photos..). It seems that the margin to the edges begins from the end of the shadows instead of the exact button. When I enabled elevation (which automatically disables shadows) the fab is located correctly at the exact same spot as the Google apps.

Here is some screenshots if my explanation wasn't good enough :)

FAB with the default settings
Here is the XML code with RelativeLayout

<com.software.shell.fab.ActionButton
    android:id="@+id/action_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_marginRight="@dimen/fab_margin"
    android:layout_marginBottom="@dimen/fab_margin"
    fab:button_color="@color/fab_material_blue_500"
    fab:button_colorPressed="@color/fab_material_blue_900"
    fab:image="@drawable/fab_plus_icon"
    fab:rippleEffect_enabled="true"
    fab:show_animation="@anim/fab_scale_up"
    fab:hide_animation="@anim/fab_scale_down" />

screenshot_2015-06-04-11-22-41

Here is a screenshot from Gmail app

67ef57d0-9d95-4577-b7aa-b05e581d0f49 1

And here is a screenshot from FAB button with the same XML code but with added elevation in java code:
if (Build.VERSION.SDK_INT >=21) {
actionButton.setElevation(10);
}

screenshot_2015-06-04-02-41-54

Background of the button

When I use the BIG type button, and place it over some view, I found that that there is a rectangular box (of white color by default) covering the view beneath, I couldn't find a way to remove it, how do i remove this ?

Can Drag?

I want drag this button, how can I do this ?

Animations not showing on default

Hi,
I'm using your library to do an app on a Moto G2. When I define the show and hide animations in the xml and through the actionButton.setHideAnimation(...) - methods, I can't see any animation. I honestly thought there's actually something really broken.

I decided to play around. I extracted the Animation object through actionButton.getShowAnimation(). I then called animation.setDuration(1000) and added them back with a actionButton.setShowAnimation(). NOW I can actually see all of the animations. This workaround is working, but I feel like this isn't the correct way done.

IS there something I might have done wrong or do I have to overwrite the duration to see the animations?

Lollipop elevation disable shadow

Hello,
I would like to add your FAB to "over a edge of two materials". Iam using relative layout with negative margin. And FAB shadow is shown properly. Problem is that when other views has android:elevation set, it shows over FAB and FAV is not visible. So, I add elevation (higher) to FAB. FAB is shown correctly over other view, but without shadow.
Any idea what I did wrong? Or how to solve this? Thank you.
fab_with_elevation
fab_without_elevation

onTouchEvent to handle onClickListener

Hi.

How is onTouchEvent supposed to work? I can't find the correct way to handle onClick events. I've tried setOnClickListener and setOnTouchListener without luck. And I can't cast FloatingActionButton to Button because it gives an error.

Can you provide an example? Thanks!

Ripple state reset on UP_ACTION outside of FAB

In order to reset the ActionButton state on an UP_ACTION outside of the view bounds, I had to include the following workaround:

actionButton.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(@NonNull View view, @NonNull MotionEvent event) {
        int action = event.getAction();
        if((action == MotionEvent.ACTION_CANCEL) || (action == MotionEvent.ACTION_UP)) {
            actionButton.setState(ActionButton.State.NORMAL); // fix ripple handling
        }
        return false; // default handling
    }
});

Render issue

HI,
currently i am working with android studio and i update the FAB version from 1.1.0 to 1.1.2 and i get a render issue i dont know if it is an Android Studio issue or maybe an incompatibility but if i downgrade to 1.1.0 the render works and display the button on preview.

Btw on 1.1.1 version still the issue.

regards

java.lang.VerifyError: Expecting a stackmap frame at branch target 12
Exception Details:
Location:
com/software/shell/fab/ActionButton.isHidden()Z @5: if_icmpne
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: 2ab6 0241 07a0 0007 04a7 0004 03ac

at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getConstructor0(Class.java:2885)
at java.lang.Class.getConstructor(Class.java:1723)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:368)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:154)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:93)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:216)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:143)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:838)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:838)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:413)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:322)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:511)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:499)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:499)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:611)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:363)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:630)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Prefix attributes to avoid collisions with other libraries

Small issue, but can you please prefix the stylable attributes with something like fab? Some of the names are pretty common and cause isses with other libraries that also don't prefix. The result is a compile time error like this

Attribute "type" already defined with incompatible format.

Animations not work

Hi,

I have no animation either if they are defined in xml or if they are defined programmatically.

I put a fab in a relative layout as you advise it, with a recycler view. All is inflated in a fragment.

All others features work well.

I don't understand what I do wrong.

Thanks.

fragment_layout.xml

<android.support.v7.widget.RecyclerView
    android:id="@+id/fragment_list_recyclerview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/padding_default"/>

<com.software.shell.fab.FloatingActionButton
    android:id="@+id/fragment_list_fab"
    android:layout_width="56dp"
    android:layout_height="56dp"
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"
    android:layout_marginBottom="@dimen/margin_default"
    android:layout_marginRight="@dimen/margin_default"
    android:layout_marginEnd="@dimen/margin_default"
    fab:type="normal"
    fab:shadow_color="@color/sq_blue_dark"
    fab:shadow_radius="8.0dp"
    fab:button_color="@color/sq_blue_dark"
    fab:button_colorPressed="@color/sq_orange_dark"/>

fragment onViewCreated

mFab = (FloatingActionButton) getSQActivity().findViewById(R.id.fragment_list_fab);
mFab.setImageSize(24.0f);
mFab.setImageDrawable(getResources().getDrawable(R.drawable.ic_add_white_24dp));
mFab.setAnimationOnShow(FloatingActionButton.Animations.ROLL_FROM_DOWN);
mFab.setAnimationOnHide(FloatingActionButton.Animations.ROLL_TO_DOWN);

PayPal donate link returns error

Clicking on the donate button in the readme returns the following error:

Currently PayPal accounts in Ukraine are only able to send payments. This recipient is not eligible to receive funds.

no resource found logback-android-core

I'm trying to build this project after cloning

$ ./gradlew --configure-on-demand --daemon assembleDebug installDebug

and got an error. It seems like it couldn't find logback-android-core. How're you able to build this?

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':sample'.
> Could not download logback-android-core.jar (com.github.tony19:logback-android-core:1.1.1-3)
   > Could not get resource 'https://jcenter.bintray.com/com/github/tony19/logback-android-core/1.1.1-3/logback-android-core-1.1.1-3.jar'.
      > Could not GET 'https://jcenter.bintray.com/com/github/tony19/logback-android-core/1.1.1-3/logback-android-core-1.1.1-3.jar'.
         > akamai.bintray.com: nodename nor servname provided, or not known

Ripple effect gets interrupted as soon as you release the touch input from the fab

Well, a video would be more explanatory then words: https://goo.gl/JgwZsD

anyway that's the code, notice that its father view is a RelativeLayout, if it matters anyway:
<com.scalified.fab.ActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginRight="16dp" android:layout_marginBottom="16dp" fab:rippleEffect_enabled="true" fab:button_colorPressed="@color/white" fab:button_color="@color/white" fab:image="@drawable/ic_my_location_black_24dp"/>

FAB sides are not perfectly round

I have used the default implementation of your library's FAB, however the FAB is not perfectly round. The left & top side of the FAB is cut off - not round. Any work arounds to resolve this.

 <com.software.shell.fab.ActionButton
        android:id="@+id/action_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="-"
        android:textColor="#fff"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:elevation="7dp"
        android:layout_margin="@dimen/fab_margins"
        fab:type="DEFAULT" />```

xml parsing error while setting the animations

Hi,

Its a great library that you've made. It helped a lot :)

But when I tried to set the animation to the button using :

actionButton.setShowAnimation(getResources().getAnimation(R.anim.fab_fade_in));
actionButton.setShowAnimation(ActionButton.Animations.FADE_IN);

it throws an error saying cannot resolve method setShowAnimation(android.content.res.xmlResourseParser)

I guess I'm not implementing it correctly. Any help would be appreciated.

(I'm using android api level 15)

Is the way to have margin 0dp?

When I delete in XML this line android:layout_marginBottom="@dimen/fab_margin", some margin would be still in mu UI. Is the way to have margin of FAB 0dp?

Needs compatible method with new CoordinatorLayout.

Hi,

it should be nice that the new CoordinatorLayout of design-lib gives behavior-relationship to your "fab" instead the FAB of design-lib self. I've tried but it throws exception to cast fab to FAB of design-lib. With the behavior we can move the "fab" up automatically against Snackbar of design-lib.

Hiding and showing on Sections Pager

Hi,
I have an activity which has some section pagers of fragments. I want to dynamically hide and show the actionbutton depending on the fragment. Here is my scenario.

Main Activity inflates my layout with the actionbutton view.

onCreateView method for fragment_1.
initActionButton()

onResume method Fragment_1
boolean shown = actionButton.isShown();
if (shown){
actionButton.setShowAnimation(ActionButton.Animations.ROLL_TO_DOWN);
actionButton.dismiss();
}

private void initActionButton() {
actionButton = (ActionButton) getActivity().findViewById(R.id.action_button);
}

The first time it loads, the button is NOT visible. If I swipe to other fragments and return, it crashes:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.software.shell.fab.ActionButton.isShown()' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3224)

How can I resolve this? I have tried isEnabled() to the same effect.

cant set color of button

using it from code: fab.setButtonColor(R.color.myRed);
or using it form xml: fab:button_color="@color/myRed"
has no effect at all.

Also i could set image into fab only from code xml attribute didnt work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.