List editing (#1104)

* List editing groundwork

* Add ability to add/remove accounts from list, delete lists

* Rename list, improve lists UI

* Add error handling, extract strings

* Revert gradle.properties

* Apply feedback suggestions

* Apply feedback

* Update license header
This commit is contained in:
Ivan Kupalov 2019-03-16 13:36:16 +01:00 committed by Konrad Pozniak
commit 520e0d6e7a
23 changed files with 1047 additions and 222 deletions

View file

@ -33,6 +33,7 @@ import com.keylesspalace.tusky.entity.StatusContext;
import java.util.List;
import androidx.annotation.Nullable;
import io.reactivex.Completable;
import io.reactivex.Single;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
@ -196,10 +197,11 @@ public interface MastodonApi {
@Nullable @Part(value="fields_attributes[3][value]") RequestBody fieldValue3);
@GET("api/v1/accounts/search")
Call<List<Account>> searchAccounts(
Single<List<Account>> searchAccounts(
@Query("q") String q,
@Query("resolve") Boolean resolve,
@Query("limit") Integer limit);
@Query("limit") Integer limit,
@Query("following") Boolean following);
@GET("api/v1/accounts/{id}")
Call<Account> account(@Path("id") String accountId);
@ -312,7 +314,29 @@ public interface MastodonApi {
);
@GET("/api/v1/lists")
Call<List<MastoList>> getLists();
Single<List<MastoList>> getLists();
@FormUrlEncoded
@POST("api/v1/lists")
Single<MastoList> createList(@Field("title") String title);
@FormUrlEncoded
@PUT("api/v1/lists/{listId}")
Single<MastoList> updateList(@Path("listId") String listId, @Field("title") String title);
@DELETE("api/v1/lists/{listId}")
Completable deleteList(@Path("listId") String listId);
@GET("api/v1/lists/{listId}/accounts")
Single<List<Account>> getAccountsInList(@Path("listId") String listId, @Query("limit") int limit);
@DELETE("api/v1/lists/{listId}/accounts")
Completable deleteAccountFromList(@Path("listId") String listId,
@Query("account_ids[]") List<String> accountIds);
@POST("api/v1/lists/{listId}/accounts")
Completable addCountToList(@Path("listId") String listId,
@Query("account_ids[]") List<String> accountIds);
@GET("/api/v1/custom_emojis")
Call<List<Emoji>> getCustomEmojis();