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

Commit

Permalink
Update Bookmarks string after a language change (#2798)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Feb 18, 2020
1 parent aa2edc9 commit 37ac4cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,8 @@ public void onConfigurationChanged(Configuration newConfig) {

LocaleUtils.update(this, language);

mWidgets.forEach((i, widget) -> widget.onConfigurationChanged(newConfig));

SessionStore.get().onConfigurationChanged(newConfig);
mWidgets.forEach((i, widget) -> widget.onConfigurationChanged(newConfig));

super.onConfigurationChanged(newConfig);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package org.mozilla.vrbrowser.browser

import android.content.Context
import android.content.res.Configuration
import android.os.Handler
import android.os.Looper
import androidx.lifecycle.ProcessLifecycleOwner
Expand Down Expand Up @@ -60,7 +61,7 @@ class BookmarksStore constructor(val context: Context) {

private val listeners = ArrayList<BookmarkListener>()
private var storage = (context.applicationContext as VRBrowserApplication).places.bookmarks
private val titles = rootTitles(context)
private var titles = rootTitles(context)
private val accountManager = (context.applicationContext as VRBrowserApplication).services.accountManager

// Bookmarks might have changed during sync, so notify our listeners.
Expand All @@ -81,6 +82,11 @@ class BookmarksStore constructor(val context: Context) {
)
}

// Update the folder strings after a language update
fun onConfigurationChanged(newConfig: Configuration) {
titles = rootTitles(context)
}

interface BookmarkListener {
fun onBookmarksUpdated()
fun onBookmarkAdded()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ public void onConfigurationChanged(Configuration newConfig) {
if (mRuntime != null) {
mRuntime.configurationChanged(newConfig);
}

mBookmarksStore.onConfigurationChanged(newConfig);
}

// Session Settings
Expand Down

0 comments on commit 37ac4cb

Please sign in to comment.