本文整理汇总了Java中android.widget.RelativeLayout.setY方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeLayout.setY方法的具体用法?Java RelativeLayout.setY怎么用?Java RelativeLayout.setY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.RelativeLayout
的用法示例。
在下文中一共展示了RelativeLayout.setY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_confirm_setup);
mLoginTextContainer = (RelativeLayout) findViewById(R.id.login_text_container);
mSetupProgress = (ProgressView) findViewById(R.id.SetupProgress);
mContinueFABContainer = (FrameLayout) findViewById(R.id.login_continue_circle_container);
mGearIcon = (ImageView) findViewById(R.id.login_icon);
mContinueIcon = (ImageView) findViewById(R.id.forward_arrow);
mLoginTextLineOne = (TextView) findViewById(R.id.login_text_line_one);
mLoginTextLineTwo = (TextView) findViewById(R.id.login_text_line_two);
mContinueFAB = findViewById(R.id.login_continue_circle);
mContinueFABShadow = findViewById(R.id.login_continue_circle_shadow);
mTransitionViewWhite = findViewById(R.id.transition_view_blue);
mContinueIcon .setVisibility(View.INVISIBLE);
mLoginTextLineOne .setVisibility(View.INVISIBLE);
mLoginTextLineTwo .setVisibility(View.INVISIBLE);
mGearIcon .setVisibility(View.INVISIBLE);
mTransitionViewWhite.setVisibility(View.INVISIBLE);
float textPosition = (int) (2.5 * (Service.getScreenHeight(getBaseContext()) / 5));
mLoginTextContainer .setY(textPosition);
mContinueFABContainer .bringToFront();
mLoginTextLineOne .bringToFront();
mLoginTextLineTwo .bringToFront();
Service.bringToBack(mTransitionViewWhite);
showLogoAnimations();
showTextLineAnimations(mLoginTextLineOne, 1);
showTextLineAnimations(mLoginTextLineTwo, 2);
CheckDataFetchingTask checkingTask = new CheckDataFetchingTask();
checkingTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
示例2: onCreate
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
trackEvent(R.string.category_read, R.string.action_login);
mLoginTextContainer = (RelativeLayout) findViewById(R.id.login_text_container);
mWebViewProgress = (ProgressView) findViewById(R.id.SetupProgress);
mWebViewContainer = (FrameLayout) findViewById(R.id.webview_container);
mContinueFABContainer = (FrameLayout) findViewById(R.id.login_continue_circle_container);
mGearIcon = (ImageView) findViewById(R.id.login_icon);
mSuccessIcon = (ImageView) findViewById(R.id.login_icon_done);
mContinueIcon = (ImageView) findViewById(R.id.forward_arrow);
mLoginTextLineOne = (TextView) findViewById(R.id.login_text_line_one);
mLoginTextLineTwo = (TextView) findViewById(R.id.login_text_line_two);
mSuccessMessage = (TextView) findViewById(R.id.login_success_message);
mSkipText = (TextView) findViewById(R.id.skip_text);
loginWebView = (WebView) findViewById(R.id.login_webview);
mContinueFAB = findViewById(R.id.login_continue_circle);
mContinueFABShadow = findViewById(R.id.login_continue_circle_shadow);
mSuccessCircle = findViewById(R.id.login_success_circle);
mSuccessCircleShadow = findViewById(R.id.login_success_shadow);
mTransitionViewWhite = findViewById(R.id.transition_view);
mTransitionViewBlue = findViewById(R.id.transition_view_blue);
mSuccessMessage .setVisibility(View.INVISIBLE);
mContinueIcon .setVisibility(View.INVISIBLE);
mSuccessCircleShadow.setVisibility(View.INVISIBLE);
mSuccessIcon .setVisibility(View.INVISIBLE);
mSuccessCircle .setVisibility(View.INVISIBLE);
mLoginTextLineOne .setVisibility(View.INVISIBLE);
mLoginTextLineTwo .setVisibility(View.INVISIBLE);
loginWebView .setVisibility(View.INVISIBLE);
mGearIcon .setVisibility(View.INVISIBLE);
mTransitionViewBlue .setVisibility(View.INVISIBLE);
mTransitionViewWhite.setVisibility(View.INVISIBLE);
mSkipText .setVisibility(View.INVISIBLE);
checkSetupType();
float textPosition = (int) (2.5 * (getScreenHeight() / 5));
mLoginTextContainer .setY(textPosition);
mSuccessMessage .setY(textPosition);
mContinueFABContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showLoginView();
if (PocketPlaysApplication.isCrawlerUpdate)
showSkippingAnimation();
}
});
Service.bringToBack(mTransitionViewWhite);
Service.bringToBack(mTransitionViewBlue);
mLoginTextLineOne .bringToFront();
mLoginTextLineTwo .bringToFront();
initSkipView();
initSnackbar();
initLoginView();
showLogoAnimations();
showTextLineAnimations(mLoginTextLineOne, 1);
showTextLineAnimations(mLoginTextLineTwo, 2);
showTextLineAnimations(mSkipText, 2);
AnimationSet animationSet = getContinueIconAnimations(270);
animationSet.setStartOffset(SHOW_CONTINUE_ICON_DELAY);
animationSet.start();
}
示例3: initCommonView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
/**
* 初始化公共的控件
*/
private void initCommonView() {
// 实例化灰色半透明蒙版控件
_backMaskView = new View(_context);
_backMaskView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (_currentInfo.getEventDelegate() != null)
_currentInfo.getEventDelegate().onMaskTouch(LemonHelloView.this, _currentInfo);
}
});
// 设置全屏宽
_backMaskView.setLayoutParams(new RelativeLayout.LayoutParams(_PST.dpToPx(_PST.screenWidthDp()), _PST.dpToPx(_PST.screenHeightDp())));
_rootLayout.setAlpha(0);// 设置全透明,也就是默认不可见,后期通过动画改变来显示
// 实例化内容面板控件
_contentPanel = new LemonHelloPanel(_context);
_contentPanel.setX(_PST.dpToPx((int) (_PST.screenWidthDp() / 2.0)));
_contentPanel.setY(_PST.dpToPx((int) (_PST.screenHeightDp() / 2.0)));
// 实例化内容面板控件的布局
_contentLayout = new RelativeLayout(_context);
// 实例化绘图动画和帧图片显示的控件
_paintView = new LemonPaintView(_context);
// 实例化标题显示标签控件
_titleView = new TextView(_context);
_titleView.setX(0);
_titleView.setY(0);
_titleView.setGravity(Gravity.CENTER);
_contentView = new TextView(_context);
_contentView.setX(0);
_contentView.setY(0);
_contentView.setGravity(Gravity.CENTER);
_actionContainer = new RelativeLayout(_context);
_actionContainer.setX(0);
_actionContainer.setY(0);
_contentView.setAlpha(0);
_titleView.setAlpha(0);
_contentPanel.setAlpha(0);
// 把所有控件添加到根视图上
_rootLayout.addView(_backMaskView);// 半透明灰色背景
_rootLayout.addView(_contentPanel);// 主内容面板
_contentPanel.addView(_contentLayout);
_contentLayout.addView(_paintView);// 动画和帧图标显示控件放置到内容面板上
_contentLayout.addView(_titleView);// 标题显示标签控件放置到内容面板上
_contentLayout.addView(_contentView);// 正文内容显示标签控件放到内容面板上
_contentLayout.addView(_actionContainer);// action事件容器放到内容面板中
}