From a5f0398a57866c72c0b5854e474e4ed31f5b643f Mon Sep 17 00:00:00 2001 From: vivekCometChat Date: Tue, 16 Apr 2024 23:07:36 +0530 Subject: [PATCH] v4.3.3 --- .gitignore | 21 +++--- app/build.gradle | 6 +- .../cometchat/javasampleapp/Application.java | 8 ++- .../fragments/calls/CallButtonFragment.java | 2 +- .../resources/SoundManagerFragment.java | 7 +- .../shared/views/AudioBubbleFragment.java | 2 +- .../shared/views/BadgeCountFragment.java | 10 +-- .../shared/views/CardBubbleFragment.java | 18 ++--- .../shared/views/FileBubbleFragment.java | 2 +- .../shared/views/FormBubbleFragment.java | 52 +++++++-------- .../shared/views/ListItemFragment.java | 6 +- .../shared/views/MediaRecorderFragment.java | 20 +++--- .../shared/views/SchedulerBubbleFragment.java | 66 +++++++++---------- .../shared/views/TextBubbleFragment.java | 6 +- build.gradle | 4 +- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 17 files changed, 124 insertions(+), 112 deletions(-) diff --git a/.gitignore b/.gitignore index 30cb608c..166d8350 100755 --- a/.gitignore +++ b/.gitignore @@ -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/ \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index a447088a..fa258d12 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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"] @@ -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' -} +} \ No newline at end of file diff --git a/app/src/main/java/com/cometchat/javasampleapp/Application.java b/app/src/main/java/com/cometchat/javasampleapp/Application.java index 08790ef4..d06448f5 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/Application.java +++ b/app/src/main/java/com/cometchat/javasampleapp/Application.java @@ -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; @@ -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); } } @@ -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); } } diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/calls/CallButtonFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/calls/CallButtonFragment.java index 45a2d89b..b0626aeb 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/calls/CallButtonFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/calls/CallButtonFragment.java @@ -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; } diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/resources/SoundManagerFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/resources/SoundManagerFragment.java index f349eec1..32fda5bb 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/resources/SoundManagerFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/resources/SoundManagerFragment.java @@ -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))); } } diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/AudioBubbleFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/AudioBubbleFragment.java index 6fa3041e..6e24245a 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/AudioBubbleFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/AudioBubbleFragment.java @@ -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; } diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/BadgeCountFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/BadgeCountFragment.java index 231a7a2d..562bf0da 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/BadgeCountFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/BadgeCountFragment.java @@ -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))); } } diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/CardBubbleFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/CardBubbleFragment.java index 86edcba6..7a542f0d 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/CardBubbleFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/CardBubbleFragment.java @@ -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) diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FileBubbleFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FileBubbleFragment.java index 73f813f4..05247dec 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FileBubbleFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FileBubbleFragment.java @@ -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; diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FormBubbleFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FormBubbleFragment.java index cb6a6dbe..d90aefef 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FormBubbleFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/FormBubbleFragment.java @@ -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); diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/ListItemFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/ListItemFragment.java index 9f0066d1..a6afed9f 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/ListItemFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/ListItemFragment.java @@ -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")); @@ -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); diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/MediaRecorderFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/MediaRecorderFragment.java index c890a9e3..1ef46458 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/MediaRecorderFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/MediaRecorderFragment.java @@ -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); diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/SchedulerBubbleFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/SchedulerBubbleFragment.java index 60e98a7f..1b9ed78c 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/SchedulerBubbleFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/SchedulerBubbleFragment.java @@ -53,39 +53,39 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, cardView = view.findViewById(R.id.scheduler_bubble_card); schedulerBubble.setStyle(getSchedulerBubbleStyle()); schedulerBubble.setSchedulerMessage(getSchedulerMessage()); - cardView.setCardBackgroundColor(CometChatTheme.getInstance(getContext()).getPalette().getAccent50()); + cardView.setCardBackgroundColor(CometChatTheme.getInstance().getPalette().getAccent50(getContext())); return view; } private SchedulerBubbleStyle getSchedulerBubbleStyle() { CometChatTheme theme = CometChatTheme.getInstance(getContext()); SchedulerBubbleStyle schedulerBubbleStyle = new SchedulerBubbleStyle(); - schedulerBubbleStyle.setAvatarStyle(new AvatarStyle().setOuterCornerRadius(100).setInnerBackgroundColor(theme.getPalette().getAccent600()).setTextColor(theme.getPalette().getAccent900()).setTextAppearance(theme.getTypography().getName())); - schedulerBubbleStyle.setCalenderStyle(new CalenderStyle().setTitleTextAppearance(theme.getTypography().getName()).setTitleTextColor(theme.getPalette().getAccent())); + schedulerBubbleStyle.setAvatarStyle(new AvatarStyle().setOuterCornerRadius(100).setInnerBackgroundColor(theme.getPalette().getAccent600(getContext())).setTextColor(theme.getPalette().getAccent900(getContext())).setTextAppearance(theme.getTypography().getName())); + schedulerBubbleStyle.setCalenderStyle(new CalenderStyle().setTitleTextAppearance(theme.getTypography().getName()).setTitleTextColor(theme.getPalette().getAccent(getContext()))); schedulerBubbleStyle.setTimeSlotSelectorStyle(new TimeSlotSelectorStyle() - .setCalenderImageTint(theme.getPalette().getAccent()) - .setEmptyTimeSlotIconColor(theme.getPalette().getAccent500()) + .setCalenderImageTint(theme.getPalette().getAccent(getContext())) + .setEmptyTimeSlotIconColor(theme.getPalette().getAccent500(getContext())) .setChosenDateTextAppearance(theme.getTypography().getSubtitle1()) - .setChosenDateTextColor(theme.getPalette().getAccent()) - .setSeparatorColor(theme.getPalette().getAccent100()) - .setTitleColor(theme.getPalette().getAccent()) + .setChosenDateTextColor(theme.getPalette().getAccent(getContext())) + .setSeparatorColor(theme.getPalette().getAccent100(getContext())) + .setTitleColor(theme.getPalette().getAccent(getContext())) .setTitleTextAppearance(theme.getTypography().getName()) - .setEmptyTimeSlotTextColor(theme.getPalette().getAccent500()) + .setEmptyTimeSlotTextColor(theme.getPalette().getAccent500(getContext())) .setEmptyTimeSlotTextAppearance(theme.getTypography().getText1()) ); - schedulerBubbleStyle.setSlotStyle(new TimeSlotItemStyle().setCornerRadius(20).setBackground(theme.getPalette().getBackground()).setTimeColor(theme.getPalette().getAccent())); - schedulerBubbleStyle.setSelectedSlotStyle(new TimeSlotItemStyle().setCornerRadius(20).setBackground(theme.getPalette().getPrimary()).setTimeColor(Color.WHITE)); + schedulerBubbleStyle.setSlotStyle(new TimeSlotItemStyle().setCornerRadius(20).setBackground(theme.getPalette().getBackground(getContext())).setTimeColor(theme.getPalette().getAccent(getContext()))); + schedulerBubbleStyle.setSelectedSlotStyle(new TimeSlotItemStyle().setCornerRadius(20).setBackground(theme.getPalette().getPrimary(getContext())).setTimeColor(Color.WHITE)); schedulerBubbleStyle.setScheduleStyle(new ScheduleStyle() .setProgressBarTintColor(Color.WHITE) - .setButtonBackgroundColor(theme.getPalette().getPrimary()) + .setButtonBackgroundColor(theme.getPalette().getPrimary(getContext())) .setButtonTextColor(Color.WHITE) - .setCalendarIconTint(theme.getPalette().getAccent()) - .setClockIconTint(theme.getPalette().getAccent()) - .setTimeZoneIconTint(theme.getPalette().getAccent()) - .setDurationTextColor(theme.getPalette().getAccent()) - .setTimeTextColor(theme.getPalette().getAccent()) - .setTimeZoneTextColor(theme.getPalette().getAccent()) - .setErrorTextColor(theme.getPalette().getError()) + .setCalendarIconTint(theme.getPalette().getAccent(getContext())) + .setClockIconTint(theme.getPalette().getAccent(getContext())) + .setTimeZoneIconTint(theme.getPalette().getAccent(getContext())) + .setDurationTextColor(theme.getPalette().getAccent(getContext())) + .setTimeTextColor(theme.getPalette().getAccent(getContext())) + .setTimeZoneTextColor(theme.getPalette().getAccent(getContext())) + .setErrorTextColor(theme.getPalette().getError(getContext())) .setButtonTextAppearance(theme.getTypography().getSubtitle1()) .setErrorTextAppearance(theme.getTypography().getCaption1()) .setDurationTextAppearance(theme.getTypography().getSubtitle1()) @@ -94,26 +94,26 @@ private SchedulerBubbleStyle getSchedulerBubbleStyle() { ); schedulerBubbleStyle.setTitleAppearance(theme.getTypography().getHeading()); schedulerBubbleStyle.setNameAppearance(theme.getTypography().getName()); - schedulerBubbleStyle.setNameColor(theme.getPalette().getAccent()); - schedulerBubbleStyle.setTitleColor(theme.getPalette().getAccent()); - schedulerBubbleStyle.setBackIconTint(theme.getPalette().getPrimary()); - schedulerBubbleStyle.setSubtitleTextColor(theme.getPalette().getAccent600()); - schedulerBubbleStyle.setClockIconTint(theme.getPalette().getAccent600()); + schedulerBubbleStyle.setNameColor(theme.getPalette().getAccent(getContext())); + schedulerBubbleStyle.setTitleColor(theme.getPalette().getAccent(getContext())); + schedulerBubbleStyle.setBackIconTint(theme.getPalette().getPrimary(getContext())); + schedulerBubbleStyle.setSubtitleTextColor(theme.getPalette().getAccent600(getContext())); + schedulerBubbleStyle.setClockIconTint(theme.getPalette().getAccent600(getContext())); schedulerBubbleStyle.setSubtitleTextAppearance(theme.getTypography().getSubtitle1()); - schedulerBubbleStyle.setSeparatorColor(theme.getPalette().getAccent100()); - schedulerBubbleStyle.setInitialSlotsItemStyle(new TimeSlotItemStyle().setBackground(theme.getPalette().getBackground()).setTimeColor(theme.getPalette().getPrimary()).setTimeTextAppearance(theme.getTypography().getSubtitle2()).setBorderColor(theme.getPalette().getPrimary()).setBorderWidth(2).setCornerRadius(25)); - schedulerBubbleStyle.setMoreTextColor(theme.getPalette().getPrimary()); - schedulerBubbleStyle.setDurationTimeTextColor(theme.getPalette().getAccent500()); - schedulerBubbleStyle.setGlobeIconTint(theme.getPalette().getAccent()); - schedulerBubbleStyle.setTimeZoneTextColor(theme.getPalette().getAccent()); + schedulerBubbleStyle.setSeparatorColor(theme.getPalette().getAccent100(getContext())); + schedulerBubbleStyle.setInitialSlotsItemStyle(new TimeSlotItemStyle().setBackground(theme.getPalette().getBackground(getContext())).setTimeColor(theme.getPalette().getPrimary(getContext())).setTimeTextAppearance(theme.getTypography().getSubtitle2()).setBorderColor(theme.getPalette().getPrimary(getContext())).setBorderWidth(2).setCornerRadius(25)); + schedulerBubbleStyle.setMoreTextColor(theme.getPalette().getPrimary(getContext())); + schedulerBubbleStyle.setDurationTimeTextColor(theme.getPalette().getAccent500(getContext())); + schedulerBubbleStyle.setGlobeIconTint(theme.getPalette().getAccent(getContext())); + schedulerBubbleStyle.setTimeZoneTextColor(theme.getPalette().getAccent(getContext())); schedulerBubbleStyle.setMoreTextAppearance(theme.getTypography().getSubtitle2()); schedulerBubbleStyle.setDurationTimeTextAppearance(theme.getTypography().getCaption1()); schedulerBubbleStyle.setTimeZoneTextAppearance(theme.getTypography().getSubtitle2()); - schedulerBubbleStyle.setQuickViewStyle(new QuickViewStyle().setCornerRadius(16).setBackground(theme.getPalette().getBackground()).setLeadingBarTint(theme.getPalette().getPrimary()).setTitleColor(theme.getPalette().getAccent()).setTitleAppearance(theme.getTypography().getText1()).setSubtitleColor(theme.getPalette().getAccent500()).setSubtitleAppearance(theme.getTypography().getSubtitle1())); + schedulerBubbleStyle.setQuickViewStyle(new QuickViewStyle().setCornerRadius(16).setBackground(theme.getPalette().getBackground(getContext())).setLeadingBarTint(theme.getPalette().getPrimary(getContext())).setTitleColor(theme.getPalette().getAccent(getContext())).setTitleAppearance(theme.getTypography().getText1()).setSubtitleColor(theme.getPalette().getAccent500(getContext())).setSubtitleAppearance(theme.getTypography().getSubtitle1())); schedulerBubbleStyle.setCornerRadius(10); schedulerBubbleStyle.setQuickSlotAvailableAppearance(theme.getTypography().getText1()); - schedulerBubbleStyle.setQuickSlotAvailableTextColor(theme.getPalette().getAccent500()); - schedulerBubbleStyle.setDisableColor(theme.getPalette().getAccent500()); + schedulerBubbleStyle.setQuickSlotAvailableTextColor(theme.getPalette().getAccent500(getContext())); + schedulerBubbleStyle.setDisableColor(theme.getPalette().getAccent500(getContext())); return schedulerBubbleStyle; } diff --git a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/TextBubbleFragment.java b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/TextBubbleFragment.java index ed016dd3..7190abc7 100644 --- a/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/TextBubbleFragment.java +++ b/app/src/main/java/com/cometchat/javasampleapp/fragments/shared/views/TextBubbleFragment.java @@ -18,14 +18,14 @@ public class TextBubbleFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_text_bubble, container, false); - CometChatTheme cometChatTheme = CometChatTheme.getInstance(getContext()); + CometChatTheme cometChatTheme = CometChatTheme.getInstance(); CometChatTextBubble receiverBubble = view.findViewById(R.id.receiver_bubble); receiverBubble.setText("Hi John, How are you?"); - receiverBubble.setStyle(new TextBubbleStyle().setBackground(cometChatTheme.getPalette().getAccent100()).setTextColor(cometChatTheme.getPalette().getAccent()).setCornerRadius(18)); + receiverBubble.setStyle(new TextBubbleStyle().setBackground(cometChatTheme.getPalette().getAccent100(getContext())).setTextColor(cometChatTheme.getPalette().getAccent(getContext())).setCornerRadius(18)); CometChatTextBubble senderBubble = view.findViewById(R.id.sender_bubble); senderBubble.setText("Hey Jack,I am fine. How about you?"); - senderBubble.setStyle(new TextBubbleStyle().setBackground(cometChatTheme.getPalette().getPrimary()).setTextColor(getResources().getColor(R.color.white)).setCornerRadius(18)); + senderBubble.setStyle(new TextBubbleStyle().setBackground(cometChatTheme.getPalette().getPrimary(getContext())).setTextColor(getResources().getColor(R.color.white)).setCornerRadius(18)); return view; } diff --git a/build.gradle b/build.gradle index 4a0042b4..7e3a085f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id 'com.android.application' version '7.4.2' apply false - id 'com.android.library' version '7.4.2' apply false + id 'com.android.application' version '8.3.1' apply false + id 'com.android.library' version '8.3.1' apply false } task clean(type: Delete) { diff --git a/gradle.properties b/gradle.properties index 6c50fce9..42b1192e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,4 +19,6 @@ android.enableJetifier=true # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d5e3b507..ab69ccff 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Apr 14 16:19:32 IST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME