Is it possible to make such design with xml using shape if yes how can I do it
and what is more efficiant for loading and memory image as png or drawable with a lot of shapes?

Asked
Active
Viewed 2,079 times
2
-
you can use 9 patch image – akhilesh0707 Jul 11 '17 at 07:45
2 Answers
2
You can draw triangle shape using XML triangle.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<rotate
android:fromDegrees="-45"
android:pivotX="270%"
android:pivotY="70%"
android:toDegrees="45">
<shape android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@android:color/transparent" />
<solid android:color="#ffffff" />
</shape>
</rotate>
</item>
</layer-list>
Edit: rotate shape
akhilesh0707
- 6,709
- 5
- 44
- 51
1
you can tileMode = repeat and for shape use this drawable vector and check this link
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<rotate
android:fromDegrees="45"
android:pivotX="-40%"
android:pivotY="50%"
android:toDegrees="90">
<shape android:shape="rectangle">
<stroke
android:width="-140dp"
android:color="@android:color/transparent" />
<solid android:color="@android:color/background_dark" />
</shape>
</rotate>
</item>
</layer-list>
Rasoul Miri
- 11,234
- 1
- 68
- 78

