Fix links for unknown accounts
This commit is contained in:
parent
fcac0ca990
commit
b72726a407
|
@ -825,7 +825,6 @@ public class Status implements Parcelable{
|
||||||
if (spannableStringT.toString().toLowerCase().contains(targetedAccount.toLowerCase())) {
|
if (spannableStringT.toString().toLowerCase().contains(targetedAccount.toLowerCase())) {
|
||||||
//Accounts can be mentioned several times so we have to loop
|
//Accounts can be mentioned several times so we have to loop
|
||||||
for(int startPosition = -1 ; (startPosition = spannableStringT.toString().toLowerCase().indexOf(targetedAccount.toLowerCase(), startPosition + 1)) != -1 ; startPosition++){
|
for(int startPosition = -1 ; (startPosition = spannableStringT.toString().toLowerCase().indexOf(targetedAccount.toLowerCase(), startPosition + 1)) != -1 ; startPosition++){
|
||||||
|
|
||||||
int endPosition = startPosition + targetedAccount.length();
|
int endPosition = startPosition + targetedAccount.length();
|
||||||
URLSpan[] spans = spannableStringT.getSpans(startPosition, endPosition, URLSpan.class);
|
URLSpan[] spans = spannableStringT.getSpans(startPosition, endPosition, URLSpan.class);
|
||||||
for (URLSpan span : spans) {
|
for (URLSpan span : spans) {
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.os.Bundle;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -201,9 +202,16 @@ public class CrossActions {
|
||||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||||
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
SQLiteDatabase db = Sqlite.getInstance(context, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||||
Account account = new AccountDAO(context, db).getAccountByID(userId);
|
Account account = new AccountDAO(context, db).getAccountByID(userId);
|
||||||
|
|
||||||
new AsyncTask<Void, Void, Void>() {
|
new AsyncTask<Void, Void, Void>() {
|
||||||
private WeakReference<Context> contextReference = new WeakReference<>(context);
|
private WeakReference<Context> contextReference = new WeakReference<>(context);
|
||||||
Results response;
|
Results response;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPreExecute() {
|
||||||
|
Toast.makeText(contextReference.get(), R.string.retrieve_remote_account, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... voids) {
|
protected Void doInBackground(Void... voids) {
|
||||||
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
||||||
|
|
|
@ -600,6 +600,7 @@
|
||||||
<string name="about_trunk">Who to follow</string>
|
<string name="about_trunk">Who to follow</string>
|
||||||
<string name="about_trunk_action">Trunk API</string>
|
<string name="about_trunk_action">Trunk API</string>
|
||||||
<string name="toast_impossible_to_follow">Account(s) can\'t be followed</string>
|
<string name="toast_impossible_to_follow">Account(s) can\'t be followed</string>
|
||||||
|
<string name="retrieve_remote_account">Fetching remote account</string>
|
||||||
|
|
||||||
|
|
||||||
<string-array translatable="false" name="proxy_type_choice">
|
<string-array translatable="false" name="proxy_type_choice">
|
||||||
|
|
Loading…
Reference in New Issue