Extend behavior to other classes
This commit is contained in:
parent
71a4d57a38
commit
07746b2634
|
@ -211,11 +211,13 @@ public class ShowConversationActivity extends BaseActivity implements OnRetriev
|
|||
boolean compactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false);
|
||||
lv_status.addItemDecoration(new ConversationDecoration(ShowConversationActivity.this, theme, compactMode));
|
||||
lv_status.setAdapter(statusListAdapter);
|
||||
String statusIdToFetch;
|
||||
String statusIdToFetch = null;
|
||||
if( initialStatus != null)
|
||||
statusIdToFetch = initialStatus.getId();
|
||||
else
|
||||
else if(detailsStatus != null)
|
||||
statusIdToFetch = detailsStatus.getId();
|
||||
if( statusIdToFetch == null)
|
||||
finish();
|
||||
new RetrieveContextAsyncTask(getApplicationContext(), expanded, statusIdToFetch, ShowConversationActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
switch (theme){
|
||||
case Helper.THEME_LIGHT:
|
||||
|
|
|
@ -188,7 +188,7 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
|||
private AlertDialog dialogTrans;
|
||||
private AlertDialog alertDialogEmoji;
|
||||
private String mentionAccount;
|
||||
private String idRedirect;
|
||||
private Status idRedirect;
|
||||
private String userId, instance;
|
||||
private Account account;
|
||||
private ArrayList<String> splitToot;
|
||||
|
@ -326,7 +326,7 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
|||
sharedContentIni = b.getString("sharedContent", null);
|
||||
sharedSubject = b.getString("sharedSubject", null);
|
||||
mentionAccount = b.getString("mentionAccount", null);
|
||||
idRedirect = b.getString("idRedirect", null);
|
||||
idRedirect = b.getParcelable("idRedirect");
|
||||
removed = b.getBoolean("removed");
|
||||
visibility = b.getString("visibility", null);
|
||||
restoredScheduled = b.getBoolean("restoredScheduled", false);
|
||||
|
@ -1681,9 +1681,9 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
|||
Intent intent = new Intent(getApplicationContext(), ShowConversationActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
if( idRedirect == null)
|
||||
b.putString("statusId", status.getId());
|
||||
b.putParcelable("status", status);
|
||||
else
|
||||
b.putString("statusId", idRedirect);
|
||||
b.putParcelable("status", idRedirect);
|
||||
intent.putExtras(b);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
|
|
|
@ -333,7 +333,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
|||
public void onClick(View v) {
|
||||
Intent intent = new Intent(context, ShowConversationActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("statusId", status.getId());
|
||||
b.putParcelable("status", status);
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
|||
public void onClick(View v) {
|
||||
Intent intent = new Intent(context, ShowConversationActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("statusId", status.getId());
|
||||
b.putParcelable("status", status);
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
|
|
@ -31,19 +31,18 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import fr.gouv.etalab.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.activities.HashTagActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowConversationActivity;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Account;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Status;
|
||||
import fr.gouv.etalab.mastodon.helper.Helper;
|
||||
import fr.gouv.etalab.mastodon.R;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -153,7 +152,7 @@ public class SearchListAdapter extends BaseAdapter {
|
|||
public void onClick(View v) {
|
||||
Intent intent = new Intent(context, ShowConversationActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("statusId", status.getId()); //Your id
|
||||
b.putParcelable("status", status); //Your id
|
||||
intent.putExtras(b); //Put your id to your next Intent
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import java.lang.ref.WeakReference;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import fr.gouv.etalab.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.activities.BaseActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowAccountActivity;
|
||||
import fr.gouv.etalab.mastodon.activities.ShowConversationActivity;
|
||||
|
@ -48,7 +49,6 @@ import fr.gouv.etalab.mastodon.drawers.StatusListAdapter;
|
|||
import fr.gouv.etalab.mastodon.interfaces.OnPostActionInterface;
|
||||
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
||||
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
||||
import fr.gouv.etalab.mastodon.R;
|
||||
import fr.gouv.etalab.mastodon.sqlite.StatusCacheDAO;
|
||||
|
||||
/**
|
||||
|
@ -316,7 +316,7 @@ public class CrossActions {
|
|||
if( statuses != null && statuses.size() > 0) {
|
||||
Intent intent = new Intent(context, ShowConversationActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("statusId", statuses.get(0).getId());
|
||||
b.putParcelable("status", statuses.get(0));
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
@ -555,10 +555,10 @@ public class CrossActions {
|
|||
}
|
||||
if( remoteStatuses.get(0).getReblog() != null ) {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0).getReblog());
|
||||
b.putString("idRedirect", remoteStatuses.get(0).getReblog().getId());
|
||||
b.putParcelable("idRedirect", remoteStatuses.get(0).getReblog());
|
||||
}else {
|
||||
b.putParcelable("tootReply", remoteStatuses.get(0));
|
||||
b.putString("idRedirect", remoteStatuses.get(0).getId());
|
||||
b.putParcelable("idRedirect", remoteStatuses.get(0));
|
||||
}
|
||||
b.putParcelable("accountReply", account);
|
||||
intent.putExtras(b); //Put your id to your next Intent
|
||||
|
|
|
@ -41,6 +41,7 @@ public class StatusCacheDAO {
|
|||
//Type of cache
|
||||
public static int BOOKMARK_CACHE = 0;
|
||||
public static int ARCHIVE_CACHE = 1;
|
||||
public static int STATUS_CACHE = 2;
|
||||
|
||||
public StatusCacheDAO(Context context, SQLiteDatabase db) {
|
||||
//Creation of the DB with tables
|
||||
|
|
Loading…
Reference in New Issue