Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/aep_ui_utils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
30 changes: 30 additions & 0 deletions code/aep_ui_utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("aep-library")
}

val mavenCoreVersion: String by project
val aepUIUtilsModuleName: String by project
val aepUIUtilsVersion: String by project
val aepUIUtilsMavenRepoName: String by project
val aepUIUtilsMavenRepoDescription: String by project


aepLibrary {
namespace = "com.adobe.marketing.mobile.aep_ui_utils"
moduleName = aepUIUtilsModuleName
moduleVersion = aepUIUtilsVersion
enableSpotless = true
enableCheckStyle = true
enableDokkaDoc = true

publishing {
mavenRepoName = aepUIUtilsMavenRepoName
mavenRepoDescription = aepUIUtilsMavenRepoDescription
gitRepoName = "aepsdk-ui-android"
addCoreDependency(mavenCoreVersion)
}
}

dependencies {
implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion")
}
Empty file.
21 changes: 21 additions & 0 deletions code/aep_ui_utils/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
3 changes: 3 additions & 0 deletions code/aep_ui_utils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

package com.adobe.marketing.mobile.utils

import android.graphics.Matrix
import com.adobe.marketing.mobile.utils.AEPUIImageConstants.DEFAULT_BITMAP_QUALITY
import com.adobe.marketing.mobile.utils.AEPUIImageConstants.DEFAULT_DOWNLOAD_TIMEOUT_SECS

class AEPUIImageConfig private constructor(builder: Builder) {
val urlList: List<String?>
val downloadTimeoutInSeconds: Int
val bitmapQuality: Int
val bitmapWidth: Float
val bitmapHeight: Float
val scaleToFit: Matrix.ScaleToFit

init {
this.urlList = builder.urlList
this.downloadTimeoutInSeconds = builder.downloadTimeoutInSeconds
this.bitmapQuality = builder.bitmapQuality
this.bitmapWidth = builder.bitmapWidth
this.bitmapHeight = builder.bitmapHeight
this.scaleToFit = builder.scaleToFit
}

class Builder(val bitmapWidth: Float, val bitmapHeight: Float) {
var urlList: List<String?> = listOf()
var downloadTimeoutInSeconds: Int = DEFAULT_DOWNLOAD_TIMEOUT_SECS
var bitmapQuality: Int = DEFAULT_BITMAP_QUALITY
var scaleToFit: Matrix.ScaleToFit = Matrix.ScaleToFit.CENTER

fun urlList(urlList: List<String?>) = apply { this.urlList = urlList }
fun downloadTimeoutInSeconds(downloadTimeoutInSeconds: Int) =
apply { this.downloadTimeoutInSeconds = downloadTimeoutInSeconds }

fun bitmapQuality(bitmapQuality: Int) = apply { this.bitmapQuality = bitmapQuality }
fun scaleToFit(scaleToFit: Matrix.ScaleToFit) = apply { this.scaleToFit = scaleToFit }

fun build() = AEPUIImageConfig(this)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

package com.adobe.marketing.mobile.utils

import java.util.concurrent.TimeUnit

object AEPUIImageConstants {
const val DEFAULT_BITMAP_QUALITY = 100
const val DEFAULT_DOWNLOAD_TIMEOUT_SECS = 10
const val AEP_UI_UTIL_LOG_TAG = "AEPUIUtils"
const val CACHE_BASE_DIR = "uiCacheDir"
const val PUSH_IMAGE_CACHE = "uiImageCache"
val IMAGE_CACHE_EXPIRY_IN_MILLISECONDS: Long = TimeUnit.DAYS.toMillis(3) // 3 days
}
Loading