mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-06-07 14:54:05 +08:00
Compare commits
2 Commits
056adc6451
...
074b6eef45
Author | SHA1 | Date | |
---|---|---|---|
|
074b6eef45 | ||
|
fa04c1b3c9 |
7
.editorconfig
Normal file
7
.editorconfig
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[*]
|
||||||
|
indent_size = 2
|
||||||
|
max_line_length = off
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{kt, kts}]
|
||||||
|
kotlin_imports_layout = ascii
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -48,6 +48,9 @@ captures/
|
|||||||
.idea/modules.xml
|
.idea/modules.xml
|
||||||
.idea/navEditor.xml
|
.idea/navEditor.xml
|
||||||
.idea/markdown*
|
.idea/markdown*
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/inspectionProfiles/Project_Default.xml
|
||||||
|
.idea/compiler.xml
|
||||||
projectFilesBackup/
|
projectFilesBackup/
|
||||||
|
|
||||||
# Keystore files
|
# Keystore files
|
||||||
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,6 +1,17 @@
|
|||||||
Change Log
|
Change Log
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
Version 4.2.0 *(2020-09-15)*
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
Update:
|
||||||
|
- Compile & Target SDK Version 28 -> 30
|
||||||
|
- GPUImage 2.0.3 -> 2.0.4
|
||||||
|
- Glide 4.9.0 -> 4.11.0
|
||||||
|
|
||||||
|
Bugfix:
|
||||||
|
- RoundedCornersTransformation with DIAGONAL_FROM_TOP_LEFT does not work [#178](https://github.com/wasabeef/glide-transformations/pull/178)
|
||||||
|
|
||||||
Version 4.1.0 *(2019-08-15)*
|
Version 4.1.0 *(2019-08-15)*
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ Thanks
|
|||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Copyright 2018 Wasabeef
|
Copyright (C) 2020 Wasabeef
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
38
build.gradle
38
build.gradle
@ -1,27 +1,27 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.3.41'
|
kotlin_version = '1.3.72'
|
||||||
glide_version = '4.9.0'
|
glide_version = '4.11.0'
|
||||||
gpuimage_version = '2.0.3'
|
gpuimage_version = '2.0.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.0-alpha05'
|
classpath 'com.android.tools.build:gradle:4.2.0-alpha10'
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,61 +8,37 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion MIN_SDK_VERSION as int
|
minSdkVersion MIN_SDK_VERSION as int
|
||||||
targetSdkVersion TARGET_SDK_VERSION as int
|
targetSdkVersion TARGET_SDK_VERSION as int
|
||||||
versionCode "git rev-list origin/master --count".execute().text.toInteger()
|
versionCode VERSION_CODE as int
|
||||||
versionName VERSION_NAME
|
versionName VERSION_NAME
|
||||||
|
|
||||||
renderscriptTargetApi TARGET_SDK_VERSION as int
|
renderscriptTargetApi TARGET_SDK_VERSION as int
|
||||||
renderscriptSupportModeEnabled true
|
renderscriptSupportModeEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
// SigningConfigs
|
||||||
release {
|
apply from: '../signingConfigs/debug.gradle', to: android
|
||||||
storeFile file(keyStoreProperty)
|
|
||||||
keyAlias keyAliasProperty
|
|
||||||
storePassword keyStorePasswordProperty
|
|
||||||
keyPassword keyAliasPasswordProperty
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
debuggable true
|
debuggable true
|
||||||
zipAlignEnabled true
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
debuggable false
|
debuggable false
|
||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
||||||
shrinkResources true
|
shrinkResources true
|
||||||
signingConfig signingConfigs.release
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getKeyStoreProperty() {
|
|
||||||
return hasProperty('WASABEEF_KEYSTORE') ? WASABEEF_KEYSTORE : "debug.keystore"
|
|
||||||
}
|
|
||||||
|
|
||||||
def getKeyAliasProperty() {
|
|
||||||
return hasProperty('WASABEEF_KEYALIAS') ? WASABEEF_KEYALIAS : "android"
|
|
||||||
}
|
|
||||||
|
|
||||||
def getKeyStorePasswordProperty() {
|
|
||||||
return hasProperty('WASABEEF_KEYSTOREPASSWORD') ? WASABEEF_KEYSTOREPASSWORD : "androiddebugkey"
|
|
||||||
}
|
|
||||||
|
|
||||||
def getKeyAliasPasswordProperty() {
|
|
||||||
return hasProperty('WASABEEF_KEYALIASPASSWORD') ? WASABEEF_KEYALIASPASSWORD : "android"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':transformations')
|
implementation project(':transformations')
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation "com.github.bumptech.glide:glide:$glide_version"
|
implementation "com.github.bumptech.glide:glide:$glide_version"
|
||||||
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
||||||
implementation "jp.co.cyberagent.android:gpuimage:$gpuimage_version"
|
implementation "jp.co.cyberagent.android:gpuimage:$gpuimage_version"
|
||||||
implementation "androidx.appcompat:appcompat:1.1.0-rc01"
|
implementation "androidx.appcompat:appcompat:1.3.0-alpha02"
|
||||||
implementation "androidx.recyclerview:recyclerview:1.1.0-beta02"
|
implementation "androidx.recyclerview:recyclerview:1.2.0-alpha05"
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="jp.wasabeef.example.glide"
|
package="jp.wasabeef.example.glide">
|
||||||
>
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
tools:ignore="GoogleAppIndexingWarning">
|
tools:ignore="GoogleAppIndexingWarning">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name">
|
||||||
>
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.example.glide
|
package jp.wasabeef.example.glide
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -15,9 +15,9 @@ class MainActivity : AppCompatActivity() {
|
|||||||
findViewById<RecyclerView>(R.id.list).apply {
|
findViewById<RecyclerView>(R.id.list).apply {
|
||||||
layoutManager = LinearLayoutManager(context)
|
layoutManager = LinearLayoutManager(context)
|
||||||
adapter = MainAdapter(context, mutableListOf(
|
adapter = MainAdapter(context, mutableListOf(
|
||||||
Mask, NinePatchMask, RoundedCorners, CropTop, CropCenter, CropBottom, CropSquare, CropCircle,
|
Mask, NinePatchMask, RoundedCorners, CropTop, CropCenter, CropBottom, CropSquare, CropCircle,
|
||||||
CropCircleWithBorder, Grayscale, Blur, SupportRSBlur, Toon, Sepia, Contrast, Invert,
|
CropCircleWithBorder, Grayscale, Blur, SupportRSBlur, Toon, Sepia, Contrast, Invert,
|
||||||
Pixel, Sketch, Swirl, Brightness, Kuawahara, Vignette
|
Pixel, Sketch, Swirl, Brightness, Kuawahara, Vignette
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ import jp.wasabeef.glide.transformations.internal.Utils
|
|||||||
* Created by Wasabeef on 2015/01/11.
|
* Created by Wasabeef on 2015/01/11.
|
||||||
*/
|
*/
|
||||||
class MainAdapter(
|
class MainAdapter(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
private val dataSet: MutableList<Type>
|
private val dataSet: MutableList<Type>
|
||||||
) : RecyclerView.Adapter<MainAdapter.ViewHolder>() {
|
) : RecyclerView.Adapter<MainAdapter.ViewHolder>() {
|
||||||
|
|
||||||
enum class Type {
|
enum class Type {
|
||||||
@ -69,129 +69,129 @@ class MainAdapter(
|
|||||||
when (dataSet[position]) {
|
when (dataSet[position]) {
|
||||||
Mask -> {
|
Mask -> {
|
||||||
Glide.with(context)
|
Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(overrideOf(266.px, 252.px))
|
.apply(overrideOf(266.px, 252.px))
|
||||||
.apply(bitmapTransform(MultiTransformation<Bitmap>(CenterCrop(),
|
.apply(bitmapTransform(MultiTransformation<Bitmap>(CenterCrop(),
|
||||||
MaskTransformation(R.drawable.mask_starfish))))
|
MaskTransformation(R.drawable.mask_starfish))))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
}
|
}
|
||||||
NinePatchMask -> {
|
NinePatchMask -> {
|
||||||
Glide.with(context)
|
Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(overrideOf(300.px, 200.px))
|
.apply(overrideOf(300.px, 200.px))
|
||||||
.apply(bitmapTransform(MultiTransformation<Bitmap>(CenterCrop(),
|
.apply(bitmapTransform(MultiTransformation<Bitmap>(CenterCrop(),
|
||||||
MaskTransformation(R.drawable.mask_chat_right))))
|
MaskTransformation(R.drawable.mask_chat_right))))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
}
|
}
|
||||||
|
|
||||||
CropTop -> Glide.with(context)
|
CropTop -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.TOP)))
|
.apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.TOP)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
CropCenter -> Glide.with(context)
|
CropCenter -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.CENTER)))
|
.apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.CENTER)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
CropBottom -> Glide.with(context)
|
CropBottom -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.BOTTOM)))
|
.apply(bitmapTransform(CropTransformation(300.px, 100.px, CropType.BOTTOM)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
CropSquare -> Glide.with(context)
|
CropSquare -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(CropSquareTransformation()))
|
.apply(bitmapTransform(CropSquareTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
CropCircle -> Glide.with(context)
|
CropCircle -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(CropCircleTransformation()))
|
.apply(bitmapTransform(CropCircleTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
CropCircleWithBorder -> Glide.with(context)
|
CropCircleWithBorder -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(
|
.apply(bitmapTransform(
|
||||||
CropCircleWithBorderTransformation(Utils.toDp(4), Color.rgb(0, 145, 86))))
|
CropCircleWithBorderTransformation(Utils.toDp(4), Color.rgb(0, 145, 86))))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
ColorFilter -> Glide.with(context)
|
ColorFilter -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(ColorFilterTransformation(Color.argb(80, 255, 0, 0))))
|
.apply(bitmapTransform(ColorFilterTransformation(Color.argb(80, 255, 0, 0))))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Grayscale -> Glide.with(context)
|
Grayscale -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(GrayscaleTransformation()))
|
.apply(bitmapTransform(GrayscaleTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
RoundedCorners -> Glide.with(context)
|
RoundedCorners -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(RoundedCornersTransformation(45, 0,
|
.apply(bitmapTransform(RoundedCornersTransformation(120, 0,
|
||||||
RoundedCornersTransformation.CornerType.BOTTOM)))
|
RoundedCornersTransformation.CornerType.DIAGONAL_FROM_TOP_LEFT)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Blur -> Glide.with(context)
|
Blur -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(BlurTransformation(25)))
|
.apply(bitmapTransform(BlurTransformation(25)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
SupportRSBlur -> Glide.with(context)
|
SupportRSBlur -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(SupportRSBlurTransformation(25, 10)))
|
.apply(bitmapTransform(SupportRSBlurTransformation(25, 10)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Toon -> Glide.with(context)
|
Toon -> Glide.with(context)
|
||||||
.load(R.drawable.demo)
|
.load(R.drawable.demo)
|
||||||
.apply(bitmapTransform(ToonFilterTransformation()))
|
.apply(bitmapTransform(ToonFilterTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Sepia -> Glide.with(context)
|
Sepia -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(SepiaFilterTransformation()))
|
.apply(bitmapTransform(SepiaFilterTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Contrast -> Glide.with(context)
|
Contrast -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(ContrastFilterTransformation(2.0f)))
|
.apply(bitmapTransform(ContrastFilterTransformation(2.0f)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Invert -> Glide.with(context)
|
Invert -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(InvertFilterTransformation()))
|
.apply(bitmapTransform(InvertFilterTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Pixel -> Glide.with(context)
|
Pixel -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(PixelationFilterTransformation(20f)))
|
.apply(bitmapTransform(PixelationFilterTransformation(20f)))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Sketch -> Glide.with(context)
|
Sketch -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(SketchFilterTransformation()))
|
.apply(bitmapTransform(SketchFilterTransformation()))
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Swirl -> Glide.with(context)
|
Swirl -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(
|
.apply(bitmapTransform(
|
||||||
SwirlFilterTransformation(0.5f, 1.0f, PointF(0.5f, 0.5f))).dontAnimate())
|
SwirlFilterTransformation(0.5f, 1.0f, PointF(0.5f, 0.5f))).dontAnimate())
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Brightness -> Glide.with(context)
|
Brightness -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(BrightnessFilterTransformation(0.5f)).dontAnimate())
|
.apply(bitmapTransform(BrightnessFilterTransformation(0.5f)).dontAnimate())
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Kuawahara -> Glide.with(context)
|
Kuawahara -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(KuwaharaFilterTransformation(25)).dontAnimate())
|
.apply(bitmapTransform(KuwaharaFilterTransformation(25)).dontAnimate())
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
|
|
||||||
Vignette -> Glide.with(context)
|
Vignette -> Glide.with(context)
|
||||||
.load(R.drawable.check)
|
.load(R.drawable.check)
|
||||||
.apply(bitmapTransform(VignetteFilterTransformation(PointF(0.5f, 0.5f),
|
.apply(bitmapTransform(VignetteFilterTransformation(PointF(0.5f, 0.5f),
|
||||||
floatArrayOf(0.0f, 0.0f, 0.0f), 0f, 0.75f)).dontAnimate())
|
floatArrayOf(0.0f, 0.0f, 0.0f), 0f, 0.75f)).dontAnimate())
|
||||||
.into(holder.image)
|
.into(holder.image)
|
||||||
}
|
}
|
||||||
holder.title.text = dataSet[position].name
|
holder.title.text = dataSet[position].name
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/list"
|
android:id="@+id/list"
|
||||||
@ -13,6 +11,5 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
/>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
@ -19,8 +17,8 @@
|
|||||||
app:layout_constraintBottom_toTopOf="@+id/title"
|
app:layout_constraintBottom_toTopOf="@+id/title"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
/>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -30,6 +28,5 @@
|
|||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
/>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
@ -17,19 +17,13 @@ org.gradle.caching=true
|
|||||||
android.enableBuildCache=true
|
android.enableBuildCache=true
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
|
||||||
# Use R8 instead of ProGuard for code shrinking.
|
# Use R8 instead of ProGuard for code shrinking.
|
||||||
android.enableR8=true
|
android.enableR8=true
|
||||||
android.enableR8.fullMode=true
|
android.enableR8.fullMode=true
|
||||||
|
|
||||||
# Enable rudimentary R class namespacing where each library only contains
|
VERSION_NAME=4.2.0
|
||||||
# references to the resources it declares instead of declarations plus all
|
VERSION_CODE=420
|
||||||
# transitive dependency references.
|
|
||||||
android.namespacedRClass=true
|
|
||||||
|
|
||||||
VERSION_NAME=4.1.0
|
|
||||||
GROUP=jp.wasabeef
|
GROUP=jp.wasabeef
|
||||||
|
COMPILE_SDK_VERSION=30
|
||||||
COMPILE_SDK_VERSION=28
|
TARGET_SDK_VERSION=30
|
||||||
TARGET_SDK_VERSION=28
|
MIN_SDK_VERSION=14
|
||||||
MIN_SDK_VERSION=14
|
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
35
gradlew
vendored
35
gradlew
vendored
@ -82,6 +82,7 @@ esac
|
|||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
@ -125,10 +126,11 @@ if $darwin; then
|
|||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if $cygwin ; then
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
@ -154,19 +156,19 @@ if $cygwin ; then
|
|||||||
else
|
else
|
||||||
eval `echo args$i`="\"$arg\""
|
eval `echo args$i`="\"$arg\""
|
||||||
fi
|
fi
|
||||||
i=$((i+1))
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
case $i in
|
case $i in
|
||||||
(0) set -- ;;
|
0) set -- ;;
|
||||||
(1) set -- "$args0" ;;
|
1) set -- "$args0" ;;
|
||||||
(2) set -- "$args0" "$args1" ;;
|
2) set -- "$args0" "$args1" ;;
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -175,14 +177,9 @@ save () {
|
|||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
APP_ARGS=$(save "$@")
|
APP_ARGS=`save "$@"`
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
25
gradlew.bat
vendored
25
gradlew.bat
vendored
@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
|||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
@ -51,7 +54,7 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
@ -61,28 +64,14 @@ echo location of your Java installation.
|
|||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
14
signingConfigs/debug.gradle
Normal file
14
signingConfigs/debug.gradle
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
signingConfigs {
|
||||||
|
debug {
|
||||||
|
storeFile file("debug.keystore")
|
||||||
|
storePassword "android"
|
||||||
|
keyAlias "androiddebugkey"
|
||||||
|
keyPassword "android"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// $ keytool -v -list -keystore
|
||||||
|
// Certificate fingerprints:
|
||||||
|
// MD5: 28:22:7C:A4:B9:2F:6E:C7:D5:58:62:48:EB:7E:82:C3
|
||||||
|
// SHA1: 94:25:A9:50:9C:0E:AE:AA:00:37:5E:D6:71:E3:BC:ED:17:E5:0C:A3
|
||||||
|
// SHA256: 04:92:39:09:3D:1C:B6:16:BE:55:58:A3:5F:3B:BB:CB:0B:E7:F1:DA:AA:26:C5:2D:BD:2F:44:CF:AE:47:CF:87
|
BIN
signingConfigs/debug.keystore
Normal file
BIN
signingConfigs/debug.keystore
Normal file
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* Copyright 2014 Google, Inc. All rights reserved.
|
* Copyright 2014 Google, Inc. All rights reserved.
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -40,8 +40,8 @@ public abstract class BitmapTransformation implements Transformation<Bitmap> {
|
|||||||
int outWidth, int outHeight) {
|
int outWidth, int outHeight) {
|
||||||
if (!Util.isValidDimensions(outWidth, outHeight)) {
|
if (!Util.isValidDimensions(outWidth, outHeight)) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Cannot apply transformation on width: " + outWidth + " or height: " + outHeight
|
"Cannot apply transformation on width: " + outWidth + " or height: " + outHeight
|
||||||
+ " less than or equal to zero and not Target.SIZE_ORIGINAL");
|
+ " less than or equal to zero and not Target.SIZE_ORIGINAL");
|
||||||
}
|
}
|
||||||
BitmapPool bitmapPool = Glide.get(context).getBitmapPool();
|
BitmapPool bitmapPool = Glide.get(context).getBitmapPool();
|
||||||
Bitmap toTransform = resource.get();
|
Bitmap toTransform = resource.get();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -33,7 +33,7 @@ public class BlurTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.BlurTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.BlurTransformation." + VERSION;
|
||||||
|
|
||||||
private static int MAX_RADIUS = 25;
|
private static int MAX_RADIUS = 25;
|
||||||
private static int DEFAULT_DOWN_SAMPLING = 1;
|
private static int DEFAULT_DOWN_SAMPLING = 1;
|
||||||
@ -86,8 +86,8 @@ public class BlurTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof BlurTransformation &&
|
return o instanceof BlurTransformation &&
|
||||||
((BlurTransformation) o).radius == radius &&
|
((BlurTransformation) o).radius == radius &&
|
||||||
((BlurTransformation) o).sampling == sampling;
|
((BlurTransformation) o).sampling == sampling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -33,7 +33,7 @@ public class ColorFilterTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.ColorFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.ColorFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private int color;
|
private int color;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ public class ColorFilterTransformation extends BitmapTransformation {
|
|||||||
int height = toTransform.getHeight();
|
int height = toTransform.getHeight();
|
||||||
|
|
||||||
Bitmap.Config config =
|
Bitmap.Config config =
|
||||||
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
|
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
|
||||||
Bitmap bitmap = pool.get(width, height, config);
|
Bitmap bitmap = pool.get(width, height, config);
|
||||||
|
|
||||||
setCanvasBitmapDensity(toTransform, bitmap);
|
setCanvasBitmapDensity(toTransform, bitmap);
|
||||||
@ -70,7 +70,7 @@ public class ColorFilterTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof ColorFilterTransformation &&
|
return o instanceof ColorFilterTransformation &&
|
||||||
((ColorFilterTransformation) o).color == color;
|
((ColorFilterTransformation) o).color == color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -35,7 +35,7 @@ public class CropCircleTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.CropCircleTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.CropCircleTransformation." + VERSION;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,
|
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,
|
||||||
|
@ -17,7 +17,7 @@ import java.security.MessageDigest;
|
|||||||
import jp.wasabeef.glide.transformations.internal.Utils;
|
import jp.wasabeef.glide.transformations.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -68,10 +68,10 @@ public class CropCircleWithBorderTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
Canvas canvas = new Canvas(bitmap);
|
Canvas canvas = new Canvas(bitmap);
|
||||||
canvas.drawCircle(
|
canvas.drawCircle(
|
||||||
outWidth / 2f,
|
outWidth / 2f,
|
||||||
outHeight / 2f,
|
outHeight / 2f,
|
||||||
Math.max(outWidth, outHeight) / 2f - borderSize / 2f,
|
Math.max(outWidth, outHeight) / 2f - borderSize / 2f,
|
||||||
paint
|
paint
|
||||||
);
|
);
|
||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
@ -85,12 +85,12 @@ public class CropCircleWithBorderTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof CropCircleWithBorderTransformation &&
|
return o instanceof CropCircleWithBorderTransformation &&
|
||||||
((CropCircleWithBorderTransformation) o).borderSize == borderSize &&
|
((CropCircleWithBorderTransformation) o).borderSize == borderSize &&
|
||||||
((CropCircleWithBorderTransformation) o).borderColor == borderColor;
|
((CropCircleWithBorderTransformation) o).borderColor == borderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return ID.hashCode() + borderSize * 100 + borderColor + 10;
|
return ID.hashCode() + borderSize * 100 + borderColor + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -30,7 +30,7 @@ public class CropSquareTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.CropSquareTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.CropSquareTransformation." + VERSION;
|
||||||
|
|
||||||
private int size;
|
private int size;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -61,7 +61,7 @@ public class CropTransformation extends BitmapTransformation {
|
|||||||
height = height == 0 ? toTransform.getHeight() : height;
|
height = height == 0 ? toTransform.getHeight() : height;
|
||||||
|
|
||||||
Bitmap.Config config =
|
Bitmap.Config config =
|
||||||
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
|
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
|
||||||
Bitmap bitmap = pool.get(width, height, config);
|
Bitmap bitmap = pool.get(width, height, config);
|
||||||
|
|
||||||
bitmap.setHasAlpha(true);
|
bitmap.setHasAlpha(true);
|
||||||
@ -105,9 +105,9 @@ public class CropTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof CropTransformation &&
|
return o instanceof CropTransformation &&
|
||||||
((CropTransformation) o).width == width &&
|
((CropTransformation) o).width == width &&
|
||||||
((CropTransformation) o).height == height &&
|
((CropTransformation) o).height == height &&
|
||||||
((CropTransformation) o).cropType == cropType;
|
((CropTransformation) o).cropType == cropType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -33,7 +33,7 @@ public class GrayscaleTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.GrayscaleTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.GrayscaleTransformation." + VERSION;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,
|
protected Bitmap transform(@NonNull Context context, @NonNull BitmapPool pool,
|
||||||
@ -42,7 +42,7 @@ public class GrayscaleTransformation extends BitmapTransformation {
|
|||||||
int height = toTransform.getHeight();
|
int height = toTransform.getHeight();
|
||||||
|
|
||||||
Bitmap.Config config =
|
Bitmap.Config config =
|
||||||
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
|
toTransform.getConfig() != null ? toTransform.getConfig() : Bitmap.Config.ARGB_8888;
|
||||||
Bitmap bitmap = pool.get(width, height, config);
|
Bitmap bitmap = pool.get(width, height, config);
|
||||||
|
|
||||||
setCanvasBitmapDensity(toTransform, bitmap);
|
setCanvasBitmapDensity(toTransform, bitmap);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -36,7 +36,7 @@ public class MaskTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.MaskTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.MaskTransformation." + VERSION;
|
||||||
|
|
||||||
private static Paint paint = new Paint();
|
private static Paint paint = new Paint();
|
||||||
private int maskId;
|
private int maskId;
|
||||||
@ -83,7 +83,7 @@ public class MaskTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof MaskTransformation &&
|
return o instanceof MaskTransformation &&
|
||||||
((MaskTransformation) o).maskId == maskId;
|
((MaskTransformation) o).maskId == maskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -136,47 +136,47 @@ public class RoundedCornersTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private void drawTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,
|
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin + radius, margin + radius, bottom), paint);
|
canvas.drawRect(new RectF(margin, margin + radius, margin + radius, bottom), paint);
|
||||||
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
|
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,
|
canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);
|
canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);
|
||||||
canvas.drawRect(new RectF(right - radius, margin + radius, right, bottom), paint);
|
canvas.drawRect(new RectF(right - radius, margin + radius, right, bottom), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,
|
canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin, margin + diameter, bottom - radius), paint);
|
canvas.drawRect(new RectF(margin, margin, margin + diameter, bottom - radius), paint);
|
||||||
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
|
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawBottomRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawBottomRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,
|
canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);
|
canvas.drawRect(new RectF(margin, margin, right - radius, bottom), paint);
|
||||||
canvas.drawRect(new RectF(right - radius, margin, right, bottom - radius), paint);
|
canvas.drawRect(new RectF(right - radius, margin, right, bottom - radius), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawTopRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawTopRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRect(new RectF(margin, margin + radius, right, bottom), paint);
|
canvas.drawRect(new RectF(margin, margin + radius, right, bottom), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawBottomRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawBottomRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRect(new RectF(margin, margin, right, bottom - radius), paint);
|
canvas.drawRect(new RectF(margin, margin, right, bottom - radius), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
|
canvas.drawRect(new RectF(margin + radius, margin, right, bottom), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,22 +187,22 @@ public class RoundedCornersTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private void drawOtherTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawOtherTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);
|
canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);
|
canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawOtherTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawOtherTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, bottom - diameter, right, bottom), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);
|
canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawOtherBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
private void drawOtherBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);
|
canvas.drawRoundRect(new RectF(right - diameter, margin, right, bottom), radius, radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);
|
canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);
|
||||||
}
|
}
|
||||||
@ -210,28 +210,28 @@ public class RoundedCornersTransformation extends BitmapTransformation {
|
|||||||
private void drawOtherBottomRightRoundRect(Canvas canvas, Paint paint, float right,
|
private void drawOtherBottomRightRoundRect(Canvas canvas, Paint paint, float right,
|
||||||
float bottom) {
|
float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, margin, right, margin + diameter), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
|
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, bottom), radius, radius,
|
||||||
paint);
|
paint);
|
||||||
canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);
|
canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawDiagonalFromTopLeftRoundRect(Canvas canvas, Paint paint, float right,
|
private void drawDiagonalFromTopLeftRoundRect(Canvas canvas, Paint paint, float right,
|
||||||
float bottom) {
|
float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,
|
canvas.drawRoundRect(new RectF(margin, margin, margin + diameter, margin + diameter), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,
|
canvas.drawRoundRect(new RectF(right - diameter, bottom - diameter, right, bottom), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin + radius, right - diameter, bottom), paint);
|
canvas.drawRect(new RectF(margin, margin + radius, right - radius, bottom), paint);
|
||||||
canvas.drawRect(new RectF(margin + diameter, margin, right, bottom - radius), paint);
|
canvas.drawRect(new RectF(margin + radius, margin, right, bottom - radius), paint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawDiagonalFromTopRightRoundRect(Canvas canvas, Paint paint, float right,
|
private void drawDiagonalFromTopRightRoundRect(Canvas canvas, Paint paint, float right,
|
||||||
float bottom) {
|
float bottom) {
|
||||||
canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,
|
canvas.drawRoundRect(new RectF(right - diameter, margin, right, margin + diameter), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,
|
canvas.drawRoundRect(new RectF(margin, bottom - diameter, margin + diameter, bottom), radius,
|
||||||
radius, paint);
|
radius, paint);
|
||||||
canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);
|
canvas.drawRect(new RectF(margin, margin, right - radius, bottom - radius), paint);
|
||||||
canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);
|
canvas.drawRect(new RectF(margin + radius, margin + radius, right, bottom), paint);
|
||||||
}
|
}
|
||||||
@ -239,16 +239,16 @@ public class RoundedCornersTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "RoundedTransformation(radius=" + radius + ", margin=" + margin + ", diameter="
|
return "RoundedTransformation(radius=" + radius + ", margin=" + margin + ", diameter="
|
||||||
+ diameter + ", cornerType=" + cornerType.name() + ")";
|
+ diameter + ", cornerType=" + cornerType.name() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof RoundedCornersTransformation &&
|
return o instanceof RoundedCornersTransformation &&
|
||||||
((RoundedCornersTransformation) o).radius == radius &&
|
((RoundedCornersTransformation) o).radius == radius &&
|
||||||
((RoundedCornersTransformation) o).diameter == diameter &&
|
((RoundedCornersTransformation) o).diameter == diameter &&
|
||||||
((RoundedCornersTransformation) o).margin == margin &&
|
((RoundedCornersTransformation) o).margin == margin &&
|
||||||
((RoundedCornersTransformation) o).cornerType == cornerType;
|
((RoundedCornersTransformation) o).cornerType == cornerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations;
|
package jp.wasabeef.glide.transformations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -36,7 +36,7 @@ public class SupportRSBlurTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.SupportRSBlurTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.SupportRSBlurTransformation." + VERSION;
|
||||||
|
|
||||||
private static int MAX_RADIUS = 25;
|
private static int MAX_RADIUS = 25;
|
||||||
private static int DEFAULT_DOWN_SAMPLING = 1;
|
private static int DEFAULT_DOWN_SAMPLING = 1;
|
||||||
@ -99,8 +99,8 @@ public class SupportRSBlurTransformation extends BitmapTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof SupportRSBlurTransformation &&
|
return o instanceof SupportRSBlurTransformation &&
|
||||||
((SupportRSBlurTransformation) o).radius == radius &&
|
((SupportRSBlurTransformation) o).radius == radius &&
|
||||||
((SupportRSBlurTransformation) o).sampling == sampling;
|
((SupportRSBlurTransformation) o).sampling == sampling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -29,7 +29,7 @@ public class BrightnessFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.BrightnessFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.BrightnessFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private float brightness;
|
private float brightness;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ public class BrightnessFilterTransformation extends GPUFilterTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof BrightnessFilterTransformation &&
|
return o instanceof BrightnessFilterTransformation &&
|
||||||
((BrightnessFilterTransformation) o).brightness == brightness;
|
((BrightnessFilterTransformation) o).brightness == brightness;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -29,7 +29,7 @@ public class ContrastFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.ContrastFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.ContrastFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private float contrast;
|
private float contrast;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -33,7 +33,7 @@ public class GPUFilterTransformation extends BitmapTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.GPUFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.GPUFilterTransformation." + VERSION;
|
||||||
private static final byte[] ID_BYTES = ID.getBytes(CHARSET);
|
private static final byte[] ID_BYTES = ID.getBytes(CHARSET);
|
||||||
|
|
||||||
private GPUImageFilter gpuImageFilter;
|
private GPUImageFilter gpuImageFilter;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -29,7 +29,7 @@ public class InvertFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.InvertFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.InvertFilterTransformation." + VERSION;
|
||||||
|
|
||||||
public InvertFilterTransformation() {
|
public InvertFilterTransformation() {
|
||||||
super(new GPUImageColorInvertFilter());
|
super(new GPUImageColorInvertFilter());
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -24,7 +24,7 @@ import jp.co.cyberagent.android.gpuimage.filter.GPUImageKuwaharaFilter;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Kuwahara all the colors in the image.
|
* Kuwahara all the colors in the image.
|
||||||
*
|
* <p>
|
||||||
* The radius to sample from when creating the brush-stroke effect, with a default of 25.
|
* The radius to sample from when creating the brush-stroke effect, with a default of 25.
|
||||||
* The larger the radius, the slower the filter.
|
* The larger the radius, the slower the filter.
|
||||||
*/
|
*/
|
||||||
@ -32,7 +32,7 @@ public class KuwaharaFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.KuwaharaFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.KuwaharaFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private int radius;
|
private int radius;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -24,14 +24,14 @@ import jp.co.cyberagent.android.gpuimage.filter.GPUImagePixelationFilter;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies a Pixelation effect to the image.
|
* Applies a Pixelation effect to the image.
|
||||||
*
|
* <p>
|
||||||
* The pixel with a default of 10.0.
|
* The pixel with a default of 10.0.
|
||||||
*/
|
*/
|
||||||
public class PixelationFilterTransformation extends GPUFilterTransformation {
|
public class PixelationFilterTransformation extends GPUFilterTransformation {
|
||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.PixelationFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.PixelationFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private float pixel;
|
private float pixel;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -31,7 +31,7 @@ public class SepiaFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private float intensity;
|
private float intensity;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -26,7 +26,7 @@ public class SketchFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation." + VERSION;
|
||||||
|
|
||||||
public SketchFilterTransformation() {
|
public SketchFilterTransformation() {
|
||||||
super(new GPUImageSketchFilter());
|
super(new GPUImageSketchFilter());
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -31,7 +31,7 @@ public class SwirlFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.SwirlFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.SwirlFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private float radius;
|
private float radius;
|
||||||
private float angle;
|
private float angle;
|
||||||
@ -60,15 +60,15 @@ public class SwirlFilterTransformation extends GPUFilterTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SwirlFilterTransformation(radius=" + radius + ",angle=" + angle + ",center="
|
return "SwirlFilterTransformation(radius=" + radius + ",angle=" + angle + ",center="
|
||||||
+ center.toString() + ")";
|
+ center.toString() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof SwirlFilterTransformation &&
|
return o instanceof SwirlFilterTransformation &&
|
||||||
((SwirlFilterTransformation) o).radius == radius &&
|
((SwirlFilterTransformation) o).radius == radius &&
|
||||||
((SwirlFilterTransformation) o).angle == radius &&
|
((SwirlFilterTransformation) o).angle == radius &&
|
||||||
((SwirlFilterTransformation) o).center.equals(center.x, center.y);
|
((SwirlFilterTransformation) o).center.equals(center.x, center.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -31,7 +31,7 @@ public class ToonFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.ToonFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.ToonFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private float threshold;
|
private float threshold;
|
||||||
private float quantizationLevels;
|
private float quantizationLevels;
|
||||||
@ -52,14 +52,14 @@ public class ToonFilterTransformation extends GPUFilterTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ToonFilterTransformation(threshold=" + threshold + ",quantizationLevels="
|
return "ToonFilterTransformation(threshold=" + threshold + ",quantizationLevels="
|
||||||
+ quantizationLevels + ")";
|
+ quantizationLevels + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof ToonFilterTransformation &&
|
return o instanceof ToonFilterTransformation &&
|
||||||
((ToonFilterTransformation) o).threshold == threshold &&
|
((ToonFilterTransformation) o).threshold == threshold &&
|
||||||
((ToonFilterTransformation) o).quantizationLevels == quantizationLevels;
|
((ToonFilterTransformation) o).quantizationLevels == quantizationLevels;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package jp.wasabeef.glide.transformations.gpu;
|
package jp.wasabeef.glide.transformations.gpu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -34,7 +34,7 @@ public class VignetteFilterTransformation extends GPUFilterTransformation {
|
|||||||
|
|
||||||
private static final int VERSION = 1;
|
private static final int VERSION = 1;
|
||||||
private static final String ID =
|
private static final String ID =
|
||||||
"jp.wasabeef.glide.transformations.gpu.VignetteFilterTransformation." + VERSION;
|
"jp.wasabeef.glide.transformations.gpu.VignetteFilterTransformation." + VERSION;
|
||||||
|
|
||||||
private PointF center;
|
private PointF center;
|
||||||
private float[] vignetteColor;
|
private float[] vignetteColor;
|
||||||
@ -61,22 +61,22 @@ public class VignetteFilterTransformation extends GPUFilterTransformation {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VignetteFilterTransformation(center=" + center.toString() + ",color=" + Arrays.toString(
|
return "VignetteFilterTransformation(center=" + center.toString() + ",color=" + Arrays.toString(
|
||||||
vignetteColor) + ",start=" + vignetteStart + ",end=" + vignetteEnd + ")";
|
vignetteColor) + ",start=" + vignetteStart + ",end=" + vignetteEnd + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
return o instanceof VignetteFilterTransformation &&
|
return o instanceof VignetteFilterTransformation &&
|
||||||
((VignetteFilterTransformation) o).center.equals(center.x, center.y) &&
|
((VignetteFilterTransformation) o).center.equals(center.x, center.y) &&
|
||||||
Arrays.equals(((VignetteFilterTransformation) o).vignetteColor, vignetteColor) &&
|
Arrays.equals(((VignetteFilterTransformation) o).vignetteColor, vignetteColor) &&
|
||||||
((VignetteFilterTransformation) o).vignetteStart == vignetteStart &&
|
((VignetteFilterTransformation) o).vignetteStart == vignetteStart &&
|
||||||
((VignetteFilterTransformation) o).vignetteEnd == vignetteEnd;
|
((VignetteFilterTransformation) o).vignetteEnd == vignetteEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return ID.hashCode() + center.hashCode() + Arrays.hashCode(vignetteColor) +
|
return ID.hashCode() + center.hashCode() + Arrays.hashCode(vignetteColor) +
|
||||||
(int) (vignetteStart * 100) + (int) (vignetteEnd * 10);
|
(int) (vignetteStart * 100) + (int) (vignetteEnd * 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,7 +3,7 @@ package jp.wasabeef.glide.transformations.internal;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -254,4 +254,4 @@ public class FastBlur {
|
|||||||
|
|
||||||
return (bitmap);
|
return (bitmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import android.renderscript.RenderScript;
|
|||||||
import android.renderscript.ScriptIntrinsicBlur;
|
import android.renderscript.ScriptIntrinsicBlur;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -38,7 +38,7 @@ public class RSBlur {
|
|||||||
rs = RenderScript.create(context);
|
rs = RenderScript.create(context);
|
||||||
rs.setMessageHandler(new RenderScript.RSMessageHandler());
|
rs.setMessageHandler(new RenderScript.RSMessageHandler());
|
||||||
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
|
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
|
||||||
Allocation.USAGE_SCRIPT);
|
Allocation.USAGE_SCRIPT);
|
||||||
output = Allocation.createTyped(rs, input.getType());
|
output = Allocation.createTyped(rs, input.getType());
|
||||||
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
|
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import androidx.renderscript.RenderScript;
|
|||||||
import androidx.renderscript.ScriptIntrinsicBlur;
|
import androidx.renderscript.ScriptIntrinsicBlur;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -39,7 +39,7 @@ public class SupportRSBlur {
|
|||||||
rs = RenderScript.create(context);
|
rs = RenderScript.create(context);
|
||||||
rs.setMessageHandler(new RenderScript.RSMessageHandler());
|
rs.setMessageHandler(new RenderScript.RSMessageHandler());
|
||||||
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
|
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
|
||||||
Allocation.USAGE_SCRIPT);
|
Allocation.USAGE_SCRIPT);
|
||||||
output = Allocation.createTyped(rs, input.getType());
|
output = Allocation.createTyped(rs, input.getType());
|
||||||
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
|
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2019 Wasabeef
|
* Copyright (C) 2020 Wasabeef
|
||||||
* <p>
|
* <p>
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user