Improves replies
This commit is contained in:
parent
8224a825e6
commit
b8e57ed98d
|
@ -16,14 +16,11 @@ package fr.gouv.etalab.mastodon.activities;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
|
@ -32,16 +29,12 @@ import android.support.v4.app.Fragment;
|
|||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
@ -57,18 +50,14 @@ import android.widget.Toast;
|
|||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import fr.gouv.etalab.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.asynctasks.RetrieveFeedsAsyncTask;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Account;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Status;
|
||||
import fr.gouv.etalab.mastodon.client.HttpsConnection;
|
||||
import fr.gouv.etalab.mastodon.fragments.DisplayNotificationsFragment;
|
||||
import fr.gouv.etalab.mastodon.fragments.DisplayStatusFragment;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.services.LiveNotificationService;
|
||||
|
@ -87,7 +76,6 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
public static String currentLocale;
|
||||
private TabLayout tabLayout;
|
||||
private ViewPager viewPager;
|
||||
private static BroadcastReceiver receive_data, receive_federated_data, receive_local_data;
|
||||
private String userIdService;
|
||||
private AppBarLayout appBar;
|
||||
private String userId;
|
||||
|
@ -103,9 +91,6 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
|
||||
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
||||
|
||||
|
||||
|
||||
final int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||
switch (theme){
|
||||
case Helper.THEME_LIGHT:
|
||||
|
@ -132,8 +117,6 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
FloatingActionButton add_new_instance = findViewById(R.id.add_new_instance);
|
||||
add_new_instance.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -236,7 +219,7 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
final String action = "/instances/search";
|
||||
final HashMap<String, String> parameters = new HashMap<>();
|
||||
parameters.put("q", s.toString().trim());
|
||||
parameters.put("count", String.valueOf(50));
|
||||
parameters.put("count", String.valueOf(100));
|
||||
parameters.put("name", String.valueOf(true));
|
||||
isLoadingInstance = true;
|
||||
|
||||
|
@ -256,13 +239,13 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
if (jsonArray != null) {
|
||||
int length = 0;
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
if( !jsonArray.getJSONObject(i).get("name").toString().contains("@"))
|
||||
if( !jsonArray.getJSONObject(i).get("name").toString().contains("@") && jsonArray.getJSONObject(i).get("up").toString().equals("true"))
|
||||
length++;
|
||||
}
|
||||
instances = new String[length];
|
||||
int j = 0;
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
if( !jsonArray.getJSONObject(i).get("name").toString().contains("@")) {
|
||||
if( !jsonArray.getJSONObject(i).get("name").toString().contains("@") && jsonArray.getJSONObject(i).get("up").toString().equals("true")) {
|
||||
instances[j] = jsonArray.getJSONObject(i).get("name").toString();
|
||||
j++;
|
||||
}
|
||||
|
@ -384,22 +367,6 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
Helper.loadPictureIcon(InstanceFederatedActivity.this, account.getAvatar(),iconbar);
|
||||
|
||||
|
||||
|
||||
|
||||
if( receive_data != null)
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(receive_data);
|
||||
receive_data = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Bundle b = intent.getExtras();
|
||||
Helper.EventStreaming eventStreaming = (Helper.EventStreaming) intent.getSerializableExtra("eventStreaming");
|
||||
assert b != null;
|
||||
userIdService = b.getString("userIdService", null);
|
||||
if( userIdService != null && userIdService.equals(userId)) {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
mamageNewIntent(getIntent());
|
||||
// LocalBroadcastManager.getInstance(this).registerReceiver(receive_data, new IntentFilter(Helper.RECEIVE_DATA));
|
||||
}
|
||||
|
@ -512,46 +479,12 @@ public class InstanceFederatedActivity extends BaseActivity {
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStart(){
|
||||
super.onStart();
|
||||
if( receive_federated_data != null)
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(receive_federated_data);
|
||||
receive_federated_data = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Bundle b = intent.getExtras();
|
||||
assert b != null;
|
||||
userIdService = b.getString("userIdService", null);
|
||||
if( userIdService != null && userIdService.equals(userId)) {
|
||||
Status status = b.getParcelable("data");
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(receive_federated_data, new IntentFilter(Helper.RECEIVE_FEDERATED_DATA));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop(){
|
||||
super.onStop();
|
||||
if( receive_federated_data != null)
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(receive_federated_data);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(){
|
||||
super.onDestroy();
|
||||
if( receive_data != null)
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(receive_data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -165,7 +165,7 @@ public class LoginActivity extends BaseActivity {
|
|||
final String action = "/instances/search";
|
||||
final HashMap<String, String> parameters = new HashMap<>();
|
||||
parameters.put("q", s.toString().trim());
|
||||
parameters.put("count", String.valueOf(50));
|
||||
parameters.put("count", String.valueOf(1000));
|
||||
parameters.put("name", String.valueOf(true));
|
||||
isLoadingInstance = true;
|
||||
if( oldSearch == null || !oldSearch.equals(s.toString().trim()))
|
||||
|
|
|
@ -1861,7 +1861,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
public void onPostAction(int statusCode, API.StatusAction statusAction, String targetedId, Error error) {
|
||||
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
|
||||
if( error != null){
|
||||
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
|
||||
if( show_error_messages)
|
||||
|
|
|
@ -119,7 +119,7 @@ public class CrossActions {
|
|||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
Account currentAccount = new AccountDAO(context, db).getAccountByID(userId);
|
||||
finalCrossAction(context, currentAccount, targetedAccount, doAction, status, baseAdapter, onPostActionInterface);
|
||||
new PostActionAsyncTask(context, currentAccount, status, doAction, onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
} else if (accounts.size() == 1 || undoAction) {
|
||||
|
||||
boolean confirmation = false;
|
||||
|
@ -159,7 +159,35 @@ public class CrossActions {
|
|||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Account selectedAccount = accountArray[which];
|
||||
finalCrossAction(context, selectedAccount, targetedAccount, doAction, status, baseAdapter, onPostActionInterface);
|
||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
Account loggedAccount = new AccountDAO(context, db).getAccountByID(userId);
|
||||
if( targetedAccount == null){
|
||||
if(loggedAccount.getInstance().equals(selectedAccount.getInstance())){
|
||||
new PostActionAsyncTask(context, selectedAccount, doAction, status.getId(), onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}else{ //Account is from another instance
|
||||
new PostActionAsyncTask(context, selectedAccount, status, doAction, onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
if( selectedAccount.getInstance().equals(loggedAccount.getInstance()) && selectedAccount.getId().equals(loggedAccount.getId())) {
|
||||
if (doAction == API.StatusAction.REBLOG) {
|
||||
status.setReblogged(true);
|
||||
} else if (doAction == API.StatusAction.FAVOURITE) {
|
||||
status.setFavourited(true);
|
||||
} else if (doAction == API.StatusAction.PIN) {
|
||||
status.setPinned(true);
|
||||
}
|
||||
baseAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}else{
|
||||
new PostActionAsyncTask(context, selectedAccount, targetedAccount, doAction, onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
if( selectedAccount.getInstance().equals(loggedAccount.getInstance()) && selectedAccount.getId().equals(loggedAccount.getId())) {
|
||||
if (doAction == API.StatusAction.FOLLOW) {
|
||||
targetedAccount.setFollowing(true);
|
||||
}
|
||||
baseAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
@ -168,43 +196,10 @@ public class CrossActions {
|
|||
}
|
||||
|
||||
|
||||
private static void finalCrossAction(Context context, Account selectedAccount, Account targetedAccount, API.StatusAction doAction, Status status, RecyclerView.Adapter baseAdapter, final OnPostActionInterface onPostActionInterface ){
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
Account loggedAccount = new AccountDAO(context, db).getAccountByID(userId);
|
||||
new PostActionAsyncTask(context, selectedAccount, status, doAction, onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
if( targetedAccount == null){
|
||||
if(loggedAccount.getInstance().equals(selectedAccount.getInstance())){
|
||||
new PostActionAsyncTask(context, selectedAccount, doAction, status.getId(), onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}else{ //Account is from another instance
|
||||
new PostActionAsyncTask(context, selectedAccount, status, doAction, onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
if( selectedAccount.getInstance().equals(loggedAccount.getInstance()) && selectedAccount.getId().equals(loggedAccount.getId())) {
|
||||
if (doAction == API.StatusAction.REBLOG) {
|
||||
status.setReblogged(true);
|
||||
} else if (doAction == API.StatusAction.FAVOURITE) {
|
||||
status.setFavourited(true);
|
||||
} else if (doAction == API.StatusAction.PIN) {
|
||||
status.setPinned(true);
|
||||
}
|
||||
baseAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}else{
|
||||
new PostActionAsyncTask(context, selectedAccount, targetedAccount, doAction, onPostActionInterface).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
if( selectedAccount.getInstance().equals(loggedAccount.getInstance()) && selectedAccount.getId().equals(loggedAccount.getId())) {
|
||||
if (doAction == API.StatusAction.FOLLOW) {
|
||||
targetedAccount.setFollowing(true);
|
||||
}
|
||||
baseAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void doCrossReply(final Context context, final Status status, final RetrieveFeedsAsyncTask.Type type, boolean limitedToOwner){
|
||||
List<Account> accounts = connectedAccounts(context, status, limitedToOwner);
|
||||
|
||||
if( accounts.size() == 1) {
|
||||
if( accounts.size() == 1 && type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE) {
|
||||
Intent intent = new Intent(context, TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
if( status.getReblog() != null )
|
||||
|
@ -221,85 +216,138 @@ public class CrossActions {
|
|||
|
||||
}
|
||||
}else {
|
||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
|
||||
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accounts, true);
|
||||
final Account[] accountArray = new Account[accounts.size()];
|
||||
int i = 0;
|
||||
for(Account account: accounts){
|
||||
accountArray[i] = account;
|
||||
i++;
|
||||
}
|
||||
builderSingle.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
if( type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE){
|
||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
|
||||
builderSingle.setTitle(context.getString(R.string.choose_accounts));
|
||||
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accounts, true);
|
||||
final Account[] accountArray = new Account[accounts.size()];
|
||||
int i = 0;
|
||||
for(Account account: accounts){
|
||||
accountArray[i] = account;
|
||||
i++;
|
||||
}
|
||||
});
|
||||
builderSingle.setAdapter(accountsSearchAdapter, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, int which) {
|
||||
final Account account = accountArray[which];
|
||||
builderSingle.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builderSingle.setAdapter(accountsSearchAdapter, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, int which) {
|
||||
final Account account = accountArray[which];
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
private List<fr.gouv.etalab.mastodon.client.Entities.Status> remoteStatuses;
|
||||
private WeakReference<Context> contextReference = new WeakReference<>(context);
|
||||
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
private List<fr.gouv.etalab.mastodon.client.Entities.Status> remoteStatuses;
|
||||
private WeakReference<Context> contextReference = new WeakReference<>(context);
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
|
||||
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
||||
String uri;
|
||||
if(status.getReblog() != null ){
|
||||
if( status.getReblog().getUri().startsWith("http"))
|
||||
uri = status.getReblog().getUri();
|
||||
else
|
||||
uri = status.getReblog().getUrl();
|
||||
}else {
|
||||
if( status.getUri().startsWith("http"))
|
||||
uri = status.getUri();
|
||||
else
|
||||
uri = status.getUrl();
|
||||
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
||||
String uri;
|
||||
if(status.getReblog() != null ){
|
||||
if( status.getReblog().getUri().startsWith("http"))
|
||||
uri = status.getReblog().getUri();
|
||||
else
|
||||
uri = status.getReblog().getUrl();
|
||||
}else {
|
||||
if( status.getUri().startsWith("http"))
|
||||
uri = status.getUri();
|
||||
else
|
||||
uri = status.getUrl();
|
||||
}
|
||||
Results search = api.search(uri);
|
||||
if( search != null){
|
||||
remoteStatuses = search.getStatuses();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Results search = api.search(uri);
|
||||
if( search != null){
|
||||
remoteStatuses = search.getStatuses();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
Intent intent = new Intent(contextReference.get(), TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
if( remoteStatuses == null || remoteStatuses.size() == 0){
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
Intent intent = new Intent(contextReference.get(), TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
if( remoteStatuses == null || remoteStatuses.size() == 0){
|
||||
dialog.dismiss();
|
||||
return;
|
||||
}
|
||||
if( remoteStatuses.get(0).getReblog() != null ) {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0).getReblog());
|
||||
b.putString("idRedirect", status.getReblog().getId());
|
||||
}else {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0));
|
||||
b.putString("idRedirect", status.getId());
|
||||
}
|
||||
b.putParcelable("accountReply", account);
|
||||
intent.putExtras(b); //Put your id to your next Intent
|
||||
contextReference.get().startActivity(intent);
|
||||
if( type == RetrieveFeedsAsyncTask.Type.CONTEXT ){
|
||||
try {
|
||||
//Avoid to open multi activities when replying in a conversation
|
||||
((ShowConversationActivity)contextReference.get()).finish();
|
||||
}catch (Exception ignored){}
|
||||
|
||||
}
|
||||
dialog.dismiss();
|
||||
return;
|
||||
}
|
||||
if( remoteStatuses.get(0).getReblog() != null ) {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0).getReblog());
|
||||
b.putString("idRedirect", status.getReblog().getId());
|
||||
}else {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0));
|
||||
b.putString("idRedirect", status.getId());
|
||||
}
|
||||
b.putParcelable("accountReply", account);
|
||||
intent.putExtras(b); //Put your id to your next Intent
|
||||
contextReference.get().startActivity(intent);
|
||||
if( type == RetrieveFeedsAsyncTask.Type.CONTEXT ){
|
||||
try {
|
||||
//Avoid to open multi activities when replying in a conversation
|
||||
((ShowConversationActivity)contextReference.get()).finish();
|
||||
}catch (Exception ignored){}
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR );
|
||||
|
||||
}
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builderSingle.show();
|
||||
}else{
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
Account account = new AccountDAO(context, db).getAccountByID(userId);
|
||||
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
private List<fr.gouv.etalab.mastodon.client.Entities.Status> remoteStatuses;
|
||||
private WeakReference<Context> contextReference = new WeakReference<>(context);
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
|
||||
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
||||
String uri;
|
||||
if(status.getReblog() != null ){
|
||||
if( status.getReblog().getUri().startsWith("http"))
|
||||
uri = status.getReblog().getUri();
|
||||
else
|
||||
uri = status.getReblog().getUrl();
|
||||
}else {
|
||||
if( status.getUri().startsWith("http"))
|
||||
uri = status.getUri();
|
||||
else
|
||||
uri = status.getUrl();
|
||||
}
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR );
|
||||
Results search = api.search(uri);
|
||||
if( search != null){
|
||||
remoteStatuses = search.getStatuses();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
builderSingle.show();
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
Intent intent = new Intent(contextReference.get(), TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
if( remoteStatuses == null || remoteStatuses.size() == 0){
|
||||
return;
|
||||
}
|
||||
if( remoteStatuses.get(0).getReblog() != null ) {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0).getReblog());
|
||||
b.putString("idRedirect", remoteStatuses.get(0).getReblog().getId());
|
||||
}else {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0));
|
||||
b.putString("idRedirect", remoteStatuses.get(0).getId());
|
||||
}
|
||||
b.putParcelable("accountReply", account);
|
||||
intent.putExtras(b); //Put your id to your next Intent
|
||||
contextReference.get().startActivity(intent);
|
||||
}
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,7 +387,6 @@ public class CrossActions {
|
|||
context.startActivity(intentToot);
|
||||
((BaseActivity)context).finish();
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
builderSingle.show();
|
||||
|
|
Loading…
Reference in New Issue