Bug 1149645 - Polish UI of Toast to be same as rest of Fennec (r=mcomella)

This commit is contained in:
Martyn Haigh 2015-04-22 15:58:34 -07:00
Родитель 2fb50ac667
Коммит b740c3aa94
3 изменённых файлов: 49 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/toast"
style="@style/Toast">
<TextView
android:id="@+id/toast_message"
style="@style/ToastMessage"
tools:text="Tab queued in firefox" />
<View
android:id="@+id/toast_divider"
style="@style/ToastDivider" />
<Button
android:id="@+id/toast_button"
style="@style/ToastButton"
android:drawableLeft="@drawable/switch_button_icon"
tools:text="Open" />
</LinearLayout>
</FrameLayout>

Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<style name="Toast" parent="ToastBase">
<item name="android:layout_width">400dp</item>
</style>
</resources>

Просмотреть файл

@ -84,7 +84,7 @@ public class TabQueueService extends Service {
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
toastLayout = layoutInflater.inflate(R.layout.button_toast, null);
toastLayout = layoutInflater.inflate(R.layout.tab_queue_toast, null);
final Resources resources = getResources();
@ -95,7 +95,7 @@ public class TabQueueService extends Service {
openNowButton.setText(resources.getText(R.string.tab_queue_toast_action));
toastLayoutParams = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_PHONE,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL |