Skip to content

Commit 43e1510

Browse files
author
Chris Bellew
committed
Fixed scrolling issue on smaller devices.
1 parent 07740b2 commit 43e1510

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.atomjack.vcfp;
2+
3+
import android.content.Context;
4+
import android.util.AttributeSet;
5+
import android.view.ViewGroup;
6+
import android.widget.ListView;
7+
8+
public class NonScrollListView extends ListView {
9+
public NonScrollListView(Context context) {
10+
super(context);
11+
}
12+
public NonScrollListView(Context context, AttributeSet attrs) {
13+
super(context, attrs);
14+
}
15+
public NonScrollListView(Context context, AttributeSet attrs, int defStyle) {
16+
super(context, attrs, defStyle);
17+
}
18+
@Override
19+
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
20+
int heightMeasureSpec_custom = MeasureSpec.makeMeasureSpec(
21+
Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
22+
super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom);
23+
ViewGroup.LayoutParams params = getLayoutParams();
24+
params.height = getMeasuredHeight();
25+
}
26+
}

Voice Control For Plex/src/main/res/layout/main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
android:orientation="vertical"
1616
android:gravity="center">
1717

18-
<ListView
18+
<com.atomjack.vcfp.NonScrollListView
1919
android:id="@+id/settingsList"
2020
android:layout_height="fill_parent"
2121
android:layout_width="match_parent">
22-
</ListView>
22+
</com.atomjack.vcfp.NonScrollListView>
2323

2424
<CheckBox
2525
android:id="@+id/resumeCheckbox"

0 commit comments

Comments
 (0)