use of android.widget.RelativeLayout in project talk-android by nextcloud.
the class CallActivity method removeMediaStream.
private void removeMediaStream(String sessionId) {
if (remoteRenderersLayout.getChildCount() > 0) {
RelativeLayout relativeLayout = remoteRenderersLayout.findViewWithTag(sessionId);
if (relativeLayout != null) {
SurfaceViewRenderer surfaceViewRenderer = relativeLayout.findViewById(R.id.surface_view);
surfaceViewRenderer.release();
remoteRenderersLayout.removeView(relativeLayout);
remoteRenderersLayout.invalidate();
}
}
callControls.setZ(100.0f);
}
use of android.widget.RelativeLayout in project talk-android by nextcloud.
the class CallActivity method gotNick.
private void gotNick(String sessionId, String nick) {
RelativeLayout relativeLayout = remoteRenderersLayout.findViewWithTag(sessionId);
if (relativeLayout != null) {
TextView textView = relativeLayout.findViewById(R.id.peer_nick_text_view);
textView.setText(nick);
}
}
use of android.widget.RelativeLayout in project pictureapp by EyeSeeTea.
the class LoginActivity method initProgressBar.
private void initProgressBar() {
bar = (CircularProgressBar) findViewById(R.id.progress_bar_circular);
float progressBarStrokeWidth = getResources().getDimensionPixelSize(R.dimen.progressbar_stroke_width);
bar.setIndeterminateDrawable(new CircularProgressDrawable.Builder(this).color(ContextCompat.getColor(this, R.color.color_primary_default)).style(CircularProgressDrawable.STYLE_ROUNDED).strokeWidth(progressBarStrokeWidth).rotationSpeed(1f).sweepSpeed(1f).build());
onPostAnimationListener = new OnPostAnimationListener();
/* adding transition animations to root layout */
if (isGreaterThanOrJellyBean()) {
layoutTransition = new LayoutTransition();
layoutTransition.enableTransitionType(LayoutTransition.CHANGING);
layoutTransition.addTransitionListener(onPostAnimationListener);
RelativeLayout loginLayoutContent = (RelativeLayout) findViewById(org.hisp.dhis.client.sdk.ui.R.id.layout_content);
loginLayoutContent.setLayoutTransition(layoutTransition);
} else {
layoutTransitionSlideIn = AnimationUtils.loadAnimation(this, org.hisp.dhis.client.sdk.ui.R.anim.in_up);
layoutTransitionSlideOut = AnimationUtils.loadAnimation(this, org.hisp.dhis.client.sdk.ui.R.anim.out_down);
layoutTransitionSlideIn.setAnimationListener(onPostAnimationListener);
layoutTransitionSlideOut.setAnimationListener(onPostAnimationListener);
}
}
use of android.widget.RelativeLayout in project AndroidStudy by tinggengyan.
the class MyPopupMenu method divisionTran.
/**
* 分界线布局中的textView跟随选中标题移动位置的,设置为动画效果
*/
public void divisionTran(int position) {
/**
* 先移除了RelativeLayout中原有的textView
*/
divisionLayout.removeAllViews();
/**
* 重新设置textView布局属性 动态改变控件位置 第一步
*/
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(screenWidth / 3, LayoutParams.MATCH_PARENT);
/**
* 设置动画效果
*/
Animation translateTextView;
translateTextView = new TranslateAnimation((preIndex - currentIndex) * screenWidth / 3, 0, 0, 0);
/**
* 根据选中的标题确定布局 动态改变控件位置 第二步
*/
if (position == 0) {
lp.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
} else if (position == 1) {
lp.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
} else {
lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
}
/**
* 动态改变控件位置 第三步
*/
TextView line = new TextView(context);
line.setBackgroundColor(Color.WHITE);
divisionLayout.addView(line, lp);
/**
* 设置动画执行时间
*/
translateTextView.setDuration(200);
/**
* 启动动画
*/
line.startAnimation(translateTextView);
}
use of android.widget.RelativeLayout in project android_packages_apps_Gallery2 by LineageOS.
the class AlbumSetPage method setupCameraButton.
private boolean setupCameraButton() {
if (!GalleryUtils.isCameraAvailable(mActivity))
return false;
RelativeLayout galleryRoot = (RelativeLayout) ((Activity) mActivity).findViewById(R.id.gallery_root);
if (galleryRoot == null)
return false;
mCameraButton = new Button(mActivity);
mCameraButton.setText(R.string.camera_label);
mCameraButton.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.frame_overlay_gallery_camera, 0, 0);
mCameraButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
GalleryUtils.startCameraActivity(mActivity);
}
});
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
if (tvEmptyAlbum != null && tvEmptyAlbum.getVisibility() == View.VISIBLE) {
lp.addRule(RelativeLayout.BELOW, tvEmptyAlbum.getId());
lp.addRule(RelativeLayout.CENTER_HORIZONTAL);
} else {
lp.addRule(RelativeLayout.CENTER_IN_PARENT);
}
galleryRoot.addView(mCameraButton, lp);
return true;
}
Aggregations