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

Commit 39a1ce2d authored by Adnan's avatar Adnan Committed by Gerrit Code Review
Browse files

QS: Make CameraTile respect locale changes for the label.

Change-Id: Id4be230c443263b4185e5b4af6e8df6805a7aac5
parent 78c6cefa
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -245,7 +245,6 @@ public class CameraTile extends QuickSettingsTile {
    public CameraTile(Context context, QuickSettingsController qsc, Handler handler) {
    public CameraTile(Context context, QuickSettingsController qsc, Handler handler) {
        super(context, qsc, R.layout.quick_settings_tile_camera);
        super(context, qsc, R.layout.quick_settings_tile_camera);
        mHandler = handler;
        mHandler = handler;
        mLabel = mContext.getString(R.string.quick_settings_camera_label);
        mDrawable = R.drawable.ic_qs_camera;
        mDrawable = R.drawable.ic_qs_camera;


        String imageFileNameFormat = DEFAULT_IMAGE_FILE_NAME_FORMAT;
        String imageFileNameFormat = DEFAULT_IMAGE_FILE_NAME_FORMAT;
@@ -266,6 +265,7 @@ public class CameraTile extends QuickSettingsTile {


    @Override
    @Override
    void onPostCreate() {
    void onPostCreate() {
        updateTile();
        mOnLongClick = new View.OnLongClickListener() {
        mOnLongClick = new View.OnLongClickListener() {
            @Override
            @Override
            public boolean onLongClick(View v) {
            public boolean onLongClick(View v) {
@@ -305,6 +305,12 @@ public class CameraTile extends QuickSettingsTile {
        }
        }
    }
    }


    @Override
    public void updateResources() {
        updateTile();
        super.updateResources();
    }

    private PanelView getContainingPanel() {
    private PanelView getContainingPanel() {
        ViewParent parent = mContainer;
        ViewParent parent = mContainer;
        while (parent != null) {
        while (parent != null) {
@@ -316,6 +322,10 @@ public class CameraTile extends QuickSettingsTile {
        return null;
        return null;
    }
    }


    private synchronized void updateTile() {
        mLabel = mContext.getString(R.string.quick_settings_camera_label);
    }

    private void updateOrientation() {
    private void updateOrientation() {
        final WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        final WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        int rotation = wm.getDefaultDisplay().getRotation();
        int rotation = wm.getDefaultDisplay().getRotation();