@@ -828,6 +828,20 @@ public void run() {
828
828
dialog .setCancelable (true );
829
829
dialog .setInAppBroswer (getInAppBrowser ());
830
830
831
+ dialog .getWindow ().clearFlags (0x04000000 ); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
832
+ dialog .getWindow ().addFlags (0x80000000 ); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
833
+
834
+ View decorView = dialog .getWindow ().getDecorView ();
835
+ decorView .setSystemUiVisibility (View .SYSTEM_UI_FLAG_LIGHT_STATUS_BAR );
836
+
837
+ try {
838
+ // Using reflection makes sure any 5.0+ device will work without having to compile with SDK level 21
839
+ dialog .getWindow ().getClass ().getMethod ("setStatusBarColor" , int .class )
840
+ .invoke (dialog .getWindow (), toolbarColor );
841
+ } catch (Exception e ) {
842
+ e .printStackTrace ();
843
+ }
844
+
831
845
// Main container layout
832
846
LinearLayout main = new LinearLayout (cordova .getActivity ());
833
847
main .setOrientation (LinearLayout .VERTICAL );
@@ -931,7 +945,7 @@ public void onClick(View v) {
931
945
edittext .setTextSize (17 );
932
946
edittext .setTextColor (android .graphics .Color .argb (150 , 255 ,255 ,255 ));
933
947
edittext .setBackgroundColor (android .graphics .Color .argb (0 ,0 ,0 ,0 ));
934
- edittext .setPadding (10 , this .dpToPixels (10 ), 10 , this .dpToPixels (10 ));
948
+ edittext .setPadding (20 , this .dpToPixels (10 ), 20 , this .dpToPixels (10 ));
935
949
edittext .setOnKeyListener (new View .OnKeyListener () {
936
950
public boolean onKey (View v , int keyCode , KeyEvent event ) {
937
951
// If the event is a key-down event on the "enter" button
@@ -982,17 +996,17 @@ public boolean onKey(View v, int keyCode, KeyEvent event) {
982
996
int closeButtonId = 1 ;
983
997
ImageButton closeButton = createImageButton (closeButtonId , "ic_action_remove_white" );
984
998
closeButton .setContentDescription ("Close Button" );
985
- closeButton .setPadding (15 , this .dpToPixels (10 ), 15 , this .dpToPixels (10 ));
999
+ closeButton .setPadding (20 , this .dpToPixels (10 ), 20 , this .dpToPixels (10 ));
986
1000
closeButton .setOnClickListener (new View .OnClickListener (){
987
1001
public void onClick (View v ){
988
1002
closeDialog ();
989
1003
}
990
1004
});
991
1005
992
1006
// Share button
993
- int shareButtonId = 8 ;
1007
+ int shareButtonId = 8 ;
994
1008
ImageButton shareButton = createImageButton (shareButtonId , "ic_action_share" );
995
- shareButton .setPadding (15 , this .dpToPixels (10 ), 15 , this .dpToPixels (10 ));
1009
+ shareButton .setPadding (20 , this .dpToPixels (10 ), 20 , this .dpToPixels (10 ));
996
1010
shareButton .setContentDescription ("Share Button" );
997
1011
shareButton .setOnClickListener (new View .OnClickListener () {
998
1012
public void onClick (View v ) {
@@ -1615,4 +1629,3 @@ public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, Str
1615
1629
}
1616
1630
}
1617
1631
}
1618
-
0 commit comments