投稿後のリフレッシュでぬるぽが出る場合がある問題の修正
This commit is contained in:
parent
c6220f195a
commit
f8376f4260
|
@ -1000,11 +1000,10 @@ class Column {
|
||||||
return parseNotifications( client, PATH_NOTIFICATIONS );
|
return parseNotifications( client, PATH_NOTIFICATIONS );
|
||||||
|
|
||||||
case TYPE_BOOSTED_BY:
|
case TYPE_BOOSTED_BY:
|
||||||
return parseAccountList( client, String.format( Locale.JAPAN,PATH_BOOSTED_BY,status_id ) );
|
return parseAccountList( client, String.format( Locale.JAPAN, PATH_BOOSTED_BY, status_id ) );
|
||||||
|
|
||||||
case TYPE_FAVOURITED_BY:
|
case TYPE_FAVOURITED_BY:
|
||||||
return parseAccountList( client, String.format( Locale.JAPAN,PATH_FAVOURITED_BY,status_id ) );
|
return parseAccountList( client, String.format( Locale.JAPAN, PATH_FAVOURITED_BY, status_id ) );
|
||||||
|
|
||||||
|
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
|
||||||
|
@ -1246,15 +1245,15 @@ class Column {
|
||||||
}
|
}
|
||||||
|
|
||||||
void startRefreshForPost( long status_id, int refresh_after_toot ){
|
void startRefreshForPost( long status_id, int refresh_after_toot ){
|
||||||
switch(column_type){
|
switch( column_type ){
|
||||||
case TYPE_HOME:
|
case TYPE_HOME:
|
||||||
case TYPE_LOCAL:
|
case TYPE_LOCAL:
|
||||||
case TYPE_FEDERATE:
|
case TYPE_FEDERATE:
|
||||||
startRefresh( true, false, status_id ,refresh_after_toot);
|
startRefresh( true, false, status_id, refresh_after_toot );
|
||||||
break;
|
break;
|
||||||
case TYPE_PROFILE:
|
case TYPE_PROFILE:
|
||||||
if( profile_tab == TAB_STATUS && profile_id == access_info.id ){
|
if( profile_tab == TAB_STATUS && profile_id == access_info.id ){
|
||||||
startRefresh( true, false, status_id ,refresh_after_toot);
|
startRefresh( true, false, status_id, refresh_after_toot );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TYPE_CONVERSATION:
|
case TYPE_CONVERSATION:
|
||||||
|
@ -1264,7 +1263,7 @@ class Column {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startRefresh( final boolean bSilent, final boolean bBottom , final long status_id, final int refresh_after_toot){
|
void startRefresh( final boolean bSilent, final boolean bBottom, final long status_id, final int refresh_after_toot ){
|
||||||
|
|
||||||
if( last_task != null ){
|
if( last_task != null ){
|
||||||
if( ! bSilent ){
|
if( ! bSilent ){
|
||||||
|
@ -1642,12 +1641,10 @@ class Column {
|
||||||
return getNotificationList( client, PATH_NOTIFICATIONS );
|
return getNotificationList( client, PATH_NOTIFICATIONS );
|
||||||
|
|
||||||
case TYPE_BOOSTED_BY:
|
case TYPE_BOOSTED_BY:
|
||||||
return getAccountList( client, String.format( Locale.JAPAN,PATH_BOOSTED_BY,status_id ) );
|
return getAccountList( client, String.format( Locale.JAPAN, PATH_BOOSTED_BY, status_id ) );
|
||||||
|
|
||||||
case TYPE_FAVOURITED_BY:
|
case TYPE_FAVOURITED_BY:
|
||||||
return getAccountList( client, String.format( Locale.JAPAN,PATH_FAVOURITED_BY,status_id ) );
|
return getAccountList( client, String.format( Locale.JAPAN, PATH_FAVOURITED_BY, status_id ) );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case TYPE_PROFILE:
|
case TYPE_PROFILE:
|
||||||
if( who_account == null ){
|
if( who_account == null ){
|
||||||
|
@ -1766,17 +1763,17 @@ class Column {
|
||||||
if( bBottom ){
|
if( bBottom ){
|
||||||
list_data.addAll( list_new );
|
list_data.addAll( list_new );
|
||||||
fireShowContent();
|
fireShowContent();
|
||||||
if( holder != null ){
|
|
||||||
//noinspection ConstantConditions
|
if( sp != null ){
|
||||||
holder.setScrollPosition( sp, 20f );
|
holder.setScrollPosition( sp, 20f );
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
int status_index = -1;
|
int status_index = - 1;
|
||||||
for( int i=0,ie=list_new.size();i<ie;++i){
|
for( int i = 0, ie = list_new.size() ; i < ie ; ++ i ){
|
||||||
Object o = list_new.get(i);
|
Object o = list_new.get( i );
|
||||||
if( o instanceof TootStatus ){
|
if( o instanceof TootStatus ){
|
||||||
TootStatus status = (TootStatus)o;
|
TootStatus status = (TootStatus) o;
|
||||||
if( status.id == status_id ){
|
if( status.id == status_id ){
|
||||||
status_index = i;
|
status_index = i;
|
||||||
break;
|
break;
|
||||||
|
@ -1790,24 +1787,21 @@ class Column {
|
||||||
list_data.addAll( list_new );
|
list_data.addAll( list_new );
|
||||||
fireShowContent();
|
fireShowContent();
|
||||||
|
|
||||||
if( status_index >= 0 && refresh_after_toot == Pref.RAT_REFRESH_SCROLL){
|
if( status_index >= 0 && refresh_after_toot == Pref.RAT_REFRESH_SCROLL ){
|
||||||
if( holder != null ){
|
if( holder != null ){
|
||||||
//noinspection ConstantConditions
|
holder.setScrollPosition( new ScrollPosition( status_index, 0 ), 0f );
|
||||||
sp.pos = status_index;
|
|
||||||
sp.top = 0;
|
|
||||||
holder.setScrollPosition( sp, 0f );
|
|
||||||
}else{
|
}else{
|
||||||
scroll_save.pos = status_index;
|
scroll_save = new ScrollPosition( status_index, 0 );
|
||||||
scroll_save.top = 0;
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
float delta = bSilent ? 0f : - 20f;
|
float delta = bSilent ? 0f : - 20f;
|
||||||
if( holder != null ){
|
if( sp != null ){
|
||||||
//noinspection ConstantConditions
|
|
||||||
sp.pos += added;
|
sp.pos += added;
|
||||||
holder.setScrollPosition( sp, delta );
|
holder.setScrollPosition( sp, delta );
|
||||||
}else{
|
}else if ( scroll_save != null ){
|
||||||
scroll_save.pos += added;
|
scroll_save.pos += added;
|
||||||
|
}else{
|
||||||
|
scroll_save = new ScrollPosition( added,0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2080,11 +2074,10 @@ class Column {
|
||||||
String.format( Locale.JAPAN, PATH_HASHTAG, Uri.encode( hashtag ) ) );
|
String.format( Locale.JAPAN, PATH_HASHTAG, Uri.encode( hashtag ) ) );
|
||||||
|
|
||||||
case TYPE_BOOSTED_BY:
|
case TYPE_BOOSTED_BY:
|
||||||
return getAccountList( client, String.format( Locale.JAPAN,PATH_BOOSTED_BY,status_id ) );
|
return getAccountList( client, String.format( Locale.JAPAN, PATH_BOOSTED_BY, status_id ) );
|
||||||
|
|
||||||
case TYPE_FAVOURITED_BY:
|
case TYPE_FAVOURITED_BY:
|
||||||
return getAccountList( client, String.format( Locale.JAPAN,PATH_FAVOURITED_BY,status_id ) );
|
return getAccountList( client, String.format( Locale.JAPAN, PATH_FAVOURITED_BY, status_id ) );
|
||||||
|
|
||||||
|
|
||||||
case TYPE_MUTES:
|
case TYPE_MUTES:
|
||||||
return getAccountList( client, PATH_MUTES );
|
return getAccountList( client, PATH_MUTES );
|
||||||
|
@ -2207,7 +2200,9 @@ class Column {
|
||||||
if( holder != null ){
|
if( holder != null ){
|
||||||
setItemTop( restore_idx + added - 1, restore_y );
|
setItemTop( restore_idx + added - 1, restore_y );
|
||||||
}else{
|
}else{
|
||||||
scroll_save.pos += added - 1;
|
if( scroll_save != null ){
|
||||||
|
scroll_save.pos += added - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -460,11 +460,11 @@ class ColumnViewHolder
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveScrollPosition(){
|
private void saveScrollPosition(){
|
||||||
column.scroll_save = null;
|
|
||||||
if( listView.getVisibility() == View.VISIBLE ){
|
if( listView.getVisibility() == View.VISIBLE ){
|
||||||
if( listView.getChildCount() > 0 ){
|
column.scroll_save = new ScrollPosition( listView );
|
||||||
column.scroll_save = new ScrollPosition( listView );
|
}else{
|
||||||
}
|
column.scroll_save = new ScrollPosition( 0,0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,18 @@ public class ScrollPosition {
|
||||||
public int pos;
|
public int pos;
|
||||||
public int top;
|
public int top;
|
||||||
|
|
||||||
|
public ScrollPosition( int pos,int top ){
|
||||||
|
this.pos = pos;
|
||||||
|
this.top = top;
|
||||||
|
}
|
||||||
|
|
||||||
public ScrollPosition( MyListView listView ){
|
public ScrollPosition( MyListView listView ){
|
||||||
pos = listView.getFirstVisiblePosition();
|
if( listView.getChildCount() == 0 ){
|
||||||
top = listView.getChildAt( 0 ).getTop();
|
pos = top = 0;
|
||||||
|
}else{
|
||||||
|
pos = listView.getFirstVisiblePosition();
|
||||||
|
top = listView.getChildAt( 0 ).getTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restore( MyListView listView ){
|
public void restore( MyListView listView ){
|
||||||
|
|
Loading…
Reference in New Issue