Merge "Allow configuration of Toast gravity settings" into klp-dev
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index aaa1adaa..4b71e36 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -95,6 +95,8 @@
mTN = new TN();
mTN.mY = context.getResources().getDimensionPixelSize(
com.android.internal.R.dimen.toast_y_offset);
+ mTN.mGravity = context.getResources().getInteger(
+ com.android.internal.R.integer.config_toastDefaultGravity);
}
/**
@@ -382,12 +384,12 @@
private final WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
final Handler mHandler = new Handler();
- int mGravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
+ int mGravity;
int mX, mY;
float mHorizontalMargin;
float mVerticalMargin;
-
+
View mView;
View mNextView;
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 0908f36..4a472fc 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1200,4 +1200,7 @@
from an emulated display within the physical display. -->
<bool name="config_forceDefaultOrientation">false</bool>
+ <!-- Default Gravity setting for the system Toast view. Equivalent to: Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM -->
+ <integer name="config_toastDefaultGravity">0x00000051</integer>
+
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 04cdac9..2e05663 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -294,6 +294,7 @@
<java-symbol type="integer" name="config_ntpRetry" />
<java-symbol type="integer" name="config_ntpThreshold" />
<java-symbol type="integer" name="config_ntpTimeout" />
+ <java-symbol type="integer" name="config_toastDefaultGravity" />
<java-symbol type="integer" name="config_wifi_framework_scan_interval" />
<java-symbol type="integer" name="config_wifi_supplicant_scan_interval" />
<java-symbol type="integer" name="config_wifi_scan_interval_p2p_connected" />