Add some improvements

This commit is contained in:
tom79 2020-04-08 15:14:27 +02:00
parent d6dc05fc4f
commit 722479d4e2
23 changed files with 367 additions and 677 deletions

View File

@ -0,0 +1,3 @@
Changed:
- One logout entry in menu (it will removed the account from the app)
- Improve memory management

View File

@ -19,7 +19,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Build;
@ -60,14 +59,11 @@ import app.fedilab.android.asynctasks.PostActionAsyncTask;
import app.fedilab.android.asynctasks.RetrieveDomainsAsyncTask;
import app.fedilab.android.client.API;
import app.fedilab.android.client.APIResponse;
import app.fedilab.android.client.Entities.Account;
import app.fedilab.android.client.Entities.Error;
import app.fedilab.android.drawers.DomainsListAdapter;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.interfaces.OnPostActionInterface;
import app.fedilab.android.interfaces.OnRetrieveDomainsInterface;
import app.fedilab.android.sqlite.AccountDAO;
import app.fedilab.android.sqlite.Sqlite;
import es.dmoral.toasty.Toasty;
@ -159,11 +155,7 @@ public class MutedInstanceActivity extends BaseActivity implements OnRetrieveDom
alertDialog.show();
break;
case R.id.action_export_instances:
SQLiteDatabase db = Sqlite.getInstance(MutedInstanceActivity.this, Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
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());
Helper.exportInstanceBlock(MutedInstanceActivity.this);
break;
case R.id.action_import_instances:
if (ContextCompat.checkSelfPermission(MutedInstanceActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=

View File

@ -646,7 +646,7 @@ public class PeertubeActivity extends BaseActivity implements OnRetrievePeertube
if (share_details) {
extra_text = "@" + peertube.getAccount().getAcct();
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;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
contentToot = Html.fromHtml(peertube.getDescription(), Html.FROM_HTML_MODE_LEGACY).toString();

View File

@ -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) {
account_un.setText(String.format("@%s", account.getAcct()));
account_un.setOnLongClickListener(v -> {

View File

@ -279,10 +279,10 @@ public class API {
instanceSocial.setHttps_rank(resobj.get("https_rank").toString());
instanceSocial.setHttps_score(Integer.parseInt(resobj.get("https_score").toString()));
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.setUpdated_at(Helper.mstStringToDate(context, resobj.get("updated_at").toString()));
instanceSocial.setChecked_at(Helper.mstStringToDate(resobj.get("checked_at").toString()));
instanceSocial.setUpdated_at(Helper.mstStringToDate(resobj.get("updated_at").toString()));
} catch (Exception e) {
@ -315,7 +315,7 @@ public class API {
peertube.setDislike(Integer.parseInt(resobj.get("dislikes").toString()));
peertube.setDuration(Integer.parseInt(resobj.get("duration").toString()));
try {
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
} catch (ParseException e) {
e.printStackTrace();
}
@ -352,7 +352,7 @@ public class API {
peertube.setDuration(Integer.parseInt(resobj.get("duration").toString()));
peertube.setAccount(parseAccountResponsePeertube(context, instance, resobj.getJSONObject("account")));
try {
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
} catch (ParseException e) {
e.printStackTrace();
}
@ -406,7 +406,7 @@ public class API {
status.setContent(context, comment.get("text").toString());
status.setIn_reply_to_id(comment.get("inReplyToCommentId").toString());
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.setEmojis(new ArrayList<>());
status.setMedia_attachments(new ArrayList<>());
@ -459,7 +459,7 @@ public class API {
schedule.setStatus(status);
schedule.setAttachmentList(attachements);
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) {
e.printStackTrace();
}
@ -487,7 +487,7 @@ public class API {
schedule.setAttachmentList(attachements);
schedules.add(schedule);
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++;
}
} catch (JSONException | ParseException e) {
@ -609,16 +609,16 @@ public class API {
announcement.setId(resobj.getString("id"));
announcement.setContent(context, resobj.getString("content"));
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) {
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) {
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) {
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();
try {
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.setMultiple(resobj.getBoolean("multiple"));
poll.setVotes_count(resobj.getInt("votes_count"));
@ -728,7 +728,7 @@ public class API {
status.setUri(resobj.get("id").toString());
}
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 {
status.setCreated_at(new Date());
}
@ -886,7 +886,7 @@ public class API {
Poll poll = new Poll();
poll.setId(resobj.getJSONObject("poll").getString("id"));
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) {
poll.setExpires_at(new Date());
}
@ -979,7 +979,7 @@ public class API {
status.setId(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.setSensitive(false);
resobj.get("cw");
@ -1173,7 +1173,7 @@ public class API {
account.setDisplay_name(resobj.get("displayName").toString());
account.setHost(resobj.get("host").toString());
if (resobj.has("createdAt"))
account.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
account.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
else
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")) {
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 (!resobj.isNull("account")) {
@ -1291,7 +1291,7 @@ public class API {
accountAdmin.setUsername(resobj.getString("nickname"));
}
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")) {
accountAdmin.setEmail(resobj.getString("email"));
@ -1378,7 +1378,7 @@ public class API {
account.setDisplay_name(resobj.get("display_name").toString());
account.setLocked(Boolean.parseBoolean(resobj.get("locked").toString()));
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 {
account.setCreated_at(new Date());
}
@ -1609,13 +1609,13 @@ public class API {
try {
notification.setId(resobj.get("id").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")));
try {
notification.setStatus(parseStatuses(context, resobj.getJSONObject("status")));
} 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 (ParseException e) {
e.printStackTrace();
@ -1797,7 +1797,7 @@ public class API {
identityProof.setProof_url(jsonObject.getString("proof_url"));
identityProof.setProvider(jsonObject.getString("provider"));
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) {
e.printStackTrace();
@ -5854,7 +5854,7 @@ public class API {
filter.setPhrase(resobj.get("phrase").toString());
resobj.get("expires_at");
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.setIrreversible(Boolean.parseBoolean(resobj.get("irreversible").toString()));
String contextString = resobj.get("context").toString();

View File

@ -102,7 +102,7 @@ public class Notification implements Parcelable {
switch (notification.getType()) {
case "mention":
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_mention));
break;
@ -111,25 +111,25 @@ public class Notification implements Parcelable {
break;
case "reblog":
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_reblog));
break;
case "favourite":
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_favourite));
break;
case "follow":
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow));
break;
case "follow_request":
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow_request));
break;

View File

@ -164,7 +164,7 @@ public class GNUAPI {
group.setId(resobj.get("id").toString());
//group.setFollowers_count(resobj.getInt("admin_count"));
//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.setDisplay_name(resobj.getString("fullname"));
//group.setHomepage(resobj.getString("homepage"));
@ -227,7 +227,7 @@ public class GNUAPI {
} catch (Exception ignored) {
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"))
status.setIn_reply_to_id(resobj.get("in_reply_to_status_id").toString());
if (resobj.has("in_reply_to_user_id"))
@ -400,7 +400,7 @@ public class GNUAPI {
else
account.setSocial("GNU");
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) {
e.printStackTrace();
}

View File

@ -130,8 +130,8 @@ public class PeertubeAPI {
try {
peertubeNotification.setId(resobj.get("id").toString());
peertubeNotification.setType(resobj.getInt("type"));
peertubeNotification.setUpdatedAt(Helper.mstStringToDate(context, resobj.get("updatedAt").toString()));
peertubeNotification.setCreatedAt(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
peertubeNotification.setUpdatedAt(Helper.mstStringToDate(resobj.get("updatedAt").toString()));
peertubeNotification.setCreatedAt(Helper.mstStringToDate(resobj.get("createdAt").toString()));
peertubeNotification.setRead(resobj.getBoolean("read"));
if (resobj.has("comment")) {
@ -264,7 +264,7 @@ public class PeertubeAPI {
}
try {
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
} catch (ParseException e) {
e.printStackTrace();
}
@ -333,13 +333,13 @@ public class PeertubeAPI {
}
peertube.setSensitive(Boolean.parseBoolean(resobj.get("nsfw").toString()));
try {
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
} catch (ParseException e) {
e.printStackTrace();
}
try {
peertube.setCreated_at(Helper.mstStringToDate(context, resobj.get("createdAt").toString()));
peertube.setCreated_at(Helper.mstStringToDate(resobj.get("createdAt").toString()));
} catch (ParseException e) {
e.printStackTrace();
}
@ -442,7 +442,7 @@ public class PeertubeAPI {
account.setSocial("PEERTUBE");
if (accountObject.has("createdAt"))
account.setCreated_at(Helper.mstStringToDate(context, accountObject.get("createdAt").toString()));
account.setCreated_at(Helper.mstStringToDate(accountObject.get("createdAt").toString()));
else
account.setCreated_at(new Date());
if (accountObject.has("followersCount"))

View File

@ -112,10 +112,10 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
if (account.getSocial() == null || !account.getSocial().contains("OPENCOLLECTIVE")) {
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()));
} 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()));
}
if (account.isFollowing()) {
@ -124,7 +124,7 @@ public class AccountSearchDevAdapter extends BaseAdapter implements OnPostAction
holder.account_follow.show();
}
} 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_follow.hide();
}

View File

@ -71,7 +71,7 @@ public class AccountsAdminListAdapter extends RecyclerView.Adapter implements On
Account.makeAccountNameEmoji(context, AccountsAdminListAdapter.this, account);
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().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) {
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.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) {
holder.account_dn.setText(account.getDisplay_name().replace("@", ""));
}

View File

@ -87,7 +87,7 @@ public class AccountsFollowRequestAdapter extends RecyclerView.Adapter implement
holder.btn_authorize.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());
//Profile picture
Glide.with(holder.account_pp.getContext())

View File

@ -89,7 +89,7 @@ public class AccountsInAListAdapter extends RecyclerView.Adapter implements OnLi
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());
if (account.getDisplay_name().equals(account.getAcct()))
holder.account_ac.setVisibility(View.GONE);

View File

@ -171,7 +171,7 @@ public class AccountsListAdapter extends RecyclerView.Adapter implements OnPostA
}
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().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
holder.account_dn.setText(account.getUsername().replace("@", ""));
} else

View File

@ -153,7 +153,7 @@ public class AccountsSearchAdapter extends ArrayAdapter<Account> implements Filt
holder.account_dn.setVisibility(View.GONE);
} else {
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);
}
//Profile picture

View File

@ -265,7 +265,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
case "mention":
holder.status_action_container.setVisibility(View.VISIBLE);
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_mention));
imgH = ContextCompat.getDrawable(context, R.drawable.ic_chat_bubble_outline);
@ -287,7 +287,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
case "reblog":
holder.status_action_container.setVisibility(View.GONE);
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_reblog));
imgH = ContextCompat.getDrawable(context, R.drawable.ic_repeat_head);
@ -297,7 +297,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
case "favourite":
holder.status_action_container.setVisibility(View.GONE);
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_favourite));
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_date.setVisibility(View.GONE);
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
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);
@ -318,7 +318,7 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
holder.status_action_container.setVisibility(View.GONE);
holder.status_date.setVisibility(View.GONE);
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
typeString = String.format("@%s %s", notification.getAccount().getUsername(), context.getString(R.string.notif_follow));
imgH = ContextCompat.getDrawable(context, R.drawable.ic_follow_notif_header);

View File

@ -840,7 +840,7 @@ public class PixelfedListAdapter extends RecyclerView.Adapter implements OnPostA
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
else
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;
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();

View File

@ -71,7 +71,7 @@ public class ReportsListAdapter extends RecyclerView.Adapter implements OnRetrie
Account.makeAccountNameEmoji(context, ReportsListAdapter.this, target_account);
if (account.getdisplayNameSpan() == null || account.getdisplayNameSpan().toString().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
holder.account_dn_reporter.setText(account.getUsername().replace("@", ""));
} 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.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 {
if (target_account.getUsername() != null) {
holder.account_dn.setText(target_account.getUsername().replace("@", ""));

View File

@ -157,7 +157,7 @@ public class SearchListAdapter extends BaseAdapter {
final String content, displayName, username, ppurl;
if (status.getReblog() != null) {
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();
holder.status_reblog_user.setText(String.format("%s @%s", displayName, username));
ppurl = status.getReblog().getAccount().getAvatar();
@ -167,7 +167,7 @@ public class SearchListAdapter extends BaseAdapter {
} else {
ppurl = status.getAccount().getAvatar();
content = status.getContent();
displayName = Helper.shortnameToUnicode(status.getAccount().getDisplay_name(), true);
displayName = Helper.shortnameToUnicode(status.getAccount().getDisplay_name());
username = status.getAccount().getUsername();
holder.status_reblog_user.setVisibility(View.GONE);
holder.status_account_displayname.setText(displayName);

View File

@ -579,9 +579,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if (social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED && type == RetrieveFeedsAsyncTask.Type.CONTEXT) {
return COMPACT_STATUS;
} else {
if (instanceType == null || instanceType.compareTo("NITTER") != 0) {
if( instanceType == null || instanceType.compareTo("NITTER") != 0 ) {
return statuses.get(position).getViewType();
} else {
}else{
return COMPACT_STATUS;
}
}
@ -1009,8 +1009,8 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
iconColor = ThemeHelper.getAttColor(context, R.attr.iconColor);
}
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA ){
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS ) {
holder.status_account_profile.setVisibility(View.GONE);
holder.status_account_displayname_owner.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) -> {
String emojiStr = imageView.getUnicode();
boolean alreadyAdded = false;
for (Reaction reaction : status.getReactions()) {
if (reaction.getName().compareTo(emojiStr) == 0) {
for(Reaction reaction: status.getReactions()){
if( reaction.getName().compareTo(emojiStr) == 0){
alreadyAdded = true;
reaction.setCount(reaction.getCount() - 1);
if (reaction.getCount() == 0) {
reaction.setCount(reaction.getCount()-1);
if( reaction.getCount() == 0) {
status.getReactions().remove(reaction);
}
notifyStatusChanged(status);
break;
}
}
if (!alreadyAdded) {
if( !alreadyAdded){
Reaction reaction = new Reaction();
reaction.setMe(true);
reaction.setCount(1);
@ -1053,17 +1053,17 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
notifyStatusChanged(status);
}
API.StatusAction statusAction;
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS ) {
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
} else {
}else{
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);
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.setOnClickListener(v -> {
@ -1090,18 +1090,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
gridView.setNumColumns(5);
gridView.setOnItemClickListener((parent, view, position, id) -> {
boolean alreadyAdded = false;
for (Reaction reaction : status.getReactions()) {
if (reaction.getName().compareTo(emojis.get(position).getShortcode()) == 0) {
for(Reaction reaction: status.getReactions()){
if( reaction.getName().compareTo(emojis.get(position).getShortcode()) == 0){
alreadyAdded = true;
reaction.setCount(reaction.getCount() - 1);
if (reaction.getCount() == 0) {
reaction.setCount(reaction.getCount()-1);
if( reaction.getCount() == 0) {
status.getReactions().remove(reaction);
}
notifyStatusChanged(status);
break;
}
}
if (!alreadyAdded) {
if( !alreadyAdded){
Reaction reaction = new Reaction();
reaction.setMe(true);
reaction.setCount(1);
@ -1111,12 +1111,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
notifyStatusChanged(status);
}
API.StatusAction statusAction;
if (type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS) {
if( type == RetrieveFeedsAsyncTask.Type.ANNOUNCEMENTS ) {
statusAction = alreadyAdded ? API.StatusAction.REMOVE_REACTION : API.StatusAction.ADD_REACTION;
} else {
}else{
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();
});
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);
else
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;
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();
@ -2940,7 +2940,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
else
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;
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();
@ -3365,7 +3365,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Glide.with(imageView.getContext())
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
.thumbnail(0.1f)
// .override(640, 480)
// .override(640, 480)
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
@ -3373,7 +3373,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
Glide.with(imageView.getContext())
.load(!attachment.getType().toLowerCase().equals("audio") ? url : R.drawable.ic_audio_wave)
.thumbnail(0.1f)
// .override(640, 480)
// .override(640, 480)
.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new RoundedCorners(10)))
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);

File diff suppressed because it is too large Load Diff

View File

@ -196,7 +196,7 @@ public class NotificationsSyncJob extends Job {
if (notificationUrl == null) {
notificationUrl = notification.getAccount().getAvatar();
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
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) {
notificationUrl = notification.getAccount().getAvatar();
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
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) {
notificationUrl = notification.getAccount().getAvatar();
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
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) {
notificationUrl = notification.getAccount().getAvatar();
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
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_follow_request));
targeted_account = notification.getAccount().getId();
@ -250,7 +250,7 @@ public class NotificationsSyncJob extends Job {
if (notificationUrl == null) {
notificationUrl = notification.getAccount().getAvatar();
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
title = String.format("@%s %s", notification.getAccount().getAcct(), getContext().getString(R.string.notif_follow));
targeted_account = notification.getAccount().getId();

View File

@ -340,7 +340,7 @@ public class LiveNotificationDelayedService extends Service {
notifType = Helper.NotifType.MENTION;
if (notif_mention) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_mention));
if (notification.getStatus() != null) {
@ -364,7 +364,7 @@ public class LiveNotificationDelayedService extends Service {
notifType = Helper.NotifType.BOOST;
if (notif_share) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_reblog));
} else {
@ -375,7 +375,7 @@ public class LiveNotificationDelayedService extends Service {
notifType = Helper.NotifType.FAV;
if (notif_add) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_favourite));
} else {
@ -386,7 +386,7 @@ public class LiveNotificationDelayedService extends Service {
notifType = Helper.NotifType.FOLLLOW;
if (notif_follow) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow_request));
targeted_account = notification.getAccount().getId();
@ -398,7 +398,7 @@ public class LiveNotificationDelayedService extends Service {
notifType = Helper.NotifType.FOLLLOW;
if (notif_follow) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow));
targeted_account = notification.getAccount().getId();

View File

@ -376,7 +376,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
notifType = Helper.NotifType.MENTION;
if (notif_mention) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_mention));
if (notification.getStatus() != null) {
@ -400,7 +400,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
notifType = Helper.NotifType.BOOST;
if (notif_share) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_reblog));
} else {
@ -411,7 +411,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
notifType = Helper.NotifType.FAV;
if (notif_add) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_favourite));
} else {
@ -422,7 +422,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
notifType = Helper.NotifType.FOLLLOW;
if (notif_follow) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow_request));
targeted_account = notification.getAccount().getId();
@ -434,7 +434,7 @@ public class LiveNotificationService extends Service implements NetworkStateRece
notifType = Helper.NotifType.FOLLLOW;
if (notif_follow) {
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
message = String.format("@%s %s", notification.getAccount().getAcct(), getString(R.string.notif_follow));
targeted_account = notification.getAccount().getId();