APIリクエスト中の進捗メッセージにHTTPメソッドも併記する
This commit is contained in:
parent
96eea57604
commit
577c6f97fe
@ -10,8 +10,8 @@ android {
|
|||||||
applicationId "jp.juggler.subwaytooter"
|
applicationId "jp.juggler.subwaytooter"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 183
|
versionCode 184
|
||||||
versionName "1.8.3"
|
versionName "1.8.4"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4517,9 +4517,6 @@ public class ActMain extends AppCompatActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
static final Pattern reFollowError = Pattern.compile( "follow", Pattern.CASE_INSENSITIVE );
|
static final Pattern reFollowError = Pattern.compile( "follow", Pattern.CASE_INSENSITIVE );
|
||||||
// case R.id.btnOk:
|
|
||||||
// addListMember( false );
|
|
||||||
// break;
|
|
||||||
|
|
||||||
public void callListMemberAdd(
|
public void callListMemberAdd(
|
||||||
@NonNull final SavedAccount access_info
|
@NonNull final SavedAccount access_info
|
||||||
|
@ -426,6 +426,7 @@ class DlgContextMenu implements View.OnClickListener, View.OnLongClickListener {
|
|||||||
}else if( relation.muting ){
|
}else if( relation.muting ){
|
||||||
activity.callMute( access_info, who, false,false );
|
activity.callMute( access_info, who, false,false );
|
||||||
}else{
|
}else{
|
||||||
|
@SuppressLint("InflateParams")
|
||||||
View view = activity.getLayoutInflater().inflate( R.layout.dlg_confirm,null,false );
|
View view = activity.getLayoutInflater().inflate( R.layout.dlg_confirm,null,false );
|
||||||
TextView tvMessage = view.findViewById( R.id.tvMessage );
|
TextView tvMessage = view.findViewById( R.id.tvMessage );
|
||||||
tvMessage.setText( activity.getString( R.string.confirm_mute_user, who.username ) );
|
tvMessage.setText( activity.getString( R.string.confirm_mute_user, who.username ) );
|
||||||
|
@ -109,8 +109,6 @@ public class TootApiClient {
|
|||||||
|
|
||||||
if( MIMUMEDON.equalsIgnoreCase( instance ) ) return new TootApiResult( MIMUMEDON_ERROR );
|
if( MIMUMEDON.equalsIgnoreCase( instance ) ) return new TootApiResult( MIMUMEDON_ERROR );
|
||||||
|
|
||||||
callback.publishApiProgress( context.getString( R.string.request_api, path ) );
|
|
||||||
|
|
||||||
if( account == null ){
|
if( account == null ){
|
||||||
return new TootApiResult( "account is null" );
|
return new TootApiResult( "account is null" );
|
||||||
}
|
}
|
||||||
@ -127,7 +125,10 @@ public class TootApiClient {
|
|||||||
request_builder.header( "Authorization", "Bearer " + access_token );
|
request_builder.header( "Authorization", "Bearer " + access_token );
|
||||||
}
|
}
|
||||||
|
|
||||||
Call call = ok_http_client.newCall( request_builder.build() );
|
Request request = request_builder.build();
|
||||||
|
callback.publishApiProgress( context.getString( R.string.request_api, request.method(), path ) );
|
||||||
|
|
||||||
|
Call call = ok_http_client.newCall( request );
|
||||||
if( call_callback != null ) call_callback.onCallCreated( call );
|
if( call_callback != null ) call_callback.onCallCreated( call );
|
||||||
response = call.execute();
|
response = call.execute();
|
||||||
}catch( Throwable ex ){
|
}catch( Throwable ex ){
|
||||||
@ -174,9 +175,6 @@ public class TootApiClient {
|
|||||||
|
|
||||||
if( callback.isApiCancelled() ) return null;
|
if( callback.isApiCancelled() ) return null;
|
||||||
|
|
||||||
// アクセストークンを使ってAPIを呼び出す
|
|
||||||
callback.publishApiProgress( context.getString( R.string.request_api, path ) );
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
if( account == null ){
|
if( account == null ){
|
||||||
return new TootApiResult( "account is null" );
|
return new TootApiResult( "account is null" );
|
||||||
@ -192,8 +190,10 @@ public class TootApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
request_builder.url( url );
|
request_builder.url( url );
|
||||||
|
Request request = request_builder.build();
|
||||||
|
|
||||||
WebSocket ws = ok_http_client.newWebSocket( request_builder.build(), ws_listener );
|
callback.publishApiProgress( context.getString( R.string.request_api, request.method(), path ) );
|
||||||
|
WebSocket ws = ok_http_client.newWebSocket( request, ws_listener );
|
||||||
if( callback.isApiCancelled() ){
|
if( callback.isApiCancelled() ){
|
||||||
ws.cancel();
|
ws.cancel();
|
||||||
return null;
|
return null;
|
||||||
@ -212,7 +212,6 @@ public class TootApiClient {
|
|||||||
|
|
||||||
// サーバ情報APIを使う
|
// サーバ情報APIを使う
|
||||||
String path = "/api/v1/instance";
|
String path = "/api/v1/instance";
|
||||||
callback.publishApiProgress( context.getString( R.string.request_api, path ) );
|
|
||||||
|
|
||||||
Response response;
|
Response response;
|
||||||
try{
|
try{
|
||||||
@ -220,6 +219,7 @@ public class TootApiClient {
|
|||||||
.url( "https://" + instance + path )
|
.url( "https://" + instance + path )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
callback.publishApiProgress( context.getString( R.string.request_api, request.method(), path ) );
|
||||||
Call call = ok_http_client.newCall( request );
|
Call call = ok_http_client.newCall( request );
|
||||||
if( call_callback != null ) call_callback.onCallCreated( call );
|
if( call_callback != null ) call_callback.onCallCreated( call );
|
||||||
|
|
||||||
@ -534,7 +534,6 @@ public class TootApiClient {
|
|||||||
// 認証されたアカウントのユーザ名を取得する
|
// 認証されたアカウントのユーザ名を取得する
|
||||||
|
|
||||||
String path = "/api/v1/accounts/verify_credentials";
|
String path = "/api/v1/accounts/verify_credentials";
|
||||||
callback.publishApiProgress( context.getString( R.string.request_api, path ) );
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
@ -543,6 +542,7 @@ public class TootApiClient {
|
|||||||
.header( "Authorization", "Bearer " + Utils.optStringX( token_info, "access_token" ) )
|
.header( "Authorization", "Bearer " + Utils.optStringX( token_info, "access_token" ) )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
callback.publishApiProgress( context.getString( R.string.request_api, request.method(), path ) );
|
||||||
Call call = ok_http_client.newCall( request );
|
Call call = ok_http_client.newCall( request );
|
||||||
if( call_callback != null ) call_callback.onCallCreated( call );
|
if( call_callback != null ) call_callback.onCallCreated( call );
|
||||||
|
|
||||||
@ -596,13 +596,13 @@ public class TootApiClient {
|
|||||||
|
|
||||||
// 認証されたアカウントのユーザ名を取得する
|
// 認証されたアカウントのユーザ名を取得する
|
||||||
String path = "/api/v1/accounts/verify_credentials";
|
String path = "/api/v1/accounts/verify_credentials";
|
||||||
callback.publishApiProgress( context.getString( R.string.request_api, path ) );
|
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url( "https://" + instance + path )
|
.url( "https://" + instance + path )
|
||||||
.header( "Authorization", "Bearer " + Utils.optStringX( token_info, "access_token" ) )
|
.header( "Authorization", "Bearer " + Utils.optStringX( token_info, "access_token" ) )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
callback.publishApiProgress( context.getString( R.string.request_api, request.method(), path ) );
|
||||||
Call call = ok_http_client.newCall( request );
|
Call call = ok_http_client.newCall( request );
|
||||||
if( call_callback != null ) call_callback.onCallCreated( call );
|
if( call_callback != null ) call_callback.onCallCreated( call );
|
||||||
|
|
||||||
@ -645,10 +645,12 @@ public class TootApiClient {
|
|||||||
public TootApiResult getHttp( String url ){
|
public TootApiResult getHttp( String url ){
|
||||||
Response response;
|
Response response;
|
||||||
try{
|
try{
|
||||||
Request.Builder request_builder = new Request.Builder();
|
Request request = new Request.Builder()
|
||||||
request_builder.url( url );
|
.url( url )
|
||||||
|
.build();
|
||||||
|
|
||||||
Call call = ok_http_client.newCall( request_builder.build() );
|
callback.publishApiProgress( context.getString( R.string.request_api, request.method(), url ) );
|
||||||
|
Call call = ok_http_client.newCall( request );
|
||||||
if( call_callback != null ) call_callback.onCallCreated( call );
|
if( call_callback != null ) call_callback.onCallCreated( call );
|
||||||
|
|
||||||
response = call.execute();
|
response = call.execute();
|
||||||
|
@ -254,7 +254,7 @@
|
|||||||
<string name="report_reason">Décrire la raison du signalement</string>
|
<string name="report_reason">Décrire la raison du signalement</string>
|
||||||
<string name="reports">Signalements</string>
|
<string name="reports">Signalements</string>
|
||||||
<string name="request_access_token">Demander l\'autorisation d\'accès à l\'instance…</string>
|
<string name="request_access_token">Demander l\'autorisation d\'accès à l\'instance…</string>
|
||||||
<string name="request_api">Obtenir %1$s…</string>
|
<string name="request_api">Acquiring: %1$s %2$s</string>
|
||||||
<string name="reset">Reset</string>
|
<string name="reset">Reset</string>
|
||||||
<string name="resize_image">Changer la taille des images jointes (JPEG,PNG)</string>
|
<string name="resize_image">Changer la taille des images jointes (JPEG,PNG)</string>
|
||||||
<string name="resolve_non_local_account">Résoudre le compte non local</string>
|
<string name="resolve_non_local_account">Résoudre le compte non local</string>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<!---->
|
<!---->
|
||||||
<string name="request_access_token">アクセストークンの取得中…</string>
|
<string name="request_access_token">アクセストークンの取得中…</string>
|
||||||
<!---->
|
<!---->
|
||||||
<string name="request_api">取得中… %1$s</string>
|
<string name="request_api">Acquiring: %1$s %2$s</string>
|
||||||
<!---->
|
<!---->
|
||||||
<string name="column_empty">左下のメニューボタンを押してアカウントまたはカラムを追加してください</string>
|
<string name="column_empty">左下のメニューボタンを押してアカウントまたはカラムを追加してください</string>
|
||||||
<!---->
|
<!---->
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<string name="register_app_to_server">Registering this app to %1$s…</string>
|
<string name="register_app_to_server">Registering this app to %1$s…</string>
|
||||||
<string name="request_access_token">Requesting access token…</string>
|
<string name="request_access_token">Requesting access token…</string>
|
||||||
<string name="request_api">Get %1$s…</string>
|
<string name="request_api">Acquiring: %1$s %2$s</string>
|
||||||
<string name="column_empty">Use the left-bottom menu button to add a column</string>
|
<string name="column_empty">Use the left-bottom menu button to add a column</string>
|
||||||
<string name="home">Home</string>
|
<string name="home">Home</string>
|
||||||
<string name="local_timeline">Local timeline</string>
|
<string name="local_timeline">Local timeline</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user