Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2894cedb authored by Narinder Rana's avatar Narinder Rana
Browse files

fab button a 20% darker version of the OS accent colour

parent 9cddb3d8
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.SuppressLint;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;

import android.graphics.drawable.ColorDrawable;
@@ -320,6 +321,7 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C
        });

        mFloatingActionButton = (FloatingActionButton) findViewById(R.id.floating_action_button);

        if (mFloatingActionButton != null) {
            mFloatingActionButton.setOnClickListener(new OnClickListener() {

@@ -332,6 +334,8 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C

       ACCENT_COLOR=fetchAccentColor(this);
        mTabs.setBackgroundColor(ACCENT_COLOR);
        mFloatingActionButton.setBackgroundTintList(ColorStateList.valueOf(darkenColor20(ACCENT_COLOR)));

    }


@@ -733,4 +737,10 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C
        hsv[2] *= 0.8f;
        return android.graphics.Color.HSVToColor(hsv);
    }
    @ColorInt int darkenColor20(@ColorInt int color) {
        float[] hsv = new float[3];
        android.graphics.Color.colorToHSV(color, hsv);
        hsv[2] *= 0.6f;
        return android.graphics.Color.HSVToColor(hsv);
    }
}