Skip to content

Instantly share code, notes, and snippets.

@saturov
Created April 6, 2017 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saturov/8a37cc456cb9e9f51b103ad8f67b46bf to your computer and use it in GitHub Desktop.
Save saturov/8a37cc456cb9e9f51b103ad8f67b46bf to your computer and use it in GitHub Desktop.
@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