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

Commit 710a0db6 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "SystemUI: calculate height for tablet status_bar_settings_view" into ics

parents 467e1e37 9215b6c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="380px"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

<com.android.systemui.statusbar.tablet.SettingsView
+14 −0
Original line number Diff line number Diff line
@@ -24,11 +24,13 @@ import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Slog;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
@@ -345,6 +347,18 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    void addSettingsView() {
        LayoutInflater infl = LayoutInflater.from(getContext());
        mSettingsView = infl.inflate(R.layout.status_bar_settings_view, mContentFrame, false);

        // set height
        mSettingsView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
        int currentHeight = mSettingsView.getMeasuredHeight();
        WindowManager wm = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE);
        Display d = wm.getDefaultDisplay();
        int maxHeight = d.getHeight() - mTitleArea.getHeight();
        if (currentHeight > maxHeight) {
            currentHeight = maxHeight;
        }
        mSettingsView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, currentHeight));

        mSettingsView.setVisibility(View.GONE);
        mContentFrame.addView(mSettingsView);
    }