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

Commit 1b730029 authored by Zhao Wei Liew's avatar Zhao Wei Liew
Browse files

SystemUI: PowerNotification: Add up button to fragment

Currently, there is no up button for the user to navigate
back to "Configure notifications" after entering "Power notification
controls".

Add the up button.

Change-Id: Ia983cd9453da4e3354aac9f3928ffcb5985226e5
parent 981e89eb
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.app.Fragment;
import android.os.Bundle;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Switch;
@@ -69,6 +70,17 @@ public class PowerNotificationControlsFragment extends Fragment {
                        : getString(R.string.switch_bar_off));
            }
        });

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

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

    @Override