alexzhirkevich / custom-qr-generator

Android library for creating QR codes with logo, custom shapes, colors, background image. Powered by ZXing
MIT License
173 stars 18 forks source link

QrVectorLogo is not correctly showed #30

Closed sjavokhir closed 1 year ago

sjavokhir commented 1 year ago

Library version: 1.6.2 Android version: 13 (Samsung S21)

I'm using this vector image, that displays telegram logo

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="100dp"
    android:height="100dp"
    android:viewportWidth="100"
    android:viewportHeight="100">
    <group>
        <clip-path android:pathData="M50,0L50,0A50,50 0,0 1,100 50L100,50A50,50 0,0 1,50 100L50,100A50,50 0,0 1,0 50L0,50A50,50 0,0 1,50 0z" />
        <path
            android:fillColor="#ffffff"
            android:pathData="M50,0L50,0A50,50 0,0 1,100 50L100,50A50,50 0,0 1,50 100L50,100A50,50 0,0 1,0 50L0,50A50,50 0,0 1,50 0z" />
        <path
            android:fillColor="#34AADF"
            android:fillType="evenOdd"
            android:pathData="M100,0H0V100H100V0ZM50.32,77.64C65.41,77.64 77.64,65.41 77.64,50.32C77.64,35.23 65.41,23 50.32,23C35.23,23 23,35.23 23,50.32C23,65.41 35.23,77.64 50.32,77.64ZM33.38,52.24C33.38,52.24 31.5,51.02 34.71,49.72C34.71,49.72 48.24,43.96 52.94,41.94C54.74,41.13 60.84,38.53 60.84,38.53C60.84,38.53 63.66,37.4 63.42,40.15C63.36,40.97 63.02,43.27 62.6,46.11C62.44,47.2 62.26,48.37 62.09,49.56C61.15,55.64 60.14,62.29 60.14,62.29C60.14,62.29 59.98,64.16 58.65,64.48C57.32,64.81 55.13,63.35 54.74,63.02C54.67,62.97 54.36,62.76 53.88,62.44C52.18,61.28 48.43,58.74 46.84,57.34C46.29,56.86 45.66,55.88 46.92,54.75C49.73,52.07 53.09,48.75 55.13,46.64C56.07,45.67 57.01,43.4 53.09,46.15C47.54,50.13 42.06,53.86 42.06,53.86C42.06,53.86 40.81,54.67 38.47,53.94C36.12,53.21 33.38,52.24 33.38,52.24Z" />
    </group>
</vector>
logo {
    drawable = AppCompatResources.getDrawable(
        context, R.drawable.ic_logo_telegram
    )
    size = .25f
    padding = QrVectorLogoPadding.Natural(.2f)
    shape = QrVectorLogoShape.Default
}

Result. If you set the playback speed to 0.5, the first telegram logo is opened, then the qr code.

https://github.com/alexzhirkevich/custom-qr-generator/assets/49775105/716e1e35-8cae-4513-9182-8837b52b2f4f

alexzhirkevich commented 1 year ago

Works fine for me. Please create a minimal reproducible sample and share it on GitHub.

Screenshot 2023-06-19 at 02 18 02
sjavokhir commented 1 year ago

Yes, it works )