Created
April 6, 2017 09:23
-
-
Save saturov/8a37cc456cb9e9f51b103ad8f67b46bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data | |
@NoArgsConstructor | |
public class ToolbarConfig { | |
private | |
@IdRes | |
int toolbarId = R.id.toolbar; | |
private boolean setDisplayHomeAsUpEnabled = true; | |
private | |
@StringRes | |
int titleId; | |
public ToolbarConfig(int toolbarId, boolean setDisplayHomeAsUpEnabled, @StringRes int titleId) { | |
this.toolbarId = toolbarId; | |
this.setDisplayHomeAsUpEnabled = setDisplayHomeAsUpEnabled; | |
this.titleId = titleId; | |
} | |
public ToolbarConfig setId(int toolbarId) { | |
this.toolbarId = toolbarId; | |
return this; | |
} | |
public ToolbarConfig setSetDisplayHomeAsUpEnabled(boolean setDisplayHomeAsUpEnabled) { | |
this.setDisplayHomeAsUpEnabled = setDisplayHomeAsUpEnabled; | |
return this; | |
} | |
public ToolbarConfig setTitleId(@StringRes int titleId) { | |
this.titleId = titleId; | |
return this; | |
} | |
public ToolbarConfig build() { | |
return new ToolbarConfig(toolbarId, setDisplayHomeAsUpEnabled, titleId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment