ViewGroup removeAllViews - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ViewGroup removeAllViews method.

This code example shows how to use the following methods:requestLayout, addView, removeAllViews
		if (style != PLAIN && style != BIG && style != DARK && style != BIG_DARK) {
			Log.w(TAG, "Invalid value \"" + style + "\" for style.");
			return; 
		} 
 
		view.removeAllViews();
		progress = new ProgressBar(proxy.getActivity(), null, style);
		currentStyle = style;
		view.addView(progress);
		view.addView(label);
		view.requestLayout();
	} 
} 
8
CodeRank
This code example shows how to use the following methods:addView, removeAllViews
		final ViewGroup widget_frame = (ViewGroup) widget_frame_view;
		// widget_frame.setPadding(widget_frame.getPaddingLeft(), 
		// widget_frame.getPaddingTop(), (int) (mDensity * 8), 
		// widget_frame.getPaddingBottom()); 
		// remove already create preview image 
		widget_frame.removeAllViews();
		widget_frame.addView(image_view);
		image_view.setBackgroundDrawable(new AlphaPatternDrawable((int) (5 * mDensity)));
		image_view.setImageBitmap(getColorPreviewBitmap(getContext(), getValue()));
	} 
} 
7
CodeRank
This code example shows how to use the following methods:setEnabled, setVisibility, addView, getChildCount, removeAllViews
 
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        mImageButton.setEnabled(enabled);
        mTextButton.setEnabled(enabled);
        mCustomView.setEnabled(enabled);
    } 
 
    public void setDivider(ImageView divider) {
        mDivider = new WeakReference<ImageView>(divider);
    } 
 
    public void setVisible(boolean visible) {
        final int visibility = visible ? View.VISIBLE : View.GONE;
        if ((mDivider != null) && (mDivider.get() != null)) {
            mDivider.get().setVisibility(visibility);
        } 
        setVisibility(visibility);
    } 
 

7
CodeRank
This code example shows how to use the following methods:addView, removeAllViews, setOrientation
    protected void applyBinding() { 
        if (container != null) {
            if (isHtml()) { 
                if (htmlWidget == null) {
                    htmlWidget = new WebView(getRootContext());
                    container.removeAllViews();
                    container.addView(htmlWidget);
                } 
                txtWidget = null;
            } else { 
                if (txtWidget == null) {
                    txtWidget = new TextView(getRootContext());
                    container.removeAllViews();
                    container.addView(txtWidget);
                } 
                htmlWidget = null;
            } 
        } 
        if (txtWidget != null) {
            txtWidget.setText(getCurrentValue().get(0));

7
CodeRank
This code example shows how to use the following methods:addView, removeAllViews
      } 
      else if (ACTION_DELIVER_CONTENT.equals(i.getAction())) { 
        RemoteViews rv=(RemoteViews)i.getParcelableExtra(EXTRA_CONTENT); 
        ViewGroup frame=(ViewGroup)findViewById(android.R.id.content); 
 
        frame.removeAllViews(); 
 
        View pluginView=rv.apply(RemoteViewsHostActivity.this, frame); 
 
        frame.addView(pluginView); 
      } 
    } 
  }; 
} 
7
CodeRank
This code example shows how to use the following methods:removeAllViews
 
    public CacheDetailsCreator(final Activity activity, final ViewGroup parentView) {
        this.activity = activity;
        this.res = activity.getResources();
        this.parentView = parentView;
        parentView.removeAllViews();
    } 
 
    public TextView add(final int nameId, final CharSequence value) {
        final RelativeLayout layout = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.cache_information_item, null);
        final TextView nameView = (TextView) layout.findViewById(R.id.name);
        nameView.setText(res.getString(nameId));
        lastValueView = (TextView) layout.findViewById(R.id.value);
        lastValueView.setText(value);
        parentView.addView(layout);
        return lastValueView;
    } 
 
    public TextView getValueView() {
        return lastValueView;
6
CodeRank
This code example shows how to use the following methods:removeAllViews, destroy
    } 
     
    public void onDestroy() { 
    	super.onDestroy(); 
    	 
    	mapView.removeAllViews();
    	mapView.destroy();
    	 
	    System.gc();
    } 
     
  
} 
6
CodeRank
This code example shows how to use the following methods:addView, removeAllViews
            mAppWidgetName = mAppWidgetName.replaceAll("[^a-zA-Z0-9]", "_");
 
            ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
            mAppWidgetView.setLayoutParams(p);
            mAppWidgetFrame.removeAllViews();
            mAppWidgetHost.deleteAppWidgetId(mAppWidgetId);
            mAppWidgetFrame.addView(mAppWidgetView, mPreviewWidth, mPreviewHeight);
            mAppWidgetId = appWidgetId;
        } 
    } 
 
    // Taken from CellLayout.java 
    public int[] getLauncherCellDimensions(int width, int height) {
        // Always assume we're working with the smallest span to make sure we 
        // reserve enough space in both orientations. 
        Resources resources = getResources();
        int cellWidth = resources.getDimensionPixelSize(R.dimen.workspace_cell_width);
        int cellHeight = resources.getDimensionPixelSize(R.dimen.workspace_cell_height);
        int widthGap = resources.getDimensionPixelSize(R.dimen.workspace_width_gap);
6
CodeRank
This code example shows how to use the following methods:removeAllViews
        mLayout.removeView(mCloseButton);
    } 
     
    @Override 
    protected void onDestroy() { 
        mLayout.removeAllViews();
        super.onDestroy(); 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:measure, addView, removeAllViews
     * Adds the panel with the menu to its content. 
     * 
     * @param view The panel view with the menu to be shown. 
     */ 
    public void setPanelView(View view) {
        mPanel.removeAllViews();
        mPanel.addView(view);
        mPanel.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    } 
 
    /** 
     * Show/hide the arrow pointing to the anchor. 
     * 
     * @param show Show/hide the arrow. 
     */ 
    public void showArrowToAnchor(boolean show) {
        mShowArrow = show;
    } 
 
    /** 
6
CodeRank

Related ViewGroup removeAllViews Questions & Answers:

removeAllViews Method Overview
Call this method to remove all child views from the ViewGroup.
See Code Examples for other Android ViewGroup Methods: