Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BrandedDialogFragment.java « branding « notes « owncloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63eb2a69b2c0564ea2638c99cae6f03f90e64c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package it.niedermann.owncloud.notes.branding;

import android.content.Context;

import androidx.annotation.ColorInt;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

public abstract class BrandedDialogFragment extends DialogFragment implements Branded {

    @Override
    public void onStart() {
        super.onStart();

        @Nullable Context context = getContext();
        if (context != null) {
            if (BrandingUtil.isBrandingEnabled(context)) {
                @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(context);
                @ColorInt final int textColor = BrandingUtil.readBrandTextColor(context);
                applyBrand(mainColor, textColor);
            }
        }
    }
}