android.widget.FrameLayout.LayoutParams Java Examples

The following examples show how to use android.widget.FrameLayout.LayoutParams. 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: DialogCropPhotoTransit.java    From bither-android with Apache License 2.0 6 votes vote down vote up
private DialogCropPhotoTransit(Context context) {
    super(context, R.style.dialogCropPhotoTransit);
    toShowAnimation = true;
    this.setCancelable(false);
    this.mContext = context;
    this.mWindow = this.getWindow();
    this.mWindowLp = mWindow.getAttributes();
    mWindow.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    mWindowLp.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
    mWindowLp.windowAnimations = R.style.dialogCropPhotoTransit;
    mWindow.setAttributes(mWindowLp);
    this.setContentView(R.layout.dialog_crop_image_transit);
    this.mIv = (ImageView) findViewById(R.id.iv_photo);
    ivLp = (LayoutParams) mIv.getLayoutParams();
    mFl = (FrameLayout) findViewById(R.id.fl_container);
    mFl.getLayoutParams().height = mContext.getResources()
            .getDisplayMetrics().heightPixels;
    mFl.getLayoutParams().width = mContext.getResources()
            .getDisplayMetrics().widthPixels;
}
 
Example #2
Source File: StateViewLayout.java    From YCStateLayout with Apache License 2.0 6 votes vote down vote up
/**
 * StateViewLayout(loading status view) wrap the specific view.
 * @param view view to be wrapped
 * @return Holder
 */
public Holder wrap(View view) {
    FrameLayout wrapper = new FrameLayout(view.getContext());
    ViewGroup.LayoutParams lp = view.getLayoutParams();
    if (lp != null) {
        wrapper.setLayoutParams(lp);
    }
    if (view.getParent() != null) {
        ViewGroup parent = (ViewGroup) view.getParent();
        int index = parent.indexOfChild(view);
        parent.removeView(view);
        parent.addView(wrapper, index);
    }
    LayoutParams newLp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    wrapper.addView(view, newLp);
    return new Holder(mAdapter, view.getContext(), wrapper);
}
 
Example #3
Source File: SuperAwesomeCardFragment.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

	LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
       params.gravity = Gravity.CENTER;

	FrameLayout fl = new FrameLayout(getActivity());
	fl.setLayoutParams(params);

	final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources()
			.getDisplayMetrics());

	TextView v = new TextView(getActivity());
	params.setMargins(margin, margin, margin, margin);
	v.setLayoutParams(params);
	v.setGravity(Gravity.CENTER);
	v.setBackgroundResource(R.drawable.view_sliding_tab_background_card);
	v.setText("CARD " + (position + 1));

	fl.addView(v);
	return fl;
}
 
Example #4
Source File: FimiH264Video.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public void init() {
    this.mVideoWidth = 0;
    this.mVideoHeight = 0;
    setBackgroundColor(ViewCompat.MEASURED_STATE_MASK);
    setFocusable(true);
    setFocusableInTouchMode(true);
    requestFocus();
    this.mCurrentState = 0;
    this.mTargetState = 0;
    TextureView renderUIView = new TextureView(getContext());
    renderUIView.setLayoutParams(new LayoutParams(-2, -2, 17));
    renderUIView.setSurfaceTextureListener(this.mSurfaceCallback);
    this.mX8Camera9GridView = new X8Camera9GridView(getContext());
    this.mX8Camera9GridView.setLayoutParams(new LayoutParams(-1, -1, 17));
    this.mX8AiTrackContainterView = new X8AiTrackContainterView(getContext());
    this.mX8AiTrackContainterView.setLayoutParams(new LayoutParams(-1, -1, 17));
    this.blackView = new View(getContext());
    this.blackView.setLayoutParams(new LayoutParams(-1, -1, 17));
    this.blackView.setBackgroundColor(getContext().getResources().getColor(R.color.black));
    addView(renderUIView);
    addView(this.mX8AiTrackContainterView);
    addView(this.blackView);
    addView(this.mX8Camera9GridView);
    showGridLine(GlobalConfig.getInstance().getGridLine());
}
 
Example #5
Source File: WXScroller.java    From weex with Apache License 2.0 6 votes vote down vote up
@Override
protected MeasureOutput measure(int width, int height) {
  MeasureOutput measureOutput = new MeasureOutput();
  if (this.mOrientation == WXVContainer.HORIZONTAL) {
    int screenW = WXViewUtils.getScreenWidth(WXEnvironment.sApplication);
    int weexW = WXViewUtils.getWeexWidth(mInstanceId);
    measureOutput.width = width > (weexW >= screenW ? screenW : weexW) ? FrameLayout.LayoutParams.MATCH_PARENT
                                                                       : width;
    measureOutput.height = height;
  } else {
    int screenH = WXViewUtils.getScreenHeight(WXEnvironment.sApplication);
    int weexH = WXViewUtils.getWeexHeight(mInstanceId);
    measureOutput.height = height > (weexH >= screenH ? screenH : weexH) ? FrameLayout.LayoutParams.MATCH_PARENT
                                                                         : height;
    measureOutput.width = width;
  }
  return measureOutput;
}
 
Example #6
Source File: CustomTabBottomBarDelegate.java    From delion with Apache License 2.0 6 votes vote down vote up
private void hideBottomBar() {
    if (mBottomBarView == null) return;
    ((ViewGroup) mBottomBarView.getParent()).removeView(mBottomBarView);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    lp.gravity = Gravity.BOTTOM;
    final ViewGroup compositorView = mActivity.getCompositorViewHolder();
    compositorView.addView(mBottomBarView, lp);
    compositorView.addOnLayoutChangeListener(new OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom,
                int oldLeft, int oldTop, int oldRight, int oldBottom) {
            compositorView.removeOnLayoutChangeListener(this);
            mBottomBarView.animate().alpha(0f).translationY(mBottomBarView.getHeight())
                    .setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE)
                    .setDuration(SLIDE_ANIMATION_DURATION_MS)
                    .withEndAction(new Runnable() {
                        @Override
                        public void run() {
                            ((ViewGroup) mBottomBarView.getParent()).removeView(mBottomBarView);
                            mBottomBarView = null;
                        }
                    }).start();
        }
    });
}
 
Example #7
Source File: PhoneTabRecyclerAdapter.java    From ChromeLikeTabSwitcher with Apache License 2.0 6 votes vote down vote up
@Override
protected final void onShowTabView(@NonNull final View view, @NonNull final TabItem tabItem,
                                   @NonNull final Integer... params) {
    LayoutParams layoutParams =
            new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    int borderMargin = -(tabInset + tabBorderWidth);
    int bottomMargin = params.length > 0 && params[0] != -1 ? params[0] : borderMargin;
    layoutParams.leftMargin = borderMargin;
    layoutParams.topMargin = -(tabInset + tabTitleContainerHeight);
    layoutParams.rightMargin = borderMargin;
    layoutParams.bottomMargin = bottomMargin;
    view.setLayoutParams(layoutParams);
    adaptContentBackgroundColor(tabItem);
    adaptBackgroundVisibility(tabItem);

    if (!getModel().isSwitcherShown()) {
        addContentView(tabItem);
    } else {
        renderPreview(tabItem);
    }
}
 
Example #8
Source File: Gloading.java    From Gloading with Apache License 2.0 6 votes vote down vote up
/**
 * Gloading(loading status view) wrap the specific view.
 * @param view view to be wrapped
 * @return Holder
 */
public Holder wrap(View view) {
    FrameLayout wrapper = new FrameLayout(view.getContext());
    ViewGroup.LayoutParams lp = view.getLayoutParams();
    if (lp != null) {
        wrapper.setLayoutParams(lp);
    }
    if (view.getParent() != null) {
        ViewGroup parent = (ViewGroup) view.getParent();
        int index = parent.indexOfChild(view);
        parent.removeView(view);
        parent.addView(wrapper, index);
    }
    LayoutParams newLp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    wrapper.addView(view, newLp);
    return new Holder(mAdapter, view.getContext(), wrapper);
}
 
