Skip to content

Commit 44024e1

Browse files
committed
fixed IndexOutOfBoundsException when HeaderSettingsObject is first on the list
1 parent 3da2046 commit 44024e1

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.idea/caches/build_file_checksums.ser

0 Bytes
Binary file not shown.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.1.0'
10+
classpath 'com.android.tools.build:gradle:3.1.2'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong

easysettings-basic/src/main/java/com/hotmail/or_dvir/easysettings/pojos/EasySettings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public static void inflateSettingsLayout(Context context,
186186
int bottomPadding = individualSettingsContainer.getPaddingBottom();
187187
int topPadding = individualSettingsContainer.getPaddingTop();
188188

189-
if(settingsList.get(i-1).hasDivider())
189+
if(i == 0 ||
190+
settingsList.get(i-1).hasDivider())
190191
{
191192
topPadding = settingsPadding;
192193
}

sample/src/main/java/or_dvir/hotmail/com/ActivityMain.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ protected void onCreate(Bundle savedInstanceState)
7676
//todo note that there might be some more methods available for the below builders.
7777
//todo please check docs/original code for all available options
7878
mySettingsList = EasySettings.createSettingsArray(
79+
new HeaderSettingsObject.Builder("no more index out of bound")
80+
.build(),
7981
new BasicSettingsObject.Builder(SETTINGS_KEY_BASIC, "fancy title 1")
8082
.setSummary("fancy summary")
8183
.setIcon(null)

0 commit comments

Comments
 (0)