1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-02-05 13:17:43 +01:00
- CWつきのトゥートがさらに自動CWされちゃう不具合の修正
This commit is contained in:
tateisu 2017-09-06 07:10:38 +09:00
parent 250511c62f
commit 388f046a79
2 changed files with 22 additions and 22 deletions

View File

@ -9,8 +9,8 @@ android {
applicationId "jp.juggler.subwaytooter"
minSdkVersion 21
targetSdkVersion 26
versionCode 138
versionName "1.3.8"
versionCode 139
versionName "1.3.9"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

View File

@ -4619,29 +4619,29 @@ public class ActMain extends AppCompatActivity
);
Layout l = tv.getLayout();
if( l != null ){
a.originalLineCount = l.getLineCount();
int line_count = a.originalLineCount = l.getLineCount();
if( nAutoCwLines > 0 ){
int line_count = l.getLineCount();
if( line_count > nAutoCwLines ){
SpannableStringBuilder sb = new SpannableStringBuilder();
sb.append( getString( R.string.auto_cw_prefix ) );
sb.append( text, 0, l.getLineEnd( nAutoCwLines - 1 ) );
int last = sb.length();
while( last > 0 ){
char c = sb.charAt( last - 1 );
if( c == '\n' || Character.isWhitespace( c ) ){
-- last;
continue;
}
break;
if( nAutoCwLines > 0
&& line_count > nAutoCwLines
&& TextUtils.isEmpty( status.spoiler_text )
){
SpannableStringBuilder sb = new SpannableStringBuilder();
sb.append( getString( R.string.auto_cw_prefix ) );
sb.append( text, 0, l.getLineEnd( nAutoCwLines - 1 ) );
int last = sb.length();
while( last > 0 ){
char c = sb.charAt( last - 1 );
if( c == '\n' || Character.isWhitespace( c ) ){
-- last;
continue;
}
if( last < sb.length() ){
sb.delete( last, sb.length() );
}
sb.append( '…' );
a.decoded_spoiler_text = sb;
break;
}
if( last < sb.length() ){
sb.delete( last, sb.length() );
}
sb.append( '…' );
a.decoded_spoiler_text = sb;
}
}
}