Spinner Dropdown CheckedTextView Autoscroll

I am trying to use a spinner filled with long lines that should automatically scroll horizontally.

So, I wrote a special adapter that uses my own dropdown layout:

Markup:

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" style="?android:attr/spinnerDropDownItemStyle" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:ellipsize="marquee" android:marqueeRepeatLimit="50" android:singleLine="true" /> 

In my adapter, I overwrite the getDropDownView method:

 public View getDropDownView(int position, View convertView, ViewGroup parent) { if (convertView == null) { mInflater = LayoutInflater.from(this.getContext()); convertView = mInflater.inflate(R.layout.scrolling_list_item, null); } return super.getDropDownView(position, convertView, parent); } 

Any idea why my CheckedTextView just stands without autoscrolling?

+4
source share

Source: https://habr.com/ru/post/1437165/


All Articles