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

Commit 43733460 authored by Jim Miller's avatar Jim Miller Committed by Android Git Automerger
Browse files

am 30142f7e: Merge change I9f239766 into eclair

Merge commit '30142f7e' into eclair-mr2

* commit '30142f7e':
  Workaround for 2262578: Don't draw tabs if view is not in the correct orientation for the layout
parents 9335d414 30142f7e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.widget;

import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@@ -150,6 +151,14 @@ public class SlidingTab extends ViewGroup {
    // TODO: For debugging; remove after glitches debugged.
    @Override
    protected void dispatchDraw(Canvas canvas) {
        int orientation = getResources().getConfiguration().orientation;
        if (mOrientation == HORIZONTAL && orientation != Configuration.ORIENTATION_PORTRAIT
                || mOrientation == VERTICAL && orientation != Configuration.ORIENTATION_LANDSCAPE) {
            // UBER HACK ALERT.  This is a workaround for a configuration race condition between
            // orientation changed notification and the resize notification. This just prevents
            // us from drawing under this circumstance, though the view will still be wrong.
            return;
        }
        super.dispatchDraw(canvas);
    }