--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Like I said before the really question is should we do it or not?
I for one when creating my apps opt for either phonegap or native.
Why should I take the pain of doing both whn I can produce the output by simply using just phonegap or just native android (java) code.
// Get the screen size. WindowManager mW = (WindowManager)cordova.getActivity().getSystemService(Context.WINDOW_SERVICE); int screenWidth = mW.getDefaultDisplay().getWidth(); int screenHeight = mW.getDefaultDisplay().getHeight(); // Null check. if (displayAdView == null) { return; } int ad_width = displayAdView.getLayoutParams().width; int ad_height = displayAdView.getLayoutParams().height; // Resize display ad if it's too big. if (screenWidth < ad_width) { // Using screen width, but substitute for the any width. int desired_width = screenWidth;
int scale; Double val = Double.valueOf(desired_width) / Double.valueOf(ad_width); val = val * 100d; scale = val.intValue();
((android.webkit.WebView) (displayAdView)).getSettings().setSupportZoom(true); ((android.webkit.WebView) (displayAdView)).setPadding(0, 0, 0, 0); ((android.webkit.WebView) (displayAdView)).setVerticalScrollBarEnabled(false); ((android.webkit.WebView) (displayAdView)).setHorizontalScrollBarEnabled(false); // ((WebView)(displayAdView)).getSettings().setLoadWithOverviewMode(true); ((android.webkit.WebView) (displayAdView)).setInitialScale(scale); // Resize display ad to desired width and keep aspect ratio. LayoutParams layout = new LayoutParams(desired_width, (desired_width*ad_height)/ad_width); displayAdView.setLayoutParams(layout); } if (linearLayout != null) { linearLayout.removeAllViews(); } linearLayout = new LinearLayout(cordova.getActivity()); linearLayout.setLayoutParams(new ViewGroup.LayoutParams(screenWidth, screenHeight)); // Use padding to set the x/y coordinates. linearLayout.setPadding(displayAdX, displayAdY, 0, 0); linearLayout.addView(displayAdView); cordova.getActivity().getWindow().addContentView(linearLayout, new ViewGroup.LayoutParams(screenWidth, screenHeight));