Loading java/com/android/newbubble/NewBubble.java→java/com/android/bubble/Bubble.java +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. Loading @@ -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 Loading @@ -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. Loading java/com/android/newbubble/NewBubbleComponent.java→java/com/android/bubble/BubbleComponent.java +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. Loading @@ -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; Loading @@ -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(); } } java/com/android/newbubble/NewBubbleInfo.java→java/com/android/bubble/BubbleInfo.java +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. Loading @@ -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; Loading @@ -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(); Loading @@ -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()) Loading @@ -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 { Loading @@ -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 */ Loading @@ -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) { Loading java/com/android/newbubble/stub/NewBubbleStub.java→java/com/android/bubble/stub/BubbleStub.java +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. Loading @@ -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() {} Loading @@ -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) {} Loading java/com/android/newbubble/stub/StubNewBubbleModule.java→java/com/android/bubble/stub/StubBubbleModule.java +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. Loading @@ -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
java/com/android/newbubble/NewBubble.java→java/com/android/bubble/Bubble.java +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. Loading @@ -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 Loading @@ -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. Loading
java/com/android/newbubble/NewBubbleComponent.java→java/com/android/bubble/BubbleComponent.java +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. Loading @@ -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; Loading @@ -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(); } }
java/com/android/newbubble/NewBubbleInfo.java→java/com/android/bubble/BubbleInfo.java +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. Loading @@ -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; Loading @@ -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(); Loading @@ -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()) Loading @@ -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 { Loading @@ -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 */ Loading @@ -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) { Loading
java/com/android/newbubble/stub/NewBubbleStub.java→java/com/android/bubble/stub/BubbleStub.java +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. Loading @@ -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() {} Loading @@ -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) {} Loading
java/com/android/newbubble/stub/StubNewBubbleModule.java→java/com/android/bubble/stub/StubBubbleModule.java +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. Loading @@ -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); }