android/source/src/java/org/libreoffice/canvas/BitmapHandle.java |   14 
+++++-----
 android/source/src/java/org/libreoffice/canvas/ImageUtils.java   |    4 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit e9b7dd6faf191111a071ffeb0367f7e12a2aa7e1
Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
Date:   Wed Apr 5 18:49:28 2017 +0200

    android: getDrawable(int) is deprecated
    
    additionally reduce scope of to package-private
    
    Change-Id: I46ca55c5ef7daf992407beef53f5da939bf9066a

diff --git a/android/source/src/java/org/libreoffice/canvas/BitmapHandle.java 
b/android/source/src/java/org/libreoffice/canvas/BitmapHandle.java
index d450b7cc0f68..e46173db518f 100644
--- a/android/source/src/java/org/libreoffice/canvas/BitmapHandle.java
+++ b/android/source/src/java/org/libreoffice/canvas/BitmapHandle.java
@@ -2,10 +2,10 @@ package org.libreoffice.canvas;
 
 import android.content.Context;
 import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
 import android.graphics.RectF;
 import android.graphics.drawable.Drawable;
+import android.support.v4.content.ContextCompat;
 
 /**
  * Bitmap handle canvas element is used to show a handle on the screen.
@@ -14,10 +14,10 @@ import android.graphics.drawable.Drawable;
  */
 public abstract class BitmapHandle extends CommonCanvasElement {
     public final RectF mDocumentPosition;
-    protected final Bitmap mBitmap;
-    protected final RectF mScreenPosition;
+    private final Bitmap mBitmap;
+    final RectF mScreenPosition;
 
-    public BitmapHandle(Bitmap bitmap) {
+    BitmapHandle(Bitmap bitmap) {
         mBitmap = bitmap;
         mScreenPosition = new RectF(0, 0, mBitmap.getWidth(), 
mBitmap.getHeight());
         mDocumentPosition = new RectF();
@@ -26,8 +26,8 @@ public abstract class BitmapHandle extends 
CommonCanvasElement {
     /**
      * Return a bitmap for a drawable id.
      */
-    protected static Bitmap getBitmapForDrawable(Context context, int 
drawableId) {
-        Drawable drawable = context.getResources().getDrawable(drawableId);
+    static Bitmap getBitmapForDrawable(Context context, int drawableId) {
+        Drawable drawable = ContextCompat.getDrawable(context, drawableId);
 
         return ImageUtils.getBitmapForDrawable(drawable);
     }
@@ -45,7 +45,7 @@ public abstract class BitmapHandle extends 
CommonCanvasElement {
      * Test if the bitmap has been hit.
      * @param x - x coordinate
      * @param y - y coordinate
-     * @return
+     * @return true if the bitmap has been hit
      */
     @Override
     public boolean onHitTest(float x, float y) {
diff --git a/android/source/src/java/org/libreoffice/canvas/ImageUtils.java 
b/android/source/src/java/org/libreoffice/canvas/ImageUtils.java
index e41e6ebe2101..ecda9b77c597 100644
--- a/android/source/src/java/org/libreoffice/canvas/ImageUtils.java
+++ b/android/source/src/java/org/libreoffice/canvas/ImageUtils.java
@@ -4,8 +4,8 @@ import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.drawable.Drawable;
 
-public class ImageUtils {
-    public static Bitmap getBitmapForDrawable(Drawable drawable) {
+class ImageUtils {
+    static Bitmap getBitmapForDrawable(Drawable drawable) {
         drawable = drawable.mutate();
 
         int width = !drawable.getBounds().isEmpty() ?
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to