зеркало из https://github.com/mozilla/gecko-dev.git
bug 977677 - GeckoView can't access some resources it needs r=snorp
This commit is contained in:
Родитель
9d873280ff
Коммит
776d77b6b5
|
@ -13,6 +13,7 @@ import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
|
|||
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.Log;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.LinkedList;
|
||||
|
@ -53,7 +54,9 @@ public final class ThumbnailHelper {
|
|||
|
||||
private ThumbnailHelper() {
|
||||
mPendingThumbnails = new LinkedList<Tab>();
|
||||
mPendingWidth = new AtomicInteger((int)GeckoAppShell.getContext().getResources().getDimension(R.dimen.tab_thumbnail_width));
|
||||
try {
|
||||
mPendingWidth = new AtomicInteger((int)GeckoAppShell.getContext().getResources().getDimension(R.dimen.tab_thumbnail_width));
|
||||
} catch (Resources.NotFoundException nfe) { mPendingWidth = new AtomicInteger(0); }
|
||||
mWidth = -1;
|
||||
mHeight = -1;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.mozilla.gecko.mozglue.DirectBufferAllocator;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
|
@ -135,8 +136,10 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
|||
|
||||
public LayerRenderer(LayerView view) {
|
||||
mView = view;
|
||||
mOverscrollColor = view.getContext().getResources().getColor(R.color.background_normal);
|
||||
|
||||
try {
|
||||
mOverscrollColor = view.getContext().getResources().getColor(R.color.background_normal);
|
||||
} catch (Resources.NotFoundException nfe) { mOverscrollColor = Color.BLACK; }
|
||||
|
||||
Bitmap scrollbarImage = view.getScrollbarImage();
|
||||
IntSize size = new IntSize(scrollbarImage.getWidth(), scrollbarImage.getHeight());
|
||||
scrollbarImage = expandCanvasToPowerOfTwo(scrollbarImage, size);
|
||||
|
|
Загрузка…
Ссылка в новой задаче