Example usage for android.view ViewGroup setLayoutParams

List of usage examples for android.view ViewGroup setLayoutParams

Introduction

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

Prototype

public void setLayoutParams(ViewGroup.LayoutParams params) 

Source Link

Document

Set the layout parameters associated with this view.

Usage

From source file:com.goliathonline.android.kegbot.ui.TagStreamFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            try {
                mWebView.loadUrl(// ww w. jav  a 2  s  .c om
                        "http://mobile.twitter.com/searches?q=" + URLEncoder.encode(mSearchString, "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                Log.e(TAG, "Could not construct the realtime search URL", e);
            }
        }
    });

    return root;
}

From source file:com.google.android.apps.iosched.ui.TagStreamFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            try {
                mWebView.loadUrl("http://search.twitter.com/search.html?result_type=recent&q="
                        + URLEncoder.encode(mSearchString, "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                Log.e(TAG, "Could not construct the realtime search URL", e);
            }//from   w w w  . ja v  a 2 s  .c o  m
        }
    });

    return root;
}

From source file:com.heneryh.aquanotes.ui.WebStreamFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            //                    mWebView.loadUrl(
            //                            "http://www.google.com/search?tbs="
            //                            + "mbl%3A1&hl=en&source=hp&biw=1170&bih=668&q="
            //                            + URLEncoder.encode(mSearchString, "UTF-8")
            //                            + "&btnG=Search");
            mWebView.loadUrl("http://reefcentral.com/forums/forumdisplay.php?f=368");
        }/*from w  w  w  .  j  a  v a  2s  . co  m*/
    });

    return root;
}

From source file:com.infine.android.devoxx.ui.TagStreamFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            try {
                mWebView.loadUrl("https://twitter.com/#!/search/" + URLEncoder.encode(mSearchString, "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                Log.e(TAG, "Could not construct the realtime search URL", e);
            }/*from  ww  w  . j  av  a 2s . c om*/
        }
    });

    return root;
}

From source file:com.heneryh.aquanotes.ui.TagStreamFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            try {
                mWebView.loadUrl(/*from   w w  w  .  ja  v a2s.  c  om*/
                        "http://www.google.com/search?tbs=" + "mbl%3A1&hl=en&source=hp&biw=1170&bih=668&q="
                                + URLEncoder.encode(mSearchString, "UTF-8") + "&btnG=Search");
            } catch (UnsupportedEncodingException e) {
                Log.e(TAG, "Could not construct the realtime search URL", e);
            }
        }
    });

    return root;
}

From source file:com.lullabot.android.apps.iosched.ui.MapFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            // Initialize web view
            if (CLEAR_CACHE_ON_LOAD) {
                mWebView.clearCache(true);
            }//from  ww w. j  av a  2s .  c  om

            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.loadUrl(MAP_URL);
        }
    });

    return root;
}

From source file:gov.wa.wsdot.android.wsdot.ui.MountainPassItemForecastFragment.java

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

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

    return root;//  w ww . j av a  2 s  .co  m
}

From source file:org.ietf.ietfsched.ui.TracksFragment.java

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

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

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
    return root;/*from  w  w w  .j a v  a  2  s .  co m*/
}

From source file:tw.idv.gasolin.pycontw2012.ui.BulletinFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we
    // are//from ww w.j av  a2  s. c o m
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top
    // of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            //                if ( UIUtils.isTablet(getActivity()) ) {
            mWebView.loadUrl(getString(R.string.bulletin_url));
            //                } else {
            //                    mWebView.loadUrl(BULLETIN_URL);
            //                }
        }
    });

    return root;
}

From source file:com.google.android.apps.iosched2.ui.TagStreamFragment.java

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

    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_webview_with_spinner, null);

    // For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
    // FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
    root.setLayoutParams(
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));

    mLoadingSpinner = root.findViewById(R.id.loading_spinner);
    mWebView = (WebView) root.findViewById(R.id.webview);
    mWebView.setWebViewClient(mWebViewClient);

    mWebView.post(new Runnable() {
        public void run() {
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
            try {
                //                    mWebView.loadUrl(
                //                            "http://www.google.com/search?tbs="
                //                            + "mbl%3A1&hl=en&source=hp&biw=1170&bih=668&q="
                //                            + URLEncoder.encode(mSearchString, "UTF-8")
                //                            + "&btnG=Search");

                mWebView.loadUrl(Setup.CONFERENCE_STREAM + URLEncoder.encode(mSearchString, "UTF-8")
                        + "&method=gdd.stream");

            } catch (UnsupportedEncodingException e) {
                Log.e(TAG, "Could not construct the realtime search URL", e);
            }//from w w  w. j ava2  s.c o m
        }
    });

    return root;
}