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

Commit b52ea741 authored by yueg's avatar yueg Committed by Copybara-Service
Browse files

Bubble bottom action changes.

- Hide bottom action view when bubble move canceled
- Get display height every time when show bottom action view (onConfigurationChanged() won't be called when bubble is not visible)

Test: manual
PiperOrigin-RevId: 182979768
Change-Id: I989422c4ab5866b22c78bffbc82f229842a6dd9e
parent c0326e9b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@ final class BottomActionViewController {
  private final Context context;
  private final WindowManager windowManager;
  private final int gradientHeight;
  private final int bottomActionViewTop;
  private final int textOffsetSize;
  private int bottomActionViewTop;

  private View bottomActionView;
  private View dismissView;
@@ -55,7 +55,6 @@ final class BottomActionViewController {
    windowManager = context.getSystemService(WindowManager.class);
    gradientHeight =
        context.getResources().getDimensionPixelSize(R.dimen.bubble_bottom_action_view_height);
    bottomActionViewTop = context.getResources().getDisplayMetrics().heightPixels - gradientHeight;
    textOffsetSize =
        context.getResources().getDimensionPixelSize(R.dimen.bubble_bottom_action_text_offset);
  }
@@ -76,6 +75,7 @@ final class BottomActionViewController {

    // Add the target to the window
    // TODO(yueg): use TYPE_NAVIGATION_BAR_PANEL to draw over navigation bar
    bottomActionViewTop = context.getResources().getDisplayMetrics().heightPixels - gradientHeight;
    LayoutParams layoutParams =
        new LayoutParams(
            LayoutParams.MATCH_PARENT,
+8 −0
Original line number Diff line number Diff line
@@ -251,6 +251,14 @@ class NewMoveHandler implements OnTouchListener {
          }
        }
        break;
      case MotionEvent.ACTION_CANCEL:
        if (isMoving) {
          snapX();
          isMoving = false;
          bubble.onMoveFinish();
          bottomActionViewController.destroyBottomActionView();
        }
        break;
      default: // fall out
    }
    return true;