campaign fix
This commit is contained in:
@@ -19,8 +19,8 @@ public class AppToolbar extends Toolbar {
|
||||
|
||||
private View rootView;
|
||||
private TextView toolbarTitleTextView;
|
||||
private ImageView hamburgerIcon, backIcon;
|
||||
private boolean showHamburgerIcon, showBackIcon;
|
||||
private ImageView hamburgerIcon, backIcon, closeIcon;
|
||||
private boolean showHamburgerIcon, showBackIcon, showCloseIcon;
|
||||
private String title;
|
||||
private int toolbarBackgroundColor, titleTextColor;
|
||||
|
||||
@@ -42,6 +42,7 @@ public class AppToolbar extends Toolbar {
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.AppToolbar, 0, 0);
|
||||
try {
|
||||
showHamburgerIcon = a.getBoolean(R.styleable.AppToolbar_showHamburgerMenuIcon, false);
|
||||
showCloseIcon = a.getBoolean(R.styleable.AppToolbar_showCloseIcon, false);
|
||||
showBackIcon = a.getBoolean(R.styleable.AppToolbar_showBackIcon, false);
|
||||
title = a.getString(R.styleable.AppToolbar_title);
|
||||
/*
|
||||
@@ -65,17 +66,26 @@ public class AppToolbar extends Toolbar {
|
||||
//this.setBackgroundResource(toolbarBackgroundColor);
|
||||
//toolbarTitleTextView.setTextColor(titleTextColor);
|
||||
hamburgerIcon = (ImageView) rootView.findViewById(R.id.hamburgerIcon);
|
||||
closeIcon = (ImageView) rootView.findViewById(R.id.closeIcon);
|
||||
backIcon = (ImageView) rootView.findViewById(R.id.backIcon);
|
||||
if(showHamburgerIcon)
|
||||
hamburgerIcon.setVisibility(VISIBLE);
|
||||
if(showBackIcon)
|
||||
backIcon.setVisibility(VISIBLE);
|
||||
if(showCloseIcon)
|
||||
closeIcon.setVisibility(VISIBLE);
|
||||
backIcon.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
BaseActivity.currentActivity.onBackPressed();
|
||||
}
|
||||
});
|
||||
closeIcon.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
BaseActivity.currentActivity.onBackPressed();
|
||||
}
|
||||
});
|
||||
if(title != null) {
|
||||
toolbarTitleTextView.setText(title);
|
||||
toolbarTitleTextView.setVisibility(VISIBLE);
|
||||
|
||||
Reference in New Issue
Block a user