Java Code Examples for android.widget.FrameLayout#setFocusable()

The following examples show how to use android.widget.FrameLayout#setFocusable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicPopup.java    From a with GNU General Public License v3.0 6 votes vote down vote up
private void initDialog() {
    contentLayout = new FrameLayout(activity);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    dialog = new Dialog(activity);
    dialog.setCanceledOnTouchOutside(true);//触摸屏幕取消窗体
    dialog.setCancelable(true);//按返回键取消窗体
    dialog.setOnKeyListener(this);
    dialog.setOnDismissListener(this);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //AndroidRuntimeException: requestFeature() must be called before adding content
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setContentView(contentLayout);
    }
    setSize(screenWidthPixels, WRAP_CONTENT);
}
 
Example 2
Source File: ScrollSlidingTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void addStickerTab(TLRPC.Document sticker) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setTag(sticker);
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tabsContainer.addView(tab);
    tab.setSelected(position == currentPosition);
    BackupImageView imageView = new BackupImageView(getContext());
    imageView.setAspectFit(true);
    tab.addView(imageView, LayoutHelper.createFrame(30, 30, Gravity.CENTER));
}
 
Example 3
Source File: BasicPopup.java    From MyBookshelf with GNU General Public License v3.0 6 votes vote down vote up
private void initDialog() {
    contentLayout = new FrameLayout(activity);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    dialog = new Dialog(activity);
    dialog.setCanceledOnTouchOutside(true);//触摸屏幕取消窗体
    dialog.setCancelable(true);//按返回键取消窗体
    dialog.setOnKeyListener(this);
    dialog.setOnDismissListener(this);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //AndroidRuntimeException: requestFeature() must be called before adding content
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setContentView(contentLayout);
    }
    setSize(screenWidthPixels, WRAP_CONTENT);
}
 
Example 4
Source File: ScrollSlidingTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void addStickerTab(TLRPC.Document sticker) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setTag(sticker);
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tabsContainer.addView(tab);
    tab.setSelected(position == currentPosition);
    BackupImageView imageView = new BackupImageView(getContext());
    imageView.setAspectFit(true);
    tab.addView(imageView, LayoutHelper.createFrame(30, 30, Gravity.CENTER));
}
 
Example 5
Source File: BasePopupWindow.java    From FilterTabView with Apache License 2.0 6 votes vote down vote up
/**
     * @param context
     * @param data
     * @param filterType 筛选样式
     */
    public BasePopupWindow(Context context, List data, int filterType, int position, OnFilterToViewListener onFilterToViewListener) {
        this.mContext = context;
        this.filterType = filterType;
        this.mData = data;
        this.mPosition = position;
        this.onFilterToViewListener = onFilterToViewListener;
        mActivity = (Activity) context;
        mRootView = initView();
        mFrameLayout = new FrameLayout(mContext);
        mFrameLayout.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        mFrameLayout.setBackgroundColor(mContext.getResources().getColor(R.color.color_00000050));
        mFrameLayout.setFocusable(true);
        mFrameLayout.setFocusableInTouchMode(true);
//        setCustomDensity(mActivity,((Activity) context).getApplication());
        mFrameLayout.addView(mRootView);
        setContentView(mFrameLayout);
        initCommonContentView();
        initSelectData();
    }
 
Example 6
Source File: BasicPopup.java    From AndroidPicker with MIT License 6 votes vote down vote up
private void initDialog() {
    contentLayout = new FrameLayout(activity);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    dialog = new Dialog(activity);
    dialog.setCanceledOnTouchOutside(true);//触摸屏幕取消窗体
    dialog.setCancelable(true);//按返回键取消窗体
    dialog.setOnKeyListener(this);
    dialog.setOnDismissListener(this);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //AndroidRuntimeException: requestFeature() must be called before adding content
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setContentView(contentLayout);
    }
    setSize(screenWidthPixels, WRAP_CONTENT);
}
 
Example 7
Source File: ScrollSlidingTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public TextView addIconTabWithCounter(Drawable drawable) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setFocusable(true);
    tabsContainer.addView(tab);

    ImageView imageView = new ImageView(getContext());
    imageView.setImageDrawable(drawable);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tab.addView(imageView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));

    tab.setSelected(position == currentPosition);

    TextView textView = new TextView(getContext());
    textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    textView.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelBadgeText));
    textView.setGravity(Gravity.CENTER);
    textView.setBackgroundDrawable(Theme.createRoundRectDrawable(AndroidUtilities.dp(9), Theme.getColor(Theme.key_chat_emojiPanelBadgeBackground)));
    textView.setMinWidth(AndroidUtilities.dp(18));
    textView.setPadding(AndroidUtilities.dp(5), 0, AndroidUtilities.dp(5), AndroidUtilities.dp(1));
    tab.addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 18, Gravity.TOP | Gravity.LEFT, 26, 6, 0, 0));

    return textView;
}
 
Example 8
Source File: ScrollSlidingTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public void addStickerTab(TLRPC.Chat chat) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tabsContainer.addView(tab);
    tab.setSelected(position == currentPosition);
    BackupImageView imageView = new BackupImageView(getContext());
    imageView.setRoundRadius(AndroidUtilities.dp(15));
    TLRPC.FileLocation photo = null;

    AvatarDrawable avatarDrawable = new AvatarDrawable();
    if (chat.photo != null) {
        photo = chat.photo.photo_small;
    }
    avatarDrawable.setTextSize(AndroidUtilities.dp(14));
    avatarDrawable.setInfo(chat);
    imageView.setImage(photo, "50_50", avatarDrawable);

    imageView.setAspectFit(true);
    tab.addView(imageView, LayoutHelper.createFrame(30, 30, Gravity.CENTER));
}
 
Example 9
Source File: ScrollSlidingTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public TextView addIconTabWithCounter(Drawable drawable) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setFocusable(true);
    tabsContainer.addView(tab);

    ImageView imageView = new ImageView(getContext());
    imageView.setImageDrawable(drawable);
    imageView.setScaleType(ImageView.ScaleType.CENTER);
    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tab.addView(imageView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));

    tab.setSelected(position == currentPosition);

    TextView textView = new TextView(getContext());
    textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 12);
    textView.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelBadgeText));
    textView.setGravity(Gravity.CENTER);
    textView.setBackgroundDrawable(Theme.createRoundRectDrawable(AndroidUtilities.dp(9), Theme.getColor(Theme.key_chat_emojiPanelBadgeBackground)));
    textView.setMinWidth(AndroidUtilities.dp(18));
    textView.setPadding(AndroidUtilities.dp(5), 0, AndroidUtilities.dp(5), AndroidUtilities.dp(1));
    tab.addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 18, Gravity.TOP | Gravity.LEFT, 26, 6, 0, 0));

    return textView;
}
 
Example 10
Source File: ScrollSlidingTabStrip.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public void addStickerTab(TLRPC.Chat chat) {
    final int position = tabCount++;
    FrameLayout tab = new FrameLayout(getContext());
    tab.setFocusable(true);
    tab.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            delegate.onPageSelected(position);
        }
    });
    tabsContainer.addView(tab);
    tab.setSelected(position == currentPosition);
    BackupImageView imageView = new BackupImageView(getContext());
    imageView.setRoundRadius(AndroidUtilities.dp(15));
    TLRPC.FileLocation photo = null;

    AvatarDrawable avatarDrawable = new AvatarDrawable();
    if (chat.photo != null) {
        photo = chat.photo.photo_small;
    }
    avatarDrawable.setTextSize(AndroidUtilities.dp(14));
    avatarDrawable.setInfo(chat);
    imageView.setImage(photo, "50_50", avatarDrawable);

    imageView.setAspectFit(true);
    tab.addView(imageView, LayoutHelper.createFrame(30, 30, Gravity.CENTER));
}
 
Example 11
Source File: TabContentViewParent.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
public TabContentViewParent(Context context, Tab tab) {
    super(context);
    mInfobarWrapper = new FrameLayout(context);
    mInfobarWrapper.setFocusable(true);
    mInfobarWrapper.setFocusableInTouchMode(true);
    addView(mInfobarWrapper,
            new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    tab.addObserver(mTabObserver);
}
 
Example 12
Source File: StickerPreviewViewer.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public void setParentActivity(Activity activity) {
    currentAccount = UserConfig.selectedAccount;
    centerImage.setCurrentAccount(currentAccount);
    if (parentActivity == activity) {
        return;
    }
    parentActivity = activity;

    windowView = new FrameLayout(activity);
    windowView.setFocusable(true);
    windowView.setFocusableInTouchMode(true);
    if (Build.VERSION.SDK_INT >= 23) {
        windowView.setFitsSystemWindows(true);
    }

    containerView = new FrameLayoutDrawer(activity);
    containerView.setFocusable(false);
    windowView.addView(containerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT));
    containerView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_POINTER_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
                close();
            }
            return true;
        }
    });

    windowLayoutParams = new WindowManager.LayoutParams();
    windowLayoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.format = PixelFormat.TRANSLUCENT;
    windowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.gravity = Gravity.TOP;
    windowLayoutParams.type = WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
    if (Build.VERSION.SDK_INT >= 21) {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
    } else {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
    }
    centerImage.setAspectFit(true);
    centerImage.setInvalidateAll(true);
    centerImage.setParentView(containerView);
}
 
Example 13
Source File: NormalDokitViewManager.java    From DoraemonKit with Apache License 2.0 4 votes vote down vote up
/**
 * @return rootView
 */
private FrameLayout getDokitRootContentView(final Activity activity, FrameLayout decorView) {
    FrameLayout dokitRootView = decorView.findViewById(R.id.dokit_contentview_id);
    if (dokitRootView != null) {
        return dokitRootView;
    }

    dokitRootView = new DokitFrameLayout(mContext);
    //普通模式的返回按键监听
    dokitRootView.setOnKeyListener(new View.OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            //LogHelper.i(TAG, "keyCode===>" + keyCode + " " + v.getClass().getSimpleName());
            //监听返回键
            if (keyCode == KeyEvent.KEYCODE_BACK) {
                Map<String, AbsDokitView> dokitViews = getDokitViews(activity);
                if (dokitViews == null || dokitViews.size() == 0) {
                    return false;
                }
                for (AbsDokitView dokitView : dokitViews.values()) {
                    if (dokitView.shouldDealBackKey()) {
                        return dokitView.onBackPressed();
                    }
                }
                return false;
            }
            return false;
        }
    });
    dokitRootView.setClipChildren(false);
    //解决无法获取返回按键的问题
    dokitRootView.setFocusable(true);
    dokitRootView.setFocusableInTouchMode(true);
    dokitRootView.requestFocus();
    dokitRootView.setId(R.id.dokit_contentview_id);
    FrameLayout.LayoutParams dokitParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    try {
        //解决由于项目集成SwipeBackLayout而出现的dokit入口不显示
        if (BarUtils.isStatusBarVisible(activity)) {
            dokitParams.topMargin = BarUtils.getStatusBarHeight();
        }
        if (BarUtils.isSupportNavBar()) {
            if (BarUtils.isNavBarVisible(activity)) {
                dokitParams.bottomMargin = BarUtils.getNavBarHeight();
            }
        }
    } catch (Exception e) {
        //e.printStackTrace();
    }
    dokitRootView.setLayoutParams(dokitParams);
    //添加到DecorView中 为了不和用户自己往根布局中添加view干扰
    decorView.addView(dokitRootView);

    return dokitRootView;
}
 
Example 14
Source File: StickerPreviewViewer.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public void setParentActivity(Activity activity) {
    currentAccount = UserConfig.selectedAccount;
    centerImage.setCurrentAccount(currentAccount);
    if (parentActivity == activity) {
        return;
    }
    parentActivity = activity;

    windowView = new FrameLayout(activity);
    windowView.setFocusable(true);
    windowView.setFocusableInTouchMode(true);
    if (Build.VERSION.SDK_INT >= 23) {
        windowView.setFitsSystemWindows(true);
    }

    containerView = new FrameLayoutDrawer(activity);
    containerView.setFocusable(false);
    windowView.addView(containerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT));
    containerView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_POINTER_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
                close();
            }
            return true;
        }
    });

    windowLayoutParams = new WindowManager.LayoutParams();
    windowLayoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.format = PixelFormat.TRANSLUCENT;
    windowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.gravity = Gravity.TOP;
    windowLayoutParams.type = WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
    if (Build.VERSION.SDK_INT >= 21) {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
    } else {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
    }
    centerImage.setAspectFit(true);
    centerImage.setInvalidateAll(true);
    centerImage.setParentView(containerView);
}
 
Example 15
Source File: ContentPreviewViewer.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
public void setParentActivity(Activity activity) {
    currentAccount = UserConfig.selectedAccount;
    centerImage.setCurrentAccount(currentAccount);
    centerImage.setLayerNum(7);
    if (parentActivity == activity) {
        return;
    }
    parentActivity = activity;

    slideUpDrawable = parentActivity.getResources().getDrawable(R.drawable.preview_arrow);

    windowView = new FrameLayout(activity);
    windowView.setFocusable(true);
    windowView.setFocusableInTouchMode(true);
    if (Build.VERSION.SDK_INT >= 21) {
        windowView.setFitsSystemWindows(true);
        windowView.setOnApplyWindowInsetsListener((v, insets) -> {
            lastInsets = insets;
            return insets;
        });
    }

    containerView = new FrameLayoutDrawer(activity);
    containerView.setFocusable(false);
    windowView.addView(containerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT));
    containerView.setOnTouchListener((v, event) -> {
        if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_POINTER_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
            close();
        }
        return true;
    });

    windowLayoutParams = new WindowManager.LayoutParams();
    windowLayoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.format = PixelFormat.TRANSLUCENT;
    windowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.gravity = Gravity.TOP;
    windowLayoutParams.type = WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
    if (Build.VERSION.SDK_INT >= 21) {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
    } else {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
    }
    centerImage.setAspectFit(true);
    centerImage.setInvalidateAll(true);
    centerImage.setParentView(containerView);
}
 
Example 16
Source File: ContentPreviewViewer.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
public void setParentActivity(Activity activity) {
    currentAccount = UserConfig.selectedAccount;
    centerImage.setCurrentAccount(currentAccount);
    centerImage.setLayerNum(7);
    if (parentActivity == activity) {
        return;
    }
    parentActivity = activity;

    slideUpDrawable = parentActivity.getResources().getDrawable(R.drawable.preview_arrow);

    windowView = new FrameLayout(activity);
    windowView.setFocusable(true);
    windowView.setFocusableInTouchMode(true);
    if (Build.VERSION.SDK_INT >= 21) {
        windowView.setFitsSystemWindows(true);
        windowView.setOnApplyWindowInsetsListener((v, insets) -> {
            lastInsets = insets;
            return insets;
        });
    }

    containerView = new FrameLayoutDrawer(activity);
    containerView.setFocusable(false);
    windowView.addView(containerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT));
    containerView.setOnTouchListener((v, event) -> {
        if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_POINTER_UP || event.getAction() == MotionEvent.ACTION_CANCEL) {
            close();
        }
        return true;
    });

    windowLayoutParams = new WindowManager.LayoutParams();
    windowLayoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.format = PixelFormat.TRANSLUCENT;
    windowLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
    windowLayoutParams.gravity = Gravity.TOP;
    windowLayoutParams.type = WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
    if (Build.VERSION.SDK_INT >= 21) {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
    } else {
        windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
    }
    centerImage.setAspectFit(true);
    centerImage.setInvalidateAll(true);
    centerImage.setParentView(containerView);
}