зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 3761b11b90f0 (bug 970247) for robocop NPEs (again).
CLOSED TREE
This commit is contained in:
Родитель
d75e9670ba
Коммит
18df517424
|
@ -2257,7 +2257,7 @@ abstract public class BrowserApp extends GeckoApp
|
|||
item.setIcon(R.drawable.ic_menu_bookmark_add);
|
||||
} else {
|
||||
tab.addBookmark();
|
||||
getButtonToast().show(false,
|
||||
mToast.show(false,
|
||||
getResources().getString(R.string.bookmark_added),
|
||||
getResources().getString(R.string.bookmark_options),
|
||||
null,
|
||||
|
|
|
@ -93,7 +93,6 @@ import android.view.SurfaceView;
|
|||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewStub;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AbsoluteLayout;
|
||||
|
@ -822,17 +821,6 @@ public abstract class GeckoApp
|
|||
});
|
||||
}
|
||||
|
||||
protected ButtonToast getButtonToast() {
|
||||
if (mToast != null) {
|
||||
return mToast;
|
||||
}
|
||||
|
||||
ViewStub toastStub = (ViewStub) findViewById(R.id.toast_stub);
|
||||
mToast = new ButtonToast(toastStub.inflate());
|
||||
|
||||
return mToast;
|
||||
}
|
||||
|
||||
void showButtonToast(final String message, final String buttonText,
|
||||
final String buttonIcon, final String buttonId) {
|
||||
BitmapUtils.getDrawable(GeckoApp.this, buttonIcon, new BitmapUtils.BitmapLoader() {
|
||||
|
@ -841,7 +829,7 @@ public abstract class GeckoApp
|
|||
ThreadUtils.postToUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getButtonToast().show(false, message, buttonText, d, new ButtonToast.ToastListener() {
|
||||
mToast.show(false, message, buttonText, d, new ButtonToast.ToastListener() {
|
||||
@Override
|
||||
public void onButtonClicked() {
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Toast:Click", buttonId));
|
||||
|
@ -1260,6 +1248,8 @@ public abstract class GeckoApp
|
|||
mGeckoLayout = (RelativeLayout) findViewById(R.id.gecko_layout);
|
||||
mMainLayout = (RelativeLayout) findViewById(R.id.main_layout);
|
||||
|
||||
mToast = new ButtonToast(findViewById(R.id.toast));
|
||||
|
||||
// Determine whether we should restore tabs.
|
||||
mShouldRestore = getSessionRestoreState(savedInstanceState);
|
||||
if (mShouldRestore && savedInstanceState != null) {
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
<?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/. -->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/toast"
|
||||
style="@style/Toast">
|
||||
|
||||
<TextView android:id="@+id/toast_message"
|
||||
style="@style/ToastMessage" />
|
||||
|
||||
<ImageView android:id="@+id/toast_divider"
|
||||
style="@style/ToastDivider" />
|
||||
|
||||
<Button android:id="@+id/toast_button"
|
||||
style="@style/ToastButton" />
|
||||
|
||||
</LinearLayout>
|
|
@ -98,8 +98,18 @@
|
|||
|
||||
</view>
|
||||
|
||||
<ViewStub android:id="@+id/toast_stub"
|
||||
android:layout="@layout/button_toast"
|
||||
style="@style/Toast"/>
|
||||
<LinearLayout android:id="@+id/toast"
|
||||
style="@style/Toast">
|
||||
|
||||
<TextView android:id="@+id/toast_message"
|
||||
style="@style/ToastMessage" />
|
||||
|
||||
<ImageView android:id="@+id/toast_divider"
|
||||
style="@style/ToastDivider" />
|
||||
|
||||
<Button android:id="@+id/toast_button"
|
||||
style="@style/ToastButton" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -53,8 +53,18 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<ViewStub android:id="@+id/toast_stub"
|
||||
android:layout="@layout/button_toast"
|
||||
style="@style/Toast"/>
|
||||
<LinearLayout android:id="@+id/toast"
|
||||
style="@style/Toast">
|
||||
|
||||
<TextView android:id="@+id/toast_message"
|
||||
style="@style/ToastMessage" />
|
||||
|
||||
<ImageView android:id="@+id/toast_divider"
|
||||
style="@style/ToastDivider" />
|
||||
|
||||
<Button android:id="@+id/toast_button"
|
||||
style="@style/ToastButton" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
Загрузка…
Ссылка в новой задаче