11package com .cometchat .javasampleapp .activity ;
22
33import android .content .Intent ;
4+ import android .content .res .ColorStateList ;
45import android .os .Bundle ;
56import android .view .View ;
7+ import android .widget .LinearLayout ;
68import android .widget .TextView ;
79
810import androidx .appcompat .app .AppCompatActivity ;
11+ import androidx .core .content .ContextCompat ;
912
1013import com .cometchat .chatuikit .shared .resources .utils .Utils ;
14+ import com .cometchat .javasampleapp .AppUtils ;
1115import com .cometchat .javasampleapp .R ;
1216import com .cometchat .javasampleapp .constants .StringConstants ;
1317
1418public class ComponentListActivity extends AppCompatActivity {
19+ LinearLayout parentView ;
1520 @ Override
1621 protected void onCreate (Bundle savedInstanceState ) {
1722 super .onCreate (savedInstanceState );
1823 setContentView (R .layout .activity_component_list );
19- Utils . setStatusBarColor ( this , getResources (). getColor ( R . color . app_background ) );
24+ parentView = findViewById ( R . id . parent_view );
2025 TextView title = findViewById (R .id .title );
26+ setUpUI ();
2127 if (getIntent () != null ) {
2228 title .setText (getIntent ().getStringExtra (StringConstants .MODULE ));
2329 if (getIntent ().getStringExtra (StringConstants .MODULE ).equalsIgnoreCase (StringConstants .CONVERSATIONS )) {
@@ -40,6 +46,7 @@ protected void onCreate(Bundle savedInstanceState) {
4046 //chats
4147 findViewById (R .id .conversationWithMessages ).setOnClickListener (view -> handleIntent (R .id .conversationWithMessages ));
4248 findViewById (R .id .conversations ).setOnClickListener (view -> handleIntent (R .id .conversations ));
49+ findViewById (R .id .contacts ).setOnClickListener (view -> handleIntent (R .id .contacts ));
4350
4451 //users
4552 findViewById (R .id .userWithMessages ).setOnClickListener (view -> handleIntent (R .id .userWithMessages ));
@@ -62,6 +69,7 @@ protected void onCreate(Bundle savedInstanceState) {
6269 findViewById (R .id .messageList ).setOnClickListener (view -> handleIntent (R .id .messageList ));
6370 findViewById (R .id .messageHeader ).setOnClickListener (view -> handleIntent (R .id .messageHeader ));
6471 findViewById (R .id .messageComposer ).setOnClickListener (view -> handleIntent (R .id .messageComposer ));
72+ findViewById (R .id .messageInformation ).setOnClickListener (view -> handleIntent (R .id .messageInformation ));
6573
6674 //calls
6775 findViewById (R .id .call_button ).setOnClickListener (view -> handleIntent (R .id .call_button ));
@@ -79,15 +87,93 @@ protected void onCreate(Bundle savedInstanceState) {
7987 findViewById (R .id .video_bubble ).setOnClickListener (view -> handleIntent (R .id .video_bubble ));
8088 findViewById (R .id .audio_bubble ).setOnClickListener (view -> handleIntent (R .id .audio_bubble ));
8189 findViewById (R .id .files_bubble ).setOnClickListener (view -> handleIntent (R .id .files_bubble ));
90+ findViewById (R .id .media_recorder ).setOnClickListener (view -> handleIntent (R .id .media_recorder ));
8291
8392 //resources
8493 findViewById (R .id .soundManager ).setOnClickListener (view -> handleIntent (R .id .soundManager ));
8594 findViewById (R .id .theme ).setOnClickListener (view -> handleIntent (R .id .theme ));
8695 findViewById (R .id .localize ).setOnClickListener (view -> handleIntent (R .id .localize ));
87-
88-
8996 }
9097
98+ private void setUpUI () {
99+ if (AppUtils .isNightMode (this )){
100+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .backIcon ));
101+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_cwm ));
102+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_c ));
103+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_contacts ));
104+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_uwm ));
105+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_u ));
106+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_ud ));
107+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_gwm ));
108+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_g ));
109+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_cg ));
110+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_jp ));
111+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_gm ));
112+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_ad ));
113+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_to ));
114+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_bm ));
115+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_gd ));
116+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_message ));
117+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_message_header ));
118+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_message_list ));
119+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_message_composer ));
120+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_message_information ));
121+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_call_button ));
122+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_audio ));
123+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_translate ));
124+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_avatar ));
125+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_badge_count ));
126+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_message_receipt ));
127+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_status_indicator ));
128+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_text_bubble ));
129+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_image_bubble ));
130+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_video_bubble ));
131+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_audio_bubble ));
132+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_file_bubble ));
133+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_mic ));
134+ AppUtils .changeIconTintToWhite (this ,findViewById (R .id .image_list_item ));
135+ Utils .setStatusBarColor (this , ContextCompat .getColor (this ,R .color .app_background_dark ));
136+ parentView .setBackgroundTintList (ColorStateList .valueOf (ContextCompat .getColor (this ,R .color .app_background_dark )));
137+ }else {
138+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .backIcon ));
139+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_cwm ));
140+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_c ));
141+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_contacts ));
142+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_uwm ));
143+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_u ));
144+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_ud ));
145+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_gwm ));
146+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_g ));
147+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_cg ));
148+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_jp ));
149+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_gm ));
150+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_ad ));
151+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_to ));
152+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_bm ));
153+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_gd ));
154+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_message ));
155+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_message_header ));
156+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_message_list ));
157+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_message_composer ));
158+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_message_information ));
159+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_call_button ));
160+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_audio ));
161+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_translate ));
162+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_avatar ));
163+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_badge_count ));
164+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_message_receipt ));
165+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_status_indicator ));
166+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_text_bubble ));
167+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_image_bubble ));
168+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_video_bubble ));
169+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_audio_bubble ));
170+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_file_bubble ));
171+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_mic ));
172+ AppUtils .changeIconTintToBlack (this ,findViewById (R .id .image_list_item ));
173+ Utils .setStatusBarColor (this , getResources ().getColor (R .color .app_background ));
174+ parentView .setBackgroundTintList (ColorStateList .valueOf (getResources ().getColor (R .color .app_background )));
175+ }
176+ }
91177 private void handleIntent (int id ) {
92178 Intent intent = new Intent (this , ComponentLaunchActivity .class );
93179 intent .putExtra ("component" , id );
0 commit comments