Search in sources :

Example 16 with RelativeLayout

use of android.widget.RelativeLayout in project WoWoViewPager by Nightonke.

the class AppIntroExampleActivity method onWindowFocusChanged.

@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    screenW = WoWoUtil.getScreenWidth(this);
    screenH = WoWoUtil.getScreenHeight(this);
    circleR = (int) Math.sqrt(screenW * screenW + screenH * screenH) + 10;
    RelativeLayout base = (RelativeLayout) findViewById(R.id.base);
    ViewGroup.LayoutParams layoutParams = base.getLayoutParams();
    layoutParams.height = circleR * 2;
    layoutParams.width = circleR * 2;
    base.setLayoutParams(layoutParams);
    RelativeLayout subBase = (RelativeLayout) findViewById(R.id.sub_base);
    layoutParams = subBase.getLayoutParams();
    layoutParams.height = screenH;
    layoutParams.width = screenW;
    subBase.setLayoutParams(layoutParams);
    setCircleAnimation();
    setNightonkeAnimation();
    setPresentsAnimation();
    setBlueStickAnimation();
    setOrangeStickAnimation();
    setWoWoAnimation();
    setViewPagerAnimation();
    setMusicStand();
    setMusicNotes();
    setBigCloud();
    setLittleCloud();
    setPath();
    setOptimized();
    setSun();
    setFree();
    setNightonkeCloud();
}
Also used : ViewGroup(android.view.ViewGroup) RelativeLayout(android.widget.RelativeLayout)

Example 17 with RelativeLayout

use of android.widget.RelativeLayout in project Context-Menu.Android by Yalantis.

the class Utils method getImageWrapper.

public static RelativeLayout getImageWrapper(Context context, MenuObject menuItem, int menuItemSize, View.OnClickListener onCLick, View.OnLongClickListener onLongClick, boolean showDivider) {
    RelativeLayout imageWrapper = new RelativeLayout(context);
    LinearLayout.LayoutParams imageWrapperLayoutParams = new LinearLayout.LayoutParams(menuItemSize, menuItemSize);
    imageWrapper.setLayoutParams(imageWrapperLayoutParams);
    imageWrapper.setOnClickListener(onCLick);
    imageWrapper.setOnLongClickListener(onLongClick);
    imageWrapper.addView(Utils.getItemImageButton(context, menuItem));
    if (showDivider) {
        imageWrapper.addView(getDivider(context, menuItem));
    }
    if (menuItem.getBgColor() != 0) {
        imageWrapper.setBackgroundColor(menuItem.getBgColor());
    } else if (menuItem.getBgDrawable() != null) {
        if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) {
            imageWrapper.setBackgroundDrawable(menuItem.getBgDrawable());
        } else {
            imageWrapper.setBackground(menuItem.getBgDrawable());
        }
    } else if (menuItem.getBgResource() != 0) {
        imageWrapper.setBackgroundResource(menuItem.getBgResource());
    } else {
        imageWrapper.setBackgroundColor(context.getResources().getColor(R.color.menu_item_background));
    }
    return imageWrapper;
}
Also used : RelativeLayout(android.widget.RelativeLayout) LinearLayout(android.widget.LinearLayout)

Example 18 with RelativeLayout

use of android.widget.RelativeLayout in project remusic by aa112901.

the class SplashActivity method setupSplashAd.

/**
	 * 设置开屏广告
	 */
private void setupSplashAd() {
    // 创建开屏容器
    final RelativeLayout splashLayout = (RelativeLayout) findViewById(R.id.rl_splash);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    params.addRule(RelativeLayout.ABOVE, R.id.view_divider);
    // 对开屏进行设置
    SplashViewSettings splashViewSettings = new SplashViewSettings();
    //		// 设置是否展示失败自动跳转,默认自动跳转
    //		splashViewSettings.setAutoJumpToTargetWhenShowFailed(false);
    // 设置跳转的窗口类
    splashViewSettings.setTargetClass(MainActivity.class);
    // 设置开屏的容器
    splashViewSettings.setSplashViewContainer(splashLayout);
    // 展示开屏广告
    SpotManager.getInstance(mContext).showSplash(mContext, splashViewSettings, mStopListener);
}
Also used : RelativeLayout(android.widget.RelativeLayout) SplashViewSettings(net.youmi.android.normal.spot.SplashViewSettings)

Example 19 with RelativeLayout

use of android.widget.RelativeLayout in project remusic by aa112901.

the class SwipeRefreshLayout method createFooterViewContainer.

/**
     * 添加底部布局
     */
private void createFooterViewContainer() {
    mFooterViewContainer = new RelativeLayout(getContext());
    mFooterViewContainer.setVisibility(View.GONE);
    addView(mFooterViewContainer);
}
Also used : RelativeLayout(android.widget.RelativeLayout)

Example 20 with RelativeLayout

use of android.widget.RelativeLayout in project LuaViewSDK by alibaba.

the class Demo2Activity method test.

private void test() {
    mContainer = new RelativeLayout(this);
    mContainer.setBackgroundColor(Color.RED);
    mContainer.setAlpha(0.5f);
    child = new RelativeLayout(this);
    child.setBackgroundColor(Color.BLUE);
    child.setAlpha(0.5f);
    mContainer.addView(child, new ViewGroup.MarginLayoutParams(300, 300));
    ((ViewGroup.MarginLayoutParams) child.getLayoutParams()).leftMargin = 0;
    ((ViewGroup.MarginLayoutParams) child.getLayoutParams()).topMargin = 200;
    child.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            child.animate().translationY(-200).setDuration(2000).start();
        }
    });
    setContentView(mContainer, new ViewGroup.MarginLayoutParams(300, 300));
    ((ViewGroup.MarginLayoutParams) mContainer.getLayoutParams()).leftMargin = 200;
    ((ViewGroup.MarginLayoutParams) mContainer.getLayoutParams()).topMargin = 200;
}
Also used : ViewGroup(android.view.ViewGroup) RelativeLayout(android.widget.RelativeLayout) View(android.view.View)

Aggregations

RelativeLayout (android.widget.RelativeLayout)189 TextView (android.widget.TextView)87 View (android.view.View)75 ImageView (android.widget.ImageView)47 LinearLayout (android.widget.LinearLayout)37 ViewGroup (android.view.ViewGroup)30 OnClickListener (android.view.View.OnClickListener)14 Intent (android.content.Intent)13 LayoutInflater (android.view.LayoutInflater)12 FrameLayout (android.widget.FrameLayout)12 ListView (android.widget.ListView)12 ScrollView (android.widget.ScrollView)12 Bundle (android.os.Bundle)11 ImageButton (android.widget.ImageButton)11 SuppressLint (android.annotation.SuppressLint)10 Resources (android.content.res.Resources)10 Button (android.widget.Button)10 DialogInterface (android.content.DialogInterface)9 LayoutParams (android.view.ViewGroup.LayoutParams)9 DisplayMetrics (android.util.DisplayMetrics)8