Improve media activity
This commit is contained in:
parent
a6a4c7bca6
commit
1d9e27b4b4
|
@ -308,9 +308,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
final PopupMenu popup = new PopupMenu(ShowAccountActivity.this, account_menu);
|
||||
popup.getMenuInflater()
|
||||
.inflate(R.menu.main_showaccount, popup.getMenu());
|
||||
if( !Helper.canPin ) {
|
||||
popup.getMenu().findItem(R.id.action_show_pinned).setVisible(false);
|
||||
}
|
||||
|
||||
final String[] stringArrayConf;
|
||||
final boolean isOwner = account.getId().equals(userId);
|
||||
String[] splitAcct = account.getAcct().split("@");
|
||||
|
@ -324,6 +322,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
popup.getMenu().findItem(R.id.action_follow_instance).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_hide_boost).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_endorse).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_direct_message).setVisible(false);
|
||||
stringArrayConf = getResources().getStringArray(R.array.more_action_owner_confirm);
|
||||
}else {
|
||||
popup.getMenu().findItem(R.id.action_block).setVisible(true);
|
||||
|
@ -412,21 +411,13 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
new PostActionAsyncTask(getApplicationContext(), API.StatusAction.SHOW_BOOST, account.getId(), ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
return true;
|
||||
case R.id.action_show_pinned:
|
||||
showPinned = !showPinned;
|
||||
if( tabLayout.getTabAt(0) != null)
|
||||
//noinspection ConstantConditions
|
||||
tabLayout.getTabAt(0).select();
|
||||
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||
mPager.setAdapter(mPagerAdapter);
|
||||
return true;
|
||||
case R.id.action_show_media:
|
||||
showMediaOnly = !showMediaOnly;
|
||||
if( tabLayout.getTabAt(0) != null)
|
||||
//noinspection ConstantConditions
|
||||
tabLayout.getTabAt(0).select();
|
||||
mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||
mPager.setAdapter(mPagerAdapter);
|
||||
case R.id.action_direct_message:
|
||||
Intent intent = new Intent(getApplicationContext(), TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("mentionAccount", account.getAcct());
|
||||
b.putString("visibility", "direct");
|
||||
intent.putExtras(b);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
case R.id.action_open_browser:
|
||||
if( accountUrl != null) {
|
||||
|
@ -436,8 +427,8 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
|||
}
|
||||
return true;
|
||||
case R.id.action_mention:
|
||||
Intent intent = new Intent(getApplicationContext(), TootActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
intent = new Intent(getApplicationContext(), TootActivity.class);
|
||||
b = new Bundle();
|
||||
b.putString("mentionAccount", account.getAcct());
|
||||
intent.putExtras(b);
|
||||
startActivity(intent);
|
||||
|
|
|
@ -295,6 +295,7 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
|||
mentionAccount = b.getString("mentionAccount", null);
|
||||
idRedirect = b.getString("idRedirect", null);
|
||||
removed = b.getBoolean("removed");
|
||||
visibility = b.getString("visibility", null);
|
||||
restoredScheduled = b.getBoolean("restoredScheduled", false);
|
||||
// ACTION_SEND route
|
||||
if (b.getInt("uriNumberMast", 0) == 1) {
|
||||
|
@ -428,8 +429,10 @@ public class TootActivity extends BaseActivity implements OnRetrieveSearcAccount
|
|||
|
||||
|
||||
if( tootReply == null) {
|
||||
String defaultVisibility = account.isLocked()?"private":"public";
|
||||
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
|
||||
if( visibility == null) {
|
||||
String defaultVisibility = account.isLocked() ? "private" : "public";
|
||||
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
|
||||
}
|
||||
switch (visibility) {
|
||||
case "public":
|
||||
toot_visibility.setImageResource(R.drawable.ic_public_toot);
|
||||
|
|
|
@ -985,9 +985,13 @@ public class API {
|
|||
action = String.format("/accounts/%s/unpin", targetedId);
|
||||
break;
|
||||
case SHOW_BOOST:
|
||||
params = new HashMap<>();
|
||||
params.put("reblogs","true");
|
||||
action = String.format("/accounts/%s/follow", targetedId);
|
||||
break;
|
||||
case HIDE_BOOST:
|
||||
params = new HashMap<>();
|
||||
params.put("reblogs","false");
|
||||
action = String.format("/accounts/%s/follow", targetedId);
|
||||
break;
|
||||
case UNSTATUS:
|
||||
|
|
|
@ -32,6 +32,5 @@
|
|||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="70dp"
|
||||
/>
|
||||
</LinearLayout>
|
|
@ -2,20 +2,15 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_show_pinned"
|
||||
android:title="@string/pinned_toots"
|
||||
android:icon="@drawable/ic_pin_drop"
|
||||
android:id="@+id/action_direct_message"
|
||||
android:title="@string/direct_message"
|
||||
android:icon="@drawable/ic_mail_outline_toot"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_open_browser"
|
||||
android:title="@string/action_open_in_web"
|
||||
android:icon="@drawable/ic_open_with"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_show_media"
|
||||
android:title="@string/media"
|
||||
android:icon="@drawable/ic_perm_media"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_mute"
|
||||
android:title="@string/more_action_1"
|
||||
|
|
|
@ -569,6 +569,7 @@
|
|||
<string name="toast_unendorse">The account is no longer featured on profile</string>
|
||||
<string name="toast_show_boost">Boosts are now shown!</string>
|
||||
<string name="toast_hide_boost">Boosts are now hidden!</string>
|
||||
<string name="direct_message">Direct message</string>
|
||||
|
||||
|
||||
<string-array translatable="false" name="proxy_type_choice">
|
||||
|
|
Loading…
Reference in New Issue