diff --git a/app/src/common/shared/com/igalia/wolvic/ui/viewmodel/WindowViewModel.java b/app/src/common/shared/com/igalia/wolvic/ui/viewmodel/WindowViewModel.java index b19f6e18eb9..e9414f7f664 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/viewmodel/WindowViewModel.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/viewmodel/WindowViewModel.java @@ -256,7 +256,7 @@ public void onChanged(ObservableBoolean o) { @Override public void onChanged(Spannable aUrl) { String url = aUrl.toString(); - if (isNativeContentVisible.getValue().get() && currentContentType.getValue() != Windows.ContentType.NEW_TAB) { + if (isNativeContentVisible.getValue().get() && !isInNewTabPage.getValue().get()) { url = getApplication().getString(R.string.url_library_title); } else if (currentContentType.getValue() == Windows.ContentType.NEW_TAB) { @@ -470,10 +470,10 @@ public MutableLiveData getHint() { } private String getHintValue() { - if (isNativeContentVisible.getValue().get() && currentContentType.getValue() != Windows.ContentType.NEW_TAB) { + if (isNativeContentVisible.getValue().get() && !isInNewTabPage.getValue().get()) { return getApplication().getString(R.string.url_library_title); - } else if (currentContentType.getValue() == Windows.ContentType.NEW_TAB) { + } else if (isInNewTabPage.getValue().get()) { return getApplication().getString(R.string.url_new_tab_title); } else { diff --git a/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java b/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java index 47378645638..d15de6f1f75 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java @@ -600,7 +600,7 @@ private void hidePanel(boolean switchSurface) { } public void hideNewTab() { - if (mViewModel.getCurrentContentType().getValue() == Windows.ContentType.NEW_TAB) { + if (mViewModel.getIsInNewTabPage().getValue().get()) { mViewModel.enableBackToNewTab(true); hideNewTab(true); } diff --git a/app/src/main/res/layout/tray.xml b/app/src/main/res/layout/tray.xml index 7e8c3a61014..2e9b4b96a38 100644 --- a/app/src/main/res/layout/tray.xml +++ b/app/src/main/res/layout/tray.xml @@ -191,13 +191,13 @@ + app:activeMode="@{viewmodel.isNativeContentVisible && !viewmodel.isInNewTabPage}"/>