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

Commit c3debd3d authored by Stefan Niedermann's avatar Stefan Niedermann
Browse files

Remove branding toggle

parent 5944fbac
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -37,12 +37,10 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand
        getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
        getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true);
        colorAccent = typedValue.data;
        colorAccent = typedValue.data;


        if (BrandingUtil.isBrandingEnabled(this)) {
        @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(this);
        @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(this);
        @ColorInt final int textColor = BrandingUtil.readBrandTextColor(this);
        @ColorInt final int textColor = BrandingUtil.readBrandTextColor(this);
        applyBrand(mainColor, textColor);
        applyBrand(mainColor, textColor);
    }
    }
    }


    @Override
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    public boolean onCreateOptionsMenu(Menu menu) {
+3 −5
Original line number Original line Diff line number Diff line
@@ -14,11 +14,9 @@ public abstract class BrandedDialogFragment extends DialogFragment implements Br


        @Nullable Context context = getContext();
        @Nullable Context context = getContext();
        if (context != null) {
        if (context != null) {
            if (BrandingUtil.isBrandingEnabled(context)) {
            @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(context);
            @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(context);
            @ColorInt final int textColor = BrandingUtil.readBrandTextColor(context);
            @ColorInt final int textColor = BrandingUtil.readBrandTextColor(context);
            applyBrand(mainColor, textColor);
            applyBrand(mainColor, textColor);
        }
        }
    }
    }
}
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,7 @@ public abstract class BrandedFragment extends Fragment implements Branded {
        colorPrimary = typedValue.data;
        colorPrimary = typedValue.data;


        @Nullable Context context = getContext();
        @Nullable Context context = getContext();
        if (context != null && BrandingUtil.isBrandingEnabled(context)) {
        if (context != null) {
            @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(context);
            @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(context);
            @ColorInt final int textColor = BrandingUtil.readBrandTextColor(context);
            @ColorInt final int textColor = BrandingUtil.readBrandTextColor(context);
            applyBrand(mainColor, textColor);
            applyBrand(mainColor, textColor);
+5 −7
Original line number Original line Diff line number Diff line
@@ -34,7 +34,6 @@ public class BrandedPreferenceCategory extends PreferenceCategory {
    public void onBindViewHolder(PreferenceViewHolder holder) {
    public void onBindViewHolder(PreferenceViewHolder holder) {
        super.onBindViewHolder(holder);
        super.onBindViewHolder(holder);


        if (BrandingUtil.isBrandingEnabled(getContext())) {
        final View v = holder.itemView.findViewById(android.R.id.title);
        final View v = holder.itemView.findViewById(android.R.id.title);
        @Nullable final Context context = getContext();
        @Nullable final Context context = getContext();
        if (context != null && v instanceof TextView) {
        if (context != null && v instanceof TextView) {
@@ -43,4 +42,3 @@ public class BrandedPreferenceCategory extends PreferenceCategory {
        }
        }
    }
    }
}
}
}
+2 −4
Original line number Original line Diff line number Diff line
@@ -15,10 +15,8 @@ public class BrandedSnackbar {
    @NonNull
    @NonNull
    public static Snackbar make(@NonNull View view, @NonNull CharSequence text, @Snackbar.Duration int duration) {
    public static Snackbar make(@NonNull View view, @NonNull CharSequence text, @Snackbar.Duration int duration) {
        final Snackbar snackbar = Snackbar.make(view, text, duration);
        final Snackbar snackbar = Snackbar.make(view, text, duration);
        if (BrandingUtil.isBrandingEnabled(view.getContext())) {
        final int color = BrandingUtil.readBrandMainColor(view.getContext());
            int color = BrandingUtil.readBrandMainColor(view.getContext());
        snackbar.setActionTextColor(ColorUtil.INSTANCE.isColorDark(color) ? Color.WHITE : color);
        snackbar.setActionTextColor(ColorUtil.INSTANCE.isColorDark(color) ? Color.WHITE : color);
        }
        return snackbar;
        return snackbar;
    }
    }


Loading