Skip to content

Commit 4f34be7

Browse files
authored
Merge pull request #24 from rosuH/dev
v1.1.2
2 parents c13ff59 + 762bb8b commit 4f34be7

6 files changed

Lines changed: 39 additions & 30 deletions

File tree

app/build.gradle.kts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,27 @@ android {
4646
flavorDimensions("version")
4747

4848
productFlavors {
49-
create(googlePlay) {
50-
versionNameSuffix = "-${googlePlay}"
51-
}
52-
create(github) {
53-
versionNameSuffix = "-${github}"
54-
}
55-
create(coolApk) {
56-
versionNameSuffix = "-${coolApk}"
57-
}
49+
create(googlePlay)
50+
create(github)
51+
create(coolApk)
5852
create(others) {
5953
isDefault = true
60-
versionNameSuffix = "-${others}"
6154
}
6255
}
6356

6457
compileOptions {
6558
sourceCompatibility = JavaVersion.VERSION_1_8
6659
targetCompatibility = JavaVersion.VERSION_1_8
6760
}
61+
62+
applicationVariants.all {
63+
val variant = this
64+
variant.outputs
65+
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
66+
.forEach { output ->
67+
output.outputFileName = "ewm-v${variant.versionName}.apk"
68+
}
69+
}
6870
}
6971

7072
tasks.withType<KotlinCompile> {

app/src/main/java/me/rosuh/easywatermark/widget/ColoredImageVIew.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import android.graphics.*
77
import android.util.AttributeSet
88
import androidx.appcompat.widget.AppCompatImageView
99
import androidx.core.graphics.drawable.toBitmap
10-
import androidx.interpolator.view.animation.FastOutLinearInInterpolator
1110

1211

1312
class ColoredImageVIew : AppCompatImageView {
@@ -19,6 +18,7 @@ class ColoredImageVIew : AppCompatImageView {
1918
defStyleAttr
2019
)
2120

21+
private var sizeHasChanged: Boolean = true
2222
private val paint by lazy { Paint() }
2323

2424
private val colorList = arrayOf(
@@ -30,6 +30,8 @@ class ColoredImageVIew : AppCompatImageView {
3030

3131
private val posList = arrayOf(0f, 0.5178f, 0.7654f, 1f).toFloatArray()
3232

33+
private val xfermode by lazy { PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP) }
34+
3335
private val colorAnimator by lazy {
3436
ObjectAnimator.ofFloat(1f, 0f)
3537
.apply {
@@ -48,7 +50,6 @@ class ColoredImageVIew : AppCompatImageView {
4850
postInvalidateOnAnimation()
4951
}
5052
duration = 1200
51-
interpolator = FastOutLinearInInterpolator()
5253
repeatCount = ObjectAnimator.INFINITE
5354
repeatMode = ObjectAnimator.REVERSE
5455
}
@@ -57,16 +58,21 @@ class ColoredImageVIew : AppCompatImageView {
5758

5859
private var innerBitmap: Bitmap? = null
5960

61+
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
62+
super.onSizeChanged(w, h, oldw, oldh)
63+
sizeHasChanged = w != oldh || h != oldh
64+
}
65+
6066
@SuppressLint("DrawAllocation")
6167
override fun onDraw(canvas: Canvas?) {
62-
if (innerBitmap == null) {
68+
if (innerBitmap == null || (sizeHasChanged && width > 0 && height > 0)) {
6369
super.onDraw(canvas)
6470
innerBitmap = drawable.toBitmap(width, height)
6571
}
6672
innerBitmap?.let {
6773
val sc = canvas?.saveLayer(0f, 0f, width.toFloat(), height.toFloat(), null) ?: return
6874
canvas.drawBitmap(it, 0f, 0f, paint)
69-
paint.xfermode = PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP)
75+
paint.xfermode = xfermode
7076
canvas.drawRect(0f, 0f, width.toFloat(), height.toFloat(), paint)
7177
paint.xfermode = null
7278
canvas.restoreToCount(sc)

app/src/main/res/values-en/strings.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@
6666
<string name="dialog_change_log_title">Change log</string>
6767
<string name="dialog_change_log_content">
6868
Thank you for your feedback, the main update of this version is:\n\n
69+
<u><big>New</big></u> \n\n
70+
· Spanish \n\n
71+
Thank sguinetti \n\n
6972
<u><big>Repair</big></u> \n\n
70-
· Android Q and lower systems: failed to preview pictures\n\n · Android Q and lower systems: After the pictures are output, the media scan failed to be notified\n\n
71-
Thanks to reverieo_o, wong077 \n\n
73+
· Part of the ROM crashed due to animation
7274
</string>
7375
<string name="tips_not_app_can_open_imaegs">It looks like you have no file manager installed</string>
7476
<string name="tips_choose_other_file_type">Looks like you chose not a picture</string>

app/src/main/res/values-es/strings.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,15 @@
6565
<string name="dialog_change_log_title">Registro de cambios</string>
6666
<string name="dialog_change_log_content">
6767
Thank you for your feedback. The main update of this version is:\n\n
68-
<u><big>New</big></u> \n\n
69-
Options for adjusting transparency. Although on the left side of the preview area, sliding up and down can also be adjusted, but you don’t seem to like this method very much. 😄\n\n
70-
(Thanks: e**oc, la**r)\n\n
71-
<u><big>Adjustment</big></u> \n\n
72-
· The control panel is forbidden to slide to reduce the false touch of the adjustment parameters. \n
73-
· Used a brand new Icon, thanks to our designers! @Twowei \n\n
74-
<u><big>Fix</big></u> \n\n
75-
Fix the crash of some lower version phones when saving pictures problem. (Thanks: 2**9@qq.com, a**liang)\n
68+
<u><big>Nuevo</big> </u> \n\n
69+
· Español \n\n
70+
Gracias, sguinetti \n\n
71+
<u><big>Reparación</big> </u> \n\n
72+
· Parte de la ROM se bloqueó debido a la animación
7673
</string>
7774
<string name="tips_not_app_can_open_imaegs">Parece que no tienes un gestor de archivos instalado</string>
7875
<string name="tips_choose_other_file_type">Parece que no escogió una imagen</string>
7976
<string name="error_save_oom">Memoria insuficiente, limpie la caché y vuelva a intentarlo</string>
8077
<string name="error_share_uri_is_null">El Uri de salida está vacío, contacta con el desarrollador para enviar comentarios, gracias</string>
78+
<string name="tips_content_mode_button">Haga clic para editar texto o imagen</string>
8179
</resources>

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@
7676
<string name="contributor_info">当反馈的问题有效,并被修复或加入新版本时,您的名字或邮件出现在更新日志弹窗中。我们会对您的信息作遮挡处理,不会出现全称。\n 如果您不愿意出现,请标注:我不愿意。即可</string>
7777
<string name="dialog_change_log_content">
7878
感谢大家的反馈,此版本主要更新为:\n\n
79+
<u><big>新增</big></u> \n\n
80+
· 西班牙语 \n\n
81+
感谢 sguinetti \n\n
7982
<u><big>修复</big></u> \n\n
80-
· Android Q 以下的系统:预览图片失败的问题\n\n
81-
· Android Q 以下的系统:图片输出后,通知媒体扫描失败的问题 \n\n
82-
感谢 reverieo_o, wong077 \n\n
83+
· 部分 ROM 因为动画导致的崩溃
8384
</string>
8485
<string name="open_source_desc_compressor" translatable="false">"Compressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller sized photos with very less or negligible loss in quality of the image. "</string>
8586
<string name="open_source_desc_gif" translatable="false">Bundled GIFLib via JNI is used to render frames. This way should be more efficient than WebView or Movie classes.</string>

buildSrc/src/main/java/Dependencies.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ object Apps {
33
const val buildTools = "29.0.3"
44
const val minSdk = 22
55
const val targetSdk = 29
6-
const val versionCode = 10101
7-
const val versionName = "1.1.1"
6+
const val versionCode = 10102
7+
const val versionName = "1.1.2"
88
}
99

1010
object BuildTypes {
@@ -25,7 +25,7 @@ object Versions {
2525

2626
const val gap = "4.0.1"
2727

28-
const val kotlin = "1.4.0"
28+
const val kotlin = "1.4.10"
2929

3030
const val appcompat = "1.2.0"
3131

0 commit comments

Comments
 (0)