当前位置: 首页>>代码示例>>Java>>正文


Java FrameLayout.removeAllViews方法代码示例

本文整理汇总了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

    }
 
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:17,代码来源:DFPBannerFragment.java

示例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);
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:19,代码来源:LayoutPreference.java

示例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);
    }
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:25,代码来源:MultiVideoCallActivity.java

示例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);
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:26,代码来源:WXEmbed.java

示例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);
}
 
开发者ID:penghongru,项目名称:Coder,代码行数:17,代码来源:StateFragment.java

示例6: onLoadData

import android.widget.FrameLayout; //导入方法依赖的package包/类
public void onLoadData() {
    FrameLayout layout = (FrameLayout) getView();

    if (layout != null) {
        layout.removeAllViews();
        layout.addView(mContentView);
    }
}
 
开发者ID:iAcn,项目名称:MBEStyle,代码行数:9,代码来源:ILazyFragment.java

示例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);
    }
}
 
开发者ID:Longalei,项目名称:Edu,代码行数:14,代码来源:ToolbarActivity.java

示例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);
}
 
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:16,代码来源:DFPBannerFragment.java

示例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();
}
 
开发者ID:prebid,项目名称:prebid-mobile-android,代码行数:15,代码来源:MoPubBannerFragment.java

示例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);
        }
    });
}
 
开发者ID:penghongru,项目名称:Coder,代码行数:17,代码来源:StateFragment.java

示例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);
    }
}
 
开发者ID:jianesrq0724,项目名称:UpdateLibrary,代码行数:13,代码来源:BaseActivity.java

示例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);
        }
    }
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:39,代码来源:MultiVideoCallActivity.java

示例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);
        }
    });
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:30,代码来源:MultiVideoCallActivity.java

示例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);
}
 
开发者ID:simoneapp,项目名称:S3-16-simone,代码行数:8,代码来源:GameActivityImpl.java

示例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();
}
 
开发者ID:penghongru,项目名称:Coder,代码行数:11,代码来源:StateFragment.java


注:本文中的android.widget.FrameLayout.removeAllViews方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。