Skip to content

Instantly share code, notes, and snippets.

@sh3lan93
Created January 8, 2018 08:21
Show Gist options
  • Save sh3lan93/50fa953b1156839e0b58c34b711bd98e to your computer and use it in GitHub Desktop.
Save sh3lan93/50fa953b1156839e0b58c34b711bd98e to your computer and use it in GitHub Desktop.
this is a simple code for setting a custom drawable for back button placed on toolbar
if (SharedPreferenceHelper.getDefaultLanguage(getActivity()).equals(SharedPreferenceHelper.ARABIC_LOCAL_LANGUAGE)) {
((AppCompatActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.ar_back);
}
else {
((AppCompatActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.back);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment