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

Force view redraw when showing the awesome bar #2050

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
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 @@ -109,7 +109,7 @@ public CompletableFuture<List<String>> getSuggestions(String aQuery) {
// TODO: Use mSuggestionsClient.getSuggestions when fixed in browser-search.
String query = getSuggestionURL(aQuery);
new Handler(mContext.getMainLooper()).post(() ->
SuggestionsClient.getSuggestions(mSearchEngine, query).thenAcceptAsync((result) -> future.complete(result)));
SuggestionsClient.getSuggestions(mSearchEngine, query).thenAcceptAsync(future::complete));

return future;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SuggestionsClient {
private static AsyncHttpClient client = new AsyncHttpClient();

public static CompletableFuture<List<String>> getSuggestions(SearchEngine mEngine, String aQuery) {
final CompletableFuture future = new CompletableFuture();
final CompletableFuture<List<String>> future = new CompletableFuture<>();
client.cancelAllRequests(true);
client.get(aQuery, null, new TextHttpResponseHandler("ISO-8859-1") {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void onAnimationStart(Animation animation) {

@Override
public void onAnimationEnd(Animation animation) {
ThreadUtils.postToUiThread(() -> SuggestionsWidget.super.hide(REMOVE_WIDGET));
post(() -> SuggestionsWidget.super.hide(REMOVE_WIDGET));
}

@Override
Expand Down Expand Up @@ -145,6 +145,7 @@ public void updateItems(List<SuggestionItem> items) {
mAdapter.clear();
mAdapter.addAll(items);
mAdapter.notifyDataSetChanged();
mList.invalidateViews();
}

public void updatePlacement(int aWidth) {
Expand Down Expand Up @@ -199,6 +200,7 @@ public SuggestionsAdapter(@NonNull Context context, int resource, @NonNull List<
super(context, resource, objects);
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
View listItem = convertView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,10 @@ public void onLocationChange(@NonNull GeckoSession session, @Nullable String url

@Override
public void onHistoryStateChange(@NonNull GeckoSession geckoSession, @NonNull HistoryList historyList) {
for (HistoryItem item : historyList) {
SessionStore.get().getHistoryStore().recordObservation(item.getUri(), new PageObservation(item.getTitle()));
if (!mSession.isPrivateMode()) {
for (HistoryItem item : historyList) {
SessionStore.get().getHistoryStore().recordObservation(item.getUri(), new PageObservation(item.getTitle()));
}
}
}

Expand Down