Extensible watchlist move group icon right in jellyBean 4.3?

The following method does not work in Android version 4.3.

historyExpaLV.setIndicatorBounds(historyExpaLV.getRight() - 60, historyExpaLV.getWidth() - 8); 

Does anyone know a solution? Thanks in advance.

+9
android expandablelistview android-4.3-jelly-bean
Aug 01 '13 at 13:30
source share
2 answers

How I fixed this:

Update the SDK Manager to Android 4.3 and use it as a build target. They introduced a new method in API 18 called setIndicatorBoundsRelative (int, int) , which works like the other (but correctly) in android 4.3.

Do an Android version check and use the old method with the old API:

 if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) { mListView.setIndicatorBounds(myLeft, myRight); } else { mListView.setIndicatorBoundsRelative(myLeft, myRight); } 
+31
Aug 2 '13 at 9:48
source share

I think this is a mistake

 int right = (int) (getResources().getDisplayMetrics().widthPixels - TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30, getResources().getDisplayMetrics())); expandableListView.setIndicatorBounds(right - getResources().getDrawable(R.drawable.group_indicator_padding).getIntrinsicWidth(), right); 

this code works fine until 4.2.2 and does nothing on 4.3

+5
Aug 01 '13 at 14:20
source share



All Articles