Some fixes with boost/fav
This commit is contained in:
parent
2ecf71b670
commit
70b2f08132
|
@ -16,12 +16,15 @@ package fr.gouv.etalab.mastodon.activities;
|
|||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
|
@ -41,6 +44,7 @@ import java.util.List;
|
|||
import es.dmoral.toasty.Toasty;
|
||||
import fr.gouv.etalab.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.asynctasks.RetrieveContextAsyncTask;
|
||||
import fr.gouv.etalab.mastodon.asynctasks.UpdateAccountInfoAsyncTask;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Account;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Context;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Error;
|
||||
|
@ -72,6 +76,7 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
private List<Status> statuses;
|
||||
private StatusListAdapter statusListAdapter;
|
||||
private boolean expanded;
|
||||
private BroadcastReceiver receive_action;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -110,6 +115,25 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
if( detailsStatus == null || detailsStatus.getId() == null)
|
||||
finish();
|
||||
|
||||
|
||||
if( MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
|
||||
if( receive_action != null)
|
||||
LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(receive_action);
|
||||
receive_action = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(android.content.Context context, Intent intent) {
|
||||
Bundle b = intent.getExtras();
|
||||
assert b != null;
|
||||
Status status = b.getParcelable("status");
|
||||
if( status != null) {
|
||||
statusListAdapter.notifyStatusWithActionChanged(status);
|
||||
}
|
||||
}
|
||||
};
|
||||
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(receive_action, new IntentFilter(Helper.RECEIVE_ACTION));
|
||||
}
|
||||
|
||||
if( getSupportActionBar() != null)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
if( getSupportActionBar() != null) {
|
||||
|
@ -269,6 +293,12 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if( receive_action != null)
|
||||
LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(receive_action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRetrieveContext(Context context, Error error) {
|
||||
|
|
|
@ -2627,7 +2627,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
}
|
||||
|
||||
if( statusAction == API.StatusAction.REBLOG){
|
||||
/*if( statusAction == API.StatusAction.REBLOG){
|
||||
int position = 0;
|
||||
for(Status status: statuses){
|
||||
if( status.getId().equals(targetedId)) {
|
||||
|
@ -2674,7 +2674,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}
|
||||
position++;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if( statusAction == API.StatusAction.PEERTUBEDELETECOMMENT){
|
||||
int position = 0;
|
||||
for(Status status: statuses){
|
||||
|
|
Loading…
Reference in New Issue