@@ -46,22 +46,15 @@ class CustomNotificationModule: ReactContextBaseJavaModule {
4646
4747 @ReactMethod
4848 fun multiply (objectData : ReadableMap ,callback : Callback ) {
49- println (" multiply" )
50-
5149 try {
52- val teamImg1 = objectData.getString(" teamImg1" );
53- val teamImg2 = objectData.getString(" teamImg2" );
50+
5451 val payload = objectData.getString(" payload" );
5552 val title = objectData.getString(" title" );
5653 val body = objectData.getString(" body" );
5754 val id = objectData.getInt(" id" );
5855 val text = objectData.getArray(" TextView" );
5956 val imageView = objectData.getArray(" ImageView" );
60- var image: Bitmap ? = null
61- var image1: Bitmap ? = null
6257
63- image = BitmapFactory .decodeStream(java.net.URL (teamImg1).openStream());
64- image1 = BitmapFactory .decodeStream(java.net.URL (teamImg2).openStream());
6558 val intent = Intent (myContext, CustomTimerNotificationPackage ::class .java);
6659 intent.flags = Intent .FLAG_ACTIVITY_CLEAR_TOP or Intent .FLAG_ACTIVITY_NEW_TASK
6760 intent.putExtra(" evenData" ,payload);
@@ -106,7 +99,7 @@ class CustomNotificationModule: ReactContextBaseJavaModule {
10699 val arrayname = arrayOf(R .layout.image_view_layout1, R .layout.image_view_layout);
107100 val arrayname1 = arrayOf(R .id.imageView2, R .id.imageView1);
108101
109- if (true ) {
102+ if (false ) {
110103 val item = imageView?.getMap(0 );
111104 val textView = RemoteViews (myContext.getPackageName(),R .layout.image_view_layout);
112105 val url: String? = item?.getString(" url" );
@@ -137,38 +130,33 @@ class CustomNotificationModule: ReactContextBaseJavaModule {
137130
138131 }
139132 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+ }
167159 }
168- // textView.setViewPadding (Align.CENTER)
169- notificationLayout.addView(R .id.main, textView)
170- // notificationLayout.setImageViewBitmap(R.id.imageView1,image1)
171-
172160 }
173161 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
174162 val notificationChannel = NotificationChannel (channelId," Lineup" ,NotificationManager .IMPORTANCE_HIGH )
0 commit comments