@ -236,6 +236,9 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
grpExpanded = itemView . findViewById ( R . id . grpExpanded ) ;
grpExpanded = itemView . findViewById ( R . id . grpExpanded ) ;
tvBody . setMovementMethod ( new UrlHandler ( ) ) ;
tvBody . setMovementMethod ( new UrlHandler ( ) ) ;
if ( viewType = = ViewType . THREAD )
itemView . setHasTransientState ( true ) ;
}
}
private void wire ( ) {
private void wire ( ) {
@ -448,11 +451,9 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
}
}
if ( ! EntityFolder . OUTBOX . equals ( message . folderType ) ) {
if ( ! EntityFolder . OUTBOX . equals ( message . folderType ) ) {
bnvActions . setHasTransientState ( true ) ;
db . folder ( ) . liveSystemFolders ( message . account ) . observe ( owner , new Observer < List < EntityFolder > > ( ) {
db . folder ( ) . liveSystemFolders ( message . account ) . observe ( owner , new Observer < List < EntityFolder > > ( ) {
@Override
@Override
public void onChanged ( @Nullable List < EntityFolder > folders ) {
public void onChanged ( @Nullable List < EntityFolder > folders ) {
if ( bnvActions . hasTransientState ( ) ) {
boolean hasJunk = false ;
boolean hasJunk = false ;
boolean hasTrash = false ;
boolean hasTrash = false ;
boolean hasArchive = false ;
boolean hasArchive = false ;
@ -486,9 +487,6 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
bnvActions . setVisibility ( View . VISIBLE ) ;
bnvActions . setVisibility ( View . VISIBLE ) ;
vSeparatorBody . setVisibility ( View . GONE ) ;
vSeparatorBody . setVisibility ( View . GONE ) ;
bnvActions . setHasTransientState ( false ) ;
}
}
}
} ) ;
} ) ;
}
}
@ -670,14 +668,6 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
private SimpleTask < Spanned > bodyTask = new SimpleTask < Spanned > ( ) {
private SimpleTask < Spanned > bodyTask = new SimpleTask < Spanned > ( ) {
private String body = null ;
private String body = null ;
@Override
protected void onInit ( Bundle args ) {
btnHtml . setHasTransientState ( true ) ;
btnImages . setHasTransientState ( true ) ;
tvBody . setHasTransientState ( true ) ;
pbBody . setHasTransientState ( true ) ;
}
@Override
@Override
protected Spanned onLoad ( final Context context , final Bundle args ) throws Throwable {
protected Spanned onLoad ( final Context context , final Bundle args ) throws Throwable {
TupleMessageEx message = ( TupleMessageEx ) args . getSerializable ( "message" ) ;
TupleMessageEx message = ( TupleMessageEx ) args . getSerializable ( "message" ) ;
@ -699,20 +689,10 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
btnImages . setVisibility ( has_images & & show_expanded & & ! show_images ? View . VISIBLE : View . GONE ) ;
btnImages . setVisibility ( has_images & & show_expanded & & ! show_images ? View . VISIBLE : View . GONE ) ;
tvBody . setText ( body ) ;
tvBody . setText ( body ) ;
pbBody . setVisibility ( View . GONE ) ;
pbBody . setVisibility ( View . GONE ) ;
btnHtml . setHasTransientState ( false ) ;
btnImages . setHasTransientState ( false ) ;
tvBody . setHasTransientState ( false ) ;
pbBody . setHasTransientState ( false ) ;
}
}
@Override
@Override
protected void onException ( Bundle args , Throwable ex ) {
protected void onException ( Bundle args , Throwable ex ) {
btnHtml . setHasTransientState ( false ) ;
btnImages . setHasTransientState ( false ) ;
tvBody . setHasTransientState ( false ) ;
pbBody . setHasTransientState ( false ) ;
Helper . unexpectedError ( context , ex ) ;
Helper . unexpectedError ( context , ex ) ;
}
}
} ;
} ;