Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Layout is not drawn into canvas #27

Open
KieuQ opened this issue Oct 19, 2018 · 2 comments
Open

Layout is not drawn into canvas #27

KieuQ opened this issue Oct 19, 2018 · 2 comments

Comments

@KieuQ
Copy link

KieuQ commented Oct 19, 2018

DiagonalLayout renders fine but when I call view.draw(canvas), the DiagonalLayout is not drawn into the canvas

Bitmap b = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
v.draw(c);

heres the screenshots
before v.draw:
screenshot_2018-10-18-21-27-22
after v.draw:
screenshot_2018-10-18-21-27-27

@Adsama94
Copy link

Adsama94 commented Jan 31, 2019

I'm facing a similar issue. The diagonal layout is rendered perfectly in Android Studio but it doesn't work on my device nor the simulator.

Here is the view in Android Studio -

crop_studio

Here is the view on my device(Moto X 1st gen XT1052) -

screenshot_2019-01-31-12-40-24

@Adsama94
Copy link

I have found the issue and resolved it. The xml attribute was being picked up the wrong way.

<com.github.florent37.diagonallayout.DiagonalLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:diagonal="http://schemas.android.com/tools"
android:id="@+id/dl_top"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_alignParentTop="true"
**diagonal:diagonal_angle="25"**
diagonal:diagonal_direction="left"
diagonal:diagonal_position="bottom">

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="centerCrop"
    android:src="@drawable/b1" />
 </com.github.florent37.diagonallayout.DiagonalLayout>

The issue here was the the diagonal_angle attribute was supposed to be from the xmlns:app instead of the auto-picked xmlns:diagonal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants