Java Code Examples for android.widget.RelativeLayout.removeAllViews()

The following are Jave code examples for showing how to use removeAllViews() of the android.widget.RelativeLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: lrs_android   File: AutoScrollViewPager.java   Source Code and License Vote up 5 votes
public void setupIndicator(RelativeLayout indicator) {
    this.indicator = indicator;
    if (indicator == null) {
        return;
    }
    if (indicator.getChildCount() > 0) {
        indicator.removeAllViews();
    }
    ringList = new ArrayList<ImageView>();
    RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    lp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    LinearLayout ll = new LinearLayout(context);
    ll.setLayoutParams(lp);
    indicator.addView(ll);
    LinearLayout.LayoutParams lpp = new LinearLayout.LayoutParams(DisplayUtil.dp2px(7), DisplayUtil.dp2px(7));
    for (int i = 0; i < pageCount; i++) {
        ImageView iv = new ImageView(context);
        iv.setLayoutParams(lpp);
        if (pageCount == 1) {
            iv.setBackgroundResource(R.drawable.ring_imageview_select);
        }
        if (i > 0) {
            lpp.leftMargin = DisplayUtil.dp2px(3);
        }
        ringList.add(iv);
        ll.addView(iv);
    }
}
 
Example 2
Project: letv   File: FloatingWindowPlayerView.java   Source Code and License Vote up 5 votes
public void loadVipAuthenticationView() {
    LogInfo.log("FloatingWindowPlayer", "该集为VIP剧集,加载开通VIP会员界面");
    if (this.mVipAuthView == null) {
        this.mVipAuthView = new FloatingWindowPlayerVipAuthenticationView(this.mContext);
    }
    this.mVipAuthView.setController(this.mFloatingWindowPlayerController);
    this.mVipAuthView.setVisibility(0);
    RelativeLayout container = (RelativeLayout) findViewById(R.id.view_container);
    container.removeAllViews();
    container.addView(this.mVipAuthView);
}
 
Example 3
Project: phonk   File: MainActivity.java   Source Code and License Vote up 5 votes
@Override
public void onConfigurationChanged(Configuration newConfig) {
    MLog.d(TAG, "changing conf");
    removeFragment(mConnectionInfoFragment);
    removeFragment(mEmptyFragment);
    removeFragment(mProjectListFragment);
    removeFragment(mFolderListFragment);
    if (mCombinedFolderAndProjectFragment != null) removeFragment(mCombinedFolderAndProjectFragment);
    RelativeLayout mainContent = (RelativeLayout) findViewById(R.id.main_content);
    mainContent.removeAllViews();
    super.onConfigurationChanged(newConfig);
    loadUI();
}