| | package org.ntlab.acanthus_client.views.paint; |
---|
| | |
---|
| | import androidx.lifecycle.MutableLiveData; |
---|
| | import androidx.navigation.ActivityNavigator; |
---|
| | |
---|
| | import org.ntlab.acanthus_client.Acanthus; |
---|
| | import org.ntlab.acanthus_client.entities.Animation; |
---|
| | import org.ntlab.acanthus_client.entities.Position; |
---|
| | import org.ntlab.acanthus_client.resources.gallery.GalleryRest; |
---|
| | import org.ntlab.acanthus_client.resources.gallery.StrokesRest; |
---|
| | |
---|
| | import java.lang.reflect.Array; |
---|
| | import java.util.ArrayList; |
---|
| | import java.util.Collection; |
---|
| | |
---|
| | import retrofit2.Call; |
---|
| | import retrofit2.Callback; |
---|
| | import retrofit2.Response; |
---|
| |
---|
| | private Animation editedAnimation; |
---|
| | private Integer currentStrokeNo; |
---|
| | private Retrofit retrofit; |
---|
| | private Acanthus acanthus; |
---|
| | private Collection getPaint; |
---|
| | |
---|
| | //----------------------------------------------------------------- |
---|
| | //----------------------------------------------------------------- |
---|
| | // |
---|
| |
---|
| | //----------------------------------------------------------------- |
---|
| | // init |
---|
| | public void init(Acanthus acanthus) { |
---|
| | this.acanthus = acanthus; |
---|
| | this.getPaint = new ArrayList(); |
---|
| | this.retrofit = new Retrofit.Builder() |
---|
| | .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/acanthus/") |
---|
| | .addConverterFactory(ScalarsConverterFactory.create()) |
---|
| | .addConverterFactory(JacksonConverterFactory.create()) |
---|
| |
---|
| | } |
---|
| | }); |
---|
| | } |
---|
| | //----------------------------------------------------------------- |
---|
| | //Getを追加 |
---|
| | public void apigetPosition(MutableLiveData<Collection<Position>> paintPosition){ |
---|
| | final StrokesRest strokesRest = retrofit.create(StrokesRest.class); |
---|
| | |
---|
| | //----------------------------------------------------------------- |
---|
| | // 筆跡追加API |
---|
| | Call<Collection<Position>> call = strokesRest.getPositions(acanthus.getAid(),0); |
---|
| | call.enqueue(new Callback<Collection<Position>>() { |
---|
| | @Override |
---|
| | public void onResponse(Call<Collection<Position>> call, Response<Collection<Position>> response) { |
---|
| | if (response.isSuccessful()) paintPosition.setValue(response.body()); |
---|
| | } |
---|
| | |
---|
| | @Override |
---|
| | public void onFailure(Call<Collection<Position>> call, Throwable t) { |
---|
| | |
---|
| | } |
---|
| | }); |
---|
| | |
---|
| | } |
---|
| | |
---|
| | public Collection getPosition(){ |
---|
| | return this.getPaint; |
---|
| | } |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |
No description provided.
[update]消えた進捗を取り戻しました
9af4577
intomaster
fromfeature/accept_invitation
on 29 Jun 2021