Revert "Fixed Cursor initialization deprecation"

This reverts commit df9954ba0b927183d8fa4765e51f5b0033ff6168.

The revert is to fix #606 for the 0.100 stable release.
This commit is contained in:
Peter Serwylo 2016-05-16 23:45:17 +10:00
parent 611db650d5
commit 59a533234e
9 changed files with 12 additions and 46 deletions

View File

@ -22,7 +22,6 @@ public abstract class AppListAdapter extends CursorAdapter {
private DisplayImageOptions displayImageOptions;
private String upgradeFromTo;
@SuppressWarnings("deprecation")
public AppListAdapter(Context context, Cursor c) {
super(context, c);
init(context);

View File

@ -2,18 +2,10 @@ package org.fdroid.fdroid.views;
import android.content.Context;
import android.database.Cursor;
import android.os.Build;
public class AvailableAppListAdapter extends AppListAdapter {
public static AvailableAppListAdapter create(Context context, Cursor cursor, int flags) {
if (Build.VERSION.SDK_INT >= 11) {
return new AvailableAppListAdapter(context, cursor, flags);
}
return new AvailableAppListAdapter(context, cursor);
}
private AvailableAppListAdapter(Context context, Cursor c) {
public AvailableAppListAdapter(Context context, Cursor c) {
super(context, c);
}
@ -21,7 +13,7 @@ public class AvailableAppListAdapter extends AppListAdapter {
super(context, c, autoRequery);
}
private AvailableAppListAdapter(Context context, Cursor c, int flags) {
public AvailableAppListAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
}

View File

@ -2,18 +2,10 @@ package org.fdroid.fdroid.views;
import android.content.Context;
import android.database.Cursor;
import android.os.Build;
public class CanUpdateAppListAdapter extends AppListAdapter {
public static CanUpdateAppListAdapter create(Context context, Cursor cursor, int flags) {
if (Build.VERSION.SDK_INT >= 11) {
return new CanUpdateAppListAdapter(context, cursor, flags);
}
return new CanUpdateAppListAdapter(context, cursor);
}
private CanUpdateAppListAdapter(Context context, Cursor c) {
public CanUpdateAppListAdapter(Context context, Cursor c) {
super(context, c);
}
@ -21,7 +13,7 @@ public class CanUpdateAppListAdapter extends AppListAdapter {
super(context, c, autoRequery);
}
private CanUpdateAppListAdapter(Context context, Cursor c, int flags) {
public CanUpdateAppListAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
}

View File

@ -2,18 +2,10 @@ package org.fdroid.fdroid.views;
import android.content.Context;
import android.database.Cursor;
import android.os.Build;
public class InstalledAppListAdapter extends AppListAdapter {
public static InstalledAppListAdapter create(Context context, Cursor cursor, int flags) {
if (Build.VERSION.SDK_INT >= 11) {
return new InstalledAppListAdapter(context, cursor, flags);
}
return new InstalledAppListAdapter(context, cursor);
}
private InstalledAppListAdapter(Context context, Cursor c) {
public InstalledAppListAdapter(Context context, Cursor c) {
super(context, c);
}
@ -21,7 +13,7 @@ public class InstalledAppListAdapter extends AppListAdapter {
super(context, c, autoRequery);
}
private InstalledAppListAdapter(Context context, Cursor c, int flags) {
public InstalledAppListAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
}

View File

@ -767,7 +767,7 @@ public class ManageReposActivity extends ActionBarActivity {
setRetainInstance(true);
setHasOptionsMenu(true);
repoAdapter = RepoAdapter.create(getActivity(), null, 0);
repoAdapter = new RepoAdapter(getActivity(), null);
repoAdapter.setEnabledListener(this);
setListAdapter(repoAdapter);
}

View File

@ -2,7 +2,6 @@ package org.fdroid.fdroid.views;
import android.content.Context;
import android.database.Cursor;
import android.os.Build;
import android.support.v4.widget.CursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
@ -23,14 +22,7 @@ public class RepoAdapter extends CursorAdapter {
private EnabledListener enabledListener;
public static RepoAdapter create(Context context, Cursor cursor, int flags) {
if (Build.VERSION.SDK_INT >= 11) {
return new RepoAdapter(context, cursor, flags);
}
return new RepoAdapter(context, cursor);
}
private RepoAdapter(Context context, Cursor c, int flags) {
public RepoAdapter(Context context, Cursor c, int flags) {
super(context, c, flags);
inflater = LayoutInflater.from(context);
}
@ -40,8 +32,7 @@ public class RepoAdapter extends CursorAdapter {
inflater = LayoutInflater.from(context);
}
@SuppressWarnings("deprecation")
private RepoAdapter(Context context, Cursor c) {
public RepoAdapter(Context context, Cursor c) {
super(context, c);
inflater = LayoutInflater.from(context);
}

View File

@ -59,7 +59,7 @@ public class AvailableAppsFragment extends AppListFragment implements
@Override
protected AppListAdapter getAppListAdapter() {
if (adapter == null) {
final AppListAdapter a = AvailableAppListAdapter.create(getActivity(), null, 0);
final AppListAdapter a = new AvailableAppListAdapter(getActivity(), null);
Preferences.get().registerUpdateHistoryListener(new Preferences.ChangeListener() {
@Override
public void onPreferenceChange() {

View File

@ -15,7 +15,7 @@ public class CanUpdateAppsFragment extends AppListFragment {
@Override
protected AppListAdapter getAppListAdapter() {
return CanUpdateAppListAdapter.create(getActivity(), null, 0);
return new CanUpdateAppListAdapter(getActivity(), null);
}
@Override

View File

@ -15,7 +15,7 @@ public class InstalledAppsFragment extends AppListFragment {
@Override
protected AppListAdapter getAppListAdapter() {
return InstalledAppListAdapter.create(getActivity(), null, 0);
return new InstalledAppListAdapter(getActivity(), null);
}
@Override