当前位置: 首页>>代码示例>>Java>>正文


Java Theme.ACTION_BAR_COLOR2属性代码示例

本文整理汇总了Java中org.telegram.ui.ActionBar.Theme.ACTION_BAR_COLOR2属性的典型用法代码示例。如果您正苦于以下问题:Java Theme.ACTION_BAR_COLOR2属性的具体用法?Java Theme.ACTION_BAR_COLOR2怎么用?Java Theme.ACTION_BAR_COLOR2使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.telegram.ui.ActionBar.Theme的用法示例。


在下文中一共展示了Theme.ACTION_BAR_COLOR2属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateTheme

private void updateTheme() {
    try {
        SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
        int def = themePrefs.getInt("themeColor", AndroidUtilities.defColor);

        int hColor = Theme.ACTION_BAR_COLOR2;//themePrefs.getInt("chatHeaderColor", def);
        actionBar.setBackgroundColor(hColor);
        int val = themePrefs.getInt("chatHeaderGradient", 0);
        if (val > 0) {
            GradientDrawable.Orientation go;
            switch (val) {
                case 2:
                    go = GradientDrawable.Orientation.LEFT_RIGHT;
                    break;
                case 3:
                    go = GradientDrawable.Orientation.TL_BR;
                    break;
                case 4:
                    go = GradientDrawable.Orientation.BL_TR;
                    break;
                default:
                    go = GradientDrawable.Orientation.TOP_BOTTOM;
            }
            int gradColor = themePrefs.getInt("chatHeaderGradientColor", def);
            int[] colors = new int[]{hColor, gradColor};
            GradientDrawable gd = new GradientDrawable(go, colors);
            actionBar.setBackgroundDrawable(gd);
        }
        int nameColor = themePrefs.getInt("chatNameColor", 0xffffffff);
        avatarContainer.setTitleColor(nameColor);
        avatarContainer.setTitleSize(themePrefs.getInt("chatNameSize", 18));
        avatarContainer.setSubtitleColor(themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40)));
        avatarContainer.setSubtitleSize(themePrefs.getInt("chatStatusSize", 14));
        //nameTextView.setTextColor(nameColor);
        //nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("chatNameSize", 18));
        //onlineTextView.setTextColor(themePrefs.getInt("chatStatusColor", AndroidUtilities.getIntDarkerColor("themeColor", -0x40)));
        //onlineTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("chatStatusSize", 14));
        int iColor = themePrefs.getInt("chatHeaderIconsColor", 0xffffffff);
        if (getParentActivity() != null) {
            Drawable mute = getParentActivity().getResources().getDrawable(R.drawable.mute_blue);
            mute.setColorFilter(iColor, PorterDuff.Mode.SRC_IN);
            Drawable dots = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_other);
            dots.setColorFilter(iColor, PorterDuff.Mode.MULTIPLY);
            Drawable back = getParentActivity().getResources().getDrawable(R.drawable.ic_ab_back);
            back.setColorFilter(iColor, PorterDuff.Mode.MULTIPLY);

            Drawable searchD = getParentActivity().getResources().getDrawable(R.drawable.search_down);
            searchD.setColorFilter(iColor, PorterDuff.Mode.SRC_IN);
            Drawable searchU = getParentActivity().getResources().getDrawable(R.drawable.search_up);
            searchU.setColorFilter(iColor, PorterDuff.Mode.SRC_IN);
        }
        if (searchItem != null) searchItem.getSearchField().setTextColor(iColor);
        //Channel
        bottomOverlayChat.setBackgroundColor(hColor);
        bottomOverlayChatText.setTextColor(nameColor);
        //Report spam
        reportSpamView.setBackgroundColor(hColor);
        reportSpamButton.setTextColor(nameColor);
        addToContactsButton.setTextColor(nameColor);


        if (refreshWallpaper) {
            SizeNotifierFrameLayout contentView = (SizeNotifierFrameLayout) fragmentView;
            contentView.setBackgroundImage(ApplicationLoader.getCachedWallpaper());
            refreshWallpaper = false;
        }

    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:71,代码来源:ChatActivity.java

示例2: paintHeader

private void paintHeader(boolean tabs) {
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    actionBar.setTitleColor(themePrefs.getInt("chatsHeaderTitleColor", 0xffffffff));
    int def = Theme.ACTION_BAR_COLOR2;
    int hColor = themePrefs.getInt("chatsHeaderColor", def);
    /*if(!tabs){
        actionBar.setBackgroundColor(hColor);
    }else{
        tabsView.setBackgroundColor(hColor);
    }*/
    if (!tabs) actionBar.setBackgroundColor(hColor);
    if (tabs) {
        tabsView.setBackgroundColor(hColor);
    }
    int val = themePrefs.getInt("chatsHeaderGradient", 0);
    if (val > 0) {
        GradientDrawable.Orientation go;
        switch (val) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }
        int gradColor = themePrefs.getInt("chatsHeaderGradientColor", def);
        int[] colors = new int[]{hColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        if (!tabs) actionBar.setBackgroundDrawable(gd);
        if (tabs) {
            tabsView.setBackgroundDrawable(gd);
        }
        /*if(!tabs){
            actionBar.setBackgroundDrawable(gd);
        }else{
            tabsView.setBackgroundDrawable(gd);
        }*/
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:44,代码来源:DialogsActivity.java

示例3: updateTheme

private void updateTheme(){
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int tColor = Theme.ACTION_BAR_COLOR2;//themePrefs.getInt("themeColor", AndroidUtilities.defColor);
    int dColor = Theme.ACTION_BAR_COLOR2;//AndroidUtilities.getIntDarkerColor("themeColor", -0x40);

    int hColor = Theme.ACTION_BAR_COLOR2;//themePrefs.getInt("drawerHeaderColor", tColor);
    setBackgroundColor(hColor);
    int value = themePrefs.getInt("drawerHeaderGradient", 0);
    if(value > 0) {
        GradientDrawable.Orientation go;
        switch(value) {
            case 2:
                go = GradientDrawable.Orientation.LEFT_RIGHT;
                break;
            case 3:
                go = GradientDrawable.Orientation.TL_BR;
                break;
            case 4:
                go = GradientDrawable.Orientation.BL_TR;
                break;
            default:
                go = GradientDrawable.Orientation.TOP_BOTTOM;
        }
        int gradColor = themePrefs.getInt("drawerHeaderGradientColor", tColor);
        int[] colors = new int[]{hColor, gradColor};
        GradientDrawable gd = new GradientDrawable(go, colors);
        setBackgroundDrawable(gd);
    }

    nameTextView.setTextColor(themePrefs.getInt("drawerNameColor", 0xffffffff));
    nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("drawerNameSize", 15));
    phoneTextView.setTextColor(themePrefs.getInt("drawerPhoneColor", dColor));
    phoneTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, themePrefs.getInt("drawerPhoneSize", 13));
    //SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
    SharedPreferences plusPreferences = ApplicationLoader.applicationContext.getSharedPreferences("plusconfig", Activity.MODE_PRIVATE);

    if(plusPreferences.getBoolean("hideMobile", false) && !plusPreferences.getBoolean("showUsername", false)){
        phoneTextView.setVisibility(GONE);
    }else{
        phoneTextView.setVisibility(VISIBLE);
    }
    TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
    TLRPC.FileLocation photo = null;
    if (user != null && user.photo != null && user.photo.photo_small != null ) {
       photo = user.photo.photo_small;
    }
    AvatarDrawable avatarDrawable = new AvatarDrawable(user);
    avatarDrawable.setColor(themePrefs.getInt("drawerAvatarColor", AndroidUtilities.getIntDarkerColor("themeColor", 0x15)));
    int radius = AndroidUtilities.dp(themePrefs.getInt("drawerAvatarRadius", 32));
    avatarDrawable.setRadius(radius);
    //avatarImageView.getImageReceiver().setImageCoords(avatarImageView.getImageReceiver(), avatarTop, avatarSize, avatarSize);

    avatarImageView.getImageReceiver().setRoundRadius(radius);
    avatarImageView.setImage(photo, "50_50", avatarDrawable);

}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:56,代码来源:DrawerProfileCell.java


注:本文中的org.telegram.ui.ActionBar.Theme.ACTION_BAR_COLOR2属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。