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

Commit 7410170d authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Revert "Use a PopupWindow to show tooltips"

This reverts commit 77e53977.

Change-Id: Ic4054e0d507ce95ab93282d4da002dd804aeb26d
parent d1e7d3d7
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.widget.PopupWindow;
import android.widget.TextView;

public class TooltipPopup {
@@ -33,7 +32,6 @@ public class TooltipPopup {

    private final Context mContext;

    private final PopupWindow mPopupWindow;
    private final View mContentView;
    private final TextView mMessageView;

@@ -45,8 +43,6 @@ public class TooltipPopup {
    public TooltipPopup(Context context) {
        mContext = context;

        mPopupWindow = new PopupWindow(context);
        mPopupWindow.setBackgroundDrawable(null);
        mContentView = LayoutInflater.from(mContext).inflate(
                com.android.internal.R.layout.tooltip, null);
        mMessageView = (TextView) mContentView.findViewById(
@@ -74,16 +70,17 @@ public class TooltipPopup {

        computePosition(anchorView, anchorX, anchorY, fromTouch, mLayoutParams);

        mPopupWindow.setContentView(mContentView);
        mPopupWindow.showAtLocation(
            anchorView, mLayoutParams.gravity, mLayoutParams.x, mLayoutParams.y);
        WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
        wm.addView(mContentView, mLayoutParams);
    }

    public void hide() {
        if (!isShowing()) {
            return;
        }
        mPopupWindow.dismiss();

        WindowManager wm = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
        wm.removeView(mContentView);
    }

    public View getContentView() {
@@ -91,7 +88,7 @@ public class TooltipPopup {
    }

    public boolean isShowing() {
        return mPopupWindow.isShowing();
        return mContentView.getParent() != null;
    }

    public void updateContent(CharSequence tooltipText) {