@@ -141,34 +141,37 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
141141 // Avatar (Placeholder)
142142 // Holder.avatar.setImageDrawable(...)
143143
144- // App Badge Logic (New: Fetch Exact Icon)
144+ // Avatar (Now App Icon) & App Badge Logic
145145 String pkg = message .getPackageName ();
146146 if (pkg != null ) {
147- holder .appBadge .setVisibility (View .VISIBLE );
147+ // Hide the small badge
148+ holder .appBadge .setVisibility (View .GONE );
149+
150+ // Clear any tint on the avatar (xml has tint)
151+ holder .avatar .setImageTintList (null );
148152
149153 // Try to load from cache first
150154 if (iconCache .containsKey (pkg )) {
151- holder .appBadge .setImageDrawable (iconCache .get (pkg ));
155+ holder .avatar .setImageDrawable (iconCache .get (pkg ));
152156 } else {
153157 try {
154158 android .content .pm .PackageManager pm = holder .itemView .getContext ().getPackageManager ();
155159 android .graphics .drawable .Drawable icon = pm .getApplicationIcon (pkg );
156160 if (icon != null ) {
157161 iconCache .put (pkg , icon );
158- holder .appBadge .setImageDrawable (icon );
162+ holder .avatar .setImageDrawable (icon );
159163 } else {
160- // Fallback if icon is null (rare)
161- holder .appBadge . setVisibility ( View . GONE );
164+ // Fallback
165+ holder .avatar . setImageResource ( R . drawable . ic_person );
162166 }
163167 } catch (android .content .pm .PackageManager .NameNotFoundException e ) {
164168 // App not installed or invalid package name
165- holder .appBadge . setVisibility ( View . GONE );
169+ holder .avatar . setImageResource ( R . drawable . ic_person );
166170 }
167171 }
168- // Remove any tint since we want original colors
169- holder .appBadge .setImageTintList (null );
170-
171172 } else {
173+ // Fallback if no package name (shouldn't happen for new msgs)
174+ holder .avatar .setImageResource (R .drawable .ic_person );
172175 holder .appBadge .setVisibility (View .GONE );
173176 }
174177
0 commit comments