Last active
October 4, 2017 17:23
-
-
Save Danil0v3s/8b91487a4a080506d8f7d98b84247fbe to your computer and use it in GitHub Desktop.
Herança
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
public class BaseActivity extends AppCompatActivity { | |
public void setupViews(Toolbar toolbar, String title) { | |
setTitle(title); | |
setSupportActionBar(toolbar); | |
try { | |
getSupportActionBar().setElevation(0); | |
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | |
getSupportActionBar().setHomeButtonEnabled(true); | |
getSupportActionBar().setDisplayShowTitleEnabled(false); | |
final Drawable upArrow = getResources().getDrawable(R.drawable.ic_back); | |
upArrow.setColorFilter(getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.SRC_ATOP); | |
getSupportActionBar().setHomeAsUpIndicator(upArrow); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
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
public class TermsActivity extends BaseActivity { | |
@BindView(R2.id.toolbar) | |
Toolbar toolbar; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_terms); | |
ButterKnife.bind(this); | |
super.setupViews(toolbar, "diretrizes"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment