Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home button reverts Desktop Mode #1117

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.net.Uri;
import androidx.preference.PreferenceManager;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Pair;
Expand All @@ -33,6 +31,7 @@
import androidx.databinding.ObservableBoolean;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.preference.PreferenceManager;

import com.igalia.wolvic.BuildConfig;
import com.igalia.wolvic.R;
Expand Down Expand Up @@ -267,6 +266,16 @@ private void updateUI() {
mBinding.navigationBarNavigation.homeButton.setOnClickListener(v -> {
v.requestFocusFromTouch();
getSession().loadUri(getSession().getHomeUri());

// Revert desktop mode
final int defaultUaMode = SettingsStore.getInstance(mAppContext).getUaMode();
if (mHamburgerMenu != null) {
mHamburgerMenu.setUAMode(defaultUaMode);
}
if (mAttachedWindow.getSession() != null) {
mAttachedWindow.getSession().setUaMode(defaultUaMode, true);
}

if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}
Expand Down