Add some improvements
This commit is contained in:
parent
d6dc05fc4f
commit
722479d4e2
|
@ -0,0 +1,3 @@
|
||||||
|
Changed:
|
||||||
|
- One logout entry in menu (it will removed the account from the app)
|
||||||
|
- Improve memory management
|
|
@ -19,7 +19,6 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -60,14 +59,11 @@ import app.fedilab.android.asynctasks.PostActionAsyncTask;
|
||||||
import app.fedilab.android.asynctasks.RetrieveDomainsAsyncTask;
|
import app.fedilab.android.asynctasks.RetrieveDomainsAsyncTask;
|
||||||
import app.fedilab.android.client.API;
|
import app.fedilab.android.client.API;
|
||||||
import app.fedilab.android.client.APIResponse;
|
import app.fedilab.android.client.APIResponse;
|
||||||
import app.fedilab.android.client.Entities.Account;
|
|
||||||
import app.fedilab.android.client.Entities.Error;
|
import app.fedilab.android.client.Entities.Error;
|
||||||
import app.fedilab.android.drawers.DomainsListAdapter;
|
import app.fedilab.android.drawers.DomainsListAdapter;
|
||||||
import app.fedilab.android.helper.Helper;
|
import app.fedilab.android.helper.Helper;
|
||||||
import app.fedilab.android.interfaces.OnPostActionInterface;
|
import app.fedilab.android.interfaces.OnPostActionInterface;
|
||||||
import app.fedilab.android.interfaces.OnRetrieveDomainsInterface;
|
import app.fedilab.android.interfaces.OnRetrieveDomainsInterface;
|
||||||
import app.fedilab.android.sqlite.AccountDAO;
|
|
||||||
import app.fedilab.android.sqlite.Sqlite;
|
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,11 +155,7 @@ public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDom
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
break;
|
break;
|
||||||
case R.id.action_export_instances:
|
case R.id.action_export_instances:
|
||||||
SQLiteDatabase db = Sqlite.getInstance(MutedInstanceActivity.this, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
Helper.exportInstanceBlock(MutedInstanceActivity.this);
|
||||||
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(MutedInstanceActivity.this));
|
|
||||||
String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
|
||||||
Account account = new AccountDAO(MutedInstanceActivity.this, db).getUniqAccount(userId, instance);
|
|
||||||
Helper.exportInstanceBlock(MutedInstanceActivity.this, account.getAcct() + "_" + account.getInstance());
|
|
||||||
break;
|
break;
|
||||||
case R.id.action_import_instances:
|
case R.id.action_import_instances:
|
||||||
if (ContextCompat.checkSelfPermission(MutedInstanceActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
if (ContextCompat.checkSelfPermission(MutedInstanceActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||||
|
|
|
@ -646,7 +646,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
|
||||||
if (share_details) {
|
if (share_details) {
|
||||||
extra_text = "@" + peertube.getAccount().getAcct();
|
extra_text = "@" + peertube.getAccount().getAcct();
|
||||||
extra_text += "\r\n\r\n" + peertube.getName();
|
extra_text += "\r\n\r\n" + peertube.getName();
|
||||||
extra_text += "\n\n" + Helper.shortnameToUnicode(":link:", true) + " " + url + "\r\n-\n";
|
extra_text += "\n\n" + Helper.shortnameToUnicode(":link:") + " " + url + "\r\n-\n";
|
||||||
final String contentToot;
|
final String contentToot;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
contentToot = Html.fromHtml(peertube.getDescription(), Html.FROM_HTML_MODE_LEGACY).toString();
|
contentToot = Html.fromHtml(peertube.getDescription(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||||
|
|
|
@ -592,7 +592,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
if (!ischannel || account.getAcct().split("-").length < 4) {
|
if (!ischannel || account.getAcct().split("-").length < 4) {
|
||||||
account_un.setText(String.format("@%s", account.getAcct()));
|
account_un.setText(String.format("@%s", account.getAcct()));
|
||||||
account_un.setOnLongClickListener(v -> {
|
account_un.setOnLongClickListener(v -> {
|
||||||
|
|
|
@ -279,10 +279,10 @@ public class API {
|
||||||
instanceSocial.setHttps_rank(resobj.get("https_rank").toString());
|
instanceSocial.setHttps_rank(resobj.get("https_rank").toString());
|
||||||
instanceSocial.setHttps_score(Integer.parseInt(resobj.get("https_score").toString()));
|
instanceSocial.setHttps_score(Integer.parseInt(resobj.get("https_score").toString()));
|
||||||
if (!resobj.isNull("added_at")) {
|
if (!resobj.isNull("added_at")) {
|
||||||
instanceSocial.setAdded_at(Helper.mstStringToDate(context, resobj.get("added_at").toString()));
|
instanceSocial.setAdded_at(Helper.mstStringToDate(resobj.get("added_at").toString()));
|
||||||
}
|
}
|
||||||
instanceSocial.setChecked_at(Helper.mstStringToDate(context, resobj.get("checked_at").toString()));
|
instanceSocial.setChecked_at(Helper.mstStringToDate(resobj.get("checked_at").toString()));
|
||||||
instanceSocial.setUpdated_at(Helper.mstStringToDate(context, resobj.get("updated_at").toString()));
|
instanceSocial.setUpdated_at(Helper.mstStringToDate(resobj.get("updated_at").toString()));
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -315,7 +315,7 @@ public class API {
|
||||||
peertube.setDislike(Integer.parseInt(resobj.get("dislikes").toString()));
|
peertube.setDislike(Integer.parseInt(resobj.get("dislikes").toString()));
|
||||||
peertube.setDuration(Integer.parseInt(resobj.get("duration").toString()));
|
peertube.setDuration(Integer.parseInt(resobj.get("duration").toString()));
|
||||||
try {
|
try {
|
||||||
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ public class API {
|
||||||
peertube.setDuration(Integer.parseInt(resobj.get("duration").toString()));
|
peertube.setDuration(Integer.parseInt(resobj.get("duration").toString()));
|
||||||
peertube.setAccount(parseAccountResponsePeertube(context, instance, resobj.getJSONObject("account")));
|
peertube.setAccount(parseAccountResponsePeertube(context, instance, resobj.getJSONObject("account")));
|
||||||
try {
|
try {
|
||||||
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ public class API {
|
||||||
status.setContent(context, comment.get("text").toString());
|
status.setContent(context, comment.get("text").toString());
|
||||||
status.setIn_reply_to_id(comment.get("inReplyToCommentId").toString());
|
status.setIn_reply_to_id(comment.get("inReplyToCommentId").toString());
|
||||||
status.setAccount(parseAccountResponsePeertube(context, instance, comment.getJSONObject("account")));
|
status.setAccount(parseAccountResponsePeertube(context, instance, comment.getJSONObject("account")));
|
||||||
status.setCreated_at(Helper.mstStringToDate(context, comment.get("createdAt").toString()));
|
status.setCreated_at(Helper.mstStringToDate(comment.get("createdAt").toString()));
|
||||||
status.setMentions(new ArrayList<>());
|
status.setMentions(new ArrayList<>());
|
||||||
status.setEmojis(new ArrayList<>());
|
status.setEmojis(new ArrayList<>());
|
||||||
status.setMedia_attachments(new ArrayList<>());
|
status.setMedia_attachments(new ArrayList<>());
|
||||||
|
@ -459,7 +459,7 @@ public class API {
|
||||||
schedule.setStatus(status);
|
schedule.setStatus(status);
|
||||||
schedule.setAttachmentList(attachements);
|
schedule.setAttachmentList(attachements);
|
||||||
schedule.setId(jsonObject.get("id").toString());
|
schedule.setId(jsonObject.get("id").toString());
|
||||||
schedule.setScheduled_at(Helper.mstStringToDate(context, jsonObject.get("scheduled_at").toString()));
|
schedule.setScheduled_at(Helper.mstStringToDate(jsonObject.get("scheduled_at").toString()));
|
||||||
} catch (JSONException | ParseException e) {
|
} catch (JSONException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -487,7 +487,7 @@ public class API {
|
||||||
schedule.setAttachmentList(attachements);
|
schedule.setAttachmentList(attachements);
|
||||||
schedules.add(schedule);
|
schedules.add(schedule);
|
||||||
schedule.setId(jsonArray.getJSONObject(i).get("id").toString());
|
schedule.setId(jsonArray.getJSONObject(i).get("id").toString());
|
||||||
schedule.setScheduled_at(Helper.mstStringToDate(context, jsonArray.getJSONObject(i).get("scheduled_at").toString()));
|
schedule.setScheduled_at(Helper.mstStringToDate(jsonArray.getJSONObject(i).get("scheduled_at").toString()));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} catch (JSONException | ParseException e) {
|
} catch (JSONException | ParseException e) {
|
||||||
|
@ -609,16 +609,16 @@ public class API {
|
||||||
announcement.setId(resobj.getString("id"));
|
announcement.setId(resobj.getString("id"));
|
||||||
announcement.setContent(context, resobj.getString("content"));
|
announcement.setContent(context, resobj.getString("content"));
|
||||||
if (resobj.getString("published_at").compareTo("null") != 0) {
|
if (resobj.getString("published_at").compareTo("null") != 0) {
|
||||||
announcement.setCreated_at(Helper.mstStringToDate(context, resobj.getString("published_at")));
|
announcement.setCreated_at(Helper.mstStringToDate(resobj.getString("published_at")));
|
||||||
}
|
}
|
||||||
if (resobj.getString("updated_at").compareTo("null") != 0) {
|
if (resobj.getString("updated_at").compareTo("null") != 0) {
|
||||||
announcement.setUpdatedAt(Helper.mstStringToDate(context, resobj.getString("updated_at")));
|
announcement.setUpdatedAt(Helper.mstStringToDate(resobj.getString("updated_at")));
|
||||||
}
|
}
|
||||||
if (resobj.getString("starts_at").compareTo("null") != 0) {
|
if (resobj.getString("starts_at").compareTo("null") != 0) {
|
||||||
announcement.setStartAt(Helper.mstStringToDate(context, resobj.getString("starts_at")));
|
announcement.setStartAt(Helper.mstStringToDate(resobj.getString("starts_at")));
|
||||||
}
|
}
|
||||||
if (resobj.getString("ends_at").compareTo("null") != 0) {
|
if (resobj.getString("ends_at").compareTo("null") != 0) {
|
||||||
announcement.setEndAt(Helper.mstStringToDate(context, resobj.getString("ends_at")));
|
announcement.setEndAt(Helper.mstStringToDate(resobj.getString("ends_at")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -685,7 +685,7 @@ public class API {
|
||||||
Poll poll = new Poll();
|
Poll poll = new Poll();
|
||||||
try {
|
try {
|
||||||
poll.setId(resobj.getString("id"));
|
poll.setId(resobj.getString("id"));
|
||||||
poll.setExpires_at(Helper.mstStringToDate(context, resobj.getString("expires_at")));
|
poll.setExpires_at(Helper.mstStringToDate(resobj.getString("expires_at")));
|
||||||
poll.setExpired(resobj.getBoolean("expired"));
|
poll.setExpired(resobj.getBoolean("expired"));
|
||||||
poll.setMultiple(resobj.getBoolean("multiple"));
|
poll.setMultiple(resobj.getBoolean("multiple"));
|
||||||
poll.setVotes_count(resobj.getInt("votes_count"));
|
poll.setVotes_count(resobj.getInt("votes_count"));
|
||||||
|
@ -728,7 +728,7 @@ public class API {
|
||||||
status.setUri(resobj.get("id").toString());
|
status.setUri(resobj.get("id").toString());
|
||||||
}
|
}
|
||||||
if (resobj.has("created_at")) {
|
if (resobj.has("created_at")) {
|
||||||
status.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
|
status.setCreated_at(Helper.mstStringToDate(resobj.get("created_at").toString()));
|
||||||
} else {
|
} else {
|
||||||
status.setCreated_at(new Date());
|
status.setCreated_at(new Date());
|
||||||
}
|
}
|
||||||
|
@ -886,7 +886,7 @@ public class API {
|
||||||
Poll poll = new Poll();
|
Poll poll = new Poll();
|
||||||
poll.setId(resobj.getJSONObject("poll").getString("id"));
|
poll.setId(resobj.getJSONObject("poll").getString("id"));
|
||||||
try {
|
try {
|
||||||
poll.setExpires_at(Helper.mstStringToDate(context, resobj.getJSONObject("poll").getString("expires_at")));
|
poll.setExpires_at(Helper.mstStringToDate(resobj.getJSONObject("poll").getString("expires_at")));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
poll.setExpires_at(new Date());
|
poll.setExpires_at(new Date());
|
||||||
}
|
}
|
||||||
|
@ -979,7 +979,7 @@ public class API {
|
||||||
|
|
||||||
status.setId(resobj.get("id").toString());
|
status.setId(resobj.get("id").toString());
|
||||||
status.setUri("https://" + instance + "/notes/" + resobj.get("id").toString());
|
status.setUri("https://" + instance + "/notes/" + resobj.get("id").toString());
|
||||||
status.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
status.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
status.setIn_reply_to_id(resobj.get("replyId").toString());
|
status.setIn_reply_to_id(resobj.get("replyId").toString());
|
||||||
status.setSensitive(false);
|
status.setSensitive(false);
|
||||||
resobj.get("cw");
|
resobj.get("cw");
|
||||||
|
@ -1173,7 +1173,7 @@ public class API {
|
||||||
account.setDisplay_name(resobj.get("displayName").toString());
|
account.setDisplay_name(resobj.get("displayName").toString());
|
||||||
account.setHost(resobj.get("host").toString());
|
account.setHost(resobj.get("host").toString());
|
||||||
if (resobj.has("createdAt"))
|
if (resobj.has("createdAt"))
|
||||||
account.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
account.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
else
|
else
|
||||||
account.setCreated_at(new Date());
|
account.setCreated_at(new Date());
|
||||||
|
|
||||||
|
@ -1227,9 +1227,9 @@ public class API {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
report.setCreated_at(Helper.mstStringToDate(context, resobj.getString("created_at")));
|
report.setCreated_at(Helper.mstStringToDate(resobj.getString("created_at")));
|
||||||
if (!resobj.isNull("updated_at")) {
|
if (!resobj.isNull("updated_at")) {
|
||||||
report.setUpdated_at(Helper.mstStringToDate(context, resobj.getString("updated_at")));
|
report.setUpdated_at(Helper.mstStringToDate(resobj.getString("updated_at")));
|
||||||
}
|
}
|
||||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||||
if (!resobj.isNull("account")) {
|
if (!resobj.isNull("account")) {
|
||||||
|
@ -1291,7 +1291,7 @@ public class API {
|
||||||
accountAdmin.setUsername(resobj.getString("nickname"));
|
accountAdmin.setUsername(resobj.getString("nickname"));
|
||||||
}
|
}
|
||||||
if (!resobj.isNull("created_at")) {
|
if (!resobj.isNull("created_at")) {
|
||||||
accountAdmin.setCreated_at(Helper.mstStringToDate(context, resobj.getString("created_at")));
|
accountAdmin.setCreated_at(Helper.mstStringToDate(resobj.getString("created_at")));
|
||||||
}
|
}
|
||||||
if (!resobj.isNull("email")) {
|
if (!resobj.isNull("email")) {
|
||||||
accountAdmin.setEmail(resobj.getString("email"));
|
accountAdmin.setEmail(resobj.getString("email"));
|
||||||
|
@ -1378,7 +1378,7 @@ public class API {
|
||||||
account.setDisplay_name(resobj.get("display_name").toString());
|
account.setDisplay_name(resobj.get("display_name").toString());
|
||||||
account.setLocked(Boolean.parseBoolean(resobj.get("locked").toString()));
|
account.setLocked(Boolean.parseBoolean(resobj.get("locked").toString()));
|
||||||
if (resobj.has("created_at") && !resobj.isNull("created_at")) {
|
if (resobj.has("created_at") && !resobj.isNull("created_at")) {
|
||||||
account.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
|
account.setCreated_at(Helper.mstStringToDate(resobj.get("created_at").toString()));
|
||||||
} else {
|
} else {
|
||||||
account.setCreated_at(new Date());
|
account.setCreated_at(new Date());
|
||||||
}
|
}
|
||||||
|
@ -1609,13 +1609,13 @@ public class API {
|
||||||
try {
|
try {
|
||||||
notification.setId(resobj.get("id").toString());
|
notification.setId(resobj.get("id").toString());
|
||||||
notification.setType(resobj.get("type").toString());
|
notification.setType(resobj.get("type").toString());
|
||||||
notification.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
|
notification.setCreated_at(Helper.mstStringToDate(resobj.get("created_at").toString()));
|
||||||
notification.setAccount(parseAccountResponse(context, resobj.getJSONObject("account")));
|
notification.setAccount(parseAccountResponse(context, resobj.getJSONObject("account")));
|
||||||
try {
|
try {
|
||||||
notification.setStatus(parseStatuses(context, resobj.getJSONObject("status")));
|
notification.setStatus(parseStatuses(context, resobj.getJSONObject("status")));
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
notification.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
|
notification.setCreated_at(Helper.mstStringToDate(resobj.get("created_at").toString()));
|
||||||
} catch (JSONException ignored) {
|
} catch (JSONException ignored) {
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -1797,7 +1797,7 @@ public class API {
|
||||||
identityProof.setProof_url(jsonObject.getString("proof_url"));
|
identityProof.setProof_url(jsonObject.getString("proof_url"));
|
||||||
identityProof.setProvider(jsonObject.getString("provider"));
|
identityProof.setProvider(jsonObject.getString("provider"));
|
||||||
identityProof.setProvider_username(jsonObject.getString("provider_username"));
|
identityProof.setProvider_username(jsonObject.getString("provider_username"));
|
||||||
identityProof.setUpdated_at(Helper.mstStringToDate(context, jsonObject.getString("updated_at")));
|
identityProof.setUpdated_at(Helper.mstStringToDate(jsonObject.getString("updated_at")));
|
||||||
|
|
||||||
} catch (JSONException | ParseException e) {
|
} catch (JSONException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -5854,7 +5854,7 @@ public class API {
|
||||||
filter.setPhrase(resobj.get("phrase").toString());
|
filter.setPhrase(resobj.get("phrase").toString());
|
||||||
resobj.get("expires_at");
|
resobj.get("expires_at");
|
||||||
if (!resobj.get("expires_at").toString().equals("null"))
|
if (!resobj.get("expires_at").toString().equals("null"))
|
||||||
filter.setSetExpires_at(Helper.mstStringToDate(context, resobj.get("expires_at").toString()));
|
filter.setSetExpires_at(Helper.mstStringToDate(resobj.get("expires_at").toString()));
|
||||||
filter.setWhole_word(Boolean.parseBoolean(resobj.get("whole_word").toString()));
|
filter.setWhole_word(Boolean.parseBoolean(resobj.get("whole_word").toString()));
|
||||||
filter.setIrreversible(Boolean.parseBoolean(resobj.get("irreversible").toString()));
|
filter.setIrreversible(Boolean.parseBoolean(resobj.get("irreversible").toString()));
|
||||||
String contextString = resobj.get("context").toString();
|
String contextString = resobj.get("context").toString();
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class Notification implements Parcelable {
|
||||||
switch (notification.getType()) {
|
switch (notification.getType()) {
|
||||||
case "mention":
|
case "mention":
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_mention));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_mention));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_mention));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_mention));
|
||||||
break;
|
break;
|
||||||
|
@ -111,25 +111,25 @@ public class Notification implements Parcelable {
|
||||||
break;
|
break;
|
||||||
case "reblog":
|
case "reblog":
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_reblog));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_reblog));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_reblog));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_reblog));
|
||||||
break;
|
break;
|
||||||
case "favourite":
|
case "favourite":
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_favourite));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_favourite));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_favourite));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_favourite));
|
||||||
break;
|
break;
|
||||||
case "follow":
|
case "follow":
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_follow));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_follow));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow));
|
||||||
break;
|
break;
|
||||||
case "follow_request":
|
case "follow_request":
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_follow_request));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_follow_request));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow_request));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow_request));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -164,7 +164,7 @@ public class GNUAPI {
|
||||||
group.setId(resobj.get("id").toString());
|
group.setId(resobj.get("id").toString());
|
||||||
//group.setFollowers_count(resobj.getInt("admin_count"));
|
//group.setFollowers_count(resobj.getInt("admin_count"));
|
||||||
//group.setBlocked(resobj.getBoolean("blocked"));
|
//group.setBlocked(resobj.getBoolean("blocked"));
|
||||||
group.setCreated_at(Helper.mstStringToDate(context, resobj.getString("created")));
|
group.setCreated_at(Helper.mstStringToDate(resobj.getString("created")));
|
||||||
group.setNote(resobj.getString("description"));
|
group.setNote(resobj.getString("description"));
|
||||||
group.setDisplay_name(resobj.getString("fullname"));
|
group.setDisplay_name(resobj.getString("fullname"));
|
||||||
//group.setHomepage(resobj.getString("homepage"));
|
//group.setHomepage(resobj.getString("homepage"));
|
||||||
|
@ -227,7 +227,7 @@ public class GNUAPI {
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
status.setUri(resobj.get("id").toString());
|
status.setUri(resobj.get("id").toString());
|
||||||
}
|
}
|
||||||
status.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
|
status.setCreated_at(Helper.mstStringToDate(resobj.get("created_at").toString()));
|
||||||
if (resobj.has("in_reply_to_status_id"))
|
if (resobj.has("in_reply_to_status_id"))
|
||||||
status.setIn_reply_to_id(resobj.get("in_reply_to_status_id").toString());
|
status.setIn_reply_to_id(resobj.get("in_reply_to_status_id").toString());
|
||||||
if (resobj.has("in_reply_to_user_id"))
|
if (resobj.has("in_reply_to_user_id"))
|
||||||
|
@ -400,7 +400,7 @@ public class GNUAPI {
|
||||||
else
|
else
|
||||||
account.setSocial("GNU");
|
account.setSocial("GNU");
|
||||||
account.setEmojis(new ArrayList<>());
|
account.setEmojis(new ArrayList<>());
|
||||||
account.setCreated_at(Helper.mstStringToDate(context, resobj.get("created_at").toString()));
|
account.setCreated_at(Helper.mstStringToDate(resobj.get("created_at").toString()));
|
||||||
} catch (JSONException | ParseException e) {
|
} catch (JSONException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,8 +130,8 @@ public class PeertubeAPI {
|
||||||
try {
|
try {
|
||||||
peertubeNotification.setId(resobj.get("id").toString());
|
peertubeNotification.setId(resobj.get("id").toString());
|
||||||
peertubeNotification.setType(resobj.getInt("type"));
|
peertubeNotification.setType(resobj.getInt("type"));
|
||||||
peertubeNotification.setUpdatedAt(Helper.mstStringToDate(context, resobj.get("updatedAt").toString()));
|
peertubeNotification.setUpdatedAt(Helper.mstStringToDate(resobj.get("updatedAt").toString()));
|
||||||
peertubeNotification.setCreatedAt(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
peertubeNotification.setCreatedAt(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
peertubeNotification.setRead(resobj.getBoolean("read"));
|
peertubeNotification.setRead(resobj.getBoolean("read"));
|
||||||
|
|
||||||
if (resobj.has("comment")) {
|
if (resobj.has("comment")) {
|
||||||
|
@ -264,7 +264,7 @@ public class PeertubeAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -333,13 +333,13 @@ public class PeertubeAPI {
|
||||||
}
|
}
|
||||||
peertube.setSensitive(Boolean.parseBoolean(resobj.get("nsfw").toString()));
|
peertube.setSensitive(Boolean.parseBoolean(resobj.get("nsfw").toString()));
|
||||||
try {
|
try {
|
||||||
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
|
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,7 @@ public class PeertubeAPI {
|
||||||
account.setSocial("PEERTUBE");
|
account.setSocial("PEERTUBE");
|
||||||
|
|
||||||
if (accountObject.has("createdAt"))
|
if (accountObject.has("createdAt"))
|
||||||
account.setCreated_at(Helper.mstStringToDate(context, accountObject.get("createdAt").toString()));
|
account.setCreated_at(Helper.mstStringToDate(accountObject.get("createdAt").toString()));
|
||||||
else
|
else
|
||||||
account.setCreated_at(new Date());
|
account.setCreated_at(new Date());
|
||||||
if (accountObject.has("followersCount"))
|
if (accountObject.has("followersCount"))
|
||||||
|
|
|
@ -112,10 +112,10 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
|
||||||
|
|
||||||
if (account.getSocial() == null || !account.getSocial().contains("OPENCOLLECTIVE")) {
|
if (account.getSocial() == null || !account.getSocial().contains("OPENCOLLECTIVE")) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
||||||
} else {
|
} else {
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
||||||
}
|
}
|
||||||
if (account.isFollowing()) {
|
if (account.isFollowing()) {
|
||||||
|
@ -124,7 +124,7 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
|
||||||
holder.account_follow.show();
|
holder.account_follow.show();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
holder.account_un.setText(account.getAcct());
|
holder.account_un.setText(account.getAcct());
|
||||||
holder.account_follow.hide();
|
holder.account_follow.hide();
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class AccountsAdminListAdapter extends RecyclerView.Adapter implements On
|
||||||
Account.makeAccountNameEmoji(context, AccountsAdminListAdapter.this, account);
|
Account.makeAccountNameEmoji(context, AccountsAdminListAdapter.this, account);
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
else if (account.getDisplay_name() != null) {
|
else if (account.getDisplay_name() != null) {
|
||||||
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public class AccountsAdminListAdapter extends RecyclerView.Adapter implements On
|
||||||
|
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
else if (account.getDisplay_name() != null) {
|
else if (account.getDisplay_name() != null) {
|
||||||
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement
|
||||||
holder.btn_authorize.setVisibility(View.GONE);
|
holder.btn_authorize.setVisibility(View.GONE);
|
||||||
holder.btn_reject.setVisibility(View.GONE);
|
holder.btn_reject.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
holder.account_un.setText(account.getAcct());
|
holder.account_un.setText(account.getAcct());
|
||||||
//Profile picture
|
//Profile picture
|
||||||
Glide.with(holder.account_pp.getContext())
|
Glide.with(holder.account_pp.getContext())
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class AccountsInAListAdapter extends RecyclerView.Adapter implements OnLi
|
||||||
final Account account = accounts.get(position);
|
final Account account = accounts.get(position);
|
||||||
|
|
||||||
|
|
||||||
holder.account_un.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_un.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
holder.account_ac.setText(account.getAcct());
|
holder.account_ac.setText(account.getAcct());
|
||||||
if (account.getDisplay_name().equals(account.getAcct()))
|
if (account.getDisplay_name().equals(account.getAcct()))
|
||||||
holder.account_ac.setVisibility(View.GONE);
|
holder.account_ac.setVisibility(View.GONE);
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class AccountsListAdapter extends RecyclerView.Adapter implements OnPostA
|
||||||
}
|
}
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
else
|
else
|
||||||
holder.account_dn.setText(account.getUsername().replace("@", ""));
|
holder.account_dn.setText(account.getUsername().replace("@", ""));
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class AccountsSearchAdapter extends ArrayAdapter<Account> implements Filt
|
||||||
holder.account_dn.setVisibility(View.GONE);
|
holder.account_dn.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
holder.account_un.setText(String.format("@%s", account.getAcct()));
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
holder.account_dn.setVisibility(View.VISIBLE);
|
holder.account_dn.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
//Profile picture
|
//Profile picture
|
||||||
|
|
|
@ -265,7 +265,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
case "mention":
|
case "mention":
|
||||||
holder.status_action_container.setVisibility(View.VISIBLE);
|
holder.status_action_container.setVisibility(View.VISIBLE);
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_mention));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_mention));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_mention));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_mention));
|
||||||
imgH = ContextCompat.getDrawable(context, R.drawable.ic_chat_bubble_outline);
|
imgH = ContextCompat.getDrawable(context, R.drawable.ic_chat_bubble_outline);
|
||||||
|
@ -287,7 +287,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
case "reblog":
|
case "reblog":
|
||||||
holder.status_action_container.setVisibility(View.GONE);
|
holder.status_action_container.setVisibility(View.GONE);
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_reblog));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_reblog));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_reblog));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_reblog));
|
||||||
imgH = ContextCompat.getDrawable(context, R.drawable.ic_repeat_head);
|
imgH = ContextCompat.getDrawable(context, R.drawable.ic_repeat_head);
|
||||||
|
@ -297,7 +297,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
case "favourite":
|
case "favourite":
|
||||||
holder.status_action_container.setVisibility(View.GONE);
|
holder.status_action_container.setVisibility(View.GONE);
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_favourite));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_favourite));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_favourite));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_favourite));
|
||||||
imgH = ContextCompat.getDrawable(context, R.drawable.ic_star_border_header);
|
imgH = ContextCompat.getDrawable(context, R.drawable.ic_star_border_header);
|
||||||
|
@ -308,7 +308,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
holder.status_action_container.setVisibility(View.GONE);
|
holder.status_action_container.setVisibility(View.GONE);
|
||||||
holder.status_date.setVisibility(View.GONE);
|
holder.status_date.setVisibility(View.GONE);
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_follow_request));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_follow_request));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow_request));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow_request));
|
||||||
imgH = ContextCompat.getDrawable(context, R.drawable.ic_follow_notif_header);
|
imgH = ContextCompat.getDrawable(context, R.drawable.ic_follow_notif_header);
|
||||||
|
@ -318,7 +318,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
|
||||||
holder.status_action_container.setVisibility(View.GONE);
|
holder.status_action_container.setVisibility(View.GONE);
|
||||||
holder.status_date.setVisibility(View.GONE);
|
holder.status_date.setVisibility(View.GONE);
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), context.getString(R.string.notif_follow));
|
typeString = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), context.getString(R.string.notif_follow));
|
||||||
else
|
else
|
||||||
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow));
|
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow));
|
||||||
imgH = ContextCompat.getDrawable(context, R.drawable.ic_follow_notif_header);
|
imgH = ContextCompat.getDrawable(context, R.drawable.ic_follow_notif_header);
|
||||||
|
|
|
@ -840,7 +840,7 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
|
||||||
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
||||||
else
|
else
|
||||||
extra_text = "@" + extra_text;
|
extra_text = "@" + extra_text;
|
||||||
extra_text += " " + Helper.shortnameToUnicode(":link:", true) + " " + url + "\r\n-\n";
|
extra_text += " " + Helper.shortnameToUnicode(":link:") + " " + url + "\r\n-\n";
|
||||||
final String contentToot;
|
final String contentToot;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class ReportsListAdapter extends RecyclerView.Adapter implements OnRetrie
|
||||||
Account.makeAccountNameEmoji(context, ReportsListAdapter.this, target_account);
|
Account.makeAccountNameEmoji(context, ReportsListAdapter.this, target_account);
|
||||||
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
if (account.getDisplay_name() != null && !account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn_reporter.setText(Helper.shortnameToUnicode(account.getDisplay_name(), true));
|
holder.account_dn_reporter.setText(Helper.shortnameToUnicode(account.getDisplay_name()));
|
||||||
else
|
else
|
||||||
holder.account_dn_reporter.setText(account.getUsername().replace("@", ""));
|
holder.account_dn_reporter.setText(account.getUsername().replace("@", ""));
|
||||||
} else
|
} else
|
||||||
|
@ -79,7 +79,7 @@ public class ReportsListAdapter extends RecyclerView.Adapter implements OnRetrie
|
||||||
|
|
||||||
if (target_account.getdisplayNameSpan() == null || target_account.getdisplayNameSpan().toString().trim().equals("")) {
|
if (target_account.getdisplayNameSpan() == null || target_account.getdisplayNameSpan().toString().trim().equals("")) {
|
||||||
if (target_account.getDisplay_name() != null && !target_account.getDisplay_name().trim().equals(""))
|
if (target_account.getDisplay_name() != null && !target_account.getDisplay_name().trim().equals(""))
|
||||||
holder.account_dn.setText(Helper.shortnameToUnicode(target_account.getDisplay_name(), true));
|
holder.account_dn.setText(Helper.shortnameToUnicode(target_account.getDisplay_name()));
|
||||||
else {
|
else {
|
||||||
if (target_account.getUsername() != null) {
|
if (target_account.getUsername() != null) {
|
||||||
holder.account_dn.setText(target_account.getUsername().replace("@", ""));
|
holder.account_dn.setText(target_account.getUsername().replace("@", ""));
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class SearchListAdapter extends BaseAdapter {
|
||||||
final String content, displayName, username, ppurl;
|
final String content, displayName, username, ppurl;
|
||||||
if (status.getReblog() != null) {
|
if (status.getReblog() != null) {
|
||||||
content = status.getReblog().getContent();
|
content = status.getReblog().getContent();
|
||||||
displayName = Helper.shortnameToUnicode(status.getReblog().getAccount().getDisplay_name(), true);
|
displayName = Helper.shortnameToUnicode(status.getReblog().getAccount().getDisplay_name());
|
||||||
username = status.getReblog().getAccount().getUsername();
|
username = status.getReblog().getAccount().getUsername();
|
||||||
holder.status_reblog_user.setText(String.format("%s @%s", displayName, username));
|
holder.status_reblog_user.setText(String.format("%s @%s", displayName, username));
|
||||||
ppurl = status.getReblog().getAccount().getAvatar();
|
ppurl = status.getReblog().getAccount().getAvatar();
|
||||||
|
@ -167,7 +167,7 @@ public class SearchListAdapter extends BaseAdapter {
|
||||||
} else {
|
} else {
|
||||||
ppurl = status.getAccount().getAvatar();
|
ppurl = status.getAccount().getAvatar();
|
||||||
content = status.getContent();
|
content = status.getContent();
|
||||||
displayName = Helper.shortnameToUnicode(status.getAccount().getDisplay_name(), true);
|
displayName = Helper.shortnameToUnicode(status.getAccount().getDisplay_name());
|
||||||
username = status.getAccount().getUsername();
|
username = status.getAccount().getUsername();
|
||||||
holder.status_reblog_user.setVisibility(View.GONE);
|
holder.status_reblog_user.setVisibility(View.GONE);
|
||||||
holder.status_account_displayname.setText(displayName);
|
holder.status_account_displayname.setText(displayName);
|
||||||
|
|
|
@ -579,9 +579,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED && type == RetrieveFeedsAsyncTask.Type.CONTEXT) {
|
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED && type == RetrieveFeedsAsyncTask.Type.CONTEXT) {
|
||||||
return COMPACT_STATUS;
|
return COMPACT_STATUS;
|
||||||
} else {
|
} else {
|
||||||
if (instanceType == null || instanceType.compareTo("NITTER") != 0) {
|
if( instanceType == null || instanceType.compareTo("NITTER") != 0 ) {
|
||||||
return statuses.get(position).getViewType();
|
return statuses.get(position).getViewType();
|
||||||
} else {
|
}else{
|
||||||
return COMPACT_STATUS;
|
return COMPACT_STATUS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1009,8 +1009,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
iconColor = ThemeHelper.getAttColor(context, R.attr.iconColor);
|
iconColor = ThemeHelper.getAttColor(context, R.attr.iconColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA ){
|
||||||
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
|
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS ) {
|
||||||
holder.status_account_profile.setVisibility(View.GONE);
|
holder.status_account_profile.setVisibility(View.GONE);
|
||||||
holder.status_account_displayname_owner.setVisibility(View.GONE);
|
holder.status_account_displayname_owner.setVisibility(View.GONE);
|
||||||
holder.status_account_username.setVisibility(View.GONE);
|
holder.status_account_username.setVisibility(View.GONE);
|
||||||
|
@ -1033,18 +1033,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
}).setOnEmojiClickListener((emoji, imageView) -> {
|
}).setOnEmojiClickListener((emoji, imageView) -> {
|
||||||
String emojiStr = imageView.getUnicode();
|
String emojiStr = imageView.getUnicode();
|
||||||
boolean alreadyAdded = false;
|
boolean alreadyAdded = false;
|
||||||
for (Reaction reaction : status.getReactions()) {
|
for(Reaction reaction: status.getReactions()){
|
||||||
if (reaction.getName().compareTo(emojiStr) == 0) {
|
if( reaction.getName().compareTo(emojiStr) == 0){
|
||||||
alreadyAdded = true;
|
alreadyAdded = true;
|
||||||
reaction.setCount(reaction.getCount() - 1);
|
reaction.setCount(reaction.getCount()-1);
|
||||||
if (reaction.getCount() == 0) {
|
if( reaction.getCount() == 0) {
|
||||||
status.getReactions().remove(reaction);
|
status.getReactions().remove(reaction);
|
||||||
}
|
}
|
||||||
notifyStatusChanged(status);
|
notifyStatusChanged(status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!alreadyAdded) {
|
if( !alreadyAdded){
|
||||||
Reaction reaction = new Reaction();
|
Reaction reaction = new Reaction();
|
||||||
reaction.setMe(true);
|
reaction.setMe(true);
|
||||||
reaction.setCount(1);
|
reaction.setCount(1);
|
||||||
|
@ -1053,17 +1053,17 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
notifyStatusChanged(status);
|
notifyStatusChanged(status);
|
||||||
}
|
}
|
||||||
API.StatusAction statusAction;
|
API.StatusAction statusAction;
|
||||||
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
|
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS ) {
|
||||||
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
|
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
|
||||||
} else {
|
}else{
|
||||||
statusAction = alreadyAdded ? API.StatusAction.REMOVE_PLEROMA_REACTION : API.StatusAction.ADD_PLEROMA_REACTION;
|
statusAction = alreadyAdded ? API.StatusAction.REMOVE_PLEROMA_REACTION : API.StatusAction.ADD_PLEROMA_REACTION;
|
||||||
}
|
}
|
||||||
new PostActionAsyncTask(context, statusAction, status.getId(), null, emojiStr, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new PostActionAsyncTask(context, statusAction, status.getId(), null,emojiStr, StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
})
|
})
|
||||||
.build(holder.fake_edittext);
|
.build(holder.fake_edittext);
|
||||||
emojiPopup.toggle();
|
emojiPopup.toggle();
|
||||||
});
|
});
|
||||||
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
if( social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||||
holder.status_add_custom_emoji.setVisibility(View.GONE);
|
holder.status_add_custom_emoji.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
holder.status_add_custom_emoji.setOnClickListener(v -> {
|
holder.status_add_custom_emoji.setOnClickListener(v -> {
|
||||||
|
@ -1090,18 +1090,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
gridView.setNumColumns(5);
|
gridView.setNumColumns(5);
|
||||||
gridView.setOnItemClickListener((parent, view, position, id) -> {
|
gridView.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
boolean alreadyAdded = false;
|
boolean alreadyAdded = false;
|
||||||
for (Reaction reaction : status.getReactions()) {
|
for(Reaction reaction: status.getReactions()){
|
||||||
if (reaction.getName().compareTo(emojis.get(position).getShortcode()) == 0) {
|
if( reaction.getName().compareTo(emojis.get(position).getShortcode()) == 0){
|
||||||
alreadyAdded = true;
|
alreadyAdded = true;
|
||||||
reaction.setCount(reaction.getCount() - 1);
|
reaction.setCount(reaction.getCount()-1);
|
||||||
if (reaction.getCount() == 0) {
|
if( reaction.getCount() == 0) {
|
||||||
status.getReactions().remove(reaction);
|
status.getReactions().remove(reaction);
|
||||||
}
|
}
|
||||||
notifyStatusChanged(status);
|
notifyStatusChanged(status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!alreadyAdded) {
|
if( !alreadyAdded){
|
||||||
Reaction reaction = new Reaction();
|
Reaction reaction = new Reaction();
|
||||||
reaction.setMe(true);
|
reaction.setMe(true);
|
||||||
reaction.setCount(1);
|
reaction.setCount(1);
|
||||||
|
@ -1111,12 +1111,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
notifyStatusChanged(status);
|
notifyStatusChanged(status);
|
||||||
}
|
}
|
||||||
API.StatusAction statusAction;
|
API.StatusAction statusAction;
|
||||||
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
|
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS ) {
|
||||||
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
|
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
|
||||||
} else {
|
}else{
|
||||||
statusAction = alreadyAdded ? API.StatusAction.REMOVE_PLEROMA_REACTION : API.StatusAction.ADD_PLEROMA_REACTION;
|
statusAction = alreadyAdded ? API.StatusAction.REMOVE_PLEROMA_REACTION : API.StatusAction.ADD_PLEROMA_REACTION;
|
||||||
}
|
}
|
||||||
new PostActionAsyncTask(context, statusAction, status.getId(), null, emojis.get(position).getShortcode(), StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new PostActionAsyncTask(context, statusAction, status.getId(), null, emojis.get(position).getShortcode(), StatusListAdapter.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
alertDialogEmoji.dismiss();
|
alertDialogEmoji.dismiss();
|
||||||
});
|
});
|
||||||
gridView.setPadding(paddingDp, paddingDp, paddingDp, paddingDp);
|
gridView.setPadding(paddingDp, paddingDp, paddingDp, paddingDp);
|
||||||
|
@ -1363,7 +1363,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
||||||
else
|
else
|
||||||
extra_text = "@" + extra_text;
|
extra_text = "@" + extra_text;
|
||||||
extra_text += " " + Helper.shortnameToUnicode(":link:", true) + " " + url + "\r\n-\n";
|
extra_text += " " + Helper.shortnameToUnicode(":link:") + " " + url + "\r\n-\n";
|
||||||
final String contentToot;
|
final String contentToot;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||||
|
@ -2940,7 +2940,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
|
||||||
else
|
else
|
||||||
extra_text = "@" + extra_text;
|
extra_text = "@" + extra_text;
|
||||||
extra_text += " " + Helper.shortnameToUnicode(":link:", true) + " " + url + "\r\n-\n";
|
extra_text += " " + Helper.shortnameToUnicode(":link:") + " " + url + "\r\n-\n";
|
||||||
final String contentToot;
|
final String contentToot;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
contentToot = Html.fromHtml((status.getReblog() != null) ? status.getReblog().getContent() : status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||||
|
@ -3365,7 +3365,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
Glide.with(imageView.getContext())
|
Glide.with(imageView.getContext())
|
||||||
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
||||||
.thumbnail(0.1f)
|
.thumbnail(0.1f)
|
||||||
// .override(640, 480)
|
// .override(640, 480)
|
||||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||||
.transition(DrawableTransitionOptions.withCrossFade())
|
.transition(DrawableTransitionOptions.withCrossFade())
|
||||||
.into(imageView);
|
.into(imageView);
|
||||||
|
@ -3373,7 +3373,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
Glide.with(imageView.getContext())
|
Glide.with(imageView.getContext())
|
||||||
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
|
||||||
.thumbnail(0.1f)
|
.thumbnail(0.1f)
|
||||||
// .override(640, 480)
|
// .override(640, 480)
|
||||||
.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new RoundedCorners(10)))
|
.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new RoundedCorners(10)))
|
||||||
.transition(DrawableTransitionOptions.withCrossFade())
|
.transition(DrawableTransitionOptions.withCrossFade())
|
||||||
.into(imageView);
|
.into(imageView);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -196,7 +196,7 @@ public class NotificationsSyncJob extends Job {
|
||||||
if (notificationUrl == null) {
|
if (notificationUrl == null) {
|
||||||
notificationUrl = notification.getAccount().getAvatar();
|
notificationUrl = notification.getAccount().getAvatar();
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getContext().getString(R.string.notif_mention));
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getContext().getString(R.string.notif_mention));
|
||||||
else
|
else
|
||||||
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_mention));
|
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_mention));
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ public class NotificationsSyncJob extends Job {
|
||||||
if (notificationUrl == null) {
|
if (notificationUrl == null) {
|
||||||
notificationUrl = notification.getAccount().getAvatar();
|
notificationUrl = notification.getAccount().getAvatar();
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getContext().getString(R.string.notif_reblog));
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getContext().getString(R.string.notif_reblog));
|
||||||
else
|
else
|
||||||
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_reblog));
|
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_reblog));
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public class NotificationsSyncJob extends Job {
|
||||||
if (notificationUrl == null) {
|
if (notificationUrl == null) {
|
||||||
notificationUrl = notification.getAccount().getAvatar();
|
notificationUrl = notification.getAccount().getAvatar();
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getContext().getString(R.string.notif_favourite));
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getContext().getString(R.string.notif_favourite));
|
||||||
else
|
else
|
||||||
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_favourite));
|
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_favourite));
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ public class NotificationsSyncJob extends Job {
|
||||||
if (notificationUrl == null) {
|
if (notificationUrl == null) {
|
||||||
notificationUrl = notification.getAccount().getAvatar();
|
notificationUrl = notification.getAccount().getAvatar();
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getContext().getString(R.string.notif_follow_request));
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getContext().getString(R.string.notif_follow_request));
|
||||||
else
|
else
|
||||||
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_follow_request));
|
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_follow_request));
|
||||||
targeted_account = notification.getAccount().getId();
|
targeted_account = notification.getAccount().getId();
|
||||||
|
@ -250,7 +250,7 @@ public class NotificationsSyncJob extends Job {
|
||||||
if (notificationUrl == null) {
|
if (notificationUrl == null) {
|
||||||
notificationUrl = notification.getAccount().getAvatar();
|
notificationUrl = notification.getAccount().getAvatar();
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getContext().getString(R.string.notif_follow));
|
title = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getContext().getString(R.string.notif_follow));
|
||||||
else
|
else
|
||||||
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_follow));
|
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_follow));
|
||||||
targeted_account = notification.getAccount().getId();
|
targeted_account = notification.getAccount().getId();
|
||||||
|
|
|
@ -340,7 +340,7 @@ public class LiveNotificationDelayedService extends Service {
|
||||||
notifType = Helper.NotifType.MENTION;
|
notifType = Helper.NotifType.MENTION;
|
||||||
if (notif_mention) {
|
if (notif_mention) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_mention));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_mention));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_mention));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_mention));
|
||||||
if (notification.getStatus() != null) {
|
if (notification.getStatus() != null) {
|
||||||
|
@ -364,7 +364,7 @@ public class LiveNotificationDelayedService extends Service {
|
||||||
notifType = Helper.NotifType.BOOST;
|
notifType = Helper.NotifType.BOOST;
|
||||||
if (notif_share) {
|
if (notif_share) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_reblog));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_reblog));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_reblog));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_reblog));
|
||||||
} else {
|
} else {
|
||||||
|
@ -375,7 +375,7 @@ public class LiveNotificationDelayedService extends Service {
|
||||||
notifType = Helper.NotifType.FAV;
|
notifType = Helper.NotifType.FAV;
|
||||||
if (notif_add) {
|
if (notif_add) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_favourite));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_favourite));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_favourite));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_favourite));
|
||||||
} else {
|
} else {
|
||||||
|
@ -386,7 +386,7 @@ public class LiveNotificationDelayedService extends Service {
|
||||||
notifType = Helper.NotifType.FOLLLOW;
|
notifType = Helper.NotifType.FOLLLOW;
|
||||||
if (notif_follow) {
|
if (notif_follow) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_follow_request));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_follow_request));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow_request));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow_request));
|
||||||
targeted_account = notification.getAccount().getId();
|
targeted_account = notification.getAccount().getId();
|
||||||
|
@ -398,7 +398,7 @@ public class LiveNotificationDelayedService extends Service {
|
||||||
notifType = Helper.NotifType.FOLLLOW;
|
notifType = Helper.NotifType.FOLLLOW;
|
||||||
if (notif_follow) {
|
if (notif_follow) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_follow));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_follow));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow));
|
||||||
targeted_account = notification.getAccount().getId();
|
targeted_account = notification.getAccount().getId();
|
||||||
|
|
|
@ -376,7 +376,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
|
||||||
notifType = Helper.NotifType.MENTION;
|
notifType = Helper.NotifType.MENTION;
|
||||||
if (notif_mention) {
|
if (notif_mention) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_mention));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_mention));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_mention));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_mention));
|
||||||
if (notification.getStatus() != null) {
|
if (notification.getStatus() != null) {
|
||||||
|
@ -400,7 +400,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
|
||||||
notifType = Helper.NotifType.BOOST;
|
notifType = Helper.NotifType.BOOST;
|
||||||
if (notif_share) {
|
if (notif_share) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_reblog));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_reblog));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_reblog));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_reblog));
|
||||||
} else {
|
} else {
|
||||||
|
@ -411,7 +411,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
|
||||||
notifType = Helper.NotifType.FAV;
|
notifType = Helper.NotifType.FAV;
|
||||||
if (notif_add) {
|
if (notif_add) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_favourite));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_favourite));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_favourite));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_favourite));
|
||||||
} else {
|
} else {
|
||||||
|
@ -422,7 +422,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
|
||||||
notifType = Helper.NotifType.FOLLLOW;
|
notifType = Helper.NotifType.FOLLLOW;
|
||||||
if (notif_follow) {
|
if (notif_follow) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_follow_request));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_follow_request));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow_request));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow_request));
|
||||||
targeted_account = notification.getAccount().getId();
|
targeted_account = notification.getAccount().getId();
|
||||||
|
@ -434,7 +434,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
|
||||||
notifType = Helper.NotifType.FOLLLOW;
|
notifType = Helper.NotifType.FOLLLOW;
|
||||||
if (notif_follow) {
|
if (notif_follow) {
|
||||||
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
if (notification.getAccount().getDisplay_name() != null && notification.getAccount().getDisplay_name().length() > 0)
|
||||||
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name(), true), getString(R.string.notif_follow));
|
message = String.format("%s %s", Helper.shortnameToUnicode(notification.getAccount().getDisplay_name()), getString(R.string.notif_follow));
|
||||||
else
|
else
|
||||||
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow));
|
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow));
|
||||||
targeted_account = notification.getAccount().getId();
|
targeted_account = notification.getAccount().getId();
|
||||||
|
|
Loading…
Reference in New Issue