Skip to content

Commit 7588f6b

Browse files
committed
Fix issue with Bitmap.Config being null
1 parent d697657 commit 7588f6b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

codec2talkie/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "com.radio.codec2talkie"
1111
minSdkVersion 23
1212
targetSdkVersion 30
13-
versionCode 154
14-
versionName "1.54"
13+
versionCode 155
14+
versionName "1.55"
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}

codec2talkie/src/main/java/com/radio/codec2talkie/protocol/aprs/tools/AprsSymbolTable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.graphics.Canvas;
66
import android.graphics.Paint;
77
import android.graphics.drawable.BitmapDrawable;
8+
import android.media.audiofx.DynamicsProcessing;
89
import android.util.DisplayMetrics;
910
import android.widget.ImageView;
1011

@@ -110,7 +111,7 @@ public Bitmap bitmapFromSymbol(String symbolCode, boolean useLarge) {
110111

111112
Bitmap icon = _secondaryTable.get(symbolIconIndex);
112113
Bitmap overlayIcon = _overlayTable.get(overlayIconIndex);
113-
Bitmap bmOverlay = Bitmap.createBitmap(icon.getWidth(), icon.getHeight(), null);
114+
Bitmap bmOverlay = Bitmap.createBitmap(icon.getWidth(), icon.getHeight(), Bitmap.Config.ARGB_8888);
114115
bmOverlay.setDensity(DisplayMetrics.DENSITY_DEFAULT);
115116

116117
Canvas canvas = new Canvas(bmOverlay);
@@ -165,7 +166,7 @@ public static Bitmap generateSelectionTable(Context context, int parentWidth) {
165166
ArrayList<Bitmap> secondaryTableIcons = Load(imageViewSecondary, _selectorIconDim, _selectorIconDim, _cntWidth, _cntHeight);
166167
primaryTableIcons.addAll(secondaryTableIcons);
167168

168-
Bitmap bmOverlay = Bitmap.createBitmap(_selectorIconDim*cntX, _selectorIconDim*cntY*2, null);
169+
Bitmap bmOverlay = Bitmap.createBitmap(_selectorIconDim*cntX, _selectorIconDim*cntY*2, Bitmap.Config.ARGB_8888);
169170
bmOverlay.setDensity(DisplayMetrics.DENSITY_DEFAULT);
170171
Canvas canvas = new Canvas(bmOverlay);
171172
Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG);

codec2talkie/src/main/java/com/radio/codec2talkie/storage/station/StationItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public BitmapDrawable drawLabelWithIcon(Context context, float textSize) {
168168
int height = bitmapIcon.getHeight() + bounds.height();
169169

170170
// create overlay bitmap
171-
Bitmap bitmap = Bitmap.createBitmap(width, height, null);
171+
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
172172
bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
173173

174174
// draw APRS icon

codec2talkie/src/main/java/com/radio/codec2talkie/tools/BitmapTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static BitmapDrawable drawLabel(Context context, String text, float textS
1818
Rect bounds = new Rect();
1919
paint.getTextBounds(text, 0, text.length(), bounds);
2020

21-
Bitmap bitmap = Bitmap.createBitmap(bounds.width(), bounds.height(), null);
21+
Bitmap bitmap = Bitmap.createBitmap(bounds.width(), bounds.height(), Bitmap.Config.ARGB_8888);
2222
bitmap.setDensity(DisplayMetrics.DENSITY_DEFAULT);
2323

2424
Canvas canvas = new Canvas(bitmap);

0 commit comments

Comments
 (0)