android - Transparent gradient issue -
i have layout google map fragment in framelayout. also, placed new view on map gradient background. layout:
<framelayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <com.google.android.gms.maps.mapview android:id="@+id/mapview" android:layout_width="match_parent" android:layout_height="match_parent"/> <view android:id="@+id/fadetop" android:layout_width="match_parent" android:layout_height="@dimen/fade_height" android:layout_gravity="top" android:background="@drawable/list_fade_top"/> <include layout="@layout/top_line_mid_gray"/> </framelayout>
list_fade_top:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:angle="90" android:startcolor="@color/fade_start_color" android:centercolor="@color/fade_center_color" android:endcolor="@color/fade_end_color" android:type="linear"/> </shape>
- start/end , center colors. gradient draws 2 light lines:
<color name="fade_start_color">#00000000</color> <color name="fade_center_color">#4f000000</color> <color name="fade_end_color">#ff000000</color>
- start/end , center colors. gradient draws 1 light line:
<color name="fade_start_color">#00000000</color> <color name="fade_center_color">#6f000000</color> <color name="fade_end_color">#ff000000</color>
the same behavior gradient without center color:
<gradient android:angle="90" android:startcolor="@color/fade_start_color" android:endcolor="@color/fade_end_color" android:type="linear"/>
how can draw smooth linear gradient black (or semi transparent black) full transparent?
i tried hardware acceleration on/off, 'getwindow().setformat(pixelformat.rgba_8888);' nothing helps me.
update 1 created simple app @ github. https://github.com/ralexey/testapp activity color background , gradient on it.
add line in gradient android:centery="y%p"
may you
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="90" android:centery="25%p" android:centercolor="@color/fade_center_color" android:endcolor="@color/fade_end_color" android:startcolor="@color/fade_start_color" android:type="linear" android:dither="true" android:uselevel="true" /> </shape>
Comments
Post a Comment