Example usage for android.view ViewGroup removeAllViews

List of usage examples for android.view ViewGroup removeAllViews

Introduction

In this page you can find the example usage for android.view ViewGroup removeAllViews.

Prototype

public void removeAllViews() 

Source Link

Document

Call this method to remove all child views from the ViewGroup.

Usage

From source file:com.nps.micro.view.BaseSectionFragment.java

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    ViewGroup rootView = (ViewGroup) getView();
    rootView.removeAllViews();
    rootView.addView(buildRootView(inflater, rootView));
}

From source file:org.rssin.android.FeedItemsListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    container.removeAllViews();

    View rootView = inflater.inflate(R.layout.fragment_feeditems_list, container, false);

    loadingView = rootView.findViewById(R.id.loading);
    RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.unified_inbox_feeditems);
    context = recyclerView.getContext();

    RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(context);
    recyclerView.setLayoutManager(layoutManager);

    feedItemAdapter = new FeedItemAdapter(new ArrayList<SortedFeedItemContainer>());
    recyclerView.setAdapter(feedItemAdapter);
    recyclerView.setHasFixedSize(false);

    refresh();//from   w w  w  . j a va2  s .  c o m

    return rootView;
}

From source file:com.google.reviewit.BaseFragment.java

protected void reset(ViewGroup container) {
    container.removeAllViews();

    MainActivity activity = ((MainActivity) getActivity());
    activity.select(getClass());// w  w  w  . ja v a 2  s  . c  o  m

    if (activity.getSupportActionBar() != null) {
        activity.getSupportActionBar().show();
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setStatusBarColor(widgetUtil.color(R.color.black));
    }

    // hide keyboard if it is open
    View view = getActivity().getCurrentFocus();
    if (view != null) {
        ((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE))
                .hideSoftInputFromWindow(view.getWindowToken(), 0);
    }

    TaskObserver.clear();
}

From source file:com.bobomee.android.gank.io.base.BaseFragment.java

@Nullable
@Override//from ww  w. j a v  a2 s .  c  o  m
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
        @Nullable Bundle savedInstanceState) {
    if (null == mRootView) {
        mRootView = initFragmentView(inflater, container, savedInstanceState);
    }
    if (null != mRootView) {
        ViewGroup parent = (ViewGroup) mRootView.getParent();
        if (null != parent)
            parent.removeAllViews();

        mUnbinder = ButterKnife.bind(this, mRootView);
    }

    return mRootView;
}

From source file:com.bobomee.android.mvp.BaseFragment.java

@Nullable
@Override/*  w w  w  .j  av a 2 s .c  o m*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (null == fragmentRootView) {
        fragmentRootView = initFragmentView(inflater, container, savedInstanceState);
    }
    if (null != fragmentRootView) {
        ViewGroup parent = (ViewGroup) fragmentRootView.getParent();
        if (null != parent)
            parent.removeAllViews();
    }

    unbinder = ButterKnife.bind(this, fragmentRootView);

    return fragmentRootView;
}

From source file:com.pax.view.ViewPagerAdapter.java

@Override
public Object instantiateItem(ViewGroup container, int position) {
    try {/*from w  w w  . j  a  v a 2 s. c o  m*/
        // View??
        if (container != null) {
            container.removeAllViews();
            container.addView(lists.get(position), 0);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    return lists.get(position);
}

From source file:dev.drsoran.moloko.fragments.base.impl.LoaderFragmentImpl.java

private void showElementNotFoundError() {
    if (support.getRootView() != null) {
        final View spinner = getLoadingSpinnerView();
        if (spinner != null)
            spinner.setVisibility(View.GONE);

        final ViewGroup content = support.getContentView();
        if (content != null) {
            content.removeAllViews();

            inflateErrorWithIcon(content, R.string.err_entity_not_found, support.getLoaderDataName());
            content.setVisibility(View.VISIBLE);
        }/*from  w  ww.  j a va 2  s  .  c  o  m*/
    }
}

From source file:org.videolan.vlc2.gui.audio.EqualizerFragment.java

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.equalizer, null);
    ViewGroup rootView = (ViewGroup) getView();
    rootView.removeAllViews();
    rootView.addView(v);/*w w w .j a v  a 2s  .  c om*/
    saveViewChildren(v);

    fillViews();
}

From source file:org.rssin.android.NavigationDrawerManageFiltersFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    container.removeAllViews();

    rootView = inflater.inflate(R.layout.fragment_filters, container, false);
    final Context context = rootView.getContext();

    filtersView = (ListView) rootView.findViewById(R.id.filters_list);

    try {//from  w ww .ja v a2  s  . com
        filtersList = FiltersList.getInstance(context);
    } catch (IOException ex) {
        Frontend.error(context, R.string.error_load_filters, ex);
    }

    filterAdapter = new FilterAdapter(context, R.layout.item_filter, filtersList.getFilters());
    filtersView.setAdapter(filterAdapter);

    setupListeners();

    return rootView;
}

From source file:com.inovex.zabbixmobile.activities.fragments.ChecksItemsFragment.java

/**
 * Sets the item for this page. This also triggers an import of history
 * details for displaying the graph./*ww  w  .  ja  v  a  2s.  c o m*/
 * 
 * @param item
 */
public void setItem(Item item) {
    this.mItem = item;
    if (item == null) {
        if (getView() != null) {
            ((TextView) getView().findViewById(R.id.item_details_name)).setText("");

            ((TextView) getView().findViewById(R.id.latest_data)).setText("");

            ViewGroup layout = (LinearLayout) getView().findViewById(R.id.graphs);
            layout.removeAllViews();
        }
    }
    if (mZabbixDataService != null && item != null) {
        fillDetailsText();
        showGraphProgressBar();
        mZabbixDataService.loadHistoryDetailsByItem(mItem, true, this);
    }
}