Files
NativeScript/apps/ui/src/css/background-image-page.xml
Sébastien JEAN 8e76bbe251 fix(android): StringIndexOutOfBoundsException with invalid drawables (#9563)
* fix(android/application): org.nativescript.widgets.Utils::getDrawable

* chore: fix spacing

* fix(android/application): do not load empty path

Co-authored-by: Igor Randjelovic <rigor789@gmail.com>

* test: Add tests for empty image sources

* chore: add a few more test cases

These make the app crash without the fix in place

Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
Co-authored-by: Nathan Walker <walkerrunpdx@gmail.com>
2021-09-25 09:54:34 +02:00

60 lines
2.5 KiB
XML

<Page>
<GridLayout rows="*,*,*,*,*,*,*,*,*,*,*,*,*" >
<Button backgroundImage="url('~/resources/images/no-image.png')"
borderRadius='125' borderWidth='2' borderColor='black'
backgroundRepeat="repeat" backgroundSize="contain"
/>
<Button row="1" backgroundImage="url('~/resources/images/no-image.png')"
borderRadius='5' borderWidth='2' borderColor='black'
backgroundRepeat="repeat-y"
/>
<Button row="2" backgroundImage="url('~/resources/images/no-image.png')"
borderRadius='25' borderWidth='2' borderColor='black'
backgroundRepeat="repeat-x"
/>
<Button row="3" backgroundImage="url('res://icon')"
borderRadius='10' borderWidth='2' borderColor='black'
backgroundRepeat="no-repeat"
backgroundSize="contain"
height="80" width="180"
/>
<Button row="4" text="css background no-repeat" class="testBtn"/>
<Button row="5" backgroundImage="url('res://icon')"
borderRadius='10' borderWidth='2' borderColor='black'
style="background-repeat: no-repeat"
backgroundSize="contain"
height="80" width="180"
/>
<!-- Test some invalid cases - these should not crash -->
<Button row="6" backgroundImage="url('res://theneverfoundunicorn.png')"
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
<Button row="7" backgroundImage="url('res://')"
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
<Button row="8" backgroundImage="url('')"
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
<Button row="9" backgroundImage="res://theneverfoundunicorn.png"
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
<Button row="10" backgroundImage="res://"
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
<Button row="11" backgroundImage=" "
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
<Button row="12" backgroundImage="bad"
borderRadius='10' borderWidth='2' borderColor='black'
height="80" width="180"
/>
</GridLayout>
</Page>