Reorder menu

This commit is contained in:
Thomas 2020-06-30 17:33:23 +02:00
parent dae411e938
commit d6fbba857f
2 changed files with 9 additions and 7 deletions

View File

@ -74,15 +74,17 @@ public class MainActivity extends AppCompatActivity {
return false;
}
});
MenuItem instanceItem = menu.findItem(R.id.action_change_instance);
MenuItem uploadItem = menu.findItem(R.id.action_upload);
MenuItem myVideosItem = menu.findItem(R.id.action_myvideos);
MenuItem playslistItem = menu.findItem(R.id.action_playlist);
if (Helper.isLoggedIn(MainActivity.this)) {
instanceItem.setVisible(false);
uploadItem.setVisible(true);
myVideosItem.setVisible(true);
playslistItem.setVisible(true);
} else {
instanceItem.setVisible(true);
uploadItem.setVisible(false);
myVideosItem.setVisible(false);
playslistItem.setVisible(false);

View File

@ -15,7 +15,11 @@
android:icon="@drawable/ic_baseline_track_changes_24"
android:title="@string/change_instance"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_playlist"
android:icon="@drawable/ic_baseline_playlist_play_24"
android:title="@string/playlists"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_account"
android:icon="@drawable/ic_outline_account_circle_24"
@ -31,9 +35,5 @@
android:icon="@drawable/ic_baseline_personal_video_24"
android:title="@string/my_videos"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_playlist"
android:icon="@drawable/ic_baseline_playlist_play_24"
android:title="@string/playlists"
app:showAsAction="ifRoom" />
</menu>