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:com.hhs.hfnavigator.slidingtabs.hhs.LibFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null);

    progressWheel = (ProgressWheel) root.findViewById(R.id.webViewProgress);

    swipeRefreshLayout = (SwipeRefreshLayout) root.findViewById(R.id.swipe);
    swipeRefreshLayout.setEnabled(false);
    progressWheel.spin();/*from  w  ww  . j ava 2s .co  m*/
    final WebView webView = (WebView) root.findViewById(R.id.webView);
    if (webView != null) {
        webView.setWebViewClient(new WebViewClient() {

            public void onPageFinished(WebView view, String url) {
                progressWheel.stopSpinning();
            }
        });
        webView.loadUrl("https://hscsd.follettdestiny.com/common/welcome.jsp?context=saas30_3133764");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.getSettings().setDisplayZoomControls(false);

    }
    return root;
}

From source file:com.hhs.hfnavigator.slidingtabs.tools.CastleFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null);

    progressWheel = (ProgressWheel) root.findViewById(R.id.webViewProgress);

    swipeRefreshLayout = (SwipeRefreshLayout) root.findViewById(R.id.swipe);
    swipeRefreshLayout.setEnabled(false);
    progressWheel.spin();/*from   www.  j  av a  2 s.  c  om*/
    final WebView webView = (WebView) root.findViewById(R.id.webView);
    if (webView != null) {
        webView.setWebViewClient(new WebViewClient() {

            public void onPageFinished(WebView view, String url) {
                progressWheel.stopSpinning();
            }
        });
        webView.loadUrl("http://www.castlelearning.com/mobile");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.getSettings().setDisplayZoomControls(false);

    }
    return root;
}

From source file:com.hhs.hfnavigator.slidingtabs.tools.EdmodoFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null);

    progressWheel = (ProgressWheel) root.findViewById(R.id.webViewProgress);

    swipeRefreshLayout = (SwipeRefreshLayout) root.findViewById(R.id.swipe);
    swipeRefreshLayout.setEnabled(false);
    progressWheel.spin();/*from ww  w . j  ava  2 s  .  co  m*/
    final WebView webView = (WebView) root.findViewById(R.id.webView);
    if (webView != null) {
        webView.setWebViewClient(new WebViewClient() {

            public void onPageFinished(WebView view, String url) {
                progressWheel.stopSpinning();
            }
        });
        webView.loadUrl("http://www.edmodo.com/m");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.getSettings().setDisplayZoomControls(false);

    }
    return root;
}

From source file:org.ayo.robot.anim.transitioneverywhere.AutoTransitionSample.java

@Nullable
@Override// ww w .  ja  v a2 s  . c o m
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_autotransition, container, false);

    final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
    final TextView text = (TextView) transitionsContainer.findViewById(R.id.text);

    transitionsContainer.findViewById(R.id.button).setOnClickListener(new VisibleToggleClickListener() {

        @Override
        protected void changeVisibility(boolean visible) {
            TransitionManager.beginDelayedTransition(transitionsContainer);
            // it is the same as
            // TransitionManager.beginDelayedTransition(transitionsContainer, new AutoTransition());
            // where AutoTransition is the set of Fade and ChangeBounds transitions
            text.setVisibility(visible ? View.VISIBLE : View.GONE);
        }

    });

    return view;
}

From source file:org.ayo.robot.anim.transitioneverywhere.PathMotionSample.java

@Nullable
@Override/*from   ww w.  java  2s . co m*/
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_path, container, false);

    final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
    final View button = transitionsContainer.findViewById(R.id.button);

    button.setOnClickListener(new View.OnClickListener() {

        boolean mToRightAnimation;

        @Override
        public void onClick(View v) {
            TransitionManager.beginDelayedTransition(transitionsContainer,
                    new ChangeBounds().setPathMotion(new ArcMotion()).setDuration(500));

            mToRightAnimation = !mToRightAnimation;
            FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) button.getLayoutParams();
            params.gravity = mToRightAnimation ? (Gravity.RIGHT | Gravity.BOTTOM)
                    : (Gravity.LEFT | Gravity.TOP);
            button.setLayoutParams(params);
        }

    });

    return view;
}

From source file:com.example.client.fragment.imported.ViewPagerTabFragmentWebViewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_webview, container, false);

    final ObservableWebView webView = (ObservableWebView) view.findViewById(R.id.scroll);
    webView.loadUrl("file:///android_asset/lipsum.html");
    Fragment parentFragment = getParentFragment();
    ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
    if (viewGroup != null) {
        webView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
        if (parentFragment instanceof ObservableScrollViewCallbacks) {
            webView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
        }/*from ww w.j  a v a  2 s  . c  o m*/
    }
    return view;
}

From source file:com.example.client.fragment.imported.ViewPagerTabFragmentScrollViewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scrollview_noheader, container, false);

    final ObservableScrollView scrollView = (ObservableScrollView) view.findViewById(R.id.scroll);
    Fragment parentFragment = getParentFragment();
    ViewGroup viewGroup = (ViewGroup) parentFragment.getView();
    if (viewGroup != null) {
        scrollView.setTouchInterceptionViewGroup((ViewGroup) viewGroup.findViewById(R.id.container));
        if (parentFragment instanceof ObservableScrollViewCallbacks) {
            scrollView.setScrollViewCallbacks((ObservableScrollViewCallbacks) parentFragment);
        }/*from w  w w  .  j a v a 2  s  .c  o  m*/
    }
    return view;
}

From source file:com.hhs.hfnavigator.slidingtabs.harbinger.LiveStreamFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview, null);

    progressWheel = (ProgressWheel) root.findViewById(R.id.webViewProgress);

    swipeRefreshLayout = (SwipeRefreshLayout) root.findViewById(R.id.swipe);
    swipeRefreshLayout.setEnabled(false);
    progressWheel.spin();//from  w  w  w  .  j a  v a  2s  .  c o m

    final WebView webView = (WebView) root.findViewById(R.id.webView);
    if (webView != null) {
        webView.setWebViewClient(new WebViewClient() {

            public void onPageFinished(WebView view, String url) {
                progressWheel.stopSpinning();
                webView.setVisibility(View.VISIBLE);
            }
        });
        webView.loadUrl("http://www.harbingernews.net/livestreams");
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.getSettings().setDisplayZoomControls(false);

    }
    webView.setVisibility(View.INVISIBLE);
    return root;
}

From source file:com.ls.drupal8demo.CategoryFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    String categoryId = getArguments().getString(CATEGORY_ID_KEY);
    ViewGroup result = (ViewGroup) inflater.inflate(R.layout.fragment_category, container, false);
    ListView list = (ListView) result.findViewById(R.id.listView);
    list.setOnItemClickListener(this);

    mClient = new DrupalClient(AppConstants.SERVER_BASE_URL, getActivity());
    View noArticlesView = result.findViewById(R.id.emptyView);
    list.setAdapter(new CategoryArticlesListAdapter(categoryId, mClient, getActivity(), noArticlesView));
    return result;
}

From source file:com.bytecode.project12.ShareImageFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.image_slide_view, container, false);
    if (mImageId != 0) {
        ImageView image = (ImageView) rootView.findViewById(R.id.share_image);
        image.setImageDrawable(getResources().getDrawable(mImageId));
    }/*  ww w  . j  av  a2  s . com*/

    return rootView;
}