diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 01915eeef..7c6cb7e15 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -161,6 +161,11 @@
android:configChanges="orientation|screenSize"
android:label="@string/app_name"
/>
+
. */
+package fr.gouv.etalab.mastodon.activities;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.widget.Toolbar;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import fr.gouv.etalab.mastodon.R;
+import fr.gouv.etalab.mastodon.asynctasks.WhoToFollowAsyncTask;
+import fr.gouv.etalab.mastodon.drawers.WhoToFollowAccountsAdapter;
+import fr.gouv.etalab.mastodon.helper.Helper;
+import fr.gouv.etalab.mastodon.interfaces.OnRetrieveWhoToFollowInterface;
+
+import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
+
+
+/**
+ * Created by Thomas on 10/09/2018.
+ * Display Who to follow accounts
+ */
+
+public class WhoToFollowActivity extends BaseActivity implements OnRetrieveWhoToFollowInterface {
+
+
+
+ private String item;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
+ int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
+ switch (theme){
+ case Helper.THEME_LIGHT:
+ setTheme(R.style.AppTheme_NoActionBar);
+ break;
+ case Helper.THEME_DARK:
+ setTheme(R.style.AppThemeDark_NoActionBar);
+ break;
+ case Helper.THEME_BLACK:
+ setTheme(R.style.AppThemeBlack_NoActionBar);
+ break;
+ default:
+ setTheme(R.style.AppThemeDark_NoActionBar);
+ }
+ setContentView(R.layout.activity_who_to_follow);
+ Toolbar toolbar = findViewById(R.id.toolbar);
+ if( theme == THEME_BLACK)
+ toolbar.setBackgroundColor(ContextCompat.getColor(WhoToFollowActivity.this, R.color.black));
+ setSupportActionBar(toolbar);
+ if( getSupportActionBar() != null)
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
+ RelativeLayout mainLoader = findViewById(R.id.loader);
+ Bundle b = getIntent().getExtras();
+ if(b != null){
+ item = b.getString("item");
+ }
+ String lastDateListNameRefresh = sharedpreferences.getString(Helper.LAST_DATE_LIST_NAME_REFRESH+item, null);
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date( ));
+ cal.add(Calendar.MINUTE, -5);
+ Date dateAllowed = cal.getTime();
+ if( lastDateListNameRefresh == null || Helper.stringToDate(WhoToFollowActivity.this, lastDateListNameRefresh).after(dateAllowed))
+ new WhoToFollowAsyncTask(WhoToFollowActivity.this, item, WhoToFollowActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+ else {
+ String lastList = sharedpreferences.getString(Helper.LAST_LIST_NAME + item, null);
+ List list = Helper.restoreArrayFromString(lastList);
+ displayResults(list);
+ }
+ mainLoader.setVisibility(View.VISIBLE);
+ setTitle(item);
+ }
+
+
+ @Override
+ public void onRetrieveWhoToFollow(List list) {
+ if( list != null){
+ SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putString(Helper.LAST_DATE_LIST_NAME_REFRESH + item, Helper.dateToString(new Date()));
+ editor.putString(Helper.LAST_LIST_NAME + item, Helper.arrayToStringStorage(list));
+ editor.apply();
+ }
+ displayResults(list);
+ }
+
+ private void displayResults(List list){
+
+ RelativeLayout mainLoader = findViewById(R.id.loader);
+ mainLoader.setVisibility(View.GONE);
+ if( list != null){
+ ListView lv_list = findViewById(R.id.lv_list);
+ WhoToFollowAccountsAdapter whoToFollowAccountsAdapter = new WhoToFollowAccountsAdapter(WhoToFollowActivity.this, list);
+ lv_list.setAdapter(whoToFollowAccountsAdapter);
+ }else{
+ Toast.makeText(WhoToFollowActivity.this, R.string.toast_error, Toast.LENGTH_SHORT).show();
+ }
+ }
+}
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/WhoToFollowAsyncTask.java b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/WhoToFollowAsyncTask.java
new file mode 100644
index 000000000..3118213a6
--- /dev/null
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/asynctasks/WhoToFollowAsyncTask.java
@@ -0,0 +1,58 @@
+/* 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.asynctasks;
+import android.content.Context;
+import android.os.AsyncTask;
+import java.lang.ref.WeakReference;
+import java.util.List;
+import fr.gouv.etalab.mastodon.client.API;
+import fr.gouv.etalab.mastodon.interfaces.OnRetrieveWhoToFollowInterface;
+
+
+/**
+ * Created by Thomas on 10/09/2018.
+ * Retrieves who to follow list
+ */
+
+public class WhoToFollowAsyncTask extends AsyncTask {
+
+ private String name;
+ private List response;
+ private OnRetrieveWhoToFollowInterface listener;
+ private WeakReference contextReference;
+
+ public WhoToFollowAsyncTask(Context context, String name, OnRetrieveWhoToFollowInterface onRetrieveWhoToFollowInterface){
+ this.contextReference = new WeakReference<>(context);
+ this.name = name;
+ this.listener = onRetrieveWhoToFollowInterface;
+ }
+
+
+ @Override
+ protected Void doInBackground(Void... params) {
+ API api = new API(this.contextReference.get());
+ if( name != null)
+ response = api.getCommunitywikiList(name);
+ else
+ response = api.getCommunitywikiList();
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(Void result) {
+ listener.onRetrieveWhoToFollow(response);
+ }
+
+}
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 0840ad4a7..2954e4850 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
@@ -1893,7 +1893,7 @@ public class API {
* Retrieves list from Communitywiki *synchronously*
* @return APIResponse
*/
- private ArrayList getCommunitywikiList() {
+ public ArrayList getCommunitywikiList() {
ArrayList list = new ArrayList<>();
try {
HttpsConnection httpsConnection = new HttpsConnection(context);
@@ -1923,7 +1923,7 @@ public class API {
* Retrieves list from Communitywiki *synchronously*
* @return APIResponse
*/
- private ArrayList getCommunitywikiList(String name) {
+ public ArrayList getCommunitywikiList(String name) {
ArrayList list = new ArrayList<>();
try {
name = URLEncoder.encode(name, "UTF-8");
@@ -1935,7 +1935,7 @@ public class API {
JSONArray jsonArray = new JSONArray(response);
for(int i = 0; i < jsonArray.length(); i++){
try {
- list.add(jsonArray.getString(i));
+ list.add(jsonArray.getJSONObject(i).getString("acct"));
} catch (JSONException ignored) {}
}
} catch (HttpsConnection.HttpsConnectionException e) {
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/WhoToFollowAccountsAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/WhoToFollowAccountsAdapter.java
new file mode 100644
index 000000000..a522d5452
--- /dev/null
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/WhoToFollowAccountsAdapter.java
@@ -0,0 +1,103 @@
+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.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.CheckBox;
+import android.widget.TextView;
+import java.util.List;
+import fr.gouv.etalab.mastodon.R;
+import fr.gouv.etalab.mastodon.client.Entities.Account;
+import fr.gouv.etalab.mastodon.helper.CrossActions;
+
+
+/**
+ * Created by Thomas on 10/09/2018.
+ * Adapter for who to follow list
+ */
+public class WhoToFollowAccountsAdapter extends BaseAdapter {
+
+ private List lists;
+ private LayoutInflater layoutInflater;
+ private Context context;
+
+ public WhoToFollowAccountsAdapter(Context context, List lists){
+ this.lists = lists;
+ layoutInflater = LayoutInflater.from(context);
+ this.context = context;
+ }
+
+ @Override
+ public int getCount() {
+ return lists.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return lists.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+
+ String item = lists.get(position);
+ final ViewHolder holder;
+ if (convertView == null) {
+ convertView = layoutInflater.inflate(R.layout.drawer_who_to_follow_account, parent, false);
+ holder = new ViewHolder();
+ holder.account_to_follow = convertView.findViewById(R.id.account_to_follow);
+ holder.account_to_follow = convertView.findViewById(R.id.account_to_follow);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+
+ holder.account_to_follow.setText(item);
+
+ holder.account_to_follow.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Account account = new Account();
+ String[] val = item.split("@");
+ if( val.length > 1){
+ account.setAcct(val[0]);
+ account.setInstance(val[1]);
+ CrossActions.doCrossProfile(context, account);
+ }
+ }
+ });
+
+ return convertView;
+ }
+
+
+ private class ViewHolder {
+ CheckBox account_to_follow_check;
+ TextView account_to_follow;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/WhoToFollowAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/WhoToFollowAdapter.java
new file mode 100644
index 000000000..6260b7090
--- /dev/null
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/WhoToFollowAdapter.java
@@ -0,0 +1,124 @@
+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.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.v4.content.ContextCompat;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import java.util.List;
+import fr.gouv.etalab.mastodon.R;
+import fr.gouv.etalab.mastodon.activities.WhoToFollowActivity;
+import fr.gouv.etalab.mastodon.helper.Helper;
+import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
+
+
+/**
+ * Created by Thomas on 10/09/2018.
+ * Adapter for who to follow list
+ */
+public class WhoToFollowAdapter extends BaseAdapter {
+
+ private List lists;
+ private LayoutInflater layoutInflater;
+ private Context context;
+
+ public WhoToFollowAdapter(Context context, List lists){
+ this.lists = lists;
+ layoutInflater = LayoutInflater.from(context);
+ this.context = context;
+ }
+
+ @Override
+ public int getCount() {
+ return lists.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return lists.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+
+ String item = lists.get(position);
+ final ViewHolder holder;
+ if (convertView == null) {
+ convertView = layoutInflater.inflate(R.layout.drawer_search, parent, false);
+ holder = new ViewHolder();
+ holder.search_title = convertView.findViewById(R.id.search_keyword);
+ holder.search_container = convertView.findViewById(R.id.search_container);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
+ int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
+
+ if( theme == Helper.THEME_LIGHT){
+ holder.search_container.setBackgroundResource(R.color.mastodonC3__);
+ changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.black);
+ }else if(theme == Helper.THEME_DARK){
+ holder.search_container.setBackgroundResource(R.color.mastodonC1_);
+ changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
+ }else if(theme == Helper.THEME_BLACK) {
+ holder.search_container.setBackgroundResource(R.color.black_2);
+ changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
+ }
+ Drawable next = ContextCompat.getDrawable(context, R.drawable.ic_keyboard_arrow_right);
+ holder.search_title.setText(item);
+ assert next != null;
+ final float scale = context.getResources().getDisplayMetrics().density;
+ next.setBounds(0,0,(int) (30 * scale + 0.5f),(int) (30 * scale + 0.5f));
+ holder.search_title.setCompoundDrawables(null, null, next, null);
+
+ holder.search_container.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(context, WhoToFollowActivity.class);
+ Bundle b = new Bundle();
+ b.putString("item", item);
+ intent.putExtras(b);
+ context.startActivity(intent);
+ }
+ });
+
+ return convertView;
+ }
+
+
+ private class ViewHolder {
+ LinearLayout search_container;
+ TextView search_title;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/WhoToFollowFragment.java b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/WhoToFollowFragment.java
new file mode 100644
index 000000000..6f0e146fa
--- /dev/null
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/WhoToFollowFragment.java
@@ -0,0 +1,113 @@
+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.content.Context;
+import android.content.SharedPreferences;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import fr.gouv.etalab.mastodon.R;
+import fr.gouv.etalab.mastodon.asynctasks.WhoToFollowAsyncTask;
+import fr.gouv.etalab.mastodon.drawers.WhoToFollowAdapter;
+import fr.gouv.etalab.mastodon.helper.Helper;
+import fr.gouv.etalab.mastodon.interfaces.OnRetrieveWhoToFollowInterface;
+
+
+
+/**
+ * Created by Thomas on 10/09/2018.
+ * Fragment to display who to follow list
+ */
+public class WhoToFollowFragment extends Fragment implements OnRetrieveWhoToFollowInterface {
+
+
+ private Context context;
+ private View rootView;
+
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
+
+ rootView = inflater.inflate(R.layout.fragment_who_to_follow, container, false);
+ context = getContext();
+ RelativeLayout mainLoader = rootView.findViewById(R.id.loader);
+ SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
+ String lastDateListRefresh = sharedpreferences.getString(Helper.LAST_DATE_LIST_REFRESH, null);
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date( ));
+ cal.add(Calendar.MINUTE, -15);
+ Date dateAllowed = cal.getTime();
+ if( lastDateListRefresh == null || Helper.stringToDate(context, lastDateListRefresh).after(dateAllowed))
+ new WhoToFollowAsyncTask(context, null, WhoToFollowFragment.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+ else {
+ String lastList = sharedpreferences.getString(Helper.LAST_LIST, null);
+ List list = Helper.restoreArrayFromString(lastList);
+ displayResults(list);
+ }
+ mainLoader.setVisibility(View.VISIBLE);
+ return rootView;
+ }
+
+ @Override
+ public void onCreate(Bundle saveInstance)
+ {
+ super.onCreate(saveInstance);
+ }
+
+ @Override
+ public void onAttach(Context context) {
+ super.onAttach(context);
+ this.context = context;
+ }
+
+ @Override
+ public void onRetrieveWhoToFollow(List list) {
+
+ if( list != null){
+ SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putString(Helper.LAST_DATE_LIST_REFRESH, Helper.dateToString(new Date()));
+ editor.putString(Helper.LAST_LIST, Helper.arrayToStringStorage(list));
+ editor.apply();
+ }
+ displayResults(list);
+ }
+
+ private void displayResults(List list){
+
+ RelativeLayout mainLoader = rootView.findViewById(R.id.loader);
+ mainLoader.setVisibility(View.GONE);
+ if( list != null){
+ ListView lv_list = rootView.findViewById(R.id.lv_list);
+ WhoToFollowAdapter whoToFollowAdapter = new WhoToFollowAdapter(context, list);
+ lv_list.setAdapter(whoToFollowAdapter);
+ }else{
+ Toast.makeText(context, R.string.toast_error, Toast.LENGTH_SHORT).show();
+ }
+ }
+
+}
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java
index 5ac2a9277..dd767f65a 100644
--- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java
@@ -217,6 +217,11 @@ public class Helper {
public static final String SEARCH_URL = "search_url";
public static final String CLIP_BOARD = "clipboard";
public static final String INSTANCE_NAME = "instance_name";
+ public static final String LAST_DATE_LIST_REFRESH = "last_date_list_refresh";
+ public static final String LAST_DATE_LIST_NAME_REFRESH = "last_date_list_name_refresh";
+ public static final String LAST_LIST = "last_list";
+ public static final String LAST_LIST_NAME = "last_list_name";
+
//Notifications
public static final int NOTIFICATION_INTENT = 1;
public static final int HOME_TIMELINE_INTENT = 2;
@@ -1657,6 +1662,30 @@ public class Helper {
}
+ /**
+ * Serialized a List
+ * @param list List to serialize
+ * @return String serialized List
+ */
+ public static String arrayToStringStorage(List list){
+ Gson gson = new Gson();
+ return gson.toJson(list);
+ }
+
+ /**
+ * Unserialized a List
+ * @param serializedArray String serialized array
+ * @return List list
+ */
+ public static List restoreArrayFromString(String serializedArray){
+ Gson gson = new Gson();
+ try {
+ return gson.fromJson(serializedArray, List.class);
+ }catch (Exception e){
+ return null;
+ }
+ }
+
/**
* Serialized an Application class
* @param application Application to serialize
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnRetrieveWhoToFollowInterface.java b/app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnRetrieveWhoToFollowInterface.java
new file mode 100644
index 000000000..811b9b09b
--- /dev/null
+++ b/app/src/main/java/fr/gouv/etalab/mastodon/interfaces/OnRetrieveWhoToFollowInterface.java
@@ -0,0 +1,26 @@
+/* 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 java.util.List;
+
+/**
+ * Created by Thomas on 10/09/2018.
+ * Interface for who to follow
+ */
+public interface OnRetrieveWhoToFollowInterface {
+ void onRetrieveWhoToFollow(List list);
+}
diff --git a/app/src/main/res/drawable-hdpi/ic_people.png b/app/src/main/res/drawable-hdpi/ic_people.png
new file mode 100644
index 000000000..daae683dc
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_people.png differ
diff --git a/app/src/main/res/drawable-ldpi/ic_people.png b/app/src/main/res/drawable-ldpi/ic_people.png
new file mode 100644
index 000000000..06e7de549
Binary files /dev/null and b/app/src/main/res/drawable-ldpi/ic_people.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_people.png b/app/src/main/res/drawable-mdpi/ic_people.png
new file mode 100644
index 000000000..8ff505976
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_people.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_people.png b/app/src/main/res/drawable-xhdpi/ic_people.png
new file mode 100644
index 000000000..15d22bb1a
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_people.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_people.png b/app/src/main/res/drawable-xxhdpi/ic_people.png
new file mode 100644
index 000000000..00da67573
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_people.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_people.png b/app/src/main/res/drawable-xxxhdpi/ic_people.png
new file mode 100644
index 000000000..fabe4c587
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_people.png differ
diff --git a/app/src/main/res/layout/activity_who_to_follow.xml b/app/src/main/res/layout/activity_who_to_follow.xml
new file mode 100644
index 000000000..5850a6ff5
--- /dev/null
+++ b/app/src/main/res/layout/activity_who_to_follow.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/drawer_who_to_follow_account.xml b/app/src/main/res/layout/drawer_who_to_follow_account.xml
new file mode 100644
index 000000000..9d488a824
--- /dev/null
+++ b/app/src/main/res/layout/drawer_who_to_follow_account.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_who_to_follow.xml b/app/src/main/res/layout/fragment_who_to_follow.xml
new file mode 100644
index 000000000..426fc13e9
--- /dev/null
+++ b/app/src/main/res/layout/fragment_who_to_follow.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml
index 061771842..ab9d3dbf2 100644
--- a/app/src/main/res/menu/activity_main_drawer.xml
+++ b/app/src/main/res/menu/activity_main_drawer.xml
@@ -39,6 +39,10 @@
android:id="@+id/nav_follow_request"
android:icon="@drawable/ic_group_add"
android:title="@string/follow_request" />
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d5629df8d..a847e1a8a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -585,6 +585,7 @@
Delete filter?
Update filter
Create filter
+ Who to follow