Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Showing 10 changed files with 419 additions and 98 deletions.
10 changes: 10 additions & 0 deletions app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
Original file line number Diff line number Diff line change
@@ -1510,6 +1510,16 @@ public TrayWidget getTray() {
return mTray;
}

@Override
public NavigationBarWidget getNavigationBar() {
return mNavigationBar;
}

@Override
public Windows getWindows() {
return mWindows;
}

@Override
public void saveState() {
mWindows.saveState();
Original file line number Diff line number Diff line change
@@ -230,7 +230,6 @@ private void initialize(Context aContext) {

// Bookmarks
mBinding.bookmarkButton.setOnClickListener(v -> {
v.requestFocusFromTouch();
handleBookmarkClick();
});

@@ -392,7 +391,6 @@ public void setClickable(boolean clickable) {
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}
view.requestFocusFromTouch();

if (mDelegate != null) {
mDelegate.onVoiceSearchClicked();
@@ -415,7 +413,6 @@ public void setClickable(boolean clickable) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}

view.requestFocusFromTouch();
if (mDelegate != null) {
mDelegate.onPopUpButtonClicked();
}
Original file line number Diff line number Diff line change
@@ -64,7 +64,10 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
SharedPreferences.OnSharedPreferenceChangeListener, SuggestionsWidget.URLBarPopupDelegate,
TrayListener, WindowWidget.WindowListener {

private static final int NOTIFICATION_DURATION = 3000;
private static final int TAB_ADDED_NOTIFICATION_ID = 0;
private static final int TAB_SENT_NOTIFICATION_ID = 1;
private static final int BOOKMARK_ADDED_NOTIFICATION_ID = 2;
private static final int POPUP_NOTIFICATION_ID = 3;

private WindowViewModel mViewModel;
private NavigationBarBinding mBinding;
@@ -86,7 +89,6 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
private @VideoProjectionMenuWidget.VideoProjectionFlags int mAutoSelectedProjection = VIDEO_PROJECTION_NONE;
private HamburgerMenuWidget mHamburgerMenu;
private SendTabDialogWidget mSendTabDialog;
private TooltipWidget mPopUpNotification;
private int mBlockedCount;
private Executor mUIThreadExecutor;

@@ -375,7 +377,7 @@ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {

@Override
public void detachFromWindow() {
hideNotification(mBinding.navigationBarNavigation.urlBar.getPopUpButton());
hideNotification();

if (mAttachedWindow != null && mAttachedWindow.isResizing()) {
exitResizeMode(ResizeAction.RESTORE_SIZE);
@@ -1028,7 +1030,7 @@ public void showPopUpsBlockedNotification() {
final int currentCount = mBlockedCount;
postDelayed(() -> {
if (currentCount == mBlockedCount) {
showNotification(mBinding.navigationBarNavigation.urlBar.getPopUpButton(), R.string.popup_tooltip);
showNotification(POPUP_NOTIFICATION_ID, mBinding.navigationBarNavigation.urlBar.getPopUpButton(), R.string.popup_tooltip);
}
}, POP_UP_NOTIFICATION_DELAY);
}
@@ -1038,7 +1040,7 @@ public void hidePopUpsBlockedNotification() {
final int currentCount = mBlockedCount;
post(() -> {
if (currentCount == mBlockedCount) {
hideNotification(mBinding.navigationBarNavigation.urlBar.getPopUpButton());
hideNotification();
}
});
}
@@ -1047,37 +1049,37 @@ public void hideNotifications() {
hidePopUpsBlockedNotification();
}

private void showNotification(UIButton button, int stringRes) {
if (mPopUpNotification != null && mPopUpNotification.isVisible()) {
return;
}
public void showTabAddedNotification() {
showNotification(TAB_ADDED_NOTIFICATION_ID, R.string.tab_added_notification);
}

Rect offsetViewBounds = new Rect();
getDrawingRect(offsetViewBounds);
offsetDescendantRectToMyCoords(button, offsetViewBounds);

float ratio = WidgetPlacement.viewToWidgetRatio(getContext(), this);

mPopUpNotification = new TooltipWidget(getContext(), R.layout.library_notification);
mPopUpNotification.getPlacement().parentHandle = getHandle();
mPopUpNotification.getPlacement().anchorY = 0.0f;
mPopUpNotification.getPlacement().translationX = (getPaddingLeft() + offsetViewBounds.left + button.getWidth() / 2.0f) * ratio;
mPopUpNotification.getPlacement().translationY = ((offsetViewBounds.top - 60) * ratio);
mPopUpNotification.getPlacement().translationZ = 1.0f;
mPopUpNotification.getPlacement().density = WidgetPlacement.floatDimension(getContext(), R.dimen.tooltip_default_density);
mPopUpNotification.setText(stringRes);
mPopUpNotification.setCurvedMode(true);
mPopUpNotification.show(UIWidget.CLEAR_FOCUS);

postDelayed(() -> hideNotification(button), NOTIFICATION_DURATION);
public void showTabSentNotification() {
showNotification(TAB_SENT_NOTIFICATION_ID, R.string.tab_sent_notification);
}

private void hideNotification(UIButton button) {
if (mPopUpNotification != null) {
mPopUpNotification.hide(UIWidget.REMOVE_WIDGET);
mPopUpNotification = null;
}
button.setNotificationMode(false);
public void showBookmarkAddedNotification() {
showNotification(BOOKMARK_ADDED_NOTIFICATION_ID, R.string.bookmarks_saved_notification);
}

private void showNotification(int notificationId, UIButton button, int stringRes) {
NotificationManager.Notification notification = new NotificationManager.Builder(this)
.withView(button)
.withString(stringRes)
.withPosition(NotificationManager.Notification.BOTTOM)
.withMargin(20.0f).build();
NotificationManager.show(notificationId, notification);
}

private void showNotification(int notificationId, int stringRes) {
NotificationManager.Notification notification = new NotificationManager.Builder(this)
.withString(stringRes)
.withPosition(NotificationManager.Notification.BOTTOM)
.withMargin(20.0f).build();
NotificationManager.show(notificationId, notification);
}

private void hideNotification() {
NotificationManager.hideAll();
}

private ConnectivityReceiver.Delegate mConnectivityDelegate = connected -> {
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
package org.mozilla.vrbrowser.ui.widgets;

import android.graphics.Rect;
import android.view.View;

import androidx.annotation.DimenRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;

import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.ui.views.UIButton;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class NotificationManager {

private static final int DEFAULT_DURATION = 3000;

private static HashMap<Integer, NotificationData> mData = new HashMap<>();

private static class NotificationData {

private TooltipWidget mNotificationView;
private Notification mNotification;
private Runnable mHideTask;

public NotificationData(@NonNull TooltipWidget view, @NonNull Notification notification, @NonNull Runnable hideTask) {
mNotificationView = view;
mNotification = notification;
mHideTask = hideTask;
}

}

public static class Notification {

public static final int MIDDLE = 0;
public static final int TOP = 1;
public static final int BOTTOM = 2;
public static final int LEFT = 4;
public static final int RIGHT = 8;

private UIWidget mParent;
private View mView;
private String mString;
private float mMargin;
private float mZTranslation;
private int mPositionFlags;
private @DimenRes int mDensity;
private @LayoutRes int mLayoutRes;
private int mDuration;
private boolean mCurved;

public Notification(@NonNull Builder builder) {
mParent = builder.parent;
mView = builder.view;
mString = builder.string;
mMargin = builder.margin;
mZTranslation = builder.zTranslation;
mPositionFlags = builder.positionFlags;
mDensity = builder.density;
mLayoutRes = builder.layoutRes;
mDuration = builder.duration;
mCurved = builder.curved;
}
}

public static class Builder {

private UIWidget parent;
private View view = null;
private String string;
private float margin = 0.0f;
private float zTranslation = 0.0f;
private int positionFlags = Notification.MIDDLE;
private @DimenRes int density;
private @LayoutRes int layoutRes = R.layout.library_notification;
private int duration = DEFAULT_DURATION;
private boolean curved = false;

public Builder(@NonNull UIWidget parent) {
this.parent = parent;
this.density = R.dimen.tooltip_default_density;
}

public Builder withString(@StringRes int res) {
this.string = parent.getContext().getString(res);
return this;
}

public Builder withString(String string) {
this.string = string;
return this;
}

public Builder withView(@NonNull View view) {
this.view = view;
return this;
}

public Builder withMargin(float margin){
this.margin = margin;
return this;
}

public Builder withPosition(int positionFlags) {
this.positionFlags = positionFlags;
return this;
}

public Builder withZTranslation(float translation) {
this.zTranslation = translation;
return this;
}

public Builder withDensity(@DimenRes int density) {
this.density = density;
return this;
}

public Builder withLayout(@LayoutRes int res) {
this.layoutRes = res;
return this;
}

public Builder withDuration(int duration) {
this.duration = duration;
return this;
}

public Builder withCurved(boolean curved) {
this.curved = curved;
return this;
}

public Notification build(){
return new Notification(this);
}
}


public static void show(int notificationId, @NonNull Notification notification) {
if (mData.containsKey(notificationId)) {
return;
}

TooltipWidget notificationView = new TooltipWidget(notification.mParent.getContext(), notification.mLayoutRes);

notification.mParent.requestFocus();
notification.mParent.requestFocusFromTouch();

setPlacement(notificationView, notification);

notificationView.setText(notification.mString);
notificationView.setCurvedMode(false);
notificationView.show(UIWidget.CLEAR_FOCUS);

if (notification.mView instanceof UIButton) {
((UIButton)notification.mView).setNotificationMode(true);
}

Runnable hideTask = () -> hide(notificationId);
ThreadUtils.postDelayedToUiThread(hideTask, notification.mDuration);

mData.put(notificationId, new NotificationData(notificationView, notification, hideTask));
}

public static void hide(int notificationId) {
if (!mData.containsKey(notificationId)) {
return;
}

NotificationData data = mData.get(notificationId);
if (data != null && data.mNotificationView.isVisible()) {
ThreadUtils.removeCallbacksFromUiThread(data.mHideTask);

data.mNotificationView.hide(UIWidget.REMOVE_WIDGET);

if (data.mNotification.mView instanceof UIButton) {
((UIButton)data.mNotification.mView).setNotificationMode(false);
}

mData.remove(notificationId);
}
}

public static void hideAll() {
Iterator<Map.Entry<Integer, NotificationData>> it = mData.entrySet().iterator();
while (it.hasNext()) {
hide(it.next().getKey());
}
}

private static void setPlacement(@NonNull TooltipWidget notificationView, @NonNull Notification notification) {
notificationView.getPlacement().parentHandle = notification.mParent.getHandle();
notificationView.getPlacement().density = WidgetPlacement.floatDimension(notification.mParent.getContext(), notification.mDensity);
notificationView.getPlacement().translationZ = notification.mZTranslation;
notificationView.getPlacement().cylinder = notification.mCurved;

Rect offsetViewBounds = new Rect();
if (notification.mView != null) {
notification.mParent.getDrawingRect(offsetViewBounds);
notification.mParent.offsetDescendantRectToMyCoords(notification.mView, offsetViewBounds);
}

int width = 0;
int height = 0;
float ratio = 1.0f;
if (notification.mView != null) {
width = notification.mView.getWidth();
height = notification.mView.getHeight();
ratio = WidgetPlacement.viewToWidgetRatio(notification.mParent.getContext(), notification.mParent);
}

if (notification.mView == null) {
notificationView.getPlacement().anchorX = 0.5f;
notificationView.getPlacement().parentAnchorX = 0.5f;
notificationView.getPlacement().anchorY = 0.5f;
notificationView.getPlacement().parentAnchorY = 0.5f;

if ((notification.mPositionFlags & Notification.TOP) == Notification.TOP) {
notificationView.getPlacement().anchorY = 0.0f;
notificationView.getPlacement().parentAnchorY = 1.0f;
notificationView.getPlacement().translationY = notification.mMargin;
}

if ((notification.mPositionFlags & Notification.BOTTOM) == Notification.BOTTOM) {
notificationView.getPlacement().anchorY = 1.0f;
notificationView.getPlacement().parentAnchorY = 0.0f;
notificationView.getPlacement().translationY = -notification.mMargin;
}

if ((notification.mPositionFlags & Notification.LEFT) == Notification.LEFT) {
notificationView.getPlacement().anchorX = 1.0f;
notificationView.getPlacement().parentAnchorX = 0.0f;
notificationView.getPlacement().translationX = -notification.mMargin;
}

if ((notification.mPositionFlags & Notification.RIGHT) == Notification.RIGHT) {
notificationView.getPlacement().anchorX = 0.0f;
notificationView.getPlacement().parentAnchorX = 1.0f;
notificationView.getPlacement().translationX = notification.mMargin;
}

} else {
notificationView.getPlacement().parentAnchorX = 0.0f;
notificationView.getPlacement().parentAnchorY = 1.0f;
notificationView.getPlacement().anchorX = 0.5f;
notificationView.getPlacement().anchorY = 0.5f;

notificationView.getPlacement().translationX = (offsetViewBounds.left + (width / 2.0f)) * ratio;
notificationView.getPlacement().translationY = -(offsetViewBounds.bottom - (height / 2.0f)) * ratio;

if ((notification.mPositionFlags & Notification.TOP) == Notification.TOP) {
notificationView.getPlacement().anchorY = 0.0f;
notificationView.getPlacement().translationY = (offsetViewBounds.top + notification.mMargin) * ratio;
}

if ((notification.mPositionFlags & Notification.BOTTOM) == Notification.BOTTOM) {
notificationView.getPlacement().anchorY = 1.0f;
notificationView.getPlacement().translationY = -(offsetViewBounds.bottom + notification.mMargin) * ratio;
}

if ((notification.mPositionFlags & Notification.LEFT) == Notification.LEFT) {
notificationView.getPlacement().anchorX = 1.0f;
notificationView.getPlacement().translationX = (offsetViewBounds.left - notification.mMargin) * ratio;
}

if ((notification.mPositionFlags & Notification.RIGHT) == Notification.RIGHT) {
notificationView.getPlacement().anchorX = 0.0f;
notificationView.getPlacement().translationX = (offsetViewBounds.left + width + notification.mMargin) * ratio;
}
}
}

}
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
@@ -23,7 +22,6 @@
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.VRBrowserActivity;
@@ -44,7 +42,10 @@
public class TrayWidget extends UIWidget implements SessionChangeListener, WidgetManagerDelegate.UpdateListener {

private static final int ICON_ANIMATION_DURATION = 200;
private static final int LIBRARY_NOTIFICATION_DURATION = 3000;

private static final int TAB_ADDED_NOTIFICATION_ID = 0;
private static final int TAB_SENT_NOTIFICATION_ID = 1;
private static final int BOOKMARK_ADDED_NOTIFICATION_ID = 2;

private WindowViewModel mViewModel;
private TrayBinding mBinding;
@@ -58,7 +59,6 @@ public class TrayWidget extends UIWidget implements SessionChangeListener, Widge
private boolean mTrayVisible = true;
private Session mSession;
private WindowWidget mAttachedWindow;
private TooltipWidget mLibraryNotification;
private boolean mAddWindowVisible;

public TrayWidget(Context aContext) {
@@ -306,8 +306,7 @@ public void show(@ShowFlags int aShowFlags) {

@Override
public void hide(@HideFlags int aHideFlags) {
hideNotification(mBinding.bookmarksButton);
hideNotification(mBinding.tabsButton);
hideNotifications();

if (mWidgetPlacement.visible) {
mWidgetPlacement.visible = false;
@@ -321,9 +320,8 @@ public void hide(@HideFlags int aHideFlags) {

@Override
public void detachFromWindow() {
hideNotification(mBinding.bookmarksButton);
hideNotification(mBinding.tabsButton);

hideNotifications();

if (mSession != null) {
mSession.removeSessionChangeListener(this);
mSession = null;
@@ -522,13 +520,29 @@ public void onWidgetUpdate(Widget aWidget) {
}

public void showTabAddedNotification() {
mBinding.tabsButton.setNotificationMode(true);
ThreadUtils.postToUiThread(() -> showNotification(mBinding.tabsButton, R.string.tab_added_notification));
showNotification(TAB_ADDED_NOTIFICATION_ID, mBinding.tabsButton, R.string.tab_added_notification);
}

public void showTabSentNotification() {
mBinding.tabsButton.setNotificationMode(true);
ThreadUtils.postToUiThread(() -> showNotification(mBinding.tabsButton, R.string.tab_sent_notification));
showNotification(TAB_SENT_NOTIFICATION_ID, mBinding.tabsButton, R.string.tab_sent_notification);
}

public void showBookmarkAddedNotification() {
showNotification(BOOKMARK_ADDED_NOTIFICATION_ID, mBinding.bookmarksButton, R.string.bookmarks_saved_notification);
}

private void showNotification(int notificationId, UIButton button, int stringRes) {
NotificationManager.Notification notification = new NotificationManager.Builder(this)
.withView(button)
.withDensity(R.dimen.tray_tooltip_density)
.withString(stringRes)
.withPosition(NotificationManager.Notification.TOP)
.withZTranslation(25.0f).build();
NotificationManager.show(notificationId, notification);
}

private void hideNotifications() {
NotificationManager.hideAll();
}

private BookmarksStore.BookmarkListener mBookmarksListener = new BookmarksStore.BookmarkListener() {
@@ -539,40 +553,7 @@ public void onBookmarksUpdated() {

@Override
public void onBookmarkAdded() {
mBinding.bookmarksButton.setNotificationMode(true);
ThreadUtils.postToUiThread(() -> showNotification(mBinding.bookmarksButton, R.string.bookmarks_saved_notification));
mWidgetManager.getWindows().showBookmarkAddedNotification();
}
};

private void showNotification(UIButton button, int stringRes) {
if (mLibraryNotification != null && mLibraryNotification.isVisible()) {
return;
}

Rect offsetViewBounds = new Rect();
getDrawingRect(offsetViewBounds);
offsetDescendantRectToMyCoords(button, offsetViewBounds);

float ratio = WidgetPlacement.viewToWidgetRatio(getContext(), TrayWidget.this);

mLibraryNotification = new TooltipWidget(getContext(), R.layout.library_notification);
mLibraryNotification.getPlacement().parentHandle = getHandle();
mLibraryNotification.getPlacement().anchorY = 0.0f;
mLibraryNotification.getPlacement().translationX = (offsetViewBounds.left + button.getWidth() / 2.0f) * ratio;
mLibraryNotification.getPlacement().translationY = ((offsetViewBounds.top - 60) * ratio);
mLibraryNotification.getPlacement().translationZ = 25.0f;
mLibraryNotification.getPlacement().density = WidgetPlacement.floatDimension(getContext(), R.dimen.tray_tooltip_density);
mLibraryNotification.setText(stringRes);
mLibraryNotification.setCurvedMode(false);
mLibraryNotification.show(UIWidget.CLEAR_FOCUS);

ThreadUtils.postDelayedToUiThread(() -> hideNotification(button), LIBRARY_NOTIFICATION_DURATION);
}

private void hideNotification(UIButton button) {
if (mLibraryNotification != null) {
mLibraryNotification.hide(UIWidget.REMOVE_WIDGET);
}
button.setNotificationMode(false);
}
}
Original file line number Diff line number Diff line change
@@ -86,6 +86,8 @@ interface WorldClickListener {
void openNewTabForeground(@NonNull String uri);
WindowWidget getFocusedWindow();
TrayWidget getTray();
NavigationBarWidget getNavigationBar();
Windows getWindows();
void addConnectivityListener(ConnectivityReceiver.Delegate aListener);
void removeConnectivityListener(ConnectivityReceiver.Delegate aListener);
void saveState();
Original file line number Diff line number Diff line change
@@ -1061,7 +1061,7 @@ public void onStackSession(Session aSession) {
setSession(aSession);
SessionStore.get().setActiveSession(aSession);
current.captureBackgroundBitmap(getWindowWidth(), getWindowHeight()).thenAccept(aVoid -> current.setActive(false));
mWidgetManager.getTray().showTabAddedNotification();
mWidgetManager.getWindows().showTabAddedNotification();

GleanMetricsService.Tabs.openedCounter(GleanMetricsService.Tabs.TabSource.BROWSER);
}
Original file line number Diff line number Diff line change
@@ -54,6 +54,10 @@ public class Windows implements TrayListener, TopBarWidget.Delegate, TitleBarWid

private static final String WINDOWS_SAVE_FILENAME = "windows_state.json";

private static final int TAB_ADDED_NOTIFICATION_ID = 0;
private static final int TAB_SENT_NOTIFICATION_ID = 1;
private static final int BOOKMARK_ADDED_NOTIFICATION_ID = 2;

class WindowState {
WindowPlacement placement;
int textureWidth;
@@ -1148,7 +1152,7 @@ public void addBackgroundTab(WindowWidget targetWindow, String aUri) {
Session session = SessionStore.get().createSuspendedSession(aUri, targetWindow.getSession().isPrivateMode());
session.updateLastUse();
mFocusedWindow.getSession().updateLastUse();
mWidgetManager.getTray().showTabAddedNotification();
showTabAddedNotification();
}

@Override
@@ -1242,7 +1246,7 @@ public void onTabsReceived(@NonNull List<TabData> aTabs) {
}

if (!fullscreen) {
mWidgetManager.getTray().showTabAddedNotification();
showTabAddedNotification();
}

if (mTabsWidget != null && mTabsWidget.isVisible()) {
@@ -1276,4 +1280,59 @@ public void onTabsReceived(@NonNull List<TabData> aTabs) {
mNoInternetDialog = null;
}
};

public void showTabAddedNotification() {
if (mFocusedWindow.isFullScreen()) {
mWidgetManager.getNavigationBar().showTabAddedNotification();

} else {
if (mWidgetManager.getTray().isVisible()) {
mWidgetManager.getTray().showTabAddedNotification();

} else {
NotificationManager.Notification notification = new NotificationManager.Builder(mFocusedWindow)
.withString(R.string.tab_added_notification)
.withZTranslation(25.0f)
.withCurved(true).build();
NotificationManager.show(TAB_ADDED_NOTIFICATION_ID, notification);
}
}

}

public void showTabSentNotification() {
if (mFocusedWindow.isFullScreen()) {
mWidgetManager.getNavigationBar().showTabSentNotification();

} else {
if (mWidgetManager.getTray().isVisible()) {
mWidgetManager.getTray().showTabSentNotification();

} else {
NotificationManager.Notification notification = new NotificationManager.Builder(mFocusedWindow)
.withString(R.string.tab_sent_notification)
.withZTranslation(25.0f)
.withCurved(true).build();
NotificationManager.show(TAB_SENT_NOTIFICATION_ID, notification);
}
}
}

public void showBookmarkAddedNotification() {
if (mFocusedWindow.isFullScreen()) {
mWidgetManager.getNavigationBar().showBookmarkAddedNotification();

} else {
if (mWidgetManager.getTray().isVisible()) {
mWidgetManager.getTray().showBookmarkAddedNotification();

} else {
NotificationManager.Notification notification = new NotificationManager.Builder(mFocusedWindow)
.withString(R.string.bookmarks_saved_notification)
.withZTranslation(25.0f)
.withCurved(true).build();
NotificationManager.show(BOOKMARK_ADDED_NOTIFICATION_ID, notification);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -122,8 +122,8 @@ private void sendTabButtonClick(View v) {
// At some point we will support sending to multiple devices or to all of them
mAccounts.sendTabs(Collections.singletonList(device), session.getCurrentUri(), session.getCurrentTitle());

// Show the tab sent notifications in the tray
mWidgetManager.getTray().showTabSentNotification();
// Show the tab sent notifications
mWidgetManager.getWindows().showTabSentNotification();

onDismiss();
}
10 changes: 0 additions & 10 deletions app/src/main/res/layout/library_notification.xml
Original file line number Diff line number Diff line change
@@ -44,15 +44,5 @@
android:drawablePadding="5dp"/>
</FrameLayout>
</FrameLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="-3dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="30dp"
android:layout_height="15dp"
android:background="@drawable/library_notification_background_triangle"/>
</FrameLayout>
</LinearLayout>
</merge>

0 comments on commit 6c51e61

Please sign in to comment.