Search in sources :

Example 96 with LinearLayout

use of android.widget.LinearLayout in project openkit-android by OpenKit.

the class WebDialog method setUpWebView.

@SuppressLint("SetJavaScriptEnabled")
private void setUpWebView(int margin) {
    LinearLayout webViewContainer = new LinearLayout(getContext());
    webView = new WebView(getContext());
    webView.setVerticalScrollBarEnabled(false);
    webView.setHorizontalScrollBarEnabled(false);
    webView.setWebViewClient(new DialogWebViewClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.loadUrl(url);
    webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    webView.setVisibility(View.INVISIBLE);
    webView.getSettings().setSavePassword(false);
    webViewContainer.setPadding(margin, margin, margin, margin);
    webViewContainer.addView(webView);
    webViewContainer.setBackgroundColor(BACKGROUND_GRAY);
    contentFrameLayout.addView(webViewContainer);
}
Also used : FrameLayout(android.widget.FrameLayout) WebView(android.webkit.WebView) LinearLayout(android.widget.LinearLayout) SuppressLint(android.annotation.SuppressLint)

Example 97 with LinearLayout

use of android.widget.LinearLayout in project phonegap-facebook-plugin by Wizcorp.

the class CordovaActivity method showSplashScreen.

/**
     * Shows the splash screen over the full Activity
     */
@SuppressWarnings("deprecation")
protected void showSplashScreen(final int time) {
    final CordovaActivity that = this;
    Runnable runnable = new Runnable() {

        public void run() {
            // Get reference to display
            Display display = getWindowManager().getDefaultDisplay();
            // Create the layout for the dialog
            LinearLayout root = new LinearLayout(that.getActivity());
            root.setMinimumHeight(display.getHeight());
            root.setMinimumWidth(display.getWidth());
            root.setOrientation(LinearLayout.VERTICAL);
            root.setBackgroundColor(that.getIntegerProperty("backgroundColor", Color.BLACK));
            root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
            root.setBackgroundResource(that.splashscreen);
            // Create and show the dialog
            splashDialog = new Dialog(that, android.R.style.Theme_Translucent_NoTitleBar);
            // check to see if the splash screen should be full screen
            if ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) == WindowManager.LayoutParams.FLAG_FULLSCREEN) {
                splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
            }
            splashDialog.setContentView(root);
            splashDialog.setCancelable(false);
            splashDialog.show();
            // Set Runnable to remove splash screen just in case
            final Handler handler = new Handler();
            handler.postDelayed(new Runnable() {

                public void run() {
                    removeSplashScreen();
                }
            }, time);
        }
    };
    this.runOnUiThread(runnable);
}
Also used : Dialog(android.app.Dialog) ProgressDialog(android.app.ProgressDialog) AlertDialog(android.app.AlertDialog) Handler(android.os.Handler) LinearLayout(android.widget.LinearLayout) Display(android.view.Display)

Example 98 with LinearLayout

use of android.widget.LinearLayout in project phonegap-facebook-plugin by Wizcorp.

the class CordovaActivity method onCreate.

/**
     * Called when the activity is first created.
     *
     * @param savedInstanceState
     */
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
    Config.init(this);
    LOG.d(TAG, "CordovaActivity.onCreate()");
    super.onCreate(savedInstanceState);
    if (savedInstanceState != null) {
        initCallbackClass = savedInstanceState.getString("callbackClass");
    }
    if (!this.getBooleanProperty("ShowTitle", false)) {
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    }
    if (this.getBooleanProperty("SetFullscreen", false)) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }
    // This builds the view.  We could probably get away with NOT having a LinearLayout, but I like having a bucket!
    Display display = getWindowManager().getDefaultDisplay();
    int width = display.getWidth();
    int height = display.getHeight();
    root = new LinearLayoutSoftKeyboardDetect(this, width, height);
    root.setOrientation(LinearLayout.VERTICAL);
    root.setBackgroundColor(this.backgroundColor);
    root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 0.0F));
    // Setup the hardware volume controls to handle volume control
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
Also used : SuppressLint(android.annotation.SuppressLint) LinearLayout(android.widget.LinearLayout) Display(android.view.Display)

Example 99 with LinearLayout

use of android.widget.LinearLayout in project phonegap-facebook-plugin by Wizcorp.

the class CordovaChromeClient method getVideoLoadingProgressView.

@Override
public /**
     * Ask the host application for a custom progress view to show while
     * a <video> is loading.
     * @return View The progress view.
     */
View getVideoLoadingProgressView() {
    if (mVideoProgressView == null) {
        // Create a new Loading view programmatically.
        // create the linear layout
        LinearLayout layout = new LinearLayout(this.appView.getContext());
        layout.setOrientation(LinearLayout.VERTICAL);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
        layout.setLayoutParams(layoutParams);
        // the proress bar
        ProgressBar bar = new ProgressBar(this.appView.getContext());
        LinearLayout.LayoutParams barLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        barLayoutParams.gravity = Gravity.CENTER;
        bar.setLayoutParams(barLayoutParams);
        layout.addView(bar);
        mVideoProgressView = layout;
    }
    return mVideoProgressView;
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) RelativeLayout(android.widget.RelativeLayout) ProgressBar(android.widget.ProgressBar) LinearLayout(android.widget.LinearLayout)

Example 100 with LinearLayout

use of android.widget.LinearLayout in project phonegap-facebook-plugin by Wizcorp.

the class WebDialog method setUpWebView.

@SuppressLint("SetJavaScriptEnabled")
private void setUpWebView(int margin) {
    LinearLayout webViewContainer = new LinearLayout(getContext());
    webView = new WebView(getContext()) {

        /* Prevent NPE on Motorola 2.2 devices
             * See https://groups.google.com/forum/?fromgroups=#!topic/android-developers/ktbwY2gtLKQ
             */
        @Override
        public void onWindowFocusChanged(boolean hasWindowFocus) {
            try {
                super.onWindowFocusChanged(hasWindowFocus);
            } catch (NullPointerException e) {
            }
        }
    };
    webView.setVerticalScrollBarEnabled(false);
    webView.setHorizontalScrollBarEnabled(false);
    webView.setWebViewClient(new DialogWebViewClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.loadUrl(url);
    webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    webView.setVisibility(View.INVISIBLE);
    webView.getSettings().setSavePassword(false);
    webView.getSettings().setSaveFormData(false);
    webViewContainer.setPadding(margin, margin, margin, margin);
    webViewContainer.addView(webView);
    webViewContainer.setBackgroundColor(BACKGROUND_GRAY);
    contentFrameLayout.addView(webViewContainer);
}
Also used : FrameLayout(android.widget.FrameLayout) WebView(android.webkit.WebView) LinearLayout(android.widget.LinearLayout) SuppressLint(android.annotation.SuppressLint)

Aggregations

LinearLayout (android.widget.LinearLayout)1171 View (android.view.View)457 TextView (android.widget.TextView)435 ViewGroup (android.view.ViewGroup)200 ImageView (android.widget.ImageView)189 Button (android.widget.Button)164 ScrollView (android.widget.ScrollView)123 ListView (android.widget.ListView)97 LayoutInflater (android.view.LayoutInflater)86 FrameLayout (android.widget.FrameLayout)85 Context (android.content.Context)74 AdapterView (android.widget.AdapterView)71 EditText (android.widget.EditText)69 Intent (android.content.Intent)58 AbsListView (android.widget.AbsListView)58 LayoutParams (android.widget.LinearLayout.LayoutParams)48 RelativeLayout (android.widget.RelativeLayout)48 Bitmap (android.graphics.Bitmap)45 OnClickListener (android.view.View.OnClickListener)44 Drawable (android.graphics.drawable.Drawable)42