Search in sources :

Example 6 with FilesListModel

use of com.fastaccess.data.dao.FilesListModel in project FastHub by k0shk0sh.

the class CreateGistPresenter method onSubmitUpdate.

@Override
public void onSubmitUpdate(@NonNull String id, @NonNull String description, @NonNull HashMap<String, FilesListModel> files) {
    boolean isEmptyDesc = InputHelper.isEmpty(description);
    if (getView() != null) {
        getView().onDescriptionError(isEmptyDesc);
    }
    if (isEmptyDesc)
        return;
    CreateGistModel createGistModel = new CreateGistModel();
    createGistModel.setDescription(InputHelper.toString(description));
    createGistModel.setFiles(files);
    makeRestCall(RestProvider.getGistService(isEnterprise()).editGist(createGistModel, id), gistsModel -> sendToView(view -> view.onSuccessSubmission(gistsModel)), false);
}
Also used : RestProvider(com.fastaccess.provider.rest.RestProvider) CreateGistModel(com.fastaccess.data.dao.CreateGistModel) InputHelper(com.fastaccess.helper.InputHelper) FilesListModel(com.fastaccess.data.dao.FilesListModel) HashMap(java.util.HashMap) NonNull(android.support.annotation.NonNull) BasePresenter(com.fastaccess.ui.base.mvp.presenter.BasePresenter) CreateGistModel(com.fastaccess.data.dao.CreateGistModel)

Aggregations

FilesListModel (com.fastaccess.data.dao.FilesListModel)6 NonNull (android.support.annotation.NonNull)2 Bundle (android.os.Bundle)1 CreateGistModel (com.fastaccess.data.dao.CreateGistModel)1 InputHelper (com.fastaccess.helper.InputHelper)1 RestProvider (com.fastaccess.provider.rest.RestProvider)1 GistFilesAdapter (com.fastaccess.ui.adapter.GistFilesAdapter)1 BasePresenter (com.fastaccess.ui.base.mvp.presenter.BasePresenter)1 SpannableBuilder (com.fastaccess.ui.widgets.SpannableBuilder)1 HashMap (java.util.HashMap)1