Example #9
Source File: PhoneTabRecyclerAdapter.java    From ChromeLikeTabSwitcher with Apache License 2.0 6 votes vote down vote up
/**
 * Inflates the view, which is associated with a tab, and adds it to the view hierarchy.
 *
 * @param tabItem
 *         The tab item, which corresponds to the tab, whose associated view should be inflated,
 *         as an instance of the class {@link TabItem}. The tab item may not be null
 */
private void addContentView(@NonNull final TabItem tabItem) {
    PhoneTabViewHolder viewHolder = (PhoneTabViewHolder) tabItem.getViewHolder();
    View view = viewHolder.content;
    Tab tab = tabItem.getTab();

    if (view == null) {
        ViewGroup parent = viewHolder.contentContainer;
        Pair<View, ?> pair = tabViewRecycler.inflate(tab, parent);
        view = pair.first;
        LayoutParams layoutParams =
                new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
        Rect padding = getPadding();
        layoutParams.setMargins(padding.left, padding.top, padding.right, padding.bottom);
        parent.addView(view, 0, layoutParams);
        viewHolder.content = view;
    } else {
        tabViewRecycler.getAdapter().onShowView(getModel().getContext(), view, tab, false);
    }

    viewHolder.previewImageView.setVisibility(View.GONE);
    viewHolder.previewImageView.setImageBitmap(null);
    viewHolder.borderView.setVisibility(View.GONE);
}
 
Example #10
Source File: ListFragment.java    From letv with Apache License 2.0 6 votes vote down vote up
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Context context = getActivity();
    FrameLayout root = new FrameLayout(context);
    LinearLayout pframe = new LinearLayout(context);
    pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID);
    pframe.setOrientation(1);
    pframe.setVisibility(8);
    pframe.setGravity(17);
    pframe.addView(new ProgressBar(context, null, 16842874), new LayoutParams(-2, -2));
    root.addView(pframe, new LayoutParams(-1, -1));
    FrameLayout lframe = new FrameLayout(context);
    lframe.setId(INTERNAL_LIST_CONTAINER_ID);
    TextView tv = new TextView(getActivity());
    tv.setId(INTERNAL_EMPTY_ID);
    tv.setGravity(17);
    lframe.addView(tv, new LayoutParams(-1, -1));
    ListView lv = new ListView(getActivity());
    lv.setId(16908298);
    lv.setDrawSelectorOnTop(false);
    lframe.addView(lv, new LayoutParams(-1, -1));
    root.addView(lframe, new LayoutParams(-1, -1));
    root.setLayoutParams(new LayoutParams(-1, -1));
    return root;
}
 
Example #11
Source File: BasicNativePage.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
public BasicNativePage(Activity activity, Tab tab) {
    initialize(activity, tab);
    mActivity = activity;
    mTab = tab;
    mBackgroundColor = ApiCompatibilityUtils.getColor(activity.getResources(),
            R.color.default_primary_color);
    mThemeColor = ApiCompatibilityUtils.getColor(
            activity.getResources(), R.color.default_primary_color);

    Resources res = mActivity.getResources();

    LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.MATCH_PARENT);
    layoutParams.setMargins(0,
            res.getDimensionPixelSize(R.dimen.tab_strip_height)
            + res.getDimensionPixelSize(R.dimen.toolbar_height_no_shadow),
            0, 0);
    getView().setLayoutParams(layoutParams);
}
 
Example #12
Source File: ViewAndroidDelegate.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Set the anchor view to specified position and size (all units in dp).
 * @param view The anchor view that needs to be positioned.
 * @param x X coordinate of the top left corner of the anchor view.
 * @param y Y coordinate of the top left corner of the anchor view.
 * @param width The width of the anchor view.
 * @param height The height of the anchor view.
 */
