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


Java BackDrawable类代码示例

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


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

示例1: fixLayoutInternal

import org.telegram.ui.ActionBar.BackDrawable; //导入依赖的package包/类
private boolean fixLayoutInternal() {
    if (!AndroidUtilities.isTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        selectedMessagesCountTextView.setTextSize(18);
    } else {
        selectedMessagesCountTextView.setTextSize(20);
    }

    if (AndroidUtilities.isTablet()) {
        if (AndroidUtilities.isSmallTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
            actionBar.setBackButtonDrawable(getBackDrawable(false));
            if (playerView != null && playerView.getParent() == null) {
                ((ViewGroup) fragmentView).addView(playerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 39, Gravity.TOP | Gravity.LEFT, 0, -36, 0, 0));
            }
        } else {
            actionBar.setBackButtonDrawable(new BackDrawable(parentLayout == null || parentLayout.fragmentsStack.isEmpty() || parentLayout.fragmentsStack.get(0) == ChatActivity.this || parentLayout.fragmentsStack.size() == 1));
            if (playerView != null && playerView.getParent() != null) {
                fragmentView.setPadding(0, 0, 0, 0);
                ((ViewGroup) fragmentView).removeView(playerView);
            }
        }
        return false;
    }
    return true;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:25,代码来源:ChatActivity.java

示例2: fixLayoutInternal

import org.telegram.ui.ActionBar.BackDrawable; //导入依赖的package包/类
private boolean fixLayoutInternal() {
    if (!AndroidUtilities.isTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        selectedMessagesCountTextView.setTextSize(18);
    } else {
        selectedMessagesCountTextView.setTextSize(20);
    }

    if (AndroidUtilities.isTablet()) {
        if (AndroidUtilities.isSmallTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
            actionBar.setBackButtonDrawable(new BackDrawable(false));
            if (playerView != null && playerView.getParent() == null) {
                ((ViewGroup) fragmentView).addView(playerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 39, Gravity.TOP | Gravity.LEFT, 0, -36, 0, 0));
            }
        } else {
            actionBar.setBackButtonDrawable(new BackDrawable(parentLayout == null || parentLayout.fragmentsStack.isEmpty() || parentLayout.fragmentsStack.get(0) == ChatActivity.this || parentLayout.fragmentsStack.size() == 1));
            if (playerView != null && playerView.getParent() != null) {
                fragmentView.setPadding(0, 0, 0, 0);
                ((ViewGroup) fragmentView).removeView(playerView);
            }
        }
        return false;
    }
    return true;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:25,代码来源:ChatActivity.java

示例3: createActionBar

import org.telegram.ui.ActionBar.BackDrawable; //导入依赖的package包/类
@Override
protected ActionBar createActionBar(Context context) {
    ActionBar actionBar = new ActionBar(context) {
        @Override
        public boolean onTouchEvent(MotionEvent event) {
            return super.onTouchEvent(event); //TODO
        }
    };
    actionBar.setItemsBackgroundColor(AvatarDrawable.getButtonColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id));
    //actionBar.setBackButtonDrawable(new BackDrawable(false));
    SharedPreferences themePrefs = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    actionBar.setBackgroundColor(AvatarDrawable.getProfileBackColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id));
    //actionBar.setItemsBackground(AvatarDrawable.getButtonColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id));
    Drawable back = new BackDrawable(false);
    ((BackDrawable) back).setColor(themePrefs.getInt("profileHeaderIconsColor", 0xffffffff));
    actionBar.setBackButtonDrawable(back);
    actionBar.setCastShadows(false);
    actionBar.setAddToContainer(false);
    actionBar.setOccupyStatusBar(!AndroidUtilities.isTablet());
    return actionBar;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:22,代码来源:ProfileActivity.java

示例4: createActionBar

import org.telegram.ui.ActionBar.BackDrawable; //导入依赖的package包/类
@Override
protected ActionBar createActionBar(Context context) {
    ActionBar actionBar = new ActionBar(context) {
        @Override
        public boolean onTouchEvent(MotionEvent event) {
            return super.onTouchEvent(event);
        }
    };
    actionBar.setItemsBackgroundColor(AvatarDrawable.getButtonColorForId(user_id != 0 || ChatObject.isChannel(chat_id) && !currentChat.megagroup ? 5 : chat_id), false);
    actionBar.setItemsColor(Theme.getColor(Theme.key_actionBarDefaultIcon), false);
    actionBar.setItemsColor(Theme.getColor(Theme.key_actionBarActionModeDefaultIcon), true);
    actionBar.setBackButtonDrawable(new BackDrawable(false));
    actionBar.setCastShadows(false);
    actionBar.setAddToContainer(false);
    actionBar.setOccupyStatusBar(Build.VERSION.SDK_INT >= 21 && !AndroidUtilities.isTablet());
    return actionBar;
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:18,代码来源:ProfileActivity.java

示例5: getBackDrawable

import org.telegram.ui.ActionBar.BackDrawable; //导入依赖的package包/类
public BackDrawable getBackDrawable(boolean close){
    return new BackDrawable(close);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:ChatActivity.java

示例6: fixLayoutInternal

import org.telegram.ui.ActionBar.BackDrawable; //导入依赖的package包/类
private boolean fixLayoutInternal() {
    if (!AndroidUtilities.isTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        selectedMessagesCountTextView.setTextSize(18);
    } else {
        selectedMessagesCountTextView.setTextSize(20);
    }

    HashMap<Long, MessageObject.GroupedMessages> newGroups = null;
    int count = chatListView.getChildCount();
    for (int a = 0; a < count; a++) {
        View child = chatListView.getChildAt(a);
        if (child instanceof ChatMessageCell) {
            MessageObject.GroupedMessages groupedMessages = ((ChatMessageCell) child).getCurrentMessagesGroup();
            if (groupedMessages != null && groupedMessages.hasSibling) {
                if (newGroups == null) {
                    newGroups = new HashMap<>();
                }
                if (!newGroups.containsKey(groupedMessages.groupId)) {
                    newGroups.put(groupedMessages.groupId, groupedMessages);

                    MessageObject messageObject = groupedMessages.messages.get(groupedMessages.messages.size() - 1);
                    int idx = messages.indexOf(messageObject);
                    if (idx >= 0) {
                        chatAdapter.notifyItemRangeChanged(idx + chatAdapter.messagesStartRow, groupedMessages.messages.size());
                    }
                }
            }
        }
    }

    if (AndroidUtilities.isTablet()) {
        if (AndroidUtilities.isSmallTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
            actionBar.setBackButtonDrawable(new BackDrawable(false));
            if (fragmentContextView != null && fragmentContextView.getParent() == null) {
                ((ViewGroup) fragmentView).addView(fragmentContextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 39, Gravity.TOP | Gravity.LEFT, 0, -36, 0, 0));
            }
        } else {
            actionBar.setBackButtonDrawable(new BackDrawable(parentLayout == null || parentLayout.fragmentsStack.isEmpty() || parentLayout.fragmentsStack.get(0) == ChatActivity.this || parentLayout.fragmentsStack.size() == 1));
            if (fragmentContextView != null && fragmentContextView.getParent() != null) {
                fragmentView.setPadding(0, 0, 0, 0);
                ((ViewGroup) fragmentView).removeView(fragmentContextView);
            }
        }
        return false;
    }
    return true;
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:48,代码来源:ChatActivity.java


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