読み上げ時にURL略を繰り返さないようにした
This commit is contained in:
parent
35aa48e1bc
commit
7d770b4e2e
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "jp.juggler.subwaytooter"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
versionCode 82
|
||||
versionName "0.8.2"
|
||||
versionCode 83
|
||||
versionName "0.8.3"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
|
|
@ -211,6 +211,7 @@ class AppState {
|
|||
String str_text = text.toString();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int last_end = 0;
|
||||
boolean has_url = false;
|
||||
for( MyClickableSpan span : span_list ){
|
||||
int start = text.getSpanStart( span );
|
||||
int end = text.getSpanEnd( span );
|
||||
|
@ -228,7 +229,8 @@ class AppState {
|
|||
sb.append( span_text );
|
||||
}else{
|
||||
// それ以外はURL省略
|
||||
sb.append( context.getString( R.string.url_omitted ) );
|
||||
has_url = true;
|
||||
sb.append( " " );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,6 +238,9 @@ class AppState {
|
|||
if( text_end > last_end ){
|
||||
sb.append( str_text.substring( last_end, text_end ) );
|
||||
}
|
||||
if( has_url){
|
||||
sb.append( context.getString( R.string.url_omitted ) );
|
||||
}
|
||||
addSpeech( sb.toString() );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue