Example usage for android.view ViewGroup findViewById

List of usage examples for android.view ViewGroup findViewById

Introduction

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

Prototype

@Nullable
public final <T extends View> T findViewById(@IdRes int id) 

Source Link

Document

Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy.

Usage

From source file:org.openintents.historify.ui.fragments.QuickPostSourcesFragment.java

/** Called to have the fragment instantiate its user interface view. */
@Override// w  w w .j a  v a 2 s. c om
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    ViewGroup layout = (ViewGroup) inflater.inflate(R.layout.fragment_quickpost_sources, container, false);

    // init list
    mLstQuickPostSources = (ListView) layout.findViewById(R.id.quickpost_sources_lstQuickPostSources);

    // init list empty view
    View lstQuickPostsEmptyView = inflater.inflate(R.layout.list_empty_view, null);
    ((TextView) lstQuickPostsEmptyView).setText(R.string.sources_no_quickpost_sources);
    ((ViewGroup) mLstQuickPostSources.getParent()).addView(lstQuickPostsEmptyView);
    mLstQuickPostSources.setEmptyView(lstQuickPostsEmptyView);

    mSourcesAdapter = new QuickPostSourcesAdapter(getActivity(), mLstQuickPostSources);
    mLstQuickPostSources.setAdapter(mSourcesAdapter);

    return layout;
}

From source file:com.mimp.fragment.supervision.Anexo1Page.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);

    // Set the title view to show the page number.
    ((TextView) rootView.findViewById(android.R.id.text1)).setText("datos del formato 1");

    return rootView;
}

From source file:com.mimp.fragment.supervision.Anexo2Page.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);

    // Set the title view to show the page number.
    ((TextView) rootView.findViewById(android.R.id.text1)).setText("datos del Anexo 3");

    return rootView;
}

From source file:com.mimp.fragment.supervision.Anexo3Page.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);

    // Set the title view to show the page number.
    ((TextView) rootView.findViewById(android.R.id.text1)).setText("datos del Anexo 2");

    return rootView;
}

From source file:com.mimp.fragment.supervision.Anexo4Page.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_screen_slide_page, container, false);

    // Set the title view to show the page number.
    ((TextView) rootView.findViewById(android.R.id.text1)).setText("datos del Anexo 4");

    return rootView;
}

From source file:com.chess.genesis.view.SwipeTabsPagerAdapter.java

@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    final ViewGroup root = (ViewGroup) inflater.inflate(R.layout.swipetab_fragment, null);
    final String title = getArguments().getString("title");
    ((TextView) root.findViewById(R.id.text)).setText(title);
    return root;//from w w  w .  j  av a 2s.c  om
}

From source file:com.xogrp.planner.fragment.PortfolioSlidePageFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout containing a title and body text.
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_portfolio_images_slide_page, container,
            false);//w w  w.j  a  va 2  s.com
    ImageView ivImage = (ImageView) rootView.findViewById(R.id.iv_pic);
    RelativeLayout rlPlay = (RelativeLayout) rootView.findViewById(R.id.rl_play);
    rlPlay.setVisibility(mMediaItem.getMediaType().equalsIgnoreCase(MEDIA_TYPE) ? View.VISIBLE : View.GONE);
    String imageUrl = mMediaItem.getMediaType().equalsIgnoreCase(MEDIA_TYPE) ? mMediaItem.getThumbnailUrl()
            : mMediaItem.getVideoUrl();
    ImageLoader.getInstance().displayImage(imageUrl, ivImage,
            PlannerApplication.getDefaultDisplayImageOptions(R.drawable.vendor_summary_item_bg_default), null);
    ivImage.setOnClickListener(mOnClickListener);

    return rootView;
}

From source file:com.hkm.uipack.ScrollView.StickyFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup rootView = (ViewGroup) inflater.inflate(layout_fragment_content, container, false);

    mObservableScrollView = (ObservableScrollView) rootView.findViewById(scroll_view_id);
    mObservableScrollView.setCallbacks(this);

    mStickyView = (TextView) rootView.findViewById(sticky_id);
    //  mStickyView.setText(R.string.sticky_item);
    mPlaceholderView = rootView.findViewById(placeholder_id);

    mObservableScrollView.getViewTreeObserver()
            .addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
                @Override/*www. jav  a2 s  .  c  o  m*/
                public void onGlobalLayout() {
                    onScrollChanged(mObservableScrollView.getScrollY());
                }
            });

    return rootView;
}

From source file:com.willowtreeapps.spurceexampleapp.fragments.ListViewFragment.java

@Nullable
@Override/*from   w ww.j  a v a 2  s  .  c o  m*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, @Nullable Bundle savedInstanceState) {
    listView = (ListView) container.findViewById(R.id.list_view);

    // Create the animator after the list view has finished laying out
    listView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            initSpruce();
        }
    });

    // Mock data objects
    List<ExampleData> placeHolderList = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        placeHolderList.add(new ExampleData());
    }

    // Remove default dividers and set adapter
    listView.setDivider(null);
    listView.setDividerHeight(0);
    listView.setAdapter(new ListViewAdapter(placeHolderList));

    return inflater.inflate(R.layout.list_view_fragment, container, false);
}

From source file:com.willowtreeapps.spurceexampleapp.fragments.RecyclerFragment.java

@Nullable
@Override/* w  w w  .  j a  va  2 s  .  c  o m*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, @Nullable Bundle savedInstanceState) {
    recyclerView = (RecyclerView) container.findViewById(R.id.recycler);
    recyclerView.setHasFixedSize(true);

    RelativeLayout placeholder = (RelativeLayout) container.findViewById(R.id.placeholder_view);

    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()) {
        @Override
        public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
            super.onLayoutChildren(recycler, state);
            // Animate in the visible children
            spruceAnimator = new Spruce.SpruceBuilder(recyclerView).sortWith(new DefaultSort(100))
                    .animateWith(DefaultAnimations.shrinkAnimator(recyclerView, 800),
                            ObjectAnimator.ofFloat(recyclerView, "translationX", -recyclerView.getWidth(), 0f)
                                    .setDuration(800))
                    .start();

        }
    };

    List<RelativeLayout> placeHolderList = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        placeHolderList.add(placeholder);
    }

    recyclerView.setAdapter(new RecyclerAdapter(placeHolderList));
    recyclerView.setLayoutManager(linearLayoutManager);

    return inflater.inflate(R.layout.recycler_fragment, container, false);
}