From e3f59fb3373817028cf7c8e958b830db47c254c1 Mon Sep 17 00:00:00 2001 From: stom79 Date: Wed, 5 Sep 2018 19:00:58 +0200 Subject: [PATCH] Manage filters --- .../asynctasks/ManageFiltersAsyncTask.java | 79 +++++++ .../fr/gouv/etalab/mastodon/client/API.java | 7 +- .../mastodon/drawers/FilterAdapter.java | 208 +++++++++++++++++ .../fragments/DisplayFiltersFragment.java | 213 ++++++++++++++++++ .../interfaces/OnFilterActionInterface.java | 27 +++ app/src/main/res/drawable-hdpi/ic_filter.png | Bin 0 -> 122 bytes app/src/main/res/drawable-ldpi/ic_filter.png | Bin 0 -> 199 bytes app/src/main/res/drawable-mdpi/ic_filter.png | Bin 0 -> 108 bytes app/src/main/res/drawable-xhdpi/ic_filter.png | Bin 0 -> 112 bytes .../main/res/drawable-xxhdpi/ic_filter.png | Bin 0 -> 139 bytes .../main/res/drawable-xxxhdpi/ic_filter.png | Bin 0 -> 112 bytes app/src/main/res/layout/add_filter.xml | 147 ++++++++++++ app/src/main/res/layout/drawer_filters.xml | 60 +++++ app/src/main/res/layout/fragment_filters.xml | 77 +++++++ .../main/res/menu/activity_main_drawer.xml | 4 + app/src/main/res/values/strings.xml | 19 ++ 16 files changed, 839 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/ManageFiltersAsyncTask.java create mode 100644 app/src/main/java/fr/gouv/etalab/mastodon/drawers/FilterAdapter.java create mode 100644 app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayFiltersFragment.java create mode 100644 app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnFilterActionInterface.java create mode 100644 app/src/main/res/drawable-hdpi/ic_filter.png create mode 100644 app/src/main/res/drawable-ldpi/ic_filter.png create mode 100644 app/src/main/res/drawable-mdpi/ic_filter.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_filter.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_filter.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_filter.png create mode 100644 app/src/main/res/layout/add_filter.xml create mode 100644 app/src/main/res/layout/drawer_filters.xml create mode 100644 app/src/main/res/layout/fragment_filters.xml diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/ManageFiltersAsyncTask.java b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/ManageFiltersAsyncTask.java new file mode 100644 index 000000000..a2e9f3705 --- /dev/null +++ b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/ManageFiltersAsyncTask.java @@ -0,0 +1,79 @@ +/* Copyright 2017 Thomas Schneider + * + * This file is a part of Mastalab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Mastalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Mastalab; if not, + * see . */ +package fr.gouv.etalab.mastodon.asynctasks; + +import android.content.Context; +import android.os.AsyncTask; + +import java.lang.ref.WeakReference; + +import fr.gouv.etalab.mastodon.client.API; +import fr.gouv.etalab.mastodon.client.APIResponse; +import fr.gouv.etalab.mastodon.client.Entities.Filters; +import fr.gouv.etalab.mastodon.interfaces.OnFilterActionInterface; + + +/** + * Created by Thomas on 05/09/2018. + * Async works to manage Filters + */ + +public class ManageFiltersAsyncTask extends AsyncTask { + + public enum action{ + GET_FILTER, + GET_ALL_FILTER, + CREATE_FILTER, + DELETE_FILTER, + UPDATE_FILTER, + } + + private OnFilterActionInterface listener; + private APIResponse apiResponse; + private int statusCode; + private action apiAction; + private WeakReference contextReference; + private Filters filter; + + public ManageFiltersAsyncTask(Context context, action apiAction, Filters filter, OnFilterActionInterface onFilterActionInterface){ + contextReference = new WeakReference<>(context); + this.listener = onFilterActionInterface; + this.filter = filter; + this.apiAction = apiAction; + } + + + @Override + protected Void doInBackground(Void... params) { + if (apiAction == action.GET_ALL_FILTER) { + apiResponse = new API(contextReference.get()).getFilters(); + }else if(apiAction == action.GET_FILTER){ + apiResponse = new API(contextReference.get()).getFilters(filter.getId()); + }else if(apiAction == action.CREATE_FILTER){ + apiResponse = new API(contextReference.get()).addFilters(filter); + }else if( apiAction == action.UPDATE_FILTER){ + apiResponse = new API(contextReference.get()).updateFilters(filter); + }else if(apiAction == action.DELETE_FILTER){ + statusCode = new API(contextReference.get()).deleteFilters(filter); + } + return null; + } + + @Override + protected void onPostExecute(Void result) { + listener.onActionDone(this.apiAction, apiResponse, statusCode); + } + +} diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/client/API.java b/app/src/main/java/fr/gouv/etalab/mastodon/client/API.java index 2befa94bc..4c71e818c 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/client/API.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/client/API.java @@ -1495,10 +1495,12 @@ public class API { * @param filter Filter * @return APIResponse */ - public APIResponse deleteFilters(Filters filter){ + public int deleteFilters(Filters filter){ try { + HttpsConnection httpsConnection = new HttpsConnection(context); new HttpsConnection(context).delete(getAbsoluteUrl(String.format("/filters/%s", filter.getId())), 60, null, prefKeyOauthTokenT); + actionCode = httpsConnection.getActionCode(); } catch (HttpsConnection.HttpsConnectionException e) { setError(e.getStatusCode(), e); } catch (NoSuchAlgorithmException e) { @@ -1508,7 +1510,7 @@ public class API { } catch (KeyManagementException e) { e.printStackTrace(); } - return apiResponse; + return actionCode; } /** @@ -2228,6 +2230,7 @@ public class API { filter.setContext(finalContext); } } + }catch (Exception ignored){} return filter; } diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/FilterAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/FilterAdapter.java new file mode 100644 index 000000000..fc8c27a81 --- /dev/null +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/FilterAdapter.java @@ -0,0 +1,208 @@ +package fr.gouv.etalab.mastodon.drawers; +/* Copyright 2018 Thomas Schneider + * + * This file is a part of Mastalab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Mastalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Mastalab; if not, + * see . */ + + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.DialogInterface; +import android.os.AsyncTask; +import android.support.design.widget.FloatingActionButton; +import android.support.v7.app.AlertDialog; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.view.inputmethod.InputMethodManager; +import android.widget.BaseAdapter; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.List; +import fr.gouv.etalab.mastodon.R; +import fr.gouv.etalab.mastodon.activities.BaseMainActivity; +import fr.gouv.etalab.mastodon.asynctasks.ManageFiltersAsyncTask; +import fr.gouv.etalab.mastodon.client.APIResponse; +import fr.gouv.etalab.mastodon.client.Entities.Filters; +import fr.gouv.etalab.mastodon.interfaces.OnFilterActionInterface; + + +/** + * Created by Thomas on 05/09/2018. + * Adapter for filters + */ +public class FilterAdapter extends BaseAdapter implements OnFilterActionInterface { + + private List filters; + private LayoutInflater layoutInflater; + private Context context; + private FilterAdapter filterAdapter; + private RelativeLayout textviewNoAction; + + public FilterAdapter(Context context, List filters, RelativeLayout textviewNoAction){ + this.filters = filters; + layoutInflater = LayoutInflater.from(context); + this.context = context; + this.filterAdapter = this; + this.textviewNoAction = textviewNoAction; + } + + @Override + public int getCount() { + return filters.size(); + } + + @Override + public Object getItem(int position) { + return filters.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + + @Override + public View getView(final int position, View convertView, ViewGroup parent) { + + final fr.gouv.etalab.mastodon.client.Entities.Filters filter = filters.get(position); + final ViewHolder holder; + if (convertView == null) { + convertView = layoutInflater.inflate(R.layout.drawer_filters, parent, false); + holder = new ViewHolder(); + holder.filter_word = convertView.findViewById(R.id.filter_word); + holder.filter_context = convertView.findViewById(R.id.filter_context); + convertView.setTag(holder); + } else { + holder = (ViewHolder) convertView.getTag(); + } + + + + holder.edit_filter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); + LayoutInflater inflater = ((BaseMainActivity)context).getLayoutInflater(); + @SuppressLint("InflateParams") View dialogView = inflater.inflate(R.layout.add_filter, null); + dialogBuilder.setView(dialogView); + + EditText add_phrase = dialogView.findViewById(R.id.add_phrase); + CheckBox context_home = dialogView.findViewById(R.id.context_home); + CheckBox context_public = dialogView.findViewById(R.id.context_public); + CheckBox context_notification = dialogView.findViewById(R.id.context_notification); + CheckBox context_conversation = dialogView.findViewById(R.id.context_conversation); + CheckBox context_whole_word = dialogView.findViewById(R.id.context_whole_word); + CheckBox context_drop = dialogView.findViewById(R.id.context_drop); + + dialogBuilder.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + + if( add_phrase.getText() != null && add_phrase.getText().toString().trim().length() > 0 ) { + Filters filter = new Filters(); + ArrayList contextFilter = new ArrayList<>(); + if( context_home.isChecked()) + contextFilter.add("home"); + if( context_public.isChecked()) + contextFilter.add("public"); + if( context_notification.isChecked()) + contextFilter.add("notifications"); + if( context_conversation.isChecked()) + contextFilter.add("thread"); + filter.setContext(contextFilter); + filter.setPhrase(add_phrase.getText().toString()); + filter.setWhole_word(context_whole_word.isChecked()); + filter.setIrreversible(context_drop.isChecked()); + new ManageFiltersAsyncTask(context, ManageFiltersAsyncTask.action.UPDATE_FILTER, filter, FilterAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } + dialog.dismiss(); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + dialog.dismiss(); + } + }); + + + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.setTitle(context.getString(R.string.action_update_filter)); + alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialogInterface) { + //Hide keyboard + InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + assert imm != null; + imm.hideSoftInputFromWindow(add_phrase.getWindowToken(), 0); + } + }); + if( alertDialog.getWindow() != null ) + alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); + alertDialog.show(); + } + }); + + holder.delete_filter.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View view) { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setTitle(context.getString(R.string.action_filter_delete) ); + builder.setMessage(context.getString(R.string.action_lists_confirm_delete) ); + builder.setIcon(android.R.drawable.ic_dialog_alert) + .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + filters.remove(filter); + filterAdapter.notifyDataSetChanged(); + new ManageFiltersAsyncTask(context, ManageFiltersAsyncTask.action.DELETE_FILTER,filter, FilterAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + if( filters.size() == 0 && textviewNoAction != null && textviewNoAction.getVisibility() == View.GONE) + textviewNoAction.setVisibility(View.VISIBLE); + dialog.dismiss(); + } + }) + .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }) + .show(); + return false; + } + }); + return convertView; + } + + @Override + public void onActionDone(ManageFiltersAsyncTask.action actionType, APIResponse apiResponse, int statusCode) { + + } + + private class ViewHolder { + TextView filter_word; + TextView filter_context; + FloatingActionButton edit_filter; + FloatingActionButton delete_filter; + } + + +} \ No newline at end of file diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayFiltersFragment.java b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayFiltersFragment.java new file mode 100644 index 000000000..e9191dbc2 --- /dev/null +++ b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/DisplayFiltersFragment.java @@ -0,0 +1,213 @@ +package fr.gouv.etalab.mastodon.fragments; +/* Copyright 2018 Thomas Schneider + * + * This file is a part of Mastalab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Mastalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Mastalab; if not, + * see . */ + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.DialogInterface; +import android.content.SharedPreferences; +import android.os.AsyncTask; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.design.widget.FloatingActionButton; +import android.support.v4.app.Fragment; +import android.support.v7.app.AlertDialog; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.view.inputmethod.InputMethodManager; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.ListView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import java.util.ArrayList; +import java.util.List; + +import fr.gouv.etalab.mastodon.R; +import fr.gouv.etalab.mastodon.activities.MainActivity; +import fr.gouv.etalab.mastodon.asynctasks.ManageFiltersAsyncTask; +import fr.gouv.etalab.mastodon.client.APIResponse; +import fr.gouv.etalab.mastodon.client.Entities.Filters; +import fr.gouv.etalab.mastodon.drawers.FilterAdapter; +import fr.gouv.etalab.mastodon.helper.Helper; +import fr.gouv.etalab.mastodon.interfaces.OnFilterActionInterface; + + +/** + * Created by Thomas on 05/09/2018. + * Fragment to display Filters + */ +public class DisplayFiltersFragment extends Fragment implements OnFilterActionInterface { + + + private Context context; + private AsyncTask asyncTask; + private List filters; + private TextView no_action_text; + private RelativeLayout mainLoader; + private FloatingActionButton add_new; + private FilterAdapter filterAdapter; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + + //View for fragment is the same that fragment accounts + View rootView = inflater.inflate(R.layout.fragment_filters, container, false); + + context = getContext(); + filters = new ArrayList<>(); + + + ListView lv_filters = rootView.findViewById(R.id.lv_filters); + RelativeLayout textviewNoAction = rootView.findViewById(R.id.no_action); + no_action_text = rootView.findViewById(R.id.no_action_text); + mainLoader = rootView.findViewById(R.id.loader); + RelativeLayout nextElementLoader = rootView.findViewById(R.id.loading_next_items); + mainLoader.setVisibility(View.VISIBLE); + nextElementLoader.setVisibility(View.GONE); + filterAdapter = new FilterAdapter(context, filters, textviewNoAction); + lv_filters.setAdapter(filterAdapter); + no_action_text.setVisibility(View.GONE); + asyncTask = new ManageFiltersAsyncTask(context, ManageFiltersAsyncTask.action.GET_ALL_FILTER, null, DisplayFiltersFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + try { + add_new = ((MainActivity) context).findViewById(R.id.add_new); + }catch (Exception ignored){} + if( add_new != null) + add_new.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); + LayoutInflater inflater = getLayoutInflater(); + @SuppressLint("InflateParams") View dialogView = inflater.inflate(R.layout.add_filter, null); + dialogBuilder.setView(dialogView); + + EditText add_phrase = dialogView.findViewById(R.id.add_phrase); + CheckBox context_home = dialogView.findViewById(R.id.context_home); + CheckBox context_public = dialogView.findViewById(R.id.context_public); + CheckBox context_notification = dialogView.findViewById(R.id.context_notification); + CheckBox context_conversation = dialogView.findViewById(R.id.context_conversation); + CheckBox context_whole_word = dialogView.findViewById(R.id.context_whole_word); + CheckBox context_drop = dialogView.findViewById(R.id.context_drop); + + dialogBuilder.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + + if( add_phrase.getText() != null && add_phrase.getText().toString().trim().length() > 0 ) { + Filters filter = new Filters(); + ArrayList contextFilter = new ArrayList<>(); + if( context_home.isChecked()) + contextFilter.add("home"); + if( context_public.isChecked()) + contextFilter.add("public"); + if( context_notification.isChecked()) + contextFilter.add("notifications"); + if( context_conversation.isChecked()) + contextFilter.add("thread"); + filter.setContext(contextFilter); + filter.setPhrase(add_phrase.getText().toString()); + filter.setWhole_word(context_whole_word.isChecked()); + filter.setIrreversible(context_drop.isChecked()); + new ManageFiltersAsyncTask(context, ManageFiltersAsyncTask.action.CREATE_FILTER, filter, DisplayFiltersFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } + dialog.dismiss(); + add_new.setEnabled(false); + } + }); + dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int id) { + dialog.dismiss(); + } + }); + + + AlertDialog alertDialog = dialogBuilder.create(); + alertDialog.setTitle(getString(R.string.action_filter_create)); + alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialogInterface) { + //Hide keyboard + InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + assert imm != null; + imm.hideSoftInputFromWindow(add_phrase.getWindowToken(), 0); + } + }); + if( alertDialog.getWindow() != null ) + alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); + alertDialog.show(); + } + }); + return rootView; + } + + + + @Override + public void onCreate(Bundle saveInstance) + { + super.onCreate(saveInstance); + } + + + @Override + public void onAttach(Context context) { + super.onAttach(context); + this.context = context; + } + + public void onDestroy() { + super.onDestroy(); + if(asyncTask != null && asyncTask.getStatus() == AsyncTask.Status.RUNNING) + asyncTask.cancel(true); + } + + + + + @Override + public void onActionDone(ManageFiltersAsyncTask.action actionType, APIResponse apiResponse, int statusCode) { + mainLoader.setVisibility(View.GONE); + add_new.setEnabled(true); + if( apiResponse.getError() != null){ + final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); + boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true); + if( show_error_messages) + Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show(); + return; + } + if( actionType == ManageFiltersAsyncTask.action.GET_ALL_FILTER) { + if (apiResponse.getFilters() != null && apiResponse.getFilters().size() > 0) { + this.filters.addAll(apiResponse.getFilters()); + filterAdapter.notifyDataSetChanged(); + + } else { + no_action_text.setVisibility(View.VISIBLE); + } + }else if( actionType == ManageFiltersAsyncTask.action.CREATE_FILTER){ + if (apiResponse.getFilters() != null && apiResponse.getFilters().size() > 0) { + + this.filters.add(0, apiResponse.getFilters().get(0)); + filterAdapter.notifyDataSetChanged(); + }else{ + Toast.makeText(context, apiResponse.getError().getError(),Toast.LENGTH_LONG).show(); + } + } + } +} diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnFilterActionInterface.java b/app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnFilterActionInterface.java new file mode 100644 index 000000000..eea154a54 --- /dev/null +++ b/app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnFilterActionInterface.java @@ -0,0 +1,27 @@ +/* Copyright 2018 Thomas Schneider + * + * This file is a part of Mastalab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Mastalab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Mastalab; if not, + * see . */ +package fr.gouv.etalab.mastodon.interfaces; + + +import fr.gouv.etalab.mastodon.asynctasks.ManageFiltersAsyncTask; +import fr.gouv.etalab.mastodon.client.APIResponse; + +/** + * Created by Thomas on 05/09/2018. + * Interface when actions have been done with lists + */ +public interface OnFilterActionInterface { + void onActionDone(ManageFiltersAsyncTask.action actionType, APIResponse apiResponse, int statusCode); +} diff --git a/app/src/main/res/drawable-hdpi/ic_filter.png b/app/src/main/res/drawable-hdpi/ic_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..7f3aa5c0016085fe6e69f2f110855b1ae52acbd6 GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i0wmS%+S~(Dj-D=#Ar-fh6C_x#uuAdpxj6EM zpZK)LbkkIz6z$pjjy)x8Wu1}39!Fdbe3V(BVIRd_FGI0kDi3y U;7DCu4m6Cx)78&qol`;+0NMN@<^TWy literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-ldpi/ic_filter.png b/app/src/main/res/drawable-ldpi/ic_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..af2384f7f4170e35823997c1c31c157d14f02040 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@bo-U3d6}OTT76=#!H3l+R3wSeZ zw2;$b3}xT$DBW>;;SOHzwv#Up<**2{IoNP^s5^gDQR&f1>v-dnrXa?U#H&ztxXEN+UB=+)>gTe~DWM4fOyxn@ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_filter.png b/app/src/main/res/drawable-mdpi/ic_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..502a42e79d590cc01a7c708392bdca6e2f2ab30a GIT binary patch literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mj6Gc(Ln>}1CrGSOXk5t1?&F|g zb>M?MyN!c&xvWDoXNuM$vkZpnJ&gO6*b4-#40x&-7{U&z8Q|k0wldT1B8K;xu=U`NX4z>1PRu~2?0%PZU0ja zv@J}yprN3vDA4A@n3UALk1g`Geajl(ytvNM$| nTeViHOjqo5<=K^N4E8fQZ-;BlZE&>)n$FgTe~DWM4fj$APS literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_filter.png b/app/src/main/res/drawable-xxxhdpi/ic_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..d486f0f053d452eee60b807f847655b5e7797343 GIT binary patch literal 112 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhaw%spKkLn>~)y|R&!fq{j^@VEY1 zE)kPS@efw@GcYu)w3(yeXy43W@jK74iG^{)mj_KOoJzG^v6L(uK_ + + + + + + + + + + + + + + + + + + + + + + + + + + + +