Home | History | Annotate | Download | only in partnerconfig
      1 /*
      2  * Copyright 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.google.android.setupcompat.partnerconfig;
     18 
     19 import androidx.annotation.StringDef;
     20 import androidx.annotation.VisibleForTesting;
     21 import java.lang.annotation.Retention;
     22 import java.lang.annotation.RetentionPolicy;
     23 
     24 /** Resource names that can be customized by partner overlay APK. */
     25 @Retention(RetentionPolicy.SOURCE)
     26 @StringDef({
     27   PartnerConfigKey.KEY_STATUS_BAR_BACKGROUND,
     28   PartnerConfigKey.KEY_LIGHT_STATUS_BAR,
     29   PartnerConfigKey.KEY_NAVIGATION_BAR_BG_COLOR,
     30   PartnerConfigKey.KEY_LIGHT_NAVIGATION_BAR,
     31   PartnerConfigKey.KEY_FOOTER_BAR_BG_COLOR,
     32   PartnerConfigKey.KEY_FOOTER_BUTTON_FONT_FAMILY,
     33   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_ADD_ANOTHER,
     34   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_CANCEL,
     35   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_CLEAR,
     36   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_DONE,
     37   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_NEXT,
     38   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_OPT_IN,
     39   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_SKIP,
     40   PartnerConfigKey.KEY_FOOTER_BUTTON_ICON_STOP,
     41   PartnerConfigKey.KEY_FOOTER_BUTTON_PADDING_TOP,
     42   PartnerConfigKey.KEY_FOOTER_BUTTON_PADDING_BOTTOM,
     43   PartnerConfigKey.KEY_FOOTER_BUTTON_RADIUS,
     44   PartnerConfigKey.KEY_FOOTER_BUTTON_RIPPLE_ALPHA,
     45   PartnerConfigKey.KEY_FOOTER_BUTTON_TEXT_SIZE,
     46   PartnerConfigKey.KEY_FOOTER_PRIMARY_BUTTON_BG_COLOR,
     47   PartnerConfigKey.KEY_FOOTER_PRIMARY_BUTTON_TEXT_COLOR,
     48   PartnerConfigKey.KEY_FOOTER_SECONDARY_BUTTON_BG_COLOR,
     49   PartnerConfigKey.KEY_FOOTER_SECONDARY_BUTTON_TEXT_COLOR,
     50   PartnerConfigKey.KEY_LAYOUT_BACKGROUND_COLOR,
     51   PartnerConfigKey.KEY_HEADER_TEXT_SIZE,
     52   PartnerConfigKey.KEY_HEADER_TEXT_COLOR,
     53   PartnerConfigKey.KEY_HEADER_FONT_FAMILY,
     54   PartnerConfigKey.KEY_HEADER_AREA_BACKGROUND_COLOR,
     55   PartnerConfigKey.KEY_LAYOUT_GRAVITY,
     56   PartnerConfigKey.KEY_DESCRIPTION_TEXT_SIZE,
     57   PartnerConfigKey.KEY_DESCRIPTION_TEXT_COLOR,
     58   PartnerConfigKey.KEY_DESCRIPTION_LINK_TEXT_COLOR,
     59   PartnerConfigKey.KEY_DESCRIPTION_FONT_FAMILY,
     60 })
     61 // TODO: can be removed and always reference PartnerConfig.getResourceName()?
     62 @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
     63 public @interface PartnerConfigKey {
     64   // Status bar background color or illustration.
     65   String KEY_STATUS_BAR_BACKGROUND = "setup_compat_status_bar_background";
     66 
     67   // The same as "WindowLightStatusBar". If set true, the status bar icons will be drawn such
     68   // that it is compatible with a light status bar background
     69   String KEY_LIGHT_STATUS_BAR = "setup_compat_light_status_bar";
     70 
     71   // Navigation bar background color
     72   String KEY_NAVIGATION_BAR_BG_COLOR = "setup_compat_navigation_bar_bg_color";
     73 
     74   // The same as "windowLightNavigationBar". If set true, the navigation bar icons will be drawn
     75   // such that it is compatible with a light navigation bar background.
     76   String KEY_LIGHT_NAVIGATION_BAR = "setup_compat_light_navigation_bar";
     77 
     78   // Background color of the footer bar.
     79   String KEY_FOOTER_BAR_BG_COLOR = "setup_compat_footer_bar_bg_color";
     80 
     81   // The font face used in footer buttons. This must be a string reference to a font that is
     82   // available in the system. Font references (@font or @xml) are not allowed.
     83   String KEY_FOOTER_BUTTON_FONT_FAMILY = "setup_compat_footer_button_font_family";
     84 
     85   // The icon for "add another" action. Can be "@null" for no icon.
     86   String KEY_FOOTER_BUTTON_ICON_ADD_ANOTHER = "setup_compat_footer_button_icon_add_another";
     87 
     88   // The icon for "cancel" action. Can be "@null" for no icon.
     89   String KEY_FOOTER_BUTTON_ICON_CANCEL = "setup_compat_footer_button_icon_cancel";
     90 
     91   // The icon for "clear" action. Can be "@null" for no icon.
     92   String KEY_FOOTER_BUTTON_ICON_CLEAR = "setup_compat_footer_button_icon_clear";
     93 
     94   // The icon for "done" action. Can be "@null" for no icon.
     95   String KEY_FOOTER_BUTTON_ICON_DONE = "setup_compat_footer_button_icon_done";
     96 
     97   // The icon for "next" action. Can be "@null" for no icon.
     98   String KEY_FOOTER_BUTTON_ICON_NEXT = "setup_compat_footer_button_icon_next";
     99 
    100   // The icon for "opt-in" action. Can be "@null" for no icon.
    101   String KEY_FOOTER_BUTTON_ICON_OPT_IN = "setup_compat_footer_button_icon_opt_in";
    102 
    103   // The icon for "skip" action. Can be "@null" for no icon.
    104   String KEY_FOOTER_BUTTON_ICON_SKIP = "setup_compat_footer_button_icon_skip";
    105 
    106   // The icon for "stop" action. Can be "@null" for no icon.
    107   String KEY_FOOTER_BUTTON_ICON_STOP = "setup_compat_footer_button_icon_stop";
    108 
    109   // Top padding of the footer buttons
    110   String KEY_FOOTER_BUTTON_PADDING_TOP = "setup_compat_footer_button_padding_top";
    111 
    112   // Bottom padding of the footer buttons
    113   String KEY_FOOTER_BUTTON_PADDING_BOTTOM = "setup_compat_footer_button_padding_bottom";
    114 
    115   // Corner radius of the footer buttons
    116   String KEY_FOOTER_BUTTON_RADIUS = "setup_compat_footer_button_radius";
    117 
    118   // Ripple color alpha of the footer button
    119   String KEY_FOOTER_BUTTON_RIPPLE_ALPHA = "setup_compat_footer_button_ripple_alpha";
    120 
    121   // Text size of the footer button
    122   String KEY_FOOTER_BUTTON_TEXT_SIZE = "setup_compat_footer_button_text_size";
    123 
    124   // Background color of the primary footer button
    125   String KEY_FOOTER_PRIMARY_BUTTON_BG_COLOR = "setup_compat_footer_primary_button_bg_color";
    126 
    127   // Text color of the primary footer button
    128   String KEY_FOOTER_PRIMARY_BUTTON_TEXT_COLOR = "setup_compat_footer_primary_button_text_color";
    129 
    130   // Background color of the secondary footer button
    131   String KEY_FOOTER_SECONDARY_BUTTON_BG_COLOR = "setup_compat_footer_secondary_button_bg_color";
    132 
    133   // Text color of the secondary footer button
    134   String KEY_FOOTER_SECONDARY_BUTTON_TEXT_COLOR = "setup_compat_footer_secondary_button_text_color";
    135 
    136   // Background color of layout
    137   String KEY_LAYOUT_BACKGROUND_COLOR = "setup_design_layout_bg_color";
    138 
    139   // Text size of the header
    140   String KEY_HEADER_TEXT_SIZE = "setup_design_header_text_size";
    141 
    142   // Text color of the header
    143   String KEY_HEADER_TEXT_COLOR = "setup_design_header_text_color";
    144 
    145   // Font family of the header
    146   String KEY_HEADER_FONT_FAMILY = "setup_design_header_font_family";
    147 
    148   // Gravity of the header, icon and description
    149   String KEY_LAYOUT_GRAVITY = "setup_design_layout_gravity";
    150 
    151   // Background color of the header area
    152   String KEY_HEADER_AREA_BACKGROUND_COLOR = "setup_design_header_area_background_color";
    153 
    154   // Text size of the description
    155   String KEY_DESCRIPTION_TEXT_SIZE = "setup_design_description_text_size";
    156 
    157   // Text color of the description
    158   String KEY_DESCRIPTION_TEXT_COLOR = "setup_design_description_text_color";
    159 
    160   // Link text color of the description
    161   String KEY_DESCRIPTION_LINK_TEXT_COLOR = "setup_design_description_link_text_color";
    162 
    163   // Font family of the description
    164   String KEY_DESCRIPTION_FONT_FAMILY = "setup_design_description_font_family";
    165 }
    166