package im.actor.sdk.controllers.compose;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import im.actor.sdk.ActorSDK;
import im.actor.sdk.R;
import im.actor.sdk.controllers.BaseFragment;

public class ComposeFabFragment extends BaseFragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View res = inflater.inflate(R.layout.fragment_fab, container, false);
        FloatingActionButton fabRoot = (FloatingActionButton) res.findViewById(R.id.fab);
        fabRoot.setImageResource(R.drawable.ic_edit_white_24dp);
        if (ActorSDK.sharedActor().style.getFabColor() != 0) {
            fabRoot.setBackgroundColor(ActorSDK.sharedActor().style.getFabColor());
        }
        if (ActorSDK.sharedActor().style.getFabPressedColor() != 0) {
            fabRoot.setRippleColor(ActorSDK.sharedActor().style.getFabPressedColor());
        }
        fabRoot.setOnClickListener(v -> startActivity(new Intent(getActivity(), ComposeActivity.class)));
        return res;
    }
}

@@ -67,16 +67,90 @@
 Intent;%0A
+import android.content.res.ColorStateList;%0Aimport android.graphics.Color;%0A
 import a
@@ -270,16 +270,46 @@
 Button;%0A
+import android.util.StateSet;%0A
 import a
@@ -947,102 +947,202 @@
     
-if (ActorSDK.sharedActor().style.getFabColor() != 0) %7B%0A            fabRoot.setBackgroundColor(
+fabRoot.setBackgroundTintList(new ColorStateList(new int%5B%5D%5B%5D%7B%0A                new int%5B%5D%7Bandroid.R.attr.state_pressed%7D,%0A                StateSet.WILD_CARD,%0A%0A        %7D, new int%5B%5D%7B%0A                
 Acto
@@ -1172,25 +1172,31 @@
 e.getFab
+Pressed
 Color()
-);
+,
 %0A       
@@ -1196,26 +1196,24 @@
         
-%7D%0A
         
 if (Acto
@@ -1208,12 +1208,8 @@
     
-if (
 Acto
@@ -1243,35 +1243,30 @@
 tFab
-PressedColor() != 0) %7B%0A    
+Color(),%0A        %7D));%0A
     
@@ -1348,18 +1348,8 @@
 ));%0A
-        %7D%0A
     

fix fab wild state color