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();
}
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;
}
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);
}
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);
}
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;
}
Aggregations