remove context
This commit is contained in:
parent
89cb0ad78c
commit
945aa51c02
|
@ -235,7 +235,7 @@ public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDom
|
|||
textviewNoAction = findViewById(R.id.no_action);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
domainsListAdapter = new DomainsListAdapter(MutedInstanceActivity.this, this.domains, textviewNoAction);
|
||||
domainsListAdapter = new DomainsListAdapter(this.domains, textviewNoAction);
|
||||
lv_domains.setAdapter(domainsListAdapter);
|
||||
|
||||
final LinearLayoutManager mLayoutManager;
|
||||
|
@ -330,7 +330,7 @@ public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDom
|
|||
textviewNoAction.setVisibility(View.GONE);
|
||||
max_id = apiResponse.getMax_id();
|
||||
if( swiped ){
|
||||
domainsListAdapter = new DomainsListAdapter(MutedInstanceActivity.this, this.domains, textviewNoAction);
|
||||
domainsListAdapter = new DomainsListAdapter(this.domains, textviewNoAction);
|
||||
lv_domains.setAdapter(domainsListAdapter);
|
||||
swiped = false;
|
||||
}
|
||||
|
|
|
@ -1968,7 +1968,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
}
|
||||
builderSingle = new AlertDialog.Builder(TootActivity.this, style);
|
||||
builderSingle.setTitle(getString(R.string.choose_toot));
|
||||
final DraftsListAdapter draftsListAdapter = new DraftsListAdapter(TootActivity.this, drafts);
|
||||
final DraftsListAdapter draftsListAdapter = new DraftsListAdapter(drafts);
|
||||
final int[] ids = new int[drafts.size()];
|
||||
int i = 0;
|
||||
for(StoredStatus draft: drafts){
|
||||
|
|
|
@ -48,14 +48,11 @@ import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
|||
public class DomainsListAdapter extends RecyclerView.Adapter implements OnRetrieveDomainsInterface {
|
||||
|
||||
private List<String> domains;
|
||||
private LayoutInflater layoutInflater;
|
||||
private Context context;
|
||||
private DomainsListAdapter domainsListAdapter;
|
||||
private RelativeLayout textviewNoAction;
|
||||
|
||||
public DomainsListAdapter(Context context, List<String> domains, RelativeLayout textviewNoAction){
|
||||
this.context = context;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
public DomainsListAdapter(List<String> domains, RelativeLayout textviewNoAction){
|
||||
this.domains = domains;
|
||||
this.domainsListAdapter = this;
|
||||
this.textviewNoAction = textviewNoAction;
|
||||
|
@ -65,6 +62,8 @@ public class DomainsListAdapter extends RecyclerView.Adapter implements OnRetrie
|
|||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(context);
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_domain, parent, false));
|
||||
}
|
||||
|
||||
|
|
|
@ -51,24 +51,19 @@ import static app.fedilab.android.helper.Helper.changeDrawableColor;
|
|||
public class DraftsListAdapter extends BaseAdapter {
|
||||
|
||||
private List<StoredStatus> storedStatuses;
|
||||
private LayoutInflater layoutInflater;
|
||||
private Context context;
|
||||
private DraftsListAdapter draftsListAdapter;
|
||||
private boolean clickable;
|
||||
private RelativeLayout textviewNoAction;
|
||||
|
||||
public DraftsListAdapter(Context context, List<StoredStatus> storedStatuses){
|
||||
public DraftsListAdapter(List<StoredStatus> storedStatuses){
|
||||
this.storedStatuses = storedStatuses;
|
||||
this.context = context;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
draftsListAdapter = this;
|
||||
this.clickable = false;
|
||||
}
|
||||
|
||||
public DraftsListAdapter(Context context, List<StoredStatus> storedStatuses, boolean clickable, RelativeLayout textviewNoAction){
|
||||
public DraftsListAdapter(List<StoredStatus> storedStatuses, boolean clickable, RelativeLayout textviewNoAction){
|
||||
this.storedStatuses = storedStatuses;
|
||||
this.context = context;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
draftsListAdapter = this;
|
||||
this.clickable = clickable;
|
||||
this.textviewNoAction = textviewNoAction;
|
||||
|
@ -92,7 +87,8 @@ public class DraftsListAdapter extends BaseAdapter {
|
|||
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(context);
|
||||
final StoredStatus draft = storedStatuses.get(position);
|
||||
final ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
|
|
|
@ -15,7 +15,6 @@ package app.fedilab.android.drawers;
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -58,15 +57,12 @@ import app.fedilab.android.interfaces.OnFilterActionInterface;
|
|||
public class FilterAdapter extends BaseAdapter implements OnFilterActionInterface {
|
||||
|
||||
private List<Filters> filters;
|
||||
private LayoutInflater layoutInflater;
|
||||
private Context context;
|
||||
private FilterAdapter filterAdapter;
|
||||
private RelativeLayout textviewNoAction;
|
||||
|
||||
public FilterAdapter(Context context, List<Filters> filters, RelativeLayout textviewNoAction){
|
||||
public FilterAdapter(List<Filters> filters, RelativeLayout textviewNoAction){
|
||||
this.filters = filters;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
this.context = context;
|
||||
this.filterAdapter = this;
|
||||
this.textviewNoAction = textviewNoAction;
|
||||
}
|
||||
|
@ -89,7 +85,8 @@ public class FilterAdapter extends BaseAdapter implements OnFilterActionInterfac
|
|||
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(context);
|
||||
final Filters filter = filters.get(position);
|
||||
final ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
|
|
|
@ -56,11 +56,8 @@ public class HowToVideosAdapter extends BaseAdapter implements OnListActionInter
|
|||
private LayoutInflater layoutInflater;
|
||||
private Context context;
|
||||
|
||||
public HowToVideosAdapter(Context context, List<HowToVideo> howToVideos){
|
||||
public HowToVideosAdapter(List<HowToVideo> howToVideos){
|
||||
this.howToVideos = howToVideos;
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
this.context = context;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,6 +79,8 @@ public class HowToVideosAdapter extends BaseAdapter implements OnListActionInter
|
|||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
|
||||
context = parent.getContext();
|
||||
layoutInflater = LayoutInflater.from(context);
|
||||
final HowToVideo howToVideo = howToVideos.get(position);
|
||||
final ViewHolder holder;
|
||||
if (convertView == null) {
|
||||
|
|
|
@ -45,12 +45,9 @@ import app.fedilab.android.activities.ShowConversationActivity;
|
|||
public class ImageAdapter extends RecyclerView.Adapter {
|
||||
private Context context;
|
||||
private List<Status> statuses;
|
||||
private LayoutInflater layoutInflater;
|
||||
|
||||
public ImageAdapter(Context context, List<Status> statuses) {
|
||||
this.context = context;
|
||||
public ImageAdapter(List<Status> statuses) {
|
||||
this.statuses = statuses;
|
||||
this.layoutInflater = LayoutInflater.from(this.context);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
|
@ -64,6 +61,8 @@ public class ImageAdapter extends RecyclerView.Adapter {
|
|||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(this.context);
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_media, parent, false));
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public class DisplayDraftsFragment extends Fragment {
|
|||
new StatusStoredDAO(context, db).removeAllSent();
|
||||
drafts = new StatusStoredDAO(context, db).getAllDrafts();
|
||||
if( drafts != null && drafts.size() > 0) {
|
||||
draftsListAdapter = new DraftsListAdapter(context, drafts, true, textviewNoAction);
|
||||
draftsListAdapter = new DraftsListAdapter(drafts, true, textviewNoAction);
|
||||
lv_draft_toots.setAdapter(draftsListAdapter);
|
||||
draftsListAdapter.notifyDataSetChanged();
|
||||
}else {
|
||||
|
@ -111,7 +111,7 @@ public class DisplayDraftsFragment extends Fragment {
|
|||
new StatusStoredDAO(context, db).removeAllDrafts();
|
||||
drafts = new ArrayList<>();
|
||||
drafts.clear();
|
||||
draftsListAdapter = new DraftsListAdapter(context, drafts, true, textviewNoAction);
|
||||
draftsListAdapter = new DraftsListAdapter(drafts, true, textviewNoAction);
|
||||
lv_draft_toots.setAdapter(draftsListAdapter);
|
||||
draftsListAdapter.notifyDataSetChanged();
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -92,7 +92,7 @@ public class DisplayFiltersFragment extends Fragment implements OnFilterActionIn
|
|||
RelativeLayout nextElementLoader = rootView.findViewById(R.id.loading_next_items);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
filterAdapter = new FilterAdapter(context, filters, textviewNoAction);
|
||||
filterAdapter = new FilterAdapter(filters, textviewNoAction);
|
||||
lv_filters.setAdapter(filterAdapter);
|
||||
asyncTask = new ManageFiltersAsyncTask(context, ManageFiltersAsyncTask.action.GET_ALL_FILTER, null, DisplayFiltersFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
try {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class DisplayHowToFragment extends Fragment implements OnRetrieveHowToInt
|
|||
Toasty.error(context, context.getString(R.string.toast_error),Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
HowToVideosAdapter howToVideosAdapter = new HowToVideosAdapter(context, howToVideos);
|
||||
HowToVideosAdapter howToVideosAdapter = new HowToVideosAdapter(howToVideos);
|
||||
lv_howto.setAdapter(howToVideosAdapter);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public class DisplayMediaFragment extends Fragment implements OnRetrieveFeedsInt
|
|||
}
|
||||
|
||||
statuses = new ArrayList<>();
|
||||
gridAdaper = new ImageAdapter(context, statuses);
|
||||
gridAdaper = new ImageAdapter(statuses);
|
||||
gridview = rootView.findViewById(R.id.gridview_media);
|
||||
|
||||
gridview.setAdapter(gridAdaper);
|
||||
|
|
|
@ -94,7 +94,7 @@ public class DisplayMutedInstanceFragment extends Fragment implements OnRetrieve
|
|||
textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
domainsListAdapter = new DomainsListAdapter(context, this.domains, textviewNoAction);
|
||||
domainsListAdapter = new DomainsListAdapter(this.domains, textviewNoAction);
|
||||
lv_domains.setAdapter(domainsListAdapter);
|
||||
|
||||
final LinearLayoutManager mLayoutManager;
|
||||
|
@ -250,7 +250,7 @@ public class DisplayMutedInstanceFragment extends Fragment implements OnRetrieve
|
|||
textviewNoAction.setVisibility(View.GONE);
|
||||
max_id = apiResponse.getMax_id();
|
||||
if( swiped ){
|
||||
domainsListAdapter = new DomainsListAdapter(context, this.domains, textviewNoAction);
|
||||
domainsListAdapter = new DomainsListAdapter(this.domains, textviewNoAction);
|
||||
lv_domains.setAdapter(domainsListAdapter);
|
||||
swiped = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue