@@ -93,9 +93,9 @@ public void onFocusChanged(View oldFocus, View newFocus) {
9393 }
9494 };
9595
96- private List <AdapterView .OnItemSelectedListener > onItemSelectedListenerList = new ArrayList <>();
9796
9897 public FocusListener absListViewFocusListener = new FocusListener () {
98+ private List <AdapterView .OnItemSelectedListener > onItemSelectedListenerList = new ArrayList <>();
9999 @ Override
100100 public void onFocusChanged (View oldFocus , View newFocus ) {
101101 for (View attachView : attacheViews ) {
@@ -116,14 +116,16 @@ public void onFocusChanged(View oldFocus, View newFocus) {
116116 public void onItemSelected (AdapterView <?> parent , View view , int position , long id ) {
117117 newFocus = view ;
118118
119+ newFocus .bringToFront ();
119120
120121 int w = view .getMeasuredWidth ();
121122 int h = view .getMeasuredHeight ();
122- int ww = View .MeasureSpec .makeMeasureSpec (w , View .MeasureSpec .EXACTLY );
123- int hh = View .MeasureSpec .makeMeasureSpec (h , View .MeasureSpec .EXACTLY );
124- view .measure (ww ,hh );
123+ int ww = View .MeasureSpec .makeMeasureSpec (w , View .MeasureSpec .AT_MOST );
124+ int hh = View .MeasureSpec .makeMeasureSpec (h , View .MeasureSpec .AT_MOST );
125+ view .measure (ww , hh );
125126
126- Log .d (TAG , "onItemSelected:" + newFocus .getMeasuredWidth ()+" w:" +w );
127+ ViewGroup vg = (ViewGroup ) newFocus .getParent ();
128+ Log .d (TAG , "onItemSelected:" +vg .getWidth ()+" " + newFocus .getMeasuredWidth ()+" w:" +w );
127129
128130
129131 if (onItemSelectedListener != null ) {
0 commit comments