Skip to content

Commit

Permalink
v4.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekCometChat committed Apr 16, 2024
1 parent c7e68bb commit a5f0398
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 112 deletions.
21 changes: 13 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
*.iml
.gradle
/.gradle/
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/
/.idea/caches/
/.idea/libraries/
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/gradle.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
/bin/
/gen/
/out/
/build/
/captures/
/gradle/
/.cxx/
/.externalNativeBuild/
/release/
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.cometchat.javasampleapp"
minSdk 21
targetSdk 33
versionCode 7
versionName "4.3.2"
versionCode 8
versionName "4.3.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [file_provider: "com.cometchat.javasampleapp"]
Expand Down Expand Up @@ -41,4 +41,4 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.cometchat:calls-sdk-android:4.0.2'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import android.content.res.Configuration;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatDelegate;

import com.cometchat.chat.core.Call;
import com.cometchat.chatuikit.calls.CometChatCallActivity;
import com.cometchat.chatuikit.shared.resources.theme.CometChatTheme;
import com.cometchat.chatuikit.shared.resources.theme.Palette;
import com.cometchat.chatuikit.shared.resources.utils.Utils;
import com.cometchat.chat.core.CometChat;


Expand All @@ -19,7 +21,7 @@ public class Application extends android.app.Application {
public void onCreate() {
super.onCreate();
LISTENER_ID = System.currentTimeMillis() + "";
if (AppUtils.isNightMode(this)) {
if(AppUtils.isNightMode(this)){
Palette.getInstance(this).mode(CometChatTheme.MODE.DARK);
}
}
Expand Down Expand Up @@ -51,9 +53,9 @@ public void onIncomingCallCancelled(Call call) {
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (AppUtils.isNightMode(this)) {
if(AppUtils.isNightMode(this)){
Palette.getInstance(this).mode(CometChatTheme.MODE.DARK);
} else {
}else{
Palette.getInstance(this).mode(CometChatTheme.MODE.LIGHT);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
cometChatCallButton.setVideoButtonText("video call");
cometChatCallButton.setVoiceButtonText("voice call");
cometChatCallButton.setMarginForButtons(Utils.convertDpToPx(getContext(), 1));
cometChatCallButton.setButtonStyle(new ButtonStyle().setButtonSize(Utils.convertDpToPx(getContext(), 25), Utils.convertDpToPx(getContext(), 25)).setButtonIconTint(CometChatTheme.getInstance(getContext()).getPalette().getPrimary()));
cometChatCallButton.setButtonStyle(new ButtonStyle().setButtonSize(Utils.convertDpToPx(getContext(), 25), Utils.convertDpToPx(getContext(), 25)).setButtonIconTint(CometChatTheme.getInstance().getPalette().getPrimary(getContext())));
cometChatCallButton.setUser(AppUtils.getDefaultUser());
return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ private void setUpUI(View view) {
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.outgoing_message_text));
parentView.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.app_background_dark)));
} else {
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.soundManager_title));
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.incoming_message_text));
AppUtils.changeTextColorToWhite(getContext(),view.findViewById(R.id.outgoing_message_text));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.soundManager_title));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.soundManager_description));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.incoming_message_text));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.outgoing_message_text));
parentView.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.app_background)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
View view = inflater.inflate(R.layout.fragment_audio_bubble_fragement, container, false);
CometChatAudioBubble cometChatAudioBubble = view.findViewById(R.id.audio_bubble);
cometChatAudioBubble.setAudioUrl("https://data-us.cometchat.io/2379614bd4db65dd/media/1682517916_1406731591_130612180fb2e657699814eb52817574.mp3", "SoundHelix", "Song");
cometChatAudioBubble.setStyle(new AudioBubbleStyle().setBackground(CometChatTheme.getInstance(getContext()).getPalette().getAccent100()).setCornerRadius(18));
cometChatAudioBubble.setStyle(new AudioBubbleStyle().setBackground(CometChatTheme.getInstance().getPalette().getAccent100(getContext())).setCornerRadius(18));
return view;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ private void setUpUI(View view) {
badgeCountLayout.getEditText().setTextColor(ColorStateList.valueOf(getResources().getColor(R.color.white)));
parentView.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.app_background_dark)));
} else {
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.avatar_text));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.avatar_text_toggle));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.loggedInUserName));
parentView.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.app_background)));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.badge_count_text_desc));
AppUtils.changeTextColorToBlack(getContext(),view.findViewById(R.id.badge_count_text));
badgeCountLayout.setBoxStrokeColorStateList(ColorStateList.valueOf(getResources().getColor(R.color.black)));
badgeCountLayout.setHintTextColor(ColorStateList.valueOf(getResources().getColor(R.color.black)));
badgeCountLayout.getEditText().setTextColor(ColorStateList.valueOf(getResources().getColor(R.color.black)));
parentView.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(getContext(), R.color.app_background)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
cardBubble = view.findViewById(R.id.card_bubble);
scrollView = view.findViewById(R.id.scroll_view);
scrollView.setVerticalScrollBarEnabled(false);
CometChatTheme theme = CometChatTheme.getInstance(getContext());
CometChatTheme theme = CometChatTheme.getInstance();

//create style object for card bubble
CardBubbleStyle cardBubbleStyle = new CardBubbleStyle()
.setTextAppearance(theme.getTypography().getText1())
.setTextColor(theme.getPalette().getAccent())
.setContentBackgroundColor(theme.getPalette().getBackground())
.setTextColor(theme.getPalette().getAccent(getContext()))
.setContentBackgroundColor(theme.getPalette().getBackground(getContext()))
.setCornerRadius(16)
.setProgressBarTintColor(theme.getPalette().getPrimary())
.setButtonSeparatorColor(theme.getPalette().getAccent100())
.setButtonBackgroundColor(theme.getPalette().getBackground())
.setButtonTextColor(theme.getPalette().getPrimary())
.setButtonDisableTextColor(theme.getPalette().getAccent500())
.setProgressBarTintColor(theme.getPalette().getPrimary(getContext()))
.setButtonSeparatorColor(theme.getPalette().getAccent100(getContext()))
.setButtonBackgroundColor(theme.getPalette().getBackground(getContext()))
.setButtonTextColor(theme.getPalette().getPrimary(getContext()))
.setButtonDisableTextColor(theme.getPalette().getAccent500(getContext()))
.setButtonTextAppearance(theme.getTypography().getSubtitle1())
.setBackground(theme.getPalette().getBackground())
.setBackground(theme.getPalette().getBackground(getContext()))
.setBackground(theme.getPalette().getGradientBackground())
.setImageBubbleStyle(new ImageBubbleStyle()
.setCornerRadius(16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

CometChatFileBubble fileBubble = view.findViewById(R.id.file_bubble);
fileBubble.setFileUrl("https://data-us.cometchat.io/2379614bd4db65dd/media/1682517934_233027292_069741a92a2f641eb428ba6d12ccb9af.pdf", "Sample", "pdf");
fileBubble.setStyle(new FileBubbleStyle().setBackground(CometChatTheme.getInstance(getContext()).getPalette().getAccent100()).setCornerRadius(18));
fileBubble.setStyle(new FileBubbleStyle().setBackground(CometChatTheme.getInstance().getPalette().getAccent100(getContext())).setCornerRadius(18));
fileBubble.getTitle().setPadding(20,20,20,10);
fileBubble.getSubtitle().setPadding(20,10,2,10);
return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,51 +53,51 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
formBubble = view.findViewById(R.id.form_bubble);


CometChatTheme theme = CometChatTheme.getInstance(getContext());
CometChatTheme theme = CometChatTheme.getInstance();
//create style object for Form bubble
FormBubbleStyle formBubbleStyle = new FormBubbleStyle()
.setTitleAppearance(theme.getTypography().getHeading())
.setTitleColor(theme.getPalette().getAccent())
.setTitleColor(theme.getPalette().getAccent(getContext()))

.setLabelAppearance(theme.getTypography().getSubtitle1())
.setLabelColor(theme.getPalette().getAccent())
.setLabelColor(theme.getPalette().getAccent(getContext()))

.setInputTextAppearance(theme.getTypography().getSubtitle1())
.setInputTextColor(theme.getPalette().getAccent())
.setInputHintColor(theme.getPalette().getAccent500())
.setErrorColor(theme.getPalette().getError())
.setInputStrokeColor(theme.getPalette().getAccent600())
.setActiveInputStrokeColor(theme.getPalette().getAccent())

.setDefaultCheckboxButtonTint(theme.getPalette().getAccent500())
.setSelectedCheckboxButtonTint(theme.getPalette().getPrimary())
.setErrorCheckboxButtonTint(theme.getPalette().getError())
.setCheckboxTextColor(theme.getPalette().getAccent())
.setInputTextColor(theme.getPalette().getAccent(getContext()))
.setInputHintColor(theme.getPalette().getAccent500(getContext()))
.setErrorColor(theme.getPalette().getError(getContext()))
.setInputStrokeColor(theme.getPalette().getAccent600(getContext()))
.setActiveInputStrokeColor(theme.getPalette().getAccent(getContext()))

.setDefaultCheckboxButtonTint(theme.getPalette().getAccent500(getContext()))
.setSelectedCheckboxButtonTint(theme.getPalette().getPrimary(getContext()))
.setErrorCheckboxButtonTint(theme.getPalette().getError(getContext()))
.setCheckboxTextColor(theme.getPalette().getAccent(getContext()))
.setCheckboxTextAppearance(theme.getTypography().getSubtitle1())

.setButtonBackgroundColor(theme.getPalette().getPrimary())
.setButtonTextColor(theme.getPalette().getAccent900())
.setButtonBackgroundColor(theme.getPalette().getPrimary(getContext()))
.setButtonTextColor(theme.getPalette().getAccent900(getContext()))
.setButtonTextAppearance(theme.getTypography().getSubtitle1())
.setProgressBarTintColor(theme.getPalette().getAccent900())
.setRadioButtonTint(theme.getPalette().getAccent500())
.setRadioButtonTextColor(theme.getPalette().getAccent())
.setProgressBarTintColor(theme.getPalette().getAccent900(getContext()))
.setRadioButtonTint(theme.getPalette().getAccent500(getContext()))
.setRadioButtonTextColor(theme.getPalette().getAccent(getContext()))
.setRadioButtonTextAppearance(theme.getTypography().getSubtitle1())
.setSelectedRadioButtonTint(theme.getPalette().getPrimary())
.setSelectedRadioButtonTint(theme.getPalette().getPrimary(getContext()))

.setSpinnerTextColor(theme.getPalette().getAccent())
.setSpinnerTextColor(theme.getPalette().getAccent(getContext()))
.setSpinnerTextAppearance(theme.getTypography().getSubtitle1())
.setSpinnerBackgroundColor(theme.getPalette().getAccent500())
.setSpinnerBackgroundColor(theme.getPalette().getAccent500(getContext()))

.setBackground(theme.getPalette().getBackground())
.setBackground(theme.getPalette().getBackground(getContext()))
.setBackground(theme.getPalette().getGradientBackground())

.setSingleSelectStyle(new SingleSelectStyle()
.setOptionTextAppearance(theme.getTypography().getSubtitle1())
.setOptionTextColor(theme.getPalette().getAccent500())
.setOptionTextColor(theme.getPalette().getAccent500(getContext()))
.setSelectedOptionTextAppearance(theme.getTypography().getSubtitle1())
.setSelectedOptionTextColor(theme.getPalette().getAccent())
.setButtonStrokeColor(theme.getPalette().getAccent600())
.setTitleColor(theme.getPalette().getAccent())
.setSelectedOptionTextColor(theme.getPalette().getAccent(getContext()))
.setButtonStrokeColor(theme.getPalette().getAccent600(getContext()))
.setTitleColor(theme.getPalette().getAccent(getContext()))
.setTitleAppearance(theme.getTypography().getSubtitle1())
);
formBubble.setStyle(formBubbleStyle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ListItemFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_data_item, container, false);
parentView=view.findViewById(R.id.parent_view);
CometChatTheme theme = CometChatTheme.getInstance(getContext());
CometChatTheme theme = CometChatTheme.getInstance();
CometChatListItem groupListItem = view.findViewById(R.id.group_list_item);
groupListItem.setTitle("Superhero");
groupListItem.setSubtitleView(getTextView("8 members"));
Expand All @@ -47,9 +47,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
CometChatListItem conversationListItem = view.findViewById(R.id.conversation_list_item);
ConversationTailView tailView = new ConversationTailView(getContext());
tailView.setBadgeCount(100);
tailView.getBadge().setStyle(new BadgeStyle().setTextColor(theme.getPalette().getAccent()).setBackground(theme.getPalette().getPrimary()).setCornerRadius(100));
tailView.getBadge().setStyle(new BadgeStyle().setTextColor(theme.getPalette().getAccent(getContext())).setBackground(theme.getPalette().getPrimary(getContext())).setCornerRadius(100));
tailView.getDate().setDate(System.currentTimeMillis() / 1000, Pattern.DAY_DATE_TIME);
tailView.getDate().setStyle(new DateStyle().setTextAppearance(theme.getTypography().getSubtitle1()).setTextColor(theme.getPalette().getAccent600()));
tailView.getDate().setStyle(new DateStyle().setTextAppearance(theme.getTypography().getSubtitle1()).setTextColor(theme.getPalette().getAccent600(getContext())));
conversationListItem.setTitle(name);
conversationListItem.setAvatar(CometChatUIKit.getLoggedInUser().getAvatar(), name);
conversationListItem.setTailView(tailView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_media_recorder, container, false);
CometChatMediaRecorder mediaRecorder = view.findViewById(R.id.recorder);
CometChatTheme cometChatTheme = CometChatTheme.getInstance(getContext());
CometChatTheme cometChatTheme = CometChatTheme.getInstance();
mediaRecorder.setStyle(new MediaRecorderStyle()
.setBackground(cometChatTheme.getPalette().getBackground())
.setBackground(cometChatTheme.getPalette().getBackground())
.setRecordedContainerColor(cometChatTheme.getPalette().getAccent100())
.setPlayIconTint(cometChatTheme.getPalette().getAccent())
.setPauseIconTint(cometChatTheme.getPalette().getAccent())
.setStopIconTint(cometChatTheme.getPalette().getError())
.setVoiceRecordingIconTint(cometChatTheme.getPalette().getError())
.setRecordingChunkColor(cometChatTheme.getPalette().getPrimary())
.setTimerTextColor(cometChatTheme.getPalette().getAccent())
.setBackground(cometChatTheme.getPalette().getBackground(getContext()))
.setBackground(cometChatTheme.getPalette().getBackground(getContext()))
.setRecordedContainerColor(cometChatTheme.getPalette().getAccent100(getContext()))
.setPlayIconTint(cometChatTheme.getPalette().getAccent(getContext()))
.setPauseIconTint(cometChatTheme.getPalette().getAccent(getContext()))
.setStopIconTint(cometChatTheme.getPalette().getError(getContext()))
.setVoiceRecordingIconTint(cometChatTheme.getPalette().getError(getContext()))
.setRecordingChunkColor(cometChatTheme.getPalette().getPrimary(getContext()))
.setTimerTextColor(cometChatTheme.getPalette().getAccent(getContext()))
.setTimerTextAppearance(cometChatTheme.getTypography().getText1()));
mediaRecorder.setCardElevation(10);
mediaRecorder.setRadius(16);
Expand Down
Loading

0 comments on commit a5f0398

Please sign in to comment.