mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Changing FILL_PARENT to MATCH_PARENT, removing Eclipse deprecation warnings
This commit is contained in:
parent
3973f4f952
commit
f7910c41c3
@ -323,7 +323,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
// Toolbar layout
|
// Toolbar layout
|
||||||
RelativeLayout toolbar = new RelativeLayout(cordova.getActivity());
|
RelativeLayout toolbar = new RelativeLayout(cordova.getActivity());
|
||||||
toolbar.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, this.dpToPixels(44)));
|
toolbar.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, this.dpToPixels(44)));
|
||||||
toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2));
|
toolbar.setPadding(this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2), this.dpToPixels(2));
|
||||||
toolbar.setHorizontalGravity(Gravity.LEFT);
|
toolbar.setHorizontalGravity(Gravity.LEFT);
|
||||||
toolbar.setVerticalGravity(Gravity.TOP);
|
toolbar.setVerticalGravity(Gravity.TOP);
|
||||||
@ -337,7 +337,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
// Back button
|
// Back button
|
||||||
Button back = new Button(cordova.getActivity());
|
Button back = new Button(cordova.getActivity());
|
||||||
RelativeLayout.LayoutParams backLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT);
|
RelativeLayout.LayoutParams backLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
|
||||||
backLayoutParams.addRule(RelativeLayout.ALIGN_LEFT);
|
backLayoutParams.addRule(RelativeLayout.ALIGN_LEFT);
|
||||||
back.setLayoutParams(backLayoutParams);
|
back.setLayoutParams(backLayoutParams);
|
||||||
back.setContentDescription("Back Button");
|
back.setContentDescription("Back Button");
|
||||||
@ -351,7 +351,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
// Forward button
|
// Forward button
|
||||||
Button forward = new Button(cordova.getActivity());
|
Button forward = new Button(cordova.getActivity());
|
||||||
RelativeLayout.LayoutParams forwardLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT);
|
RelativeLayout.LayoutParams forwardLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
|
||||||
forwardLayoutParams.addRule(RelativeLayout.RIGHT_OF, 2);
|
forwardLayoutParams.addRule(RelativeLayout.RIGHT_OF, 2);
|
||||||
forward.setLayoutParams(forwardLayoutParams);
|
forward.setLayoutParams(forwardLayoutParams);
|
||||||
forward.setContentDescription("Forward Button");
|
forward.setContentDescription("Forward Button");
|
||||||
@ -365,7 +365,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
// Edit Text Box
|
// Edit Text Box
|
||||||
edittext = new EditText(cordova.getActivity());
|
edittext = new EditText(cordova.getActivity());
|
||||||
RelativeLayout.LayoutParams textLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
|
RelativeLayout.LayoutParams textLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
||||||
textLayoutParams.addRule(RelativeLayout.RIGHT_OF, 1);
|
textLayoutParams.addRule(RelativeLayout.RIGHT_OF, 1);
|
||||||
textLayoutParams.addRule(RelativeLayout.LEFT_OF, 5);
|
textLayoutParams.addRule(RelativeLayout.LEFT_OF, 5);
|
||||||
edittext.setLayoutParams(textLayoutParams);
|
edittext.setLayoutParams(textLayoutParams);
|
||||||
@ -388,7 +388,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
// Close button
|
// Close button
|
||||||
Button close = new Button(cordova.getActivity());
|
Button close = new Button(cordova.getActivity());
|
||||||
RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT);
|
RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
|
||||||
closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
closeLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
|
||||||
close.setLayoutParams(closeLayoutParams);
|
close.setLayoutParams(closeLayoutParams);
|
||||||
forward.setContentDescription("Close Button");
|
forward.setContentDescription("Close Button");
|
||||||
@ -402,7 +402,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
// WebView
|
// WebView
|
||||||
inAppWebView = new WebView(cordova.getActivity());
|
inAppWebView = new WebView(cordova.getActivity());
|
||||||
inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
||||||
inAppWebView.setWebChromeClient(new WebChromeClient());
|
inAppWebView.setWebChromeClient(new WebChromeClient());
|
||||||
WebViewClient client = new InAppBrowserClient(thatWebView, edittext);
|
WebViewClient client = new InAppBrowserClient(thatWebView, edittext);
|
||||||
inAppWebView.setWebViewClient(client);
|
inAppWebView.setWebViewClient(client);
|
||||||
@ -439,8 +439,8 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
|
|
||||||
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
|
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
|
||||||
lp.copyFrom(dialog.getWindow().getAttributes());
|
lp.copyFrom(dialog.getWindow().getAttributes());
|
||||||
lp.width = WindowManager.LayoutParams.FILL_PARENT;
|
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
lp.height = WindowManager.LayoutParams.FILL_PARENT;
|
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
|
||||||
dialog.setContentView(main);
|
dialog.setContentView(main);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user