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

Commit d26c5f8a authored by Georg Veichtlbauer's avatar Georg Veichtlbauer
Browse files

Eleven: Avoid setting toolbar backgrounds in code

We shall infer them from the theme

Change-Id: I3d45033b1b137f923fc05127bea93eaa296904a5
parent d18ff1cf
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -138,9 +138,6 @@ public abstract class BaseActivity extends AppCompatActivity implements ServiceC

        setActionBarTitle(getString(R.string.app_name));

        // set the background on the root view
        getWindow().getDecorView().getRootView().setBackgroundColor(
                ContextCompat.getColor(this, R.color.background_color));
        // Initialize the bottom action bar
        initBottomActionBar();

@@ -257,13 +254,6 @@ public abstract class BaseActivity extends AppCompatActivity implements ServiceC

    public void setupActionBar(String title) {
        setActionBarTitle(title);

        if (mActionBarBackground == null) {
            final int actionBarColor = ContextCompat.getColor(this,
                    R.color.header_action_bar_color);
            mActionBarBackground = new ColorDrawable(actionBarColor);
            mToolBar.setBackground(mActionBarBackground);
        }
    }

    public void setActionBarTitle(String title) {
@@ -273,10 +263,6 @@ public abstract class BaseActivity extends AppCompatActivity implements ServiceC
        }
    }

    public void setActionBarAlpha(int alpha) {
        mActionBarBackground.setAlpha(alpha);
    }

    public void setActionBarElevation(boolean isElevated) {
        float targetElevation = isElevated
                ? getResources().getDimension(R.dimen.action_bar_elevation) : 0;
+0 −7
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ public abstract class BaseFragment extends Fragment
    public void setupActionBar() {
        final HomeActivity activity = getContainingActivity();
        activity.setupActionBar(getTitle());
        activity.setActionBarAlpha(255);
        activity.setFragmentPadding(true);
        activity.setActionBarElevation(needsElevatedActionBar());
    }
@@ -66,12 +65,6 @@ public abstract class BaseFragment extends Fragment
                                   Bundle savedInstanceState) {
        // The View for the fragment's UI
        mRootView = (ViewGroup) inflater.inflate(getLayoutToInflate(), null);
        // set the background color
        final Context context = getContext();
        if (context != null) {
            mRootView.setBackgroundColor(ContextCompat.getColor(context,
                    R.color.background_color));
        }
        // eat any touches that fall through to the root so they aren't
        // passed on to fragments "behind" the current one.
        mRootView.setOnTouchListener((v, me) -> true);
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ public class PopupMenuButton extends AppCompatImageView implements IPopupMenuCal
        super(context, attrs);

        setScaleType(ScaleType.CENTER_INSIDE);
        setBackground(ContextCompat.getDrawable(context, R.drawable.selectable_background_light));
        setOnClickListener(this);
    }