Skip to content

Commit a5f0398

Browse files
v4.3.3
1 parent c7e68bb commit a5f0398

17 files changed

+124
-112
lines changed

.gitignore

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
*.iml
2-
.gradle
2+
/.gradle/
33
/local.properties
4-
/.idea
5-
/.idea/caches
6-
/.idea/libraries
4+
/.idea/
5+
/.idea/caches/
6+
/.idea/libraries/
77
/.idea/modules.xml
88
/.idea/workspace.xml
99
/.idea/navEditor.xml
1010
/.idea/gradle.xml
1111
/.idea/assetWizardSettings.xml
1212
.DS_Store
13-
/build
14-
/captures
15-
.externalNativeBuild
16-
.cxx
13+
/bin/
14+
/gen/
15+
/out/
16+
/build/
17+
/captures/
18+
/gradle/
19+
/.cxx/
20+
/.externalNativeBuild/
21+
/release/

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
applicationId "com.cometchat.javasampleapp"
1010
minSdk 21
1111
targetSdk 33
12-
versionCode 7
13-
versionName "4.3.2"
12+
versionCode 8
13+
versionName "4.3.3"
1414

1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
manifestPlaceholders = [file_provider: "com.cometchat.javasampleapp"]
@@ -41,4 +41,4 @@ dependencies {
4141
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
4242
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
4343
implementation 'com.cometchat:calls-sdk-android:4.0.2'
44-
}
44+
}

app/src/main/java/com/cometchat/javasampleapp/Application.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
import android.content.res.Configuration;
55

66
import androidx.annotation.NonNull;
7+
import androidx.appcompat.app.AppCompatDelegate;
78

89
import com.cometchat.chat.core.Call;
910
import com.cometchat.chatuikit.calls.CometChatCallActivity;
1011
import com.cometchat.chatuikit.shared.resources.theme.CometChatTheme;
1112
import com.cometchat.chatuikit.shared.resources.theme.Palette;
13+
import com.cometchat.chatuikit.shared.resources.utils.Utils;
1214
import com.cometchat.chat.core.CometChat;
1315

1416

@@ -19,7 +21,7 @@ public class Application extends android.app.Application {
1921
public void onCreate() {
2022
super.onCreate();
2123
LISTENER_ID = System.currentTimeMillis() + "";
22-
if (AppUtils.isNightMode(this)) {
24+
if(AppUtils.isNightMode(this)){
2325
Palette.getInstance(this).mode(CometChatTheme.MODE.DARK);
2426
}
2527
}
@@ -51,9 +53,9 @@ public void onIncomingCallCancelled(Call call) {
5153
@Override
5254
public void onConfigurationChanged(@NonNull Configuration newConfig) {
5355
super.onConfigurationChanged(newConfig);
54-
if (AppUtils.isNightMode(this)) {
56+
if(AppUtils.isNightMode(this)){
5557
Palette.getInstance(this).mode(CometChatTheme.MODE.DARK);
56-
} else {
58+
}else{
5759
Palette.getInstance(this).mode(CometChatTheme.MODE.LIGHT);
5860
}
5961
}

app/src/main/java/com/cometchat/javasampleapp/fragments/calls/CallButtonFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
3030
cometChatCallButton.setVideoButtonText("video call");
3131
cometChatCallButton.setVoiceButtonText("voice call");
3232
cometChatCallButton.setMarginForButtons(Utils.convertDpToPx(getContext(), 1));
33-
cometChatCallButton.setButtonStyle(new ButtonStyle().setButtonSize(Utils.convertDpToPx(getContext(), 25), Utils.convertDpToPx(getContext(), 25)).setButtonIconTint(CometChatTheme.getInstance(getContext()).getPalette().getPrimary()));
33+
cometChatCallButton.setButtonStyle(new ButtonStyle().setButtonSize(Utils.convertDpToPx(getContext(), 25), Utils.convertDpToPx(getContext(), 25)).setButtonIconTint(CometChatTheme.getInstance().getPalette().getPrimary(getContext())));
3434
cometChatCallButton.setUser(AppUtils.getDefaultUser());
3535
return view;
3636
}

app/src/main/java/com/cometchat/javasampleapp/fragments/shared/resources/SoundManagerFragment.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ private void setUpUI(View view) {
4747
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.outgoing_message_text));
4848
parentView.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.app_background_dark)));
4949
} else {
50-
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.soundManager_title));
51-
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.incoming_message_text));
52-
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.outgoing_message_text));
50+
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.soundManager_title));
51+
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.soundManager_description));
52+
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.incoming_message_text));
53+
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.outgoing_message_text));
5354
parentView.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.app_background)));
5455
}
5556
}

app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/AudioBubbleFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
2121
View view = inflater.inflate(R.layout.fragment_audio_bubble_fragement, container, false);
2222
CometChatAudioBubble cometChatAudioBubble = view.findViewById(R.id.audio_bubble);
2323
cometChatAudioBubble.setAudioUrl("https://data-us.cometchat.io/2379614bd4db65dd/media/1682517916_1406731591_130612180fb2e657699814eb52817574.mp3", "SoundHelix", "Song");
24-
cometChatAudioBubble.setStyle(new AudioBubbleStyle().setBackground(CometChatTheme.getInstance(getContext()).getPalette().getAccent100()).setCornerRadius(18));
24+
cometChatAudioBubble.setStyle(new AudioBubbleStyle().setBackground(CometChatTheme.getInstance().getPalette().getAccent100(getContext())).setCornerRadius(18));
2525
return view;
2626
}
2727

app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/BadgeCountFragment.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ private void setUpUI(View view) {
112112
badgeCountLayout.getEditText().setTextColor(ColorStateList.valueOf(getResources().getColor(R.color.white)));
113113
parentView.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.app_background_dark)));
114114
} else {
115-
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.avatar_text));
116-
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.avatar_text_toggle));
117-
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.loggedInUserName));
118-
parentView.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.app_background)));
115+
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.badge_count_text_desc));
116+
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.badge_count_text));
117+
badgeCountLayout.setBoxStrokeColorStateList(ColorStateList.valueOf(getResources().getColor(R.color.black)));
118+
badgeCountLayout.setHintTextColor(ColorStateList.valueOf(getResources().getColor(R.color.black)));
119+
badgeCountLayout.getEditText().setTextColor(ColorStateList.valueOf(getResources().getColor(R.color.black)));
120+
parentView.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.app_background)));
119121
}
120122
}
121123

app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/CardBubbleFragment.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
4444
cardBubble = view.findViewById(R.id.card_bubble);
4545
scrollView = view.findViewById(R.id.scroll_view);
4646
scrollView.setVerticalScrollBarEnabled(false);
47-
CometChatTheme theme = CometChatTheme.getInstance(getContext());
47+
CometChatTheme theme = CometChatTheme.getInstance();
4848

4949
//create style object for card bubble
5050
CardBubbleStyle cardBubbleStyle = new CardBubbleStyle()
5151
.setTextAppearance(theme.getTypography().getText1())
52-
.setTextColor(theme.getPalette().getAccent())
53-
.setContentBackgroundColor(theme.getPalette().getBackground())
52+
.setTextColor(theme.getPalette().getAccent(getContext()))
53+
.setContentBackgroundColor(theme.getPalette().getBackground(getContext()))
5454
.setCornerRadius(16)
55-
.setProgressBarTintColor(theme.getPalette().getPrimary())
56-
.setButtonSeparatorColor(theme.getPalette().getAccent100())
57-
.setButtonBackgroundColor(theme.getPalette().getBackground())
58-
.setButtonTextColor(theme.getPalette().getPrimary())
59-
.setButtonDisableTextColor(theme.getPalette().getAccent500())
55+
.setProgressBarTintColor(theme.getPalette().getPrimary(getContext()))
56+
.setButtonSeparatorColor(theme.getPalette().getAccent100(getContext()))
57+
.setButtonBackgroundColor(theme.getPalette().getBackground(getContext()))
58+
.setButtonTextColor(theme.getPalette().getPrimary(getContext()))
59+
.setButtonDisableTextColor(theme.getPalette().getAccent500(getContext()))
6060
.setButtonTextAppearance(theme.getTypography().getSubtitle1())
61-
.setBackground(theme.getPalette().getBackground())
61+
.setBackground(theme.getPalette().getBackground(getContext()))
6262
.setBackground(theme.getPalette().getGradientBackground())
6363
.setImageBubbleStyle(new ImageBubbleStyle()
6464
.setCornerRadius(16)

app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FileBubbleFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
2121

2222
CometChatFileBubble fileBubble = view.findViewById(R.id.file_bubble);
2323
fileBubble.setFileUrl("https://data-us.cometchat.io/2379614bd4db65dd/media/1682517934_233027292_069741a92a2f641eb428ba6d12ccb9af.pdf", "Sample", "pdf");
24-
fileBubble.setStyle(new FileBubbleStyle().setBackground(CometChatTheme.getInstance(getContext()).getPalette().getAccent100()).setCornerRadius(18));
24+
fileBubble.setStyle(new FileBubbleStyle().setBackground(CometChatTheme.getInstance().getPalette().getAccent100(getContext())).setCornerRadius(18));
2525
fileBubble.getTitle().setPadding(20,20,20,10);
2626
fileBubble.getSubtitle().setPadding(20,10,2,10);
2727
return view;

app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FormBubbleFragment.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,51 +53,51 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
5353
formBubble = view.findViewById(R.id.form_bubble);
5454

5555

56-
CometChatTheme theme = CometChatTheme.getInstance(getContext());
56+
CometChatTheme theme = CometChatTheme.getInstance();
5757
//create style object for Form bubble
5858
FormBubbleStyle formBubbleStyle = new FormBubbleStyle()
5959
.setTitleAppearance(theme.getTypography().getHeading())
60-
.setTitleColor(theme.getPalette().getAccent())
60+
.setTitleColor(theme.getPalette().getAccent(getContext()))
6161

6262
.setLabelAppearance(theme.getTypography().getSubtitle1())
63-
.setLabelColor(theme.getPalette().getAccent())
63+
.setLabelColor(theme.getPalette().getAccent(getContext()))
6464

6565
.setInputTextAppearance(theme.getTypography().getSubtitle1())
66-
.setInputTextColor(theme.getPalette().getAccent())
67-
.setInputHintColor(theme.getPalette().getAccent500())
68-
.setErrorColor(theme.getPalette().getError())
69-
.setInputStrokeColor(theme.getPalette().getAccent600())
70-
.setActiveInputStrokeColor(theme.getPalette().getAccent())
71-
72-
.setDefaultCheckboxButtonTint(theme.getPalette().getAccent500())
73-
.setSelectedCheckboxButtonTint(theme.getPalette().getPrimary())
74-
.setErrorCheckboxButtonTint(theme.getPalette().getError())
75-
.setCheckboxTextColor(theme.getPalette().getAccent())
66+
.setInputTextColor(theme.getPalette().getAccent(getContext()))
67+
.setInputHintColor(theme.getPalette().getAccent500(getContext()))
68+
.setErrorColor(theme.getPalette().getError(getContext()))
69+
.setInputStrokeColor(theme.getPalette().getAccent600(getContext()))
70+
.setActiveInputStrokeColor(theme.getPalette().getAccent(getContext()))
71+
72+
.setDefaultCheckboxButtonTint(theme.getPalette().getAccent500(getContext()))
73+
.setSelectedCheckboxButtonTint(theme.getPalette().getPrimary(getContext()))
74+
.setErrorCheckboxButtonTint(theme.getPalette().getError(getContext()))
75+
.setCheckboxTextColor(theme.getPalette().getAccent(getContext()))
7676
.setCheckboxTextAppearance(theme.getTypography().getSubtitle1())
7777

78-
.setButtonBackgroundColor(theme.getPalette().getPrimary())
79-
.setButtonTextColor(theme.getPalette().getAccent900())
78+
.setButtonBackgroundColor(theme.getPalette().getPrimary(getContext()))
79+
.setButtonTextColor(theme.getPalette().getAccent900(getContext()))
8080
.setButtonTextAppearance(theme.getTypography().getSubtitle1())
81-
.setProgressBarTintColor(theme.getPalette().getAccent900())
82-
.setRadioButtonTint(theme.getPalette().getAccent500())
83-
.setRadioButtonTextColor(theme.getPalette().getAccent())
81+
.setProgressBarTintColor(theme.getPalette().getAccent900(getContext()))
82+
.setRadioButtonTint(theme.getPalette().getAccent500(getContext()))
83+
.setRadioButtonTextColor(theme.getPalette().getAccent(getContext()))
8484
.setRadioButtonTextAppearance(theme.getTypography().getSubtitle1())
85-
.setSelectedRadioButtonTint(theme.getPalette().getPrimary())
85+
.setSelectedRadioButtonTint(theme.getPalette().getPrimary(getContext()))
8686

87-
.setSpinnerTextColor(theme.getPalette().getAccent())
87+
.setSpinnerTextColor(theme.getPalette().getAccent(getContext()))
8888
.setSpinnerTextAppearance(theme.getTypography().getSubtitle1())
89-
.setSpinnerBackgroundColor(theme.getPalette().getAccent500())
89+
.setSpinnerBackgroundColor(theme.getPalette().getAccent500(getContext()))
9090

91-
.setBackground(theme.getPalette().getBackground())
91+
.setBackground(theme.getPalette().getBackground(getContext()))
9292
.setBackground(theme.getPalette().getGradientBackground())
9393

9494
.setSingleSelectStyle(new SingleSelectStyle()
9595
.setOptionTextAppearance(theme.getTypography().getSubtitle1())
96-
.setOptionTextColor(theme.getPalette().getAccent500())
96+
.setOptionTextColor(theme.getPalette().getAccent500(getContext()))
9797
.setSelectedOptionTextAppearance(theme.getTypography().getSubtitle1())
98-
.setSelectedOptionTextColor(theme.getPalette().getAccent())
99-
.setButtonStrokeColor(theme.getPalette().getAccent600())
100-
.setTitleColor(theme.getPalette().getAccent())
98+
.setSelectedOptionTextColor(theme.getPalette().getAccent(getContext()))
99+
.setButtonStrokeColor(theme.getPalette().getAccent600(getContext()))
100+
.setTitleColor(theme.getPalette().getAccent(getContext()))
101101
.setTitleAppearance(theme.getTypography().getSubtitle1())
102102
);
103103
formBubble.setStyle(formBubbleStyle);

0 commit comments

Comments
 (0)