replace the eraser icons with vectors

This commit is contained in:
tibbi 2021-12-29 11:57:10 +01:00
parent 827c08578c
commit 33716bb3f6
12 changed files with 39 additions and 4 deletions

View File

@ -14,7 +14,6 @@ import android.view.MenuItem
import android.view.WindowManager
import android.webkit.MimeTypeMap
import android.widget.SeekBar
import androidx.core.content.ContextCompat
import androidx.print.PrintHelper
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.dialogs.ConfirmationAdvancedDialog
@ -333,7 +332,13 @@ class MainActivity : SimpleActivity(), CanvasListener {
}
private fun updateEraserState() {
eraser.setImageDrawable(ContextCompat.getDrawable(this, if (isEraserOn) R.drawable.ic_eraser_on else R.drawable.ic_eraser_off))
val iconId = if (isEraserOn) {
R.drawable.ic_eraser_off_vector
} else {
R.drawable.ic_eraser_on_vector
}
eraser.setImageResource(iconId)
my_canvas.toggleEraser(isEraserOn)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="m16.782,14.8731 l-5.0471,5.0471c-1.56,1.56 -4.09,1.56 -5.66,0l-3.53,-3.53c-0.78,-0.79 -0.78,-2.05 0,-2.84L9.0007,7.0944m-5.0458,7.8758 l3.54,3.53c0.78,0.79 2.04,0.79 2.83,0l3.53,-3.53 -4.95,-4.95z" />
<path
android:fillColor="#FFFFFFFF"
android:pathData="m7.8687,20.0909c0.0003,0.5515 0.4461,0.9968 0.9976,0.9964l11.646,-0.0069c0.5515,-0.0003 0.9968,-0.4461 0.9964,-0.9976 -0.0003,-0.5515 -0.4461,-0.9968 -0.9976,-0.9964L8.8722,19.0862c-0.5515,0.0003 -1.0038,0.4532 -1.0035,1.0047z" />
<path
android:fillColor="#FFFFFFFF"
android:pathData="m2.3788,2.019c-0.4314,0.4314 -0.4314,1.1282 0,1.5596L20.4315,21.6414c0.4314,0.4314 1.1283,0.4314 1.5597,0 0.4314,-0.4314 0.4314,-1.1282 0,-1.5596L3.9495,2.019c-0.4314,-0.4314 -1.1394,-0.4314 -1.5708,0z" />
<path
android:fillColor="#FFFFFFFF"
android:pathData="m15.9748,2.9503 l4.95,4.94c0.78,0.79 0.78,2.05 0,2.84l-2.7176,2.7176c-7.7808,-7.7792 0,0 -7.7808,-7.7792l2.7184,-2.7184c0.79,-0.78 2.05,-0.78 2.83,0" />
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="m15.9748,2.9503 l4.95,4.94c0.78,0.79 0.78,2.05 0,2.84l-9.19,9.19c-1.56,1.56 -4.09,1.56 -5.66,0l-3.53,-3.53c-0.78,-0.79 -0.78,-2.05 0,-2.84L13.1448,2.9503c0.79,-0.78 2.05,-0.78 2.83,0M3.9548,14.9703l3.54,3.53c0.78,0.79 2.04,0.79 2.83,0l3.53,-3.53 -4.95,-4.95z" />
<path
android:fillColor="#FFFFFFFF"
android:pathData="m7.8687,20.0909c0.0003,0.5515 0.4461,0.9968 0.9976,0.9964l11.646,-0.0069c0.5515,-0.0003 0.9968,-0.4461 0.9964,-0.9976 -0.0003,-0.5515 -0.4461,-0.9968 -0.9976,-0.9964L8.8722,19.0862c-0.5515,0.0003 -1.0038,0.4532 -1.0035,1.0047z" />
</vector>

View File

@ -24,8 +24,8 @@
android:layout_width="@dimen/normal_icon_size"
android:layout_height="@dimen/normal_icon_size"
android:layout_toStartOf="@+id/eye_dropper"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_eraser_off" />
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_eraser_on_vector" />
<ImageView
android:id="@+id/eye_dropper"