Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can assign the listitem background in a customised view. In getview (of adapter class) based on the item position. Create a gradient in xml and increase the alpha value based on the position. </p> <p>This is the peice of code which is working for me.</p> <p>listItem.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:minHeight="64dp"&gt; &lt;TextView android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="17sp" android:textColor="@android:color/white" android:id="@+id/textView"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p>ItemAdapter.java</p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = inflater.inflate(rowResourceId, parent, false); TextView textView = (TextView) rowView.findViewById(R.id.textView); int id = Integer.parseInt(Ids[position]); textView.setText(Model.GetbyId(id).name); // this is the main idea behind the UX look n feel. rowView.setBackgroundColor(context.getResources().getColor(android.R.color.black)); textView.setAlpha((float) position/Ids.length); return rowView; } </code></pre> <p>Please feel free to use holder design pattern in the getView. This is just a proof of concept. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload