Fix issue with Bitmap.Config being null

master 1.55
sh123 2023-05-08 17:26:40 +03:00
rodzic d697657684
commit 7588f6b0ba
4 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -10,8 +10,8 @@ android {
applicationId "com.radio.codec2talkie"
minSdkVersion 23
targetSdkVersion 30
versionCode 154
versionName "1.54"
versionCode 155
versionName "1.55"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Wyświetl plik

@ -5,6 +5,7 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.media.audiofx.DynamicsProcessing;
import android.util.DisplayMetrics;
import android.widget.ImageView;
@ -110,7 +111,7 @@ public class AprsSymbolTable {
Bitmap icon = _secondaryTable.get(symbolIconIndex);
Bitmap overlayIcon = _overlayTable.get(overlayIconIndex);
Bitmap bmOverlay = Bitmap.createBitmap(icon.getWidth(), icon.getHeight(), null);
Bitmap bmOverlay = Bitmap.createBitmap(icon.getWidth(), icon.getHeight(), Bitmap.Config.ARGB_8888);
bmOverlay.setDensity(DisplayMetrics.DENSITY_DEFAULT);
Canvas canvas = new Canvas(bmOverlay);
@ -165,7 +166,7 @@ public class AprsSymbolTable {
ArrayList<Bitmap> secondaryTableIcons = Load(imageViewSecondary, _selectorIconDim, _selectorIconDim, _cntWidth, _cntHeight);
primaryTableIcons.addAll(secondaryTableIcons);
Bitmap bmOverlay = Bitmap.createBitmap(_selectorIconDim*cntX, _selectorIconDim*cntY*2, null);
Bitmap bmOverlay = Bitmap.createBitmap(_selectorIconDim*cntX, _selectorIconDim*cntY*2, Bitmap.Config.ARGB_8888);
bmOverlay.setDensity(DisplayMetrics.DENSITY_DEFAULT);
Canvas canvas = new Canvas(bmOverlay);
Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG);

Wyświetl plik

@ -168,7 +168,7 @@ public class StationItem {
int height = bitmapIcon.getHeight() + bounds.height();
// create overlay bitmap
Bitmap bitmap = Bitmap.createBitmap(width, height, null);
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
// draw APRS icon

Wyświetl plik

@ -18,7 +18,7 @@ public class BitmapTools {
Rect bounds = new Rect();
paint.getTextBounds(text, 0, text.length(), bounds);
Bitmap bitmap = Bitmap.createBitmap(bounds.width(), bounds.height(), null);
Bitmap bitmap = Bitmap.createBitmap(bounds.width(), bounds.height(), Bitmap.Config.ARGB_8888);
bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
Canvas canvas = new Canvas(bitmap);