1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License 15 */ 16 17 package com.android.dialer.theme.base; 18 19 import android.content.Context; 20 import android.support.annotation.ColorInt; 21 import android.support.annotation.IntDef; 22 import android.support.annotation.StyleRes; 23 import android.view.LayoutInflater; 24 import java.lang.annotation.Retention; 25 import java.lang.annotation.RetentionPolicy; 26 27 /** Interface for theme. */ 28 public interface Theme { 29 30 /** IntDef for the different themes Dialer supports. */ 31 @Retention(RetentionPolicy.SOURCE) 32 @IntDef({UNKNOWN, LIGHT, DARK, LIGHT_M2}) 33 @interface Type {} 34 35 int UNKNOWN = 0; 36 int LIGHT = 1; 37 int DARK = 2; 38 int LIGHT_M2 = 3; 39 40 @Type getTheme()41 int getTheme(); 42 43 @StyleRes getApplicationThemeRes()44 int getApplicationThemeRes(); 45 getThemedContext(Context context)46 Context getThemedContext(Context context); 47 getThemedLayoutInflator(LayoutInflater inflater)48 LayoutInflater getThemedLayoutInflator(LayoutInflater inflater); 49 50 @ColorInt getColorIcon()51 int getColorIcon(); 52 53 @ColorInt getColorIconSecondary()54 int getColorIconSecondary(); 55 56 @ColorInt getColorPrimary()57 int getColorPrimary(); 58 59 @ColorInt getColorPrimaryDark()60 int getColorPrimaryDark(); 61 62 @ColorInt getColorAccent()63 int getColorAccent(); 64 65 @ColorInt getTextColorSecondary()66 int getTextColorSecondary(); 67 68 @ColorInt getTextColorPrimary()69 int getTextColorPrimary(); 70 71 @ColorInt getColorTextOnUnthemedDarkBackground()72 int getColorTextOnUnthemedDarkBackground(); 73 74 @ColorInt getColorIconOnUnthemedDarkBackground()75 int getColorIconOnUnthemedDarkBackground(); 76 } 77