Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.6.6 #353

Merged
merged 9 commits into from
Oct 31, 2022
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## CHANGE LOG.

### October 31, 2022
* [CleverTap Android SDK v4.6.6](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md)

### October 21, 2022
* [CleverTap Android SDK v4.6.5](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ We publish the SDK to `mavenCentral` as an `AAR` file. Just declare it as depend

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:4.6.5"
implementation "com.clevertap.android:clevertap-android-sdk:4.6.6"
}
```

Alternatively, you can download and add the AAR file included in this repo in your Module libs directory and tell gradle to install it like this:

```groovy
dependencies {
implementation (name: "clevertap-android-sdk-4.6.5", ext: 'aar')
implementation (name: "clevertap-android-sdk-4.6.6", ext: 'aar')
}
```

Expand All @@ -46,7 +46,7 @@ Add the Firebase Messaging library and Android Support Library v4 as dependencie

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:4.6.5"
implementation "com.clevertap.android:clevertap-android-sdk:4.6.6"
implementation "androidx.core:core:1.3.0"
implementation "com.google.firebase:firebase-messaging:21.0.0"
implementation "com.google.android.gms:play-services-ads:19.4.0" // Required only if you enable Google ADID collection in the SDK (turned off by default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1861,11 +1861,13 @@ public void messageDidClick(CTInboxActivity ctInboxActivity, CTInboxMessage inbo
coreState.getAnalyticsManager().pushInboxMessageStateEvent(true, inboxMessage, data);

if (keyValue != null && !keyValue.isEmpty()) {
Logger.v("clicked button of an inbox notification.");
if (inboxMessageButtonListener != null && inboxMessageButtonListener.get() != null) {
inboxMessageButtonListener.get().onInboxButtonClick(keyValue);
}
}
else{
Logger.v("clicked inbox notification.");
if (isBodyClick && inboxMessageListener != null && inboxMessageListener.get() != null) {
inboxMessageListener.get().onInboxItemClicked(inboxMessage);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.clevertap.android.sdk.inbox;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
Expand Down Expand Up @@ -60,8 +58,6 @@ public void onPageSelected(int position) {
}
}

private final ImageView carouselReadDot;

private final TextView carouselTimestamp;

private final RelativeLayout clickLayout;
Expand All @@ -75,7 +71,6 @@ public void onPageSelected(int position) {
imageViewPager = itemView.findViewById(R.id.image_carousel_viewpager);
sliderDots = itemView.findViewById(R.id.sliderDots);
carouselTimestamp = itemView.findViewById(R.id.carousel_timestamp);
carouselReadDot = itemView.findViewById(R.id.carousel_read_circle);
clickLayout = itemView.findViewById(R.id.body_linear_layout);
}

Expand All @@ -89,9 +84,9 @@ void configureWithMessage(final CTInboxMessage inboxMessage, final CTInboxListVi
CTInboxMessageContent content = inboxMessage.getInboxMessageContents().get(0);
this.carouselTimestamp.setVisibility(View.VISIBLE);
if (inboxMessage.isRead()) {
this.carouselReadDot.setVisibility(View.GONE);
this.readDot.setVisibility(View.GONE);
} else {
this.carouselReadDot.setVisibility(View.VISIBLE);
this.readDot.setVisibility(View.VISIBLE);
}
String carouselImageDisplayTimestamp = calculateDisplayTimestamp(inboxMessage.getDate());
this.carouselTimestamp.setText(carouselImageDisplayTimestamp);
Expand Down Expand Up @@ -121,26 +116,6 @@ void configureWithMessage(final CTInboxMessage inboxMessage, final CTInboxListVi
this.clickLayout.setOnClickListener(
new CTInboxButtonClickListener(position, inboxMessage, null, parentWeak, this.imageViewPager,true));

Runnable carouselRunnable = new Runnable() {
@Override
public void run() {
Activity activity = parent.getActivity();
if (activity == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (carouselReadDot.getVisibility() == View.VISIBLE) {
if (parentWeak != null) {
parentWeak.didShow(null, position);
}
}
}
});
}
};
Handler carouselHandler = new Handler();
carouselHandler.postDelayed(carouselRunnable, 2000);
markItemAsRead(inboxMessage, position);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.clevertap.android.sdk.inbox;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
Expand Down Expand Up @@ -72,9 +70,6 @@ public void onPageSelected(int position) {

private final CTCarouselViewPager imageViewPager;

private final ImageView readDot;

private ImageView carouselReadDot;

private final LinearLayout sliderDots;

Expand All @@ -93,7 +88,6 @@ public void onPageSelected(int position) {
title = itemView.findViewById(R.id.messageTitle);
message = itemView.findViewById(R.id.messageText);
timestamp = itemView.findViewById(R.id.timestamp);
readDot = itemView.findViewById(R.id.read_circle);
clickLayout = itemView.findViewById(R.id.body_linear_layout);
}

Expand Down Expand Up @@ -144,34 +138,6 @@ void configureWithMessage(final CTInboxMessage inboxMessage, final CTInboxListVi
this.clickLayout.setOnClickListener(
new CTInboxButtonClickListener(position, inboxMessage, null, parentWeak, this.imageViewPager,true));

Runnable carouselRunnable = new Runnable() {
@Override
public void run() {
Activity activity = parent.getActivity();
if (activity == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (inboxMessage.getType() == CTInboxMessageType.CarouselImageMessage) {
if (carouselReadDot.getVisibility() == View.VISIBLE) {
if (parentWeak != null) {
parentWeak.didShow(null, position);
}
}
} else {
if (readDot.getVisibility() == View.VISIBLE) {
if (parentWeak != null) {
parentWeak.didShow(null, position);
}
}
}
}
});
}
};
Handler carouselHandler = new Handler();
carouselHandler.postDelayed(carouselRunnable, 2000);
markItemAsRead(inboxMessage, position);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.clevertap.android.sdk.inbox;

import android.app.Activity;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
Expand Down Expand Up @@ -37,8 +35,6 @@ class CTIconMessageViewHolder extends CTInboxBaseMessageViewHolder {

private final LinearLayout ctaLinearLayout;

private final ImageView readDot;

private final ImageView iconImage;

private final TextView title;
Expand All @@ -54,7 +50,6 @@ class CTIconMessageViewHolder extends CTInboxBaseMessageViewHolder {
message = itemView.findViewById(R.id.messageText);
mediaImage = itemView.findViewById(R.id.media_image);
iconImage = itemView.findViewById(R.id.image_icon);
readDot = itemView.findViewById(R.id.read_circle);
timestamp = itemView.findViewById(R.id.timestamp);
cta1 = itemView.findViewById(R.id.cta_button_1);
cta2 = itemView.findViewById(R.id.cta_button_2);
Expand Down Expand Up @@ -372,28 +367,8 @@ void configureWithMessage(final CTInboxMessage inboxMessage, final CTInboxListVi
this.progressBarFrameLayout.setLayoutParams(new RelativeLayout.LayoutParams(width, height));

//New thread to remove the Read dot, mark message as read and raise Notification Viewed
Runnable iconRunnable = new Runnable() {
@Override
public void run() {
final CTInboxListViewFragment parent = getParent();
if (parent != null) {
Activity activity = parent.getActivity();
if (activity == null) {
return;
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (readDot.getVisibility() == View.VISIBLE) {
parent.didShow(null, position);
}
}
});
}
}
};
Handler iconHandler = new Handler();
iconHandler.postDelayed(iconRunnable, 2000);
markItemAsRead(inboxMessage, position);

try {
if (!content.getIcon().isEmpty()) {
iconImage.setVisibility(View.VISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* This activity shows the {@link CTInboxMessage} objects as per {@link CTInboxStyleConfig} style parameters
*/
@RestrictTo(Scope.LIBRARY)
public class CTInboxActivity extends FragmentActivity implements CTInboxListViewFragment.InboxListener, CTInboxListener {
public class CTInboxActivity extends FragmentActivity implements CTInboxListViewFragment.InboxListener {

public interface InboxActivityListener {

Expand All @@ -57,7 +57,6 @@ void messageDidClick(CTInboxActivity ctInboxActivity, CTInboxMessage inboxMessag

private WeakReference<InboxActivityListener> listenerWeakReference;
private CleverTapAPI cleverTapAPI;
private CTInboxListener inboxContentUpdatedListener = null;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -74,8 +73,6 @@ public void onCreate(Bundle savedInstanceState) {
cleverTapAPI = CleverTapAPI.instanceWithConfig(getApplicationContext(), config);
if (cleverTapAPI != null) {
setListener(cleverTapAPI);
inboxContentUpdatedListener = cleverTapAPI.getCTNotificationInboxListener();
cleverTapAPI.setCTNotificationInboxListener(this);
}
orientation = getResources().getConfiguration().orientation;
} catch (Throwable t) {
Expand Down Expand Up @@ -179,7 +176,6 @@ public void onTabReselected(TabLayout.Tab tab) {
public void onTabSelected(TabLayout.Tab tab) {
CTInboxListViewFragment fragment = (CTInboxListViewFragment) inboxTabAdapter
.getItem(tab.getPosition());
fragment.updateAdapterContent();
if (fragment.getMediaRecyclerView() != null) {
fragment.getMediaRecyclerView().onRestartPlayer();
}
Expand Down Expand Up @@ -213,54 +209,6 @@ protected void onDestroy() {
}


@Override
public void inboxDidInitialize() {

Logger.d("CTInboxActivity: called inboxDidInitialize");
if(inboxContentUpdatedListener !=null) {
inboxContentUpdatedListener.inboxDidInitialize();
}


}

@Override
public void inboxMessagesDidUpdate() {
Logger.v("CTInboxActivity|inboxMessagesDidUpdate called");
try {
boolean isCUListenerAvailable = inboxContentUpdatedListener != null;
Logger.v("CTInboxActivity|inboxMessagesDidUpdate: inboxContentUpdatedListener available:" + isCUListenerAvailable);

boolean isUsingMultipleTabs = styleConfig.isUsingTabs();
Logger.v("CTInboxActivity|inboxMessagesDidUpdate: isUsingMultipleTabs : " + isUsingMultipleTabs);

if (isCUListenerAvailable) {
inboxContentUpdatedListener.inboxMessagesDidUpdate();
}
if (isUsingMultipleTabs) {
int position = viewPager.getCurrentItem();
CTInboxListViewFragment fragment = (CTInboxListViewFragment) inboxTabAdapter.getItem(position);
fragment.updateAdapterContent();
}
else {
List<Fragment> fragments = getSupportFragmentManager().getFragments();
String singleTabTag = getFragmentTag();
for (Fragment f : fragments) {
String currentFTag = f.getTag();
if (f instanceof CTInboxListViewFragment && currentFTag != null && currentFTag.equalsIgnoreCase(singleTabTag)) {
((CTInboxListViewFragment) f).updateAdapterContent();
}
}

}

} catch (Throwable t) {
Logger.i("Something Went Wrong", t);
}


}

@Override
public void messageDidClick(Context baseContext, CTInboxMessage inboxMessage, Bundle data,
HashMap<String, String> keyValue, boolean isBodyClick) {
Expand Down
Loading