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

Commit 33fbbff

Browse files
keianhzobluemarvin
authored andcommitted
Force view redraw when showing the awesome bar (#2050)
1 parent 626f896 commit 33fbbff

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

app/src/common/shared/org/mozilla/vrbrowser/search/SearchEngineWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public CompletableFuture<List<String>> getSuggestions(String aQuery) {
109109
// TODO: Use mSuggestionsClient.getSuggestions when fixed in browser-search.
110110
String query = getSuggestionURL(aQuery);
111111
new Handler(mContext.getMainLooper()).post(() ->
112-
SuggestionsClient.getSuggestions(mSearchEngine, query).thenAcceptAsync((result) -> future.complete(result)));
112+
SuggestionsClient.getSuggestions(mSearchEngine, query).thenAcceptAsync(future::complete));
113113

114114
return future;
115115
}

app/src/common/shared/org/mozilla/vrbrowser/search/suggestions/SuggestionsClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class SuggestionsClient {
1414
private static AsyncHttpClient client = new AsyncHttpClient();
1515

1616
public static CompletableFuture<List<String>> getSuggestions(SearchEngine mEngine, String aQuery) {
17-
final CompletableFuture future = new CompletableFuture();
17+
final CompletableFuture<List<String>> future = new CompletableFuture<>();
1818
client.cancelAllRequests(true);
1919
client.get(aQuery, null, new TextHttpResponseHandler("ISO-8859-1") {
2020
@Override

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/SuggestionsWidget.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void onAnimationStart(Animation animation) {
7575

7676
@Override
7777
public void onAnimationEnd(Animation animation) {
78-
ThreadUtils.postToUiThread(() -> SuggestionsWidget.super.hide(REMOVE_WIDGET));
78+
post(() -> SuggestionsWidget.super.hide(REMOVE_WIDGET));
7979
}
8080

8181
@Override
@@ -145,6 +145,7 @@ public void updateItems(List<SuggestionItem> items) {
145145
mAdapter.clear();
146146
mAdapter.addAll(items);
147147
mAdapter.notifyDataSetChanged();
148+
mList.invalidateViews();
148149
}
149150

150151
public void updatePlacement(int aWidth) {
@@ -199,6 +200,7 @@ public SuggestionsAdapter(@NonNull Context context, int resource, @NonNull List<
199200
super(context, resource, objects);
200201
}
201202

203+
@Override
202204
public View getView(int position, View convertView, ViewGroup parent) {
203205
View listItem = convertView;
204206

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,8 +1463,10 @@ public void onLocationChange(@NonNull GeckoSession session, @Nullable String url
14631463

14641464
@Override
14651465
public void onHistoryStateChange(@NonNull GeckoSession geckoSession, @NonNull HistoryList historyList) {
1466-
for (HistoryItem item : historyList) {
1467-
SessionStore.get().getHistoryStore().recordObservation(item.getUri(), new PageObservation(item.getTitle()));
1466+
if (!mSession.isPrivateMode()) {
1467+
for (HistoryItem item : historyList) {
1468+
SessionStore.get().getHistoryStore().recordObservation(item.getUri(), new PageObservation(item.getTitle()));
1469+
}
14681470
}
14691471
}
14701472

0 commit comments

Comments
 (0)