Added flag for action bar back button. Added back button for actionmode
This commit is contained in:
parent
bed99dc1ea
commit
1aee28df26
7 changed files with 16 additions and 3 deletions
BIN
OsmAnd/res/drawable-hdpi/action_mode_back.png
Normal file
BIN
OsmAnd/res/drawable-hdpi/action_mode_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 667 B |
BIN
OsmAnd/res/drawable-xhdpi/action_mode_back.png
Normal file
BIN
OsmAnd/res/drawable-xhdpi/action_mode_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 706 B |
BIN
OsmAnd/res/drawable-xxhdpi/action_mode_back.png
Normal file
BIN
OsmAnd/res/drawable-xxhdpi/action_mode_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 924 B |
BIN
OsmAnd/res/drawable-xxxhdpi/action_mode_back.png
Normal file
BIN
OsmAnd/res/drawable-xxxhdpi/action_mode_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -78,6 +78,8 @@
|
|||
<item name="actionModeBackground">@color/actionbar_light_color</item>
|
||||
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
|
||||
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
|
||||
<item name="android:actionModeCloseDrawable">@drawable/action_mode_back</item>
|
||||
<item name="actionModeCloseDrawable">@drawable/action_mode_back</item>
|
||||
</style>
|
||||
|
||||
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
||||
|
@ -94,6 +96,8 @@
|
|||
<item name="actionModeBackground">@color/actionbar_dark_color</item>
|
||||
<item name="actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
|
||||
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
|
||||
<item name="android:actionModeCloseDrawable">@drawable/action_mode_back</item>
|
||||
<item name="actionModeCloseDrawable">@drawable/action_mode_back</item>
|
||||
</style>
|
||||
|
||||
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
|
|
|
@ -144,6 +144,7 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
getMyApplication().applyTheme(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
haveHomeButton = false;
|
||||
if (getIntent() != null) {
|
||||
Intent intent = getIntent();
|
||||
if (intent.getExtras() != null && intent.getExtras().containsKey(APP_EXIT_KEY)) {
|
||||
|
|
|
@ -13,6 +13,8 @@ import net.osmand.plus.R;
|
|||
*/
|
||||
public class OsmandActionBarActivity extends ActionBarActivity {
|
||||
|
||||
protected boolean haveHomeButton = true;
|
||||
|
||||
//should be called after set content view
|
||||
protected void setupHomeButton(){
|
||||
Drawable back = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
|
||||
|
@ -25,18 +27,24 @@ public class OsmandActionBarActivity extends ActionBarActivity {
|
|||
@Override
|
||||
public void setContentView(int layoutResID) {
|
||||
super.setContentView(layoutResID);
|
||||
setupHomeButton();
|
||||
if (haveHomeButton) {
|
||||
setupHomeButton();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view) {
|
||||
super.setContentView(view);
|
||||
setupHomeButton();
|
||||
if (haveHomeButton) {
|
||||
setupHomeButton();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
super.setContentView(view, params);
|
||||
setupHomeButton();
|
||||
if (haveHomeButton) {
|
||||
setupHomeButton();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue