Skip to content

Commit

Permalink
fixed IndexOutOfBoundsException when HeaderSettingsObject is first on…
Browse files Browse the repository at this point in the history
… the list
  • Loading branch information
or-dvir committed May 16, 2018
1 parent 3da2046 commit 44024e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.1.2'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ public static void inflateSettingsLayout(Context context,
int bottomPadding = individualSettingsContainer.getPaddingBottom();
int topPadding = individualSettingsContainer.getPaddingTop();

if(settingsList.get(i-1).hasDivider())
if(i == 0 ||
settingsList.get(i-1).hasDivider())
{
topPadding = settingsPadding;
}
Expand Down
2 changes: 2 additions & 0 deletions sample/src/main/java/or_dvir/hotmail/com/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ protected void onCreate(Bundle savedInstanceState)
//todo note that there might be some more methods available for the below builders.
//todo please check docs/original code for all available options
mySettingsList = EasySettings.createSettingsArray(
new HeaderSettingsObject.Builder("no more index out of bound")
.build(),
new BasicSettingsObject.Builder(SETTINGS_KEY_BASIC, "fancy title 1")
.setSummary("fancy summary")
.setIcon(null)
Expand Down

0 comments on commit 44024e1

Please sign in to comment.