Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
haanhvu committed Dec 4, 2024
1 parent 7ece1bd commit 76b493b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -470,10 +470,10 @@ public MutableLiveData<String> 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/tray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@
<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/libraryButton"
style="@style/trayButtonMiddleTheme"
android:tooltipText="@{viewmodel.isNativeContentVisible &amp;&amp; viewmodel.currentContentType != ContentType.NEW_TAB? @string/close_library_tooltip : @string/open_library_tooltip}"
android:tooltipText="@{viewmodel.isNativeContentVisible &amp;&amp; !viewmodel.isInNewTabPage? @string/close_library_tooltip : @string/open_library_tooltip}"
app:tooltipDensity="@dimen/tray_tooltip_density"
app:tooltipPosition="bottom"
app:tooltipLayout="@layout/tooltip_tray"
android:src="@drawable/ic_icon_library"
app:clipDrawable="@drawable/ic_icon_library_clip"
app:activeMode="@{viewmodel.isNativeContentVisible &amp;&amp; viewmodel.currentContentType != ContentType.NEW_TAB}"/>
app:activeMode="@{viewmodel.isNativeContentVisible &amp;&amp; !viewmodel.isInNewTabPage}"/>
<com.google.android.material.textview.MaterialTextView
android:layout_width="12dp"
android:layout_height="12dp"
Expand Down

0 comments on commit 76b493b

Please sign in to comment.