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

Commit 48c84636 authored by Aga Wronska's avatar Aga Wronska
Browse files

Revert 'Make Files drawer appear behind system ui bars' because of action mode bug

Fixing: b/27854892
Bug: 27570567

Change-Id: Iefdf2f2a450d80c551027efb35121554503cca3c
parent d273f0d6
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -101,16 +101,6 @@ public abstract class BaseActivity extends Activity
    @CallSuper
    @CallSuper
    @Override
    @Override
    public void onCreate(Bundle icicle) {
    public void onCreate(Bundle icicle) {
        // This flag is being set here as a result of the bug. When the flag was set in the
        // styles.xml keyboard was messing the layout of dialogs (create dir, rename).
        // Attempts were made to keep the flag in the main theme and to override it in the dialog
        // layout xml or to create separate style for dialog and assign it in styles.xml.
        // None of this brought successful results.
        // Setting the flag works here most probably because of the timing when it is set. Also the
        // setting might not affect the dialogs that are created in new windows or it affects them
        // in the different way that having this in the style.
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

        // Record the time when onCreate is invoked for metric.
        // Record the time when onCreate is invoked for metric.
        mStartTime = new Date().getTime();
        mStartTime = new Date().getTime();


@@ -140,7 +130,6 @@ public abstract class BaseActivity extends Activity
        mSearchManager = new SearchViewManager(this, icicle);
        mSearchManager = new SearchViewManager(this, icicle);


        DocumentsToolbar toolbar = (DocumentsToolbar) findViewById(R.id.toolbar);
        DocumentsToolbar toolbar = (DocumentsToolbar) findViewById(R.id.toolbar);
        Display.adjustToolbar(toolbar, this);
        setActionBar(toolbar);
        setActionBar(toolbar);
        mNavigator = new NavigationView(
        mNavigator = new NavigationView(
                mDrawer,
                mDrawer,
+3 −34
Original line number Original line Diff line number Diff line
@@ -20,8 +20,6 @@ import android.app.Activity;
import android.content.Context;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Point;
import android.util.TypedValue;
import android.util.TypedValue;
import android.view.WindowManager;
import android.widget.Toolbar;


/*
/*
 * Convenience class for getting display related attributes
 * Convenience class for getting display related attributes
@@ -47,41 +45,12 @@ public final class Display {
     * Returns action bar height in raw pixels.
     * Returns action bar height in raw pixels.
     */
     */
    public static float actionBarHeight(Context context) {
    public static float actionBarHeight(Context context) {
        int height = 0;
        int actionBarHeight = 0;
        TypedValue tv = new TypedValue();
        TypedValue tv = new TypedValue();
        if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
        if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
            height = TypedValue.complexToDimensionPixelSize(tv.data,
            actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,
                    context.getResources().getDisplayMetrics());
                    context.getResources().getDisplayMetrics());
        }
        }
        return height;
        return actionBarHeight;
    }

    /*
     * Returns status bar height in raw pixels.
     */
    private static int statusBarHeight(Context context) {
        int height = 0;
        int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen",
                "android");
        if (resourceId > 0) {
            height = context.getResources().getDimensionPixelSize(resourceId);
        }
        return height;
    }

    /*
     * Adjusts toolbar for the layout with translucent status bar. Increases the
     * height of the toolbar and adds padding at the top to accommodate status bar visible above
     * toolbar.
     */
    public static void adjustToolbar(Toolbar toolbar, Activity activity) {
        if ((activity.getWindow().getAttributes().flags
                & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) != 0) {
            int statusBarHeight = Display.statusBarHeight(activity);
            toolbar.getLayoutParams().height = (int) (Display.actionBarHeight(activity)
                    + statusBarHeight);
            toolbar.setPadding(toolbar.getPaddingLeft(), statusBarHeight, toolbar.getPaddingRight(),
                    toolbar.getPaddingBottom());
        }
    }
    }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ abstract class DrawerController implements DrawerListener {


        View drawer = activity.findViewById(R.id.drawer_roots);
        View drawer = activity.findViewById(R.id.drawer_roots);
        Toolbar toolbar = (Toolbar) activity.findViewById(R.id.roots_toolbar);
        Toolbar toolbar = (Toolbar) activity.findViewById(R.id.roots_toolbar);
        Display.adjustToolbar(toolbar, activity);

        drawer.getLayoutParams().width = calculateDrawerWidth(activity);
        drawer.getLayoutParams().width = calculateDrawerWidth(activity);


        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(