Skip to content

Commit

Permalink
Merge pull request #726 from CleverTap/develop
Browse files Browse the repository at this point in the history
Release core v7.2.0
  • Loading branch information
Anush-Shand authored Jan 6, 2025
2 parents b6193ee + e649cf3 commit c478ec7
Show file tree
Hide file tree
Showing 90 changed files with 2,440 additions and 2,199 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## CHANGE LOG.

### January 7, 2025
* [CleverTap Android SDK v7.2.0](docs/CTCORECHANGELOG.md)
* [CleverTap Push Templates SDK v1.3.0](docs/CTPUSHTEMPLATESCHANGELOG.md).
* [CleverTap Geofence SDK v1.4.0](docs/CTGEOFENCECHANGELOG.md)
* [CleverTap Huawei Push SDK v1.4.0](docs/CTHUAWEIPUSHCHANGELOG.md)

### December 24, 2024
* [CleverTap Android SDK v7.1.0](docs/CTCORECHANGELOG.md)

Expand Down
14 changes: 7 additions & 7 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:7.1.0"
implementation "com.clevertap.android:clevertap-android-sdk:7.2.0"
}
```

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-7.1.0", ext: 'aar')
implementation (name: "clevertap-android-sdk-7.2.0", ext: 'aar')
}
```

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

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:7.1.0"
implementation "androidx.core:core:1.9.0"
implementation "com.google.firebase:firebase-messaging:23.0.6"
implementation "com.clevertap.android:clevertap-android-sdk:7.2.0"
implementation "androidx.core:core:1.13.0"
implementation "com.google.firebase:firebase-messaging:24.0.0"
implementation "com.google.android.gms:play-services-ads:23.6.0" // Required only if you enable Google ADID collection in the SDK (turned off by default).
}
```
Expand All @@ -70,8 +70,8 @@ Also be sure to include the `google-services.json` classpath in your Project lev
}
dependencies {
classpath "com.android.tools.build:gradle:8.7.0"
classpath "com.google.gms:google-services:4.4.0"
classpath "com.android.tools.build:gradle:8.6.0"
classpath "com.google.gms:google-services:4.4.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ buildscript {

plugins {
alias(libs.plugins.sonarqube)
alias(libs.plugins.compose.compiler) apply false
}
allprojects {
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ import android.content.SharedPreferences
import android.location.Location
import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import android.view.View
import android.view.ViewGroup.MarginLayoutParams
import androidx.annotation.MainThread
import androidx.annotation.RequiresApi
import androidx.annotation.WorkerThread
import androidx.core.app.NotificationManagerCompat
import androidx.core.graphics.Insets
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updateLayoutParams
import com.clevertap.android.sdk.events.EventGroup.PUSH_NOTIFICATION_VIEWED
import com.clevertap.android.sdk.task.CTExecutorFactory
import org.json.JSONArray
Expand Down Expand Up @@ -307,3 +313,40 @@ fun String?.isNotNullAndBlank() : Boolean {
contract { returns(true) implies (this@isNotNullAndBlank != null) }
return isNullOrBlank().not()
}

/**
* Adjusts the margins of the view based on the system bar insets (such as the status bar, navigation bar,
* or display cutout) using the provided margin adjustment logic.
*
* This function sets a listener on the view to handle window insets and invokes the provided `marginAdjuster`
* block to allow custom margin adjustments. The `marginAdjuster` lambda receives the system bar insets and
* the view's margin layout parameters, allowing the caller to modify the margins as needed.
*
* @param marginAdjuster A lambda function that takes two parameters:
* - `bars`: The insets for system bars and display cutouts, representing the space occupied by UI elements
* such as the status bar or navigation bar.
* - `mlp`: The `MarginLayoutParams` of the view, which can be modified to adjust the margins based on the insets.
*
* Example usage:
* ```
* view.applyInsetsWithMarginAdjustment { insets, layoutParams ->
* layoutParams.leftMargin = insets.left
* layoutParams.rightMargin = insets.right
* layoutParams.topMargin = insets.top
* layoutParams.bottomMargin = insets.bottom
* }
* ```
*/
fun View.applyInsetsWithMarginAdjustment(marginAdjuster : (insets:Insets, mlp:MarginLayoutParams) -> Unit) {
ViewCompat.setOnApplyWindowInsetsListener(this
) { v, insets ->
val bars: Insets = insets.getInsets(
WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()
)
v.updateLayoutParams<MarginLayoutParams> {
marginAdjuster(bars,this)
}
WindowInsetsCompat.CONSUMED
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +1226,7 @@ public void promptForPushPermission(boolean showFallbackSettings){
private CleverTapAPI(final Context context, final CleverTapInstanceConfig config, String cleverTapID) {
this.context = context;

CoreState coreState = CleverTapFactory
.getCoreState(context, config, cleverTapID);
CoreState coreState = CleverTapFactory.getCoreState(context, config, cleverTapID);
setCoreState(coreState);
getConfigLogger().verbose(config.getAccountId() + ":async_deviceID", "CoreState is set");

Expand Down
Loading

0 comments on commit c478ec7

Please sign in to comment.