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

BrandedDialogFragment.java « branding « ui « deck « nextcloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 75eb90b12bdbb4c0a2251f2e14bf4123e5d8f1db (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
25
26
package it.niedermann.nextcloud.deck.ui.branding;

import android.content.Context;

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

import it.niedermann.nextcloud.deck.Application;

public abstract class BrandedDialogFragment extends DialogFragment implements Branded {

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

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