@@ -46,22 +46,15 @@ class CustomNotificationModule: ReactContextBaseJavaModule {
46
46
47
47
@ReactMethod
48
48
fun multiply (objectData : ReadableMap ,callback : Callback ) {
49
- println (" multiply" )
50
-
51
49
try {
52
- val teamImg1 = objectData.getString(" teamImg1" );
53
- val teamImg2 = objectData.getString(" teamImg2" );
50
+
54
51
val payload = objectData.getString(" payload" );
55
52
val title = objectData.getString(" title" );
56
53
val body = objectData.getString(" body" );
57
54
val id = objectData.getInt(" id" );
58
55
val text = objectData.getArray(" TextView" );
59
56
val imageView = objectData.getArray(" ImageView" );
60
- var image: Bitmap ? = null
61
- var image1: Bitmap ? = null
62
57
63
- image = BitmapFactory .decodeStream(java.net.URL (teamImg1).openStream());
64
- image1 = BitmapFactory .decodeStream(java.net.URL (teamImg2).openStream());
65
58
val intent = Intent (myContext, CustomTimerNotificationPackage ::class .java);
66
59
intent.flags = Intent .FLAG_ACTIVITY_CLEAR_TOP or Intent .FLAG_ACTIVITY_NEW_TASK
67
60
intent.putExtra(" evenData" ,payload);
@@ -106,7 +99,7 @@ class CustomNotificationModule: ReactContextBaseJavaModule {
106
99
val arrayname = arrayOf(R .layout.image_view_layout1, R .layout.image_view_layout);
107
100
val arrayname1 = arrayOf(R .id.imageView2, R .id.imageView1);
108
101
109
- if (true ) {
102
+ if (false ) {
110
103
val item = imageView?.getMap(0 );
111
104
val textView = RemoteViews (myContext.getPackageName(),R .layout.image_view_layout);
112
105
val url: String? = item?.getString(" url" );
@@ -137,38 +130,33 @@ class CustomNotificationModule: ReactContextBaseJavaModule {
137
130
138
131
}
139
132
if (true ) {
140
- val item = imageView?.getMap(1 );
141
- val textView = RemoteViews (myContext.getPackageName(),R .layout.image_view_layout1);
142
- val url: String? = item?.getString(" url" );
143
- val decodedString: ByteArray = Base64 .decode(url, Base64 .DEFAULT )
144
- val decodedByte = BitmapFactory .decodeByteArray(decodedString, 0 , decodedString.size)
145
-
146
- // val imageBitMap = BitmapFactory.decodeStream(java.net.URL(url).openStream());
147
- val float: Float = item?.getDouble(" size" )?.toFloat()!!
148
- notificationLayout.setImageViewBitmap(R .id.imageView2,decodedByte);
149
-
150
- try {
151
-
152
- // textView.setString(R.id.imageView1, "layout_width", "34dp");
153
- val PaddingLeft : Int? = item?.getInt(" PaddingLeft" );
154
- val PaddingTop : Int? = item?.getInt(" PaddingTop" );
155
- val PaddingRight : Int? = item?.getInt(" PaddingRight" );
156
- val PaddingBottom : Int? = item?.getInt(" PaddingBottom" );
157
-
158
- textView.setViewPadding(
159
- R .id.imageView1,
160
- 10 ,
161
- 0 ,
162
- 0 ,
163
- 0
164
- );
165
- } catch (e: Exception ){
166
- println (e)
133
+ for (i in 0 .. (text?.size()?.minus(1 ) ? : 0 )) {
134
+ val item = imageView?.getMap(i);
135
+ val remoteLocalImage =
136
+ RemoteViews (myContext.getPackageName(), arrayname[i]);
137
+ val url: String? = item?.getString(" url" );
138
+ val decodedString: ByteArray = Base64 .decode(url, Base64 .DEFAULT )
139
+ val decodedByte = BitmapFactory .decodeByteArray(decodedString, 0 , decodedString.size)
140
+ notificationLayout.addView(R .id.main, remoteLocalImage);
141
+ notificationLayout.setImageViewBitmap(arrayname1[i], decodedByte);
142
+ try {
143
+ // textView.setString(R.id.imageView1, "layout_width", "34dp");
144
+ val PaddingLeft : Int? = item?.getInt(" PaddingLeft" );
145
+ val PaddingTop : Int? = item?.getInt(" PaddingTop" );
146
+ val PaddingRight : Int? = item?.getInt(" PaddingRight" );
147
+ val PaddingBottom : Int? = item?.getInt(" PaddingBottom" );
148
+
149
+ remoteLocalImage.setViewPadding(
150
+ R .id.imageView1,
151
+ PaddingLeft ? : 0 ,
152
+ PaddingTop ? : 0 ,
153
+ PaddingRight ? : 0 ,
154
+ PaddingBottom ? : 0
155
+ );
156
+ } catch (e: Exception ){
157
+ println (e)
158
+ }
167
159
}
168
- // textView.setViewPadding (Align.CENTER)
169
- notificationLayout.addView(R .id.main, textView)
170
- // notificationLayout.setImageViewBitmap(R.id.imageView1,image1)
171
-
172
160
}
173
161
if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
174
162
val notificationChannel = NotificationChannel (channelId," Lineup" ,NotificationManager .IMPORTANCE_HIGH )
0 commit comments