本文整理汇总了Java中android.widget.FrameLayout.removeAllViews方法的典型用法代码示例。如果您正苦于以下问题:Java FrameLayout.removeAllViews方法的具体用法?Java FrameLayout.removeAllViews怎么用?Java FrameLayout.removeAllViews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.FrameLayout
的用法示例。
在下文中一共展示了FrameLayout.removeAllViews方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBannerWithWait
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void setupBannerWithWait(final int waitTime) {
FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame2);
adFrame.removeAllViews();
adView2 = new PublisherAdView(getActivity());
adView2.setAdUnitId(Constants.DFP_BANNER_ADUNIT_ID_300x250);
adView2.setAdSizes(new AdSize(300, 250));
adView2.setAdListener(adListener);
adFrame.addView(adView2);
//region PriceCheckForDFP API usage
PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
PublisherAdRequest request = builder.build();
Prebid.attachBidsWhenReady(request, Constants.BANNER_300x250, this, waitTime, this.getActivity());
//endregion
}
示例2: onBindViewHolder
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
holder.itemView.setOnClickListener(mClickListener);
final boolean selectable = isSelectable();
holder.itemView.setFocusable(selectable);
holder.itemView.setClickable(selectable);
//holder.setDividerAllowedAbove(mAllowDividerAbove);
//holder.setDividerAllowedBelow(mAllowDividerBelow);
FrameLayout layout = (FrameLayout) holder.itemView;
layout.removeAllViews();
ViewGroup parent = (ViewGroup) mRootView.getParent();
if (parent != null) {
parent.removeView(mRootView);
}
layout.addView(mRootView);
}
示例3: addRemoteVideo
import android.widget.FrameLayout; //导入方法依赖的package包/类
void addRemoteVideo(View singleRemoteView, SurfaceView video, String userId) {
if (singleRemoteView == null)
return;
FrameLayout remoteVideoView = (FrameLayout) singleRemoteView.findViewById(R.id.viewlet_remote_video_user);
remoteVideoView.removeAllViews();
if (video.getParent() != null) {
((ViewGroup) video.getParent()).removeView(video);
}
remoteVideoView.addView(video, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
// TextView remoteNameTextView = new TextView(this);
// TextView tv = (TextView) singleRemoteView.findViewById(R.id.user_name);
// ViewGroup.LayoutParams params = tv.getLayoutParams();
// remoteNameTextView.setLayoutParams(params);
// remoteNameTextView.setTextAppearance(this, R.style.rc_voip_text_style_style);
// UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(userId);
// if (userInfo != null) {
// remoteNameTextView.setText(userInfo.getName());
// } else {
// remoteNameTextView.setText(userId);
// }
// remoteVideoView.addView(remoteNameTextView);
remoteVideoView.setVisibility(View.VISIBLE);
remoteVideoView.setTag(userId);
}
示例4: onException
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onException(NestedContainer container, String errCode, String msg) {
if (TextUtils.equals(errCode, WXRenderErrorCode.WX_NETWORK_ERROR) && container instanceof WXEmbed) {
final WXEmbed comp = ((WXEmbed)container);
final ImageView imageView = new ImageView(comp.getContext());
imageView.setImageResource(R.drawable.error);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ERROR_IMG_WIDTH, ERROR_IMG_HEIGHT);
layoutParams.gravity = Gravity.CENTER;
imageView.setLayoutParams(layoutParams);
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setAdjustViewBounds(true);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imageView.setOnClickListener(null);
imageView.setEnabled(false);
comp.loadContent();
}
});
FrameLayout hostView = comp.getHostView();
hostView.removeAllViews();
hostView.addView(imageView);
WXLogUtils.e("WXEmbed", "NetWork failure :" + errCode + ",\n error message :" + msg);
}
}
示例5: onLoadingState
import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
* 加载中
*/
@DoMain
public void onLoadingState() {
FrameLayout contains = (FrameLayout) rootView.findViewById(R.id.state_contains);
contains.removeAllViews();
View loading = View.inflate(this.getContext(), R.layout.view_loading, null);
contains.addView(loading);
ImageView loading_img = (ImageView) loading.findViewById(R.id.loading_icon);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(500);
rotateAnimation.setRepeatMode(RotateAnimation.RESTART);
rotateAnimation.setRepeatCount(-1);
loading_img.setAnimation(rotateAnimation);
}
示例6: onLoadData
import android.widget.FrameLayout; //导入方法依赖的package包/类
public void onLoadData() {
FrameLayout layout = (FrameLayout) getView();
if (layout != null) {
layout.removeAllViews();
layout.addView(mContentView);
}
}
示例7: setContentView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void setContentView(@LayoutRes int layoutResID) {
if (layoutResID == R.layout.activity_toolbar) {
//提供基本视图
super.setContentView(layoutResID);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar_title = (TextView) findViewById(R.id.toolbar_title);
container = (FrameLayout) findViewById(R.id.container);
container.removeAllViews();
} else {
LayoutInflater.from(this).inflate(layoutResID, container, true);
}
}
示例8: setupBannerWithoutWait
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void setupBannerWithoutWait() {
FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame);
adFrame.removeAllViews();
adView1 = new PublisherAdView(getActivity());
adView1.setAdUnitId(Constants.DFP_BANNER_ADUNIT_ID_320x50);
adView1.setAdSizes(new AdSize(320, 50));
adView1.setAdListener(adListener);
adFrame.addView(adView1);
//region PriceCheckForDFP API usage
PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
PublisherAdRequest request = builder.build();
Prebid.attachBids(request, Constants.BANNER_320x50, this.getActivity());
//endregion
adView1.loadAd(request);
}
示例9: setupBannerWithoutWait
import android.widget.FrameLayout; //导入方法依赖的package包/类
private void setupBannerWithoutWait() {
adView = new MoPubView(this.getActivity());
FrameLayout adFrame = (FrameLayout) root.findViewById(R.id.adFrame);
adFrame.removeAllViews();
adView.setAdUnitId(Constants.MOPUB_BANNER_ADUNIT_ID_320x50);
adView.setBannerAdListener(this);
adView.setAutorefreshEnabled(true);
adView.setMinimumWidth(320);
adView.setMinimumHeight(50);
adView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.TOP | Gravity.CENTER_HORIZONTAL));
adFrame.addView(adView);
Prebid.attachBids(adView, Constants.BANNER_320x50, this.getActivity());
adView.loadAd();
}
示例10: onErrorState
import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
* 加载失败界面
*/
@DoMain
public void onErrorState() {
FrameLayout contains = (FrameLayout) rootView.findViewById(R.id.state_contains);
contains.removeAllViews();
View error = View.inflate(this.getContext(), R.layout.view_error, null);
contains.addView(error);
error.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onRetry(v);
}
});
}
示例11: setContentView
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void setContentView(@LayoutRes int layoutResID) {
if (R.layout.activity_base == layoutResID) {
super.setContentView(R.layout.activity_base);
contentView = (FrameLayout) findViewById(R.id.layout_center);
contentView.removeAllViews();
} else if (layoutResID != R.layout.activity_base) {
View addView = LayoutInflater.from(this).inflate(layoutResID, null);
contentView.addView(addView);
mBind = ButterKnife.bind(this);
}
}
示例12: onRemoteUserLeft
import android.widget.FrameLayout; //导入方法依赖的package包/类
@Override
public void onRemoteUserLeft(String userId, RongCallCommon.CallDisconnectedReason reason) {
//incoming状态,localViewUserId为空
if (localViewUserId == null)
return;
if (localViewUserId.equals(userId)) {
localViewContainer.removeAllViews();
String currentUserId = RongIMClient.getInstance().getCurrentUserId();
FrameLayout remoteVideoView = (FrameLayout) remoteViewContainer.findViewWithTag(currentUserId);
localView = (SurfaceView) remoteVideoView.getChildAt(0);
remoteVideoView.removeAllViews();
localViewContainer.addView(localView);
TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
topUserNameView.setTag(currentUserId + "name");
UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(currentUserId);
if (userInfo != null) {
topUserNameView.setText(userInfo.getName());
} else {
topUserNameView.setText(currentUserId);
}
localViewUserId = currentUserId;
}
View singleRemoteView = remoteViewContainer.findViewWithTag(userId + "view");
if (singleRemoteView == null)
return;
LinearLayout container = (LinearLayout) singleRemoteView.getParent();
container.removeView(singleRemoteView);
if (container.equals(remoteViewContainer2)) {
if (remoteViewContainer1.getChildCount() > 0) {
View childView = remoteViewContainer1.getChildAt(0);
remoteViewContainer1.removeView(childView);
remoteViewContainer2.addView(childView);
}
}
}
示例13: initViews
import android.widget.FrameLayout; //导入方法依赖的package包/类
protected void initViews() {
inflater = LayoutInflater.from(this);
localViewContainer = (FrameLayout) findViewById(R.id.rc_local_user_view);
remoteViewContainer = (LinearLayout) findViewById(R.id.rc_remote_user_container);
remoteViewContainer1 = (LinearLayout) findViewById(R.id.rc_remote_user_container_1);
remoteViewContainer2 = (LinearLayout) findViewById(R.id.rc_remote_user_container_2);
topContainer = (LinearLayout) findViewById(R.id.rc_top_container);
waitingContainer = (LinearLayout) findViewById(R.id.rc_waiting_container);
bottomButtonContainer = (LinearLayout) findViewById(R.id.rc_bottom_button_container);
participantPortraitContainer = (LinearLayout) findViewById(R.id.rc_participant_portait_container);
minimizeButton = (ImageView) findViewById(R.id.rc_voip_call_minimize);
addButton = (ImageView) findViewById(R.id.rc_voip_call_add);
switchCameraButton = (ImageView) findViewById(R.id.rc_voip_switch_camera);
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
remoteUserViewWidth = (metrics.widthPixels - 50) / 4;
localView = null;
localViewContainer.removeAllViews();
remoteViewContainer1.removeAllViews();
remoteViewContainer2.removeAllViews();
minimizeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MultiVideoCallActivity.super.onMinimizeClick(v);
}
});
}
示例14: swapButtonPositions
import android.widget.FrameLayout; //导入方法依赖的package包/类
public void swapButtonPositions() {
Collections.shuffle(Arrays.asList(shuffle));
for (FrameLayout f : layouts) {
f.removeAllViews();
}
AnimationHandler.performColorSwapAnimation(this, shuffle, buttons, layouts);
}
示例15: onSuccessState
import android.widget.FrameLayout; //导入方法依赖的package包/类
/**
* 加载成功,显示内容
*/
@DoMain
public void onSuccessState() {
FrameLayout contains = (FrameLayout) rootView.findViewById(R.id.state_contains);
contains.removeAllViews();
contains.addView(View.inflate(this.getContext(), setSuccessViewId(), null));
onSuccessed();
}