@CalledByNative
public void setViewPosition(View view, float x, float y,
        float width, float height, float scale, int leftMargin, int topMargin) {
    ViewGroup containerView = getContainerView();
    if (containerView == null) return;

    int scaledWidth = Math.round(width * scale);
    int scaledHeight = Math.round(height * scale);
    int startMargin;

    if (ApiCompatibilityUtils.isLayoutRtl(containerView)) {
        startMargin = containerView.getMeasuredWidth() - Math.round((width + x) * scale);
    } else {
        startMargin = leftMargin;
    }
    if (scaledWidth + startMargin > containerView.getWidth()) {
        scaledWidth = containerView.getWidth() - startMargin;
    }
    LayoutParams lp = new LayoutParams(scaledWidth, scaledHeight);
    ApiCompatibilityUtils.setMarginStart(lp, startMargin);
    lp.topMargin = topMargin;
    view.setLayoutParams(lp);
}
 
Example #13
Source File: Gloading.java    From MaoWanAndoidClient with Apache License 2.0 6 votes vote down vote up
/**
 * Gloading(loading status view) wrap the specific view.
 * @param view view to be wrapped
 * @return Holder
 */
public Holder wrap(View view) {
    FrameLayout wrapper = new FrameLayout(view.getContext());
    ViewGroup.LayoutParams lp = view.getLayoutParams();
    if (lp != null) {
        wrapper.setLayoutParams(lp);
    }
    if (view.getParent() != null) {
        ViewGroup parent = (ViewGroup) view.getParent();
        int index = parent.indexOfChild(view);
        parent.removeView(view);
        parent.addView(wrapper, index);
    }
    LayoutParams newLp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    wrapper.addView(view, newLp);
    return new Holder(mAdapter, view.getContext(), wrapper);
}
 
Example #14
Source File: SystemBarTintManager.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
    mStatusBarTintView = new View(context);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
    params.gravity = Gravity.TOP;
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
        params.rightMargin = mConfig.getNavigationBarWidth();
    }
    mStatusBarTintView.setLayoutParams(params);
    mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
    mStatusBarTintView.setVisibility(View.GONE);
    decorViewGroup.addView(mStatusBarTintView);
}
 
Example #15
Source File: PhoneTabRecyclerAdapter.java    From ChromeLikeTabSwitcher with Apache License 2.0 5 votes vote down vote up
/**
 * Adapts the padding of a tab.
 *
 * @param viewHolder
 *         The view holder, which stores references to the tab's views, as an instance of the
 *         class {@link PhoneTabViewHolder}. The view holder may not be null
 */
private void adaptPadding(@NonNull final PhoneTabViewHolder viewHolder) {
    Rect padding = getPadding();

    if (viewHolder.content != null) {
        LayoutParams contentLayoutParams = (LayoutParams) viewHolder.content.getLayoutParams();
        contentLayoutParams
                .setMargins(padding.left, padding.top, padding.right, padding.bottom);
    }

    LayoutParams previewLayoutParams =
            (LayoutParams) viewHolder.previewImageView.getLayoutParams();
    previewLayoutParams.setMargins(padding.left, padding.top, padding.right, padding.bottom);
}
 
Example #16
Source File: SystemBarTintManager.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static ViewGroup.MarginLayoutParams getToggleParams(boolean toggle, int id) {
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
    if(toggle){
        params.addRule(RelativeLayout.ABOVE, id);
    }
    else{
        params.removeRule(RelativeLayout.ABOVE);
    }
    return params;
}
 
Example #17
Source File: SystemStatusManager.java    From Android-IM with Apache License 2.0 5 votes vote down vote up
public void setTranslucentStatus(int res) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        // 透明状态栏
        this.mContext.getWindow().addFlags(
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        // 透明导航栏
        this.mContext.getWindow().addFlags(
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemStatusManager tintManager = new SystemStatusManager(this.mContext);
        tintManager.setStatusBarTintEnabled(true);
        // 设置状态栏的颜色
        tintManager.setStatusBarTintResource(res);
        this.mContext.getWindow().getDecorView().setFitsSystemWindows(true);
    }
}
 
Example #18
Source File: SystemBarTintManager.java    From tup.dota2recipe with Apache License 2.0 5 votes vote down vote up
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
    mStatusBarTintView = new View(context);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
    params.gravity = Gravity.TOP;
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
        params.rightMargin = mConfig.getNavigationBarWidth();
    }
    mStatusBarTintView.setLayoutParams(params);
    mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
    mStatusBarTintView.setVisibility(View.GONE);
    decorViewGroup.addView(mStatusBarTintView);
}
 
Example #19
Source File: SystemBarTintManager.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static ViewGroup.MarginLayoutParams getToggleParams(boolean toggle, int id) {
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
    if(toggle){
        params.addRule(RelativeLayout.ABOVE, id);
    }
    else{
        params.removeRule(RelativeLayout.ABOVE);
    }
    return params;
}
 
Example #20
Source File: StarRuleDialog.java    From letv with Apache License 2.0 5 votes vote down vote up
private void setView(int viewHeight) {
    LinearLayout.LayoutParams lltype;
    if (viewHeight < UIsUtils.dipToPx(360.0f)) {
        lltype = new LinearLayout.LayoutParams(-1, -2);
    } else {
        lltype = new LinearLayout.LayoutParams(-1, UIsUtils.dipToPx(360.0f));
    }
    lltype.setMargins(UIsUtils.dipToPx(15.0f), 0, 0, UIsUtils.dipToPx(15.0f));
    this.mRuleContent.setLayoutParams(lltype);
}
 
Example #21
Source File: BallPulseView.java    From TwinklingRefreshLayout with Apache License 2.0 5 votes vote down vote up
public BallPulseView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    int default_size = DensityUtil.dp2px(context, DEFAULT_SIZE);
    LayoutParams params = new LayoutParams(default_size, default_size, Gravity.CENTER);
    setLayoutParams(params);

    circleSpacing = DensityUtil.dp2px(context, 4);

    mPaint = new Paint();
    mPaint.setColor(Color.WHITE);
    mPaint.setStyle(Paint.Style.FILL);
    mPaint.setAntiAlias(true);
}
 
Example #22
Source File: ToolbarProgressBar.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Prepare the progress bar for being attached to the window.
 * @param topMargin The progress bar's top margin.
 */
public void prepareForAttach(int topMargin) {
    LayoutParams curParams = new LayoutParams(getLayoutParams());
    mMarginTop = topMargin;
    curParams.topMargin = mMarginTop;
    setLayoutParams(curParams);
}
 
Example #23
Source File: SystemBarTintManager.java    From Android-SpeedyViewSelector with Apache License 2.0 5 votes vote down vote up
protected LinearLayout.LayoutParams generateLayoutParams(int width,int height,float weight) {
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width,height);
    if(weight != 0){
        params.weight = weight;
    }
    return params;
}
 
Example #24
Source File: LetvBaseWebViewActivity.java    From letv with Apache License 2.0 5 votes vote down vote up
private void findView() {
    this.getMoreImg = (ImageView) findViewById(R.id.get_more);
    this.titleView = (TextView) findViewById(R.id.letv_webview_title);
    this.close = (ImageView) findViewById(R.id.close_iv);
    this.back_iv = (ImageView) findViewById(R.id.back_iv);
    LinearLayout rootLayout = (LinearLayout) findViewById(R.id.root_layout);
    this.root = new PublicLoadLayout(this);
    this.root.addContent(R.layout.letv_webview_only);
    rootLayout.addView(this.root, new LayoutParams(-1, -1));
    this.mWebView = (WebView) this.root.findViewById(R.id.webView);
    this.progressBar = (ProgressBar) findViewById(R.id.loading_progress);
    this.pullDownUrlText = (TextView) findViewById(R.id.pulldown_title_url);
    this.topBar = findViewById(R.id.web_view_top_layout);
}
 
Example #25
Source File: SystemBarTintManager.java    From SweetMusicPlayer with Apache License 2.0 5 votes vote down vote up
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
    mStatusBarTintView = new View(context);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
    params.gravity = Gravity.TOP;
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
        params.rightMargin = mConfig.getNavigationBarWidth();
    }
    mStatusBarTintView.setLayoutParams(params);
    mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
    mStatusBarTintView.setVisibility(View.GONE);
    decorViewGroup.addView(mStatusBarTintView);
}
 
Example #26
Source File: ChannelListFootView.java    From letv with Apache License 2.0 5 votes vote down vote up
protected void init(Context context) {
    View view = UIsUtils.inflate(context, R.layout.channel_listview_foot_playerlibs, null);
    view.setLayoutParams(new LayoutParams(-1, UIsUtils.dipToPx(40.0f)));
    this.loadingLayout = (LinearLayout) view.findViewById(R.id.loading_layout);
    this.refreshLayout = (LinearLayout) view.findViewById(R.id.refresh_layout);
    this.noMoreLayout = (RelativeLayout) view.findViewById(R.id.no_more_or_error_layout);
    this.finishNoReply = (RelativeLayout) view.findViewById(R.id.rl_no_more_reply_layout);
    this.noMoreInfo = (TextView) view.findViewById(R.id.tv_no_more_info);
    this.noMoreOrErrorView = (TextView) view.findViewById(R.id.no_more_or_error_text);
    addView(view);
}
 
Example #27
Source File: ChannelTabsView.java    From letv with Apache License 2.0 5 votes vote down vote up
public void setTabs(ArrayList<ChannelNavigation> navigations, Channel mChannel) {
    if (!BaseTypeUtils.isListEmpty(navigations)) {
        int row = ((navigations.size() + 4) - 1) / 4;
        int height = (this.ROW_HEIGHT * row) + ((row - 1) * this.ROW_SPACING);
        if (this.mGridView.getLayoutParams() != null) {
            this.mGridView.getLayoutParams().height = height;
        } else {
            this.mGridView.setLayoutParams(new LayoutParams(UIsUtils.getScreenWidth(), height));
        }
    }
    this.mChannel = mChannel;
    this.mAdapter.setData(navigations);
}
 
Example #28
Source File: SystemBarTintManager.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
    mStatusBarTintView = new View(context);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
    params.gravity = Gravity.TOP;
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
        params.rightMargin = mConfig.getNavigationBarWidth();
    }
    mStatusBarTintView.setLayoutParams(params);
    mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
    mStatusBarTintView.setVisibility(View.GONE);
    decorViewGroup.addView(mStatusBarTintView);
}
 
Example #29
Source File: AbsGuideActivity.java    From guideshow with MIT License 5 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    List<SinglePage> guideContent = buildGuideContent();

    if (guideContent == null) {
        // nothing to show
        return;
    }

    // prepare views
    FrameLayout container = new FrameLayout(this);
    ViewPager pager = new ViewPager(this);
    pager.setId(getPagerId());

    container.addView(pager, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

    setContentView(container);

    FragmentPagerAdapter adapter = new FragmentTabAdapter(this, guideContent);
    pager.setAdapter(adapter);

    GuideView guideView = new GuideView(this, guideContent, drawDot(), dotDefault(), dotSelected());
    pager.setOnPageChangeListener(guideView);

    container.addView(guideView, new LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.MATCH_PARENT));
}
 
Example #30
Source File: SystemBarTintManager.java    From Conquer with Apache License 2.0 5 votes vote down vote up
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
    mStatusBarTintView = new View(context);
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
    params.gravity = Gravity.TOP;
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
        params.rightMargin = mConfig.getNavigationBarWidth();
    }
    mStatusBarTintView.setLayoutParams(params);
    mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
    mStatusBarTintView.setVisibility(View.GONE);
    decorViewGroup.addView(mStatusBarTintView);
}