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

Commit d5514615 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ieab3ee3f,I4b917d8a

* changes:
  Remove bubble "new" prefix.
  Dismiss keyboard when opening overflow menu in RTT call.
parents 4093c4fc 48f93f40
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,19 +14,18 @@
 * limitations under the License
 */

package com.android.newbubble;
package com.android.bubble;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import com.android.newbubble.NewBubbleInfo.Action;
import java.util.List;

/**
 * Creates and manages a bubble window from information in a {@link NewBubbleInfo}. Before creating,
 * be sure to check whether bubbles may be shown using {@code Settings.canDrawOverlays(context)} and
 * Creates and manages a bubble window from information in a {@link BubbleInfo}. Before creating, be
 * sure to check whether bubbles may be shown using {@code Settings.canDrawOverlays(context)} and
 * request permission if necessary
 */
public interface NewBubble {
public interface Bubble {

  /**
   * Make the bubble visible. Will show a short entrance animation as it enters. If the bubble is
@@ -45,14 +44,14 @@ public interface NewBubble {
   *
   * @param bubbleInfo the BubbleInfo to display in this Bubble.
   */
  void setBubbleInfo(@NonNull NewBubbleInfo bubbleInfo);
  void setBubbleInfo(@NonNull BubbleInfo bubbleInfo);

  /**
   * Update the state and behavior of actions.
   *
   * @param actions the new state of the bubble's actions
   */
  void updateActions(@NonNull List<Action> actions);
  void updateActions(@NonNull List<BubbleInfo.Action> actions);

  /**
   * Update the avatar from photo.
+7 −7
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.newbubble;
package com.android.bubble;

import android.content.Context;
import android.support.annotation.NonNull;
@@ -22,18 +22,18 @@ import com.android.dialer.inject.HasRootComponent;
import dagger.Subcomponent;

@Subcomponent
public abstract class NewBubbleComponent {
public abstract class BubbleComponent {

  @NonNull
  public abstract NewBubble getNewBubble();
  public abstract Bubble getBubble();

  public static NewBubbleComponent get(Context context) {
  public static BubbleComponent get(Context context) {
    return ((HasComponent) ((HasRootComponent) context.getApplicationContext()).component())
        .newBubbleComponent();
        .bubbleComponent();
  }

  /** Used to refer to the root application component. */
  public interface HasComponent {
    NewBubbleComponent newBubbleComponent();
    BubbleComponent bubbleComponent();
  }
}
+9 −9
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
 * limitations under the License
 */

package com.android.newbubble;
package com.android.bubble;

import android.app.PendingIntent;
import android.graphics.drawable.Drawable;
@@ -27,9 +27,9 @@ import com.google.auto.value.AutoValue;
import java.util.Collections;
import java.util.List;

/** Info for displaying a {@link NewBubble} */
/** Info for displaying a {@link Bubble} */
@AutoValue
public abstract class NewBubbleInfo {
public abstract class BubbleInfo {
  @ColorInt
  public abstract int getPrimaryColor();

@@ -45,10 +45,10 @@ public abstract class NewBubbleInfo {
  public abstract List<Action> getActions();

  public static Builder builder() {
    return new AutoValue_NewBubbleInfo.Builder().setActions(Collections.emptyList());
    return new AutoValue_BubbleInfo.Builder().setActions(Collections.emptyList());
  }

  public static Builder from(@NonNull NewBubbleInfo bubbleInfo) {
  public static Builder from(@NonNull BubbleInfo bubbleInfo) {
    return builder()
        .setPrimaryColor(bubbleInfo.getPrimaryColor())
        .setPrimaryIcon(bubbleInfo.getPrimaryIcon())
@@ -57,7 +57,7 @@ public abstract class NewBubbleInfo {
        .setAvatar(bubbleInfo.getAvatar());
  }

  /** Builder for {@link NewBubbleInfo} */
  /** Builder for {@link BubbleInfo} */
  @AutoValue.Builder
  public abstract static class Builder {

@@ -71,7 +71,7 @@ public abstract class NewBubbleInfo {

    public abstract Builder setActions(List<Action> actions);

    public abstract NewBubbleInfo build();
    public abstract BubbleInfo build();
  }

  /** Represents actions to be shown in the bubble when expanded */
@@ -94,7 +94,7 @@ public abstract class NewBubbleInfo {
    public abstract boolean isChecked();

    public static Builder builder() {
      return new AutoValue_NewBubbleInfo_Action.Builder().setCheckable(true).setChecked(false);
      return new AutoValue_BubbleInfo_Action.Builder().setCheckable(true).setChecked(false);
    }

    public static Builder from(@NonNull Action action) {
+8 −9
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,20 +14,19 @@
 * limitations under the License
 */

package com.android.newbubble.stub;
package com.android.bubble.stub;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import com.android.newbubble.NewBubble;
import com.android.newbubble.NewBubbleInfo;
import com.android.newbubble.NewBubbleInfo.Action;
import com.android.bubble.Bubble;
import com.android.bubble.BubbleInfo;
import java.util.List;
import javax.inject.Inject;

public class NewBubbleStub implements NewBubble {
public class BubbleStub implements Bubble {

  @Inject
  public NewBubbleStub() {}
  public BubbleStub() {}

  @Override
  public void show() {}
@@ -41,10 +40,10 @@ public class NewBubbleStub implements NewBubble {
  }

  @Override
  public void setBubbleInfo(@NonNull NewBubbleInfo bubbleInfo) {}
  public void setBubbleInfo(@NonNull BubbleInfo bubbleInfo) {}

  @Override
  public void updateActions(@NonNull List<Action> actions) {}
  public void updateActions(@NonNull List<BubbleInfo.Action> actions) {}

  @Override
  public void updatePhotoAvatar(@NonNull Drawable avatar) {}
+5 −5
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,17 +14,17 @@
 * limitations under the License.
 */

package com.android.newbubble.stub;
package com.android.bubble.stub;

import com.android.newbubble.NewBubble;
import com.android.bubble.Bubble;
import dagger.Binds;
import dagger.Module;
import javax.inject.Singleton;

@Module
public abstract class StubNewBubbleModule {
public abstract class StubBubbleModule {

  @Binds
  @Singleton
  public abstract NewBubble bindsNewBubble(NewBubbleStub newBubbleStub);
  public abstract Bubble bindsBubble(BubbleStub bubbleStub);
}
Loading