Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15412832 authored by Bruno Martins's avatar Bruno Martins
Browse files

PartsActivity: Always include back button in the action bar

 * Back in N, we had top-level settings which would show the
   hamburger menu instead of the back button.
   Since this has now changed in O, add the back button to all
   the activities.

Change-Id: I1b89f90b741e6b8b78b2c267732cbdf9225192f0
parent 10906821
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The CyanogenMod Project
 *               2017 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -60,8 +61,6 @@ public class PartsActivity extends SettingsDrawerActivity implements

    private CharSequence mInitialTitle;

    private boolean mHomeAsUp = true;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
@@ -103,7 +102,6 @@ public class PartsActivity extends SettingsDrawerActivity implements
                // Alias mode
                info = PartsList.get(this).getPartInfoForClass(
                        getIntent().getComponent().getClassName());
                mHomeAsUp = false;
            }
            if (info == null) {
                throw new UnsupportedOperationException(
@@ -121,7 +119,7 @@ public class PartsActivity extends SettingsDrawerActivity implements

        switchToFragment(fragmentClass, initialArgs, -1, mInitialTitle);

        getActionBar().setDisplayHomeAsUpEnabled(mHomeAsUp);
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }

    @Override
@@ -174,7 +172,7 @@ public class PartsActivity extends SettingsDrawerActivity implements

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home && mHomeAsUp) {
        if (item.getItemId() == android.R.id.home) {
            onBackPressed();
            return true;
        }