mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset ea2d05f0a053 (bug 856767) for robocop bustage on a CLOSED TREE.
This commit is contained in:
parent
e0e0ce11ba
commit
04fd0a18b7
@ -192,12 +192,11 @@ public class AboutHomeContent extends ScrollView
|
|||||||
* Reinflates and updates all components of this view.
|
* Reinflates and updates all components of this view.
|
||||||
*/
|
*/
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
mTopSites.onDestroy();
|
|
||||||
|
|
||||||
// We must remove the currently inflated view to allow for reinflation.
|
// We must remove the currently inflated view to allow for reinflation.
|
||||||
removeAllViews();
|
removeAllViews();
|
||||||
|
|
||||||
inflate();
|
inflate();
|
||||||
|
mTopSites.refresh();
|
||||||
|
|
||||||
// Refresh all elements.
|
// Refresh all elements.
|
||||||
update(AboutHomeContent.UpdateFlags.ALL);
|
update(AboutHomeContent.UpdateFlags.ALL);
|
||||||
|
@ -141,15 +141,9 @@ public class TopSitesView extends GridView {
|
|||||||
|
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if (mTopSitesAdapter != null) {
|
if (mTopSitesAdapter != null) {
|
||||||
final Cursor cursor = mTopSitesAdapter.getCursor();
|
Cursor cursor = mTopSitesAdapter.getCursor();
|
||||||
|
if (cursor != null && !cursor.isClosed())
|
||||||
ThreadUtils.postToBackgroundThread(new Runnable() {
|
cursor.close();
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (cursor != null && !cursor.isClosed())
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,9 +186,12 @@ public class TopSitesView extends GridView {
|
|||||||
|
|
||||||
public void loadTopSites() {
|
public void loadTopSites() {
|
||||||
final ContentResolver resolver = mContext.getContentResolver();
|
final ContentResolver resolver = mContext.getContentResolver();
|
||||||
|
Cursor old = null;
|
||||||
|
if (mTopSitesAdapter != null) {
|
||||||
|
old = mTopSitesAdapter.getCursor();
|
||||||
|
}
|
||||||
// Swap in the new cursor.
|
// Swap in the new cursor.
|
||||||
final Cursor oldCursor = (mTopSitesAdapter != null) ? mTopSitesAdapter.getCursor() : null;
|
final Cursor oldCursor = old;
|
||||||
final Cursor newCursor = BrowserDB.getTopSites(resolver, mNumberOfTopSites);
|
final Cursor newCursor = BrowserDB.getTopSites(resolver, mNumberOfTopSites);
|
||||||
|
|
||||||
post(new Runnable() {
|
post(new Runnable() {
|
||||||
@ -343,6 +340,13 @@ public class TopSitesView extends GridView {
|
|||||||
mLoadCompleteCallback = callback;
|
mLoadCompleteCallback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void refresh() {
|
||||||
|
if (mTopSitesAdapter != null)
|
||||||
|
mTopSitesAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
setAdapter(mTopSitesAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
private class TopSitesViewHolder {
|
private class TopSitesViewHolder {
|
||||||
public TextView titleView = null;
|
public TextView titleView = null;
|
||||||
public ImageView thumbnailView = null;
|
public ImageView thumbnailView = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user