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


Java SizeNotifierFrameLayout类代码示例

本文整理汇总了Java中org.telegram.ui.Components.SizeNotifierFrameLayout的典型用法代码示例。如果您正苦于以下问题:Java SizeNotifierFrameLayout类的具体用法?Java SizeNotifierFrameLayout怎么用?Java SizeNotifierFrameLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: updateTheme

import org.telegram.ui.Components.SizeNotifierFrameLayout; //导入依赖的package包/类
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,代码行数:72,代码来源:ChatActivity.java


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