parent
281cccadb8
commit
b2767716b1
|
@ -312,10 +312,12 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
||||||
if( isOwner) {
|
if( isOwner) {
|
||||||
popup.getMenu().findItem(R.id.action_block).setVisible(false);
|
popup.getMenu().findItem(R.id.action_block).setVisible(false);
|
||||||
popup.getMenu().findItem(R.id.action_mute).setVisible(false);
|
popup.getMenu().findItem(R.id.action_mute).setVisible(false);
|
||||||
|
popup.getMenu().findItem(R.id.action_mention).setVisible(false);
|
||||||
stringArrayConf = getResources().getStringArray(R.array.more_action_owner_confirm);
|
stringArrayConf = getResources().getStringArray(R.array.more_action_owner_confirm);
|
||||||
}else {
|
}else {
|
||||||
popup.getMenu().findItem(R.id.action_block).setVisible(true);
|
popup.getMenu().findItem(R.id.action_block).setVisible(true);
|
||||||
popup.getMenu().findItem(R.id.action_mute).setVisible(true);
|
popup.getMenu().findItem(R.id.action_mute).setVisible(true);
|
||||||
|
popup.getMenu().findItem(R.id.action_mention).setVisible(true);
|
||||||
stringArrayConf = getResources().getStringArray(R.array.more_action_confirm);
|
stringArrayConf = getResources().getStringArray(R.array.more_action_confirm);
|
||||||
}
|
}
|
||||||
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||||
|
@ -349,6 +351,13 @@ public class ShowAccountActivity extends AppCompatActivity implements OnPostActi
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.action_mention:
|
||||||
|
Intent intent = new Intent(getApplicationContext(), TootActivity.class);
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
b.putString("mentionAccount", account.getAcct());
|
||||||
|
intent.putExtras(b);
|
||||||
|
startActivity(intent);
|
||||||
|
return true;
|
||||||
case R.id.action_mute:
|
case R.id.action_mute:
|
||||||
builderInner = new AlertDialog.Builder(ShowAccountActivity.this);
|
builderInner = new AlertDialog.Builder(ShowAccountActivity.this);
|
||||||
builderInner.setTitle(stringArrayConf[0]);
|
builderInner.setTitle(stringArrayConf[0]);
|
||||||
|
|
|
@ -192,6 +192,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
||||||
private View popup_trans;
|
private View popup_trans;
|
||||||
private AlertDialog dialogTrans;
|
private AlertDialog dialogTrans;
|
||||||
private AlertDialog alertDialogEmoji;
|
private AlertDialog alertDialogEmoji;
|
||||||
|
private String mentionAccount;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -289,6 +290,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
||||||
sharedContent = b.getString("sharedContent", null);
|
sharedContent = b.getString("sharedContent", null);
|
||||||
sharedContentIni = b.getString("sharedContent", null);
|
sharedContentIni = b.getString("sharedContent", null);
|
||||||
sharedSubject = b.getString("sharedSubject", null);
|
sharedSubject = b.getString("sharedSubject", null);
|
||||||
|
mentionAccount = b.getString("mentionAccount", null);
|
||||||
restoredScheduled = b.getBoolean("restoredScheduled", false);
|
restoredScheduled = b.getBoolean("restoredScheduled", false);
|
||||||
// ACTION_SEND route
|
// ACTION_SEND route
|
||||||
if (b.getInt("uriNumber", 0) == 1) {
|
if (b.getInt("uriNumber", 0) == 1) {
|
||||||
|
@ -307,7 +309,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
||||||
}
|
}
|
||||||
restored = b.getLong("restored", -1);
|
restored = b.getLong("restored", -1);
|
||||||
}
|
}
|
||||||
initialContent = toot_content.getText().toString();
|
|
||||||
if(restoredScheduled){
|
if(restoredScheduled){
|
||||||
toot_it.setVisibility(View.GONE);
|
toot_it.setVisibility(View.GONE);
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
@ -327,6 +329,11 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
||||||
else
|
else
|
||||||
userId = accountReply.getId();
|
userId = accountReply.getId();
|
||||||
|
|
||||||
|
if( mentionAccount != null){
|
||||||
|
toot_content.setText(String.format("@%s\n", mentionAccount));
|
||||||
|
toot_content.setSelection(toot_content.getText().length());
|
||||||
|
toot_space_left.setText(String.valueOf(toot_content.length()));
|
||||||
|
}
|
||||||
if( tootMention != null && urlMention != null && fileMention != null) {
|
if( tootMention != null && urlMention != null && fileMention != null) {
|
||||||
Bitmap pictureMention = BitmapFactory.decodeFile(getCacheDir() + "/" + fileMention);
|
Bitmap pictureMention = BitmapFactory.decodeFile(getCacheDir() + "/" + fileMention);
|
||||||
if (pictureMention != null) {
|
if (pictureMention != null) {
|
||||||
|
@ -342,6 +349,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
||||||
toot_content.setText(String.format("\n\nvia @%s\n\n%s\n\n", tootMention, urlMention));
|
toot_content.setText(String.format("\n\nvia @%s\n\n%s\n\n", tootMention, urlMention));
|
||||||
toot_space_left.setText(String.valueOf(toot_content.length()));
|
toot_space_left.setText(String.valueOf(toot_content.length()));
|
||||||
}
|
}
|
||||||
|
initialContent = toot_content.getText().toString();
|
||||||
Account account;
|
Account account;
|
||||||
if( accountReply == null)
|
if( accountReply == null)
|
||||||
account = new AccountDAO(getApplicationContext(),db).getAccountByID(userId);
|
account = new AccountDAO(getApplicationContext(),db).getAccountByID(userId);
|
||||||
|
@ -1736,7 +1744,7 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
||||||
//Nothing to store here....
|
//Nothing to store here....
|
||||||
if(toot_content.getText().toString().trim().length() == 0 && (attachments == null || attachments.size() <1) && toot_cw_content.getText().toString().trim().length() == 0)
|
if(toot_content.getText().toString().trim().length() == 0 && (attachments == null || attachments.size() <1) && toot_cw_content.getText().toString().trim().length() == 0)
|
||||||
return;
|
return;
|
||||||
if( initialContent.equals(toot_content.getText().toString()))
|
if( initialContent.trim().equals(toot_content.getText().toString().trim()))
|
||||||
return;
|
return;
|
||||||
Status toot = new Status();
|
Status toot = new Status();
|
||||||
toot.setSensitive(isSensitive);
|
toot.setSensitive(isSensitive);
|
||||||
|
|
|
@ -26,4 +26,9 @@
|
||||||
android:title="@string/more_action_2"
|
android:title="@string/more_action_2"
|
||||||
android:icon="@drawable/ic_block"
|
android:icon="@drawable/ic_block"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_mention"
|
||||||
|
android:title="@string/more_action_7"
|
||||||
|
android:icon="@drawable/ic_chat_bubble_outline"
|
||||||
|
app:showAsAction="ifRoom" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
Loading…
Reference in New Issue