- 簡略表示と内蔵メディアビューアのデフォルトをONにした

- logcatへの出力を少し削った
This commit is contained in:
tateisu 2017-12-28 23:42:02 +09:00
parent 0b63205fe1
commit 92bb6223cd
6 changed files with 19 additions and 8 deletions

View File

@ -379,7 +379,7 @@ public class ActAppSetting extends AppCompatActivity
swDontConfirmBeforeCloseColumn.setChecked( pref.getBoolean( Pref.KEY_DONT_CONFIRM_BEFORE_CLOSE_COLUMN, false ) );
swPriorLocalURL.setChecked( pref.getBoolean( Pref.KEY_PRIOR_LOCAL_URL, false ) );
swSimpleList.setChecked( pref.getBoolean( Pref.KEY_SIMPLE_LIST, false ) );
swSimpleList.setChecked( pref.getBoolean( Pref.KEY_SIMPLE_LIST, true ) );
swExitAppWhenCloseProtectedColumn.setChecked( pref.getBoolean( Pref.KEY_EXIT_APP_WHEN_CLOSE_PROTECTED_COLUMN, false ) );
swShowFollowButtonInButtonBar.setChecked( pref.getBoolean( Pref.KEY_SHOW_FOLLOW_BUTTON_IN_BUTTON_BAR, false ) );
swDontRound.setChecked( pref.getBoolean( Pref.KEY_DONT_ROUND, false ) );
@ -398,7 +398,7 @@ public class ActAppSetting extends AppCompatActivity
swShortAcctLocalUser.setChecked( pref.getBoolean( Pref.KEY_SHORT_ACCT_LOCAL_USER, false ) );
swDisableEmojiAnimation.setChecked( pref.getBoolean( Pref.KEY_DISABLE_EMOJI_ANIMATION, false ) );
swAllowNonSpaceBeforeEmojiShortcode.setChecked( pref.getBoolean( Pref.KEY_ALLOW_NON_SPACE_BEFORE_EMOJI_SHORTCODE, false ) );
swUseInternalMediaViewer.setChecked( pref.getBoolean( Pref.KEY_USE_INTERNAL_MEDIA_VIEWER, false ) );
swUseInternalMediaViewer.setChecked( pref.getBoolean( Pref.KEY_USE_INTERNAL_MEDIA_VIEWER, true ) );
// Switch with default true
swDisableFastScroller.setChecked( pref.getBoolean( Pref.KEY_DISABLE_FAST_SCROLLER, true ) );
swPriorChrome.setChecked( pref.getBoolean( Pref.KEY_PRIOR_CHROME, true ) );

View File

@ -256,7 +256,7 @@ class ColumnViewHolder
log.d( "onPageCreate [%d] %s", page_idx, column.getColumnName( true ) );
boolean bSimpleList = ( column.column_type != Column.TYPE_CONVERSATION && activity.pref.getBoolean( Pref.KEY_SIMPLE_LIST, false ) );
boolean bSimpleList = ( column.column_type != Column.TYPE_CONVERSATION && activity.pref.getBoolean( Pref.KEY_SIMPLE_LIST, true ) );
tvColumnIndex.setText( activity.getString( R.string.column_index, page_idx + 1, page_count ) );

View File

@ -922,7 +922,7 @@ class ItemViewHolder implements View.OnClickListener, View.OnLongClickListener {
if( media_attachments == null ) return;
if( App1.pref.getBoolean( Pref. KEY_USE_INTERNAL_MEDIA_VIEWER,false) ){
if( App1.pref.getBoolean( Pref. KEY_USE_INTERNAL_MEDIA_VIEWER,true) ){
ActMediaViewer.open( activity, media_attachments, i );
return;
}

View File

@ -33,7 +33,7 @@ public class CustomEmoji {
this.static_url = static_url;
}
public static CustomEmoji parse( JSONObject src ){
public static CustomEmoji parse( @Nullable JSONObject src ){
if( src == null ) return null;
String shortcode = Utils.optStringX( src, "shortcode" );
String url = Utils.optStringX( src, "url" );
@ -47,19 +47,27 @@ public class CustomEmoji {
public static class List extends ArrayList< CustomEmoji > {
}
public static List parseList( JSONArray src, @NonNull String instance ){
public static @Nullable List parseList( @Nullable JSONArray src, @NonNull String instance ){
if( src == null ) return null;
int src_length = src.length();
if( src_length == 0 ) return null;
List dst = new List();
for( int i = 0, ie = src.length() ; i < ie ; ++ i ){
CustomEmoji item = parse( src.optJSONObject( i ) );
if( item != null ) dst.add( item );
}
if( dst.isEmpty() ) return null;
Collections.sort( dst, new Comparator< CustomEmoji >() {
@Override public int compare( CustomEmoji a, CustomEmoji b ){
return a.shortcode.compareToIgnoreCase( b.shortcode );
}
} );
log.d( "parseList: parse %d emojis for %s.", dst.size(), instance );
return dst;
}

View File

@ -1,5 +1,6 @@
package jp.juggler.subwaytooter.util;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
@ -172,6 +173,7 @@ public class PostHelper implements CustomEmojiLister.Callback, EmojiPicker.Callb
//noinspection deprecation
final ProgressDialog progress = new ProgressDialog( activity );
@SuppressLint("StaticFieldLeak")
final AsyncTask< Void, Void, TootApiResult > task = new AsyncTask< Void, Void, TootApiResult >() {
final SavedAccount target_account = account;
@ -607,7 +609,7 @@ public class PostHelper implements CustomEmojiLister.Callback, EmojiPicker.Callb
String part = src.substring( last_sharp + 1, end );
if( reCharsNotTag.matcher( part ).find() ){
log.d( "checkTag: character not tag in string %s", part );
// log.d( "checkTag: character not tag in string %s", part );
checkEmoji();
return;
}

View File

@ -846,6 +846,7 @@ public class Utils {
if( ct != null && ct.contains( "/html" ) ){
sv = new DecodeOptions().decodeHTML( null, null, sv ).toString();
}
// TODO: Amazon S3 が403を返した場合にcontent-typeが?/xmlでserverがAmazonならXMLをパースして
sb.append( sv );
}