Some fixes

This commit is contained in:
stom79 2018-12-07 16:13:04 +01:00
parent a27ffa3dfa
commit 43b8cf829a
2 changed files with 3 additions and 12 deletions

View File

@ -178,7 +178,7 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
lv_status.addOnScrollListener(new RecyclerView.OnScrollListener() {
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy)
{
if (context instanceof BaseMainActivity ) {
if (type != RetrieveFeedsAsyncTask.Type.ART && context instanceof BaseMainActivity ) {
if( dy < 0 && !((BaseMainActivity)context).getFloatingVisibility() )
((BaseMainActivity) context).manageFloatingButton(true);
if( dy > 0 && ((BaseMainActivity)context).getFloatingVisibility() )
@ -225,12 +225,6 @@ public class DisplayStatusFragment extends Fragment implements OnRetrieveFeedsIn
editor.apply();
}
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
});

View File

@ -57,7 +57,6 @@ import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ExecutionException;
import fr.gouv.etalab.mastodon.R;
import fr.gouv.etalab.mastodon.activities.MainActivity;
@ -186,11 +185,9 @@ public class LiveNotificationService extends Service implements NetworkStateRece
AsyncHttpRequest.setDefaultHeaders(headers, url);
if( webSocketFutures.containsKey(urlKey) ){
try {
if( webSocketFutures.get(urlKey) != null && webSocketFutures.get(urlKey).get() != null)
if( webSocketFutures.get(urlKey) != null && webSocketFutures.get(urlKey).get() != null && webSocketFutures.get(urlKey).get().isOpen())
webSocketFutures.get(urlKey).get().close();
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
} catch (Exception e) {
e.printStackTrace();
}
}