クラッシュ対応
This commit is contained in:
parent
4ba7cd321a
commit
bcf20ad8bf
|
@ -9,6 +9,7 @@
|
||||||
<w>enty</w>
|
<w>enty</w>
|
||||||
<w>favourited</w>
|
<w>favourited</w>
|
||||||
<w>firebase</w>
|
<w>firebase</w>
|
||||||
|
<w>gifv</w>
|
||||||
<w>hashtag</w>
|
<w>hashtag</w>
|
||||||
<w>hashtags</w>
|
<w>hashtags</w>
|
||||||
<w>idempotency</w>
|
<w>idempotency</w>
|
||||||
|
|
|
@ -9,8 +9,8 @@ android {
|
||||||
applicationId "jp.juggler.subwaytooter"
|
applicationId "jp.juggler.subwaytooter"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
versionCode 102
|
versionCode 103
|
||||||
versionName "1.0.2"
|
versionName "1.0.3"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,15 +80,15 @@ class ItemViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
private final View llSearchTag;
|
private final View llSearchTag;
|
||||||
private final Button btnSearchTag;
|
private final Button btnSearchTag;
|
||||||
|
|
||||||
private @Nullable final TextView tvApplication;
|
@Nullable private final TextView tvApplication;
|
||||||
|
|
||||||
private TootStatusLike status;
|
@Nullable private TootStatusLike status;
|
||||||
private TootAccount account_thumbnail;
|
@Nullable private TootAccount account_thumbnail;
|
||||||
private TootAccount account_boost;
|
@Nullable private TootAccount account_boost;
|
||||||
private TootAccount account_follow;
|
@Nullable private TootAccount account_follow;
|
||||||
private String search_tag;
|
@Nullable private String search_tag;
|
||||||
private TootGap gap;
|
@Nullable private TootGap gap;
|
||||||
private TootDomainBlock domain_block;
|
@Nullable private TootDomainBlock domain_block;
|
||||||
|
|
||||||
private final boolean bSimpleList;
|
private final boolean bSimpleList;
|
||||||
|
|
||||||
|
@ -543,12 +543,16 @@ class ItemViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
|
|
||||||
switch( v.getId() ){
|
switch( v.getId() ){
|
||||||
case R.id.btnHideMedia:
|
case R.id.btnHideMedia:
|
||||||
MediaShown.save( status, false );
|
if( status != null){
|
||||||
btnShowMedia.setVisibility( View.VISIBLE );
|
MediaShown.save( status, false );
|
||||||
|
btnShowMedia.setVisibility( View.VISIBLE );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.btnShowMedia:
|
case R.id.btnShowMedia:
|
||||||
MediaShown.save( status, true );
|
if( status != null){
|
||||||
btnShowMedia.setVisibility( View.GONE );
|
MediaShown.save( status, true );
|
||||||
|
btnShowMedia.setVisibility( View.GONE );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.ivMedia1:
|
case R.id.ivMedia1:
|
||||||
clickMedia( 0 );
|
clickMedia( 0 );
|
||||||
|
@ -562,12 +566,13 @@ class ItemViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
case R.id.ivMedia4:
|
case R.id.ivMedia4:
|
||||||
clickMedia( 3 );
|
clickMedia( 3 );
|
||||||
break;
|
break;
|
||||||
case R.id.btnContentWarning:{
|
case R.id.btnContentWarning:
|
||||||
boolean new_shown = ( llContents.getVisibility() == View.GONE );
|
if( status != null){
|
||||||
ContentWarning.save( status, new_shown );
|
boolean new_shown = ( llContents.getVisibility() == View.GONE );
|
||||||
list_adapter.notifyDataSetChanged();
|
ContentWarning.save( status, new_shown );
|
||||||
|
list_adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case R.id.ivThumbnail:
|
case R.id.ivThumbnail:
|
||||||
if( access_info.isPseudo() ){
|
if( access_info.isPseudo() ){
|
||||||
|
@ -666,8 +671,10 @@ class ItemViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
// StatusButtonsPopupを表示する
|
// StatusButtonsPopupを表示する
|
||||||
void onItemClick( MyListView listView, View anchor ){
|
void onItemClick( MyListView listView, View anchor ){
|
||||||
activity.closeListItemPopup();
|
activity.closeListItemPopup();
|
||||||
activity.list_item_popup = new StatusButtonsPopup( activity, column, bSimpleList );
|
if( status != null ){
|
||||||
activity.list_item_popup.show( listView, anchor, status );
|
activity.list_item_popup = new StatusButtonsPopup( activity, column, bSimpleList );
|
||||||
|
activity.list_item_popup.show( listView, anchor, status );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,23 +3,18 @@ package jp.juggler.subwaytooter.api;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import jp.juggler.subwaytooter.api.entity.TootAccount;
|
import jp.juggler.subwaytooter.api.entity.TootAccount;
|
||||||
import jp.juggler.subwaytooter.api.entity.TootNotification;
|
import jp.juggler.subwaytooter.api.entity.TootNotification;
|
||||||
import jp.juggler.subwaytooter.api.entity.TootReport;
|
import jp.juggler.subwaytooter.api.entity.TootReport;
|
||||||
import jp.juggler.subwaytooter.api.entity.TootStatus;
|
import jp.juggler.subwaytooter.api.entity.TootStatus;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by tateisu on 2017/05/10.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class DuplicateMap {
|
public class DuplicateMap {
|
||||||
|
|
||||||
HashSet< Long > set_status_id = new HashSet<>();
|
private final HashSet< Long > set_status_id = new HashSet<>();
|
||||||
HashSet< Long > set_notification_id = new HashSet<>();
|
private final HashSet< Long > set_notification_id = new HashSet<>();
|
||||||
HashSet< Long > set_report_id = new HashSet<>();
|
private final HashSet< Long > set_report_id = new HashSet<>();
|
||||||
HashSet< Long > set_account_id = new HashSet<>();
|
private final HashSet< Long > set_account_id = new HashSet<>();
|
||||||
|
|
||||||
public void clear(){
|
public void clear(){
|
||||||
set_status_id.clear();
|
set_status_id.clear();
|
||||||
|
@ -28,7 +23,7 @@ public class DuplicateMap {
|
||||||
set_account_id.clear();
|
set_account_id.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isDuplicate(Object o){
|
private boolean isDuplicate( Object o ){
|
||||||
|
|
||||||
if( o instanceof TootStatus ){
|
if( o instanceof TootStatus ){
|
||||||
if( set_status_id.contains( ( (TootStatus) o ).id ) ) return true;
|
if( set_status_id.contains( ( (TootStatus) o ).id ) ) return true;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package jp.juggler.subwaytooter.api.entity;
|
package jp.juggler.subwaytooter.api.entity;
|
||||||
|
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -27,16 +28,16 @@ public class TootAttachment {
|
||||||
public static final String TYPE_UNKNOWN = "unknown";
|
public static final String TYPE_UNKNOWN = "unknown";
|
||||||
|
|
||||||
//URL of the locally hosted version of the image
|
//URL of the locally hosted version of the image
|
||||||
public String url;
|
@Nullable public String url;
|
||||||
|
|
||||||
//For remote images, the remote URL of the original image
|
//For remote images, the remote URL of the original image
|
||||||
public String remote_url;
|
@Nullable public String remote_url;
|
||||||
|
|
||||||
// URL of the preview image
|
// URL of the preview image
|
||||||
public String preview_url;
|
@Nullable public String preview_url;
|
||||||
|
|
||||||
// Shorter URL for the image, for insertion into text (only present on local images)
|
// Shorter URL for the image, for insertion into text (only present on local images)
|
||||||
public String text_url;
|
@Nullable public String text_url;
|
||||||
|
|
||||||
public JSONObject json;
|
public JSONObject json;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class TootDomainBlock {
|
||||||
// domain
|
// domain
|
||||||
public String domain;
|
public String domain;
|
||||||
|
|
||||||
public TootDomainBlock( String sv ){
|
private TootDomainBlock( String sv ){
|
||||||
this.domain = sv;
|
this.domain = sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,17 @@ package jp.juggler.subwaytooter.api.entity;
|
||||||
public class TootGap {
|
public class TootGap {
|
||||||
public String max_id;
|
public String max_id;
|
||||||
public String since_id;
|
public String since_id;
|
||||||
|
|
||||||
public TootGap( String max_id, String since_id ){
|
public TootGap( String max_id, String since_id ){
|
||||||
this.max_id = max_id;
|
this.max_id = max_id;
|
||||||
this.since_id = since_id;
|
this.since_id = since_id;
|
||||||
}
|
}
|
||||||
public TootGap( long max_id, String since_id ){
|
|
||||||
this.max_id = Long.toString(max_id);
|
// public TootGap( long max_id, String since_id ){
|
||||||
this.since_id = since_id;
|
// this.max_id = Long.toString(max_id);
|
||||||
}
|
// this.since_id = since_id;
|
||||||
|
// }
|
||||||
|
|
||||||
public TootGap( long max_id, long since_id ){
|
public TootGap( long max_id, long since_id ){
|
||||||
this.max_id = Long.toString(max_id);
|
this.max_id = Long.toString(max_id);
|
||||||
this.since_id = Long.toString(since_id);
|
this.since_id = Long.toString(since_id);
|
||||||
|
|
|
@ -3,8 +3,7 @@ package jp.juggler.subwaytooter.api.entity;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
|
|
||||||
|
public abstract class TootStatusLike extends TootId {
|
||||||
public abstract class TootStatusLike extends TootId{
|
|
||||||
|
|
||||||
//URL to the status page (can be remote)
|
//URL to the status page (can be remote)
|
||||||
public String url;
|
public String url;
|
||||||
|
@ -14,7 +13,6 @@ public abstract class TootStatusLike extends TootId{
|
||||||
// The TootAccount which posted the status
|
// The TootAccount which posted the status
|
||||||
@Nullable public TootAccount account;
|
@Nullable public TootAccount account;
|
||||||
|
|
||||||
|
|
||||||
//The number of reblogs for the status
|
//The number of reblogs for the status
|
||||||
public long reblogs_count;
|
public long reblogs_count;
|
||||||
|
|
||||||
|
@ -39,7 +37,7 @@ public abstract class TootStatusLike extends TootId{
|
||||||
public Spannable decoded_content;
|
public Spannable decoded_content;
|
||||||
|
|
||||||
//Application from which the status was posted
|
//Application from which the status was posted
|
||||||
public TootApplication application;
|
@Nullable public TootApplication application;
|
||||||
|
|
||||||
public long time_created_at;
|
public long time_created_at;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue