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


Java Theme类代码示例

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


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

示例1: ChatUnreadCell

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public ChatUnreadCell(Context context) {
    super(context);

    FrameLayout frameLayout = new FrameLayout(context);
    //frameLayout.setBackgroundResource(R.drawable.newmsg_divider);
    addView(frameLayout, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 27, Gravity.LEFT | Gravity.TOP, 0, 7, 0, 0));

    ImageView imageView = new ImageView(context);
    imageView.setImageResource(R.drawable.ic_ab_new);
    imageView.setPadding(0, AndroidUtilities.dp(2), 0, 0);
    frameLayout.addView(imageView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.RIGHT | Gravity.CENTER_VERTICAL, 0, 0, 10, 0));

    textView = new TextView(context);
    textView.setTypeface(FontManager.instance().getTypeface());
    textView.setPadding(0, 0, 0, AndroidUtilities.dp(1));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    textView.setTextColor(Theme.CHAT_UNREAD_TEXT_COLOR);
    textView.setTypeface(FontManager.instance().getTypeface());
    addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER));

    ColorUtils.ColorPresenter c= ChitSettings.currentColorPresenter();
    try {
        c.modifyUnreadBg(frameLayout, textView);
    }catch (Exception e){}

}
 
开发者ID:MLNO,项目名称:airgram,代码行数:27,代码来源:ChatUnreadCell.java

示例2: updateUserData

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
private void updateUserData() {
    TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
    TLRPC.FileLocation photo = null;
    TLRPC.FileLocation photoBig = null;
    if (user.photo != null) {
        photo = user.photo.photo_small;
        photoBig = user.photo.photo_big;
    }
    AvatarDrawable avatarDrawable = new AvatarDrawable(user, true);

    avatarDrawable.setColor(Theme.ACTION_BAR_MAIN_AVATAR_COLOR);
    if (avatarImage != null) {
        avatarImage.setImage(photo, "50_50", avatarDrawable);
        avatarImage.getImageReceiver().setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);

        nameTextView.setText(UserObject.getUserName(user));
        onlineTextView.setText(LocaleController.getString("Online", R.string.Online));

        avatarImage.getImageReceiver().setVisible(!PhotoViewer.getInstance().isShowingImage(photoBig), false);
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:SettingsActivity.java

示例3: onDraw

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
@Override
protected void onDraw(Canvas canvas) {
    int x = (canvas.getWidth() - width) / 2;
    int y = AndroidUtilities.dp(4);
    Theme.backgroundMediaDrawableIn.setBounds(x, y, width + x, height + y);
    Theme.backgroundMediaDrawableIn.draw(canvas);
    canvas.save();
    canvas.translate(textX = AndroidUtilities.dp(2 + 9) + x, textY = AndroidUtilities.dp(2 + 9) + y);
    if (pressedLink != null) {
        canvas.drawPath(urlPath, urlPaint);
    }
    if (textLayout != null) {
        textLayout.draw(canvas);
    }
    canvas.restore();
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:17,代码来源:BotHelpCell.java

示例4: AboutLinkCell

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public AboutLinkCell(Context context) {
    super(context);

    textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
    textPaint.setTextSize(AndroidUtilities.dp(16));
    textPaint.setColor(0xff000000);
    textPaint.linkColor = Theme.MSG_LINK_TEXT_COLOR;

    urlPaint = new Paint();
    urlPaint.setColor(Theme.MSG_LINK_SELECT_BACKGROUND_COLOR);

    imageView = new ImageView(context);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    addView(imageView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 16, 5, LocaleController.isRTL ? 16 : 0, 0));
    setWillNotDraw(false);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:17,代码来源:AboutLinkCell.java

示例5: ChatLoadingCell

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public ChatLoadingCell(Context context) {
    super(context);

    frameLayout = new FrameLayout(context);
    frameLayout.setBackgroundResource(R.drawable.system_loader);
    frameLayout.getBackground().setColorFilter(Theme.colorFilter);
    addView(frameLayout, LayoutHelper.createFrame(36, 36, Gravity.CENTER));

    ProgressBar progressBar = new ProgressBar(context);
    try {
        progressBar.setIndeterminateDrawable(getResources().getDrawable(R.drawable.loading_animation));
    } catch (Exception e) {
        //don't promt
    }
    progressBar.setIndeterminate(true);
    AndroidUtilities.setProgressBarAnimationDuration(progressBar, 1500);
    frameLayout.addView(progressBar, LayoutHelper.createFrame(32, 32, Gravity.CENTER));
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:19,代码来源:ChatLoadingCell.java

示例6: setUser

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public void setUser(TLRPC.User user) {
    if (user == null) {
        return;
    }
    TLRPC.FileLocation photo = null;
    if (user.photo != null) {
        photo = user.photo.photo_small;
    }

    String name= SkinMan.currentSkin.drawerProfileTitle();
    String phon= SkinMan.currentSkin.drawerProfileSubtitle();
    nameTextView.setText(name == null ? UserObject.getUserName(user) : name);
    phoneTextView.setText(phon == null ? PhoneFormat.getInstance().format("+" + user.phone) : phon);
    AvatarDrawable avatarDrawable = new AvatarDrawable(user);
    avatarDrawable.setColor(Theme.ACTION_BAR_MAIN_AVATAR_COLOR);
    avatarImageView.setImage(photo, "50_50", avatarDrawable);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:DrawerProfileCell.java

示例7: AttachButton

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public AttachButton(Context context) {
    super(context);

    imageView = new ImageView(context);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    addView(imageView, LayoutHelper.createFrame(64, 64, Gravity.CENTER_HORIZONTAL | Gravity.TOP));

    textView = new TextView(context);
    textView.setTypeface(FontManager.instance().getTypeface());
    textView.setLines(1);
    textView.setSingleLine(true);
    textView.setGravity(Gravity.CENTER_HORIZONTAL);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setTextColor(Theme.ATTACH_SHEET_TEXT_COLOR);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 0, 64, 0, 0));
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:ChatAttachAlert.java

示例8: AttachBotButton

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public AttachBotButton(Context context) {
    super(context);

    imageView = new BackupImageView(context);
    imageView.setRoundRadius(AndroidUtilities.dp(27));
    addView(imageView, LayoutHelper.createFrame(54, 54, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 7, 0, 0));

    nameTextView = new TextView(context);
    nameTextView.setTypeface(FontManager.instance().getTypeface());
    nameTextView.setTextColor(Theme.ATTACH_SHEET_TEXT_COLOR);
    nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    nameTextView.setMaxLines(2);
    nameTextView.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
    nameTextView.setLines(2);
    nameTextView.setEllipsize(TextUtils.TruncateAt.END);
    addView(nameTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 6, 65, 6, 0));
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:ChatAttachAlert.java

示例9: updateSelectedCount

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public void updateSelectedCount() {
    if (selectedDialogs.isEmpty()) {
        doneButtonBadgeTextView.setVisibility(View.GONE);
        if (!isPublicChannel) {
            doneButtonTextView.setTextColor(Theme.SHARE_SHEET_SEND_DISABLED_TEXT_COLOR);
            doneButton.setEnabled(false);
            doneButtonTextView.setText(LocaleController.getString("Send", R.string.Send).toUpperCase());
        } else {
            doneButtonTextView.setTextColor(Theme.SHARE_SHEET_COPY_TEXT_COLOR);
            doneButton.setEnabled(true);
            doneButtonTextView.setText(LocaleController.getString("CopyLink", R.string.CopyLink).toUpperCase());
        }
    } else {
        doneButtonTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
        doneButtonBadgeTextView.setVisibility(View.VISIBLE);
        doneButtonBadgeTextView.setText(String.format("%d", selectedDialogs.size()));
        doneButtonTextView.setTextColor(Theme.SHARE_SHEET_SEND_TEXT_COLOR);
        doneButton.setEnabled(true);
        doneButtonTextView.setText(LocaleController.getString("Send", R.string.Send).toUpperCase());
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:ShareAlert.java

示例10: onCreate

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.Theme_TMessages);
    super.onCreate(savedInstanceState);
    Theme.loadResources(this);
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    if (AndroidUtilities.isTablet()) {
        setContentView(R.layout.intro_layout_tablet);
    } else {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        setContentView(R.layout.intro_layout);
    }
    InitObjects();
    Step_DBase(); // Start with checking DBase...
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:17,代码来源:IntroActivity.java

示例11: AboutLinkCell

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public AboutLinkCell(Context context) {
    super(context);

    textPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
    textPaint.setTextSize(AndroidUtilities.dp(16));
    textPaint.setColor(0xff000000);
    textPaint.linkColor = Theme.MSG_LINK_TEXT_COLOR;
    textPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));

    urlPaint = new Paint();
    urlPaint.setColor(Theme.MSG_LINK_SELECT_BACKGROUND_COLOR);
    urlPaint.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));

    imageView = new ImageView(context);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    addView(imageView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 16, 5, LocaleController.isRTL ? 16 : 0, 0));
    setWillNotDraw(false);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:19,代码来源:AboutLinkCell.java

示例12: AttachButton

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public AttachButton(Context context) {
    super(context);

    imageView = new ImageView(context);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    addView(imageView, LayoutHelper.createFrame(64, 64, Gravity.CENTER_HORIZONTAL | Gravity.TOP));

    textView = new TextView(context);
    textView.setLines(1);
    textView.setSingleLine(true);
    textView.setGravity(Gravity.CENTER_HORIZONTAL);
    textView.setEllipsize(TextUtils.TruncateAt.END);
    textView.setTextColor(Theme.ATTACH_SHEET_TEXT_COLOR);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 0, 64, 0, 0));
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:17,代码来源:ChatAttachAlert.java

示例13: AttachBotButton

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public AttachBotButton(Context context) {
    super(context);

    imageView = new BackupImageView(context);
    imageView.setRoundRadius(AndroidUtilities.dp(27));
    addView(imageView, LayoutHelper.createFrame(54, 54, Gravity.TOP | Gravity.CENTER_HORIZONTAL, 0, 7, 0, 0));

    nameTextView = new TextView(context);
    nameTextView.setTextColor(Theme.ATTACH_SHEET_TEXT_COLOR);
    nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    nameTextView.setMaxLines(2);
    nameTextView.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
    nameTextView.setLines(2);
    nameTextView.setEllipsize(TextUtils.TruncateAt.END);
    addView(nameTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP, 6, 65, 6, 0));
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:17,代码来源:ChatAttachAlert.java

示例14: addTextTab

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public void addTextTab(final int position, String title) {
    TextView tab = new TextView(getContext());
    tab.setText(title);
    tab.setFocusable(true);
    tab.setGravity(Gravity.CENTER);
    tab.setSingleLine();
    tab.setTextColor(0xffffffff);
    tab.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
    tab.setTypeface(Typeface.DEFAULT_BOLD);
    tab.setBackgroundDrawable(Theme.createBarSelectorDrawable(Theme.ACTION_BAR_PICKER_SELECTOR_COLOR, false));

    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            didSelectTab(position);
        }
    });
    addView(tab);
    LayoutParams layoutParams = (LayoutParams)tab.getLayoutParams();
    layoutParams.height = LayoutHelper.MATCH_PARENT;
    layoutParams.width = 0;
    layoutParams.weight = 50;
    tab.setLayoutParams(layoutParams);

    tabCount++;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:27,代码来源:SlidingTabView.java

示例15: updateSelectedCount

import org.telegram.ui.ActionBar.Theme; //导入依赖的package包/类
public void updateSelectedCount() {
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    int textColor = themePrefs.getInt("chatAttachTextColor", 0xff3ec1f9);
    if (selectedDialogs.isEmpty()) {
        doneButtonBadgeTextView.setVisibility(View.GONE);
        if (!isPublicChannel) {
            doneButtonTextView.setTextColor(Theme.SHARE_SHEET_SEND_DISABLED_TEXT_COLOR);
            doneButton.setEnabled(false);
            doneButtonTextView.setText(LocaleController.getString("Send", R.string.Send).toUpperCase());
        } else {
            doneButtonTextView.setTextColor(Theme.SHARE_SHEET_COPY_TEXT_COLOR);
            doneButton.setEnabled(true);
            doneButtonTextView.setText(LocaleController.getString("CopyLink", R.string.CopyLink).toUpperCase());
        }
    } else {
        doneButtonTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
        doneButtonBadgeTextView.setVisibility(View.VISIBLE);
        doneButtonBadgeTextView.setText(String.format("%d", selectedDialogs.size()));
        doneButtonTextView.setTextColor(Theme.SHARE_SHEET_SEND_TEXT_COLOR);
        doneButton.setEnabled(true);
        doneButtonTextView.setText(LocaleController.getString("Send", R.string.Send).toUpperCase());
    }
    doneButtonTextView.setTextColor(textColor);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:25,代码来源:ShareAlert.java


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