diff --git a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java index 37c06f9..16c7b91 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java @@ -151,12 +151,14 @@ public class MainActivity extends AppCompatActivity { MenuItem myVideosItem = menu.findItem(R.id.action_myvideos); MenuItem playslistItem = menu.findItem(R.id.action_playlist); MenuItem historyItem = menu.findItem(R.id.action_history); + MenuItem settingsItem = menu.findItem(R.id.action_settings); if (Helper.isLoggedIn(MainActivity.this)) { instanceItem.setVisible(false); uploadItem.setVisible(true); myVideosItem.setVisible(true); playslistItem.setVisible(true); historyItem.setVisible(true); + settingsItem.setVisible(false); final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null); String instance = Helper.getLiveInstance(MainActivity.this); @@ -171,6 +173,7 @@ public class MainActivity extends AppCompatActivity { myVideosItem.setVisible(false); playslistItem.setVisible(false); historyItem.setVisible(false); + settingsItem.setVisible(true); } return true; } @@ -184,6 +187,9 @@ public class MainActivity extends AppCompatActivity { showRadioButtonDialog(); } return true; + } else if (item.getItemId() == R.id.action_settings) { + Intent intent = new Intent(MainActivity.this, SettingsActivity.class); + startActivity(intent); } else if (item.getItemId() == R.id.action_account) { Intent intent; if (Helper.isLoggedIn(MainActivity.this)) { diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index d6b3035..a3f1b5e 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -648,10 +648,8 @@ public class PeertubeActivity extends AppCompatActivity { setFullscreen(FullScreenMediaController.fullscreen.OFF); } change(); - } - public void manageVIewComment(APIResponse apiResponse) { if (apiResponse == null || (apiResponse.getError() != null && apiResponse.getError().getStatusCode() != 404 && apiResponse.getError() != null && apiResponse.getError().getStatusCode() != 501)) { if (apiResponse == null) @@ -678,7 +676,6 @@ public class PeertubeActivity extends AppCompatActivity { } } - @Override public void onDestroy() { super.onDestroy(); @@ -686,6 +683,9 @@ public class PeertubeActivity extends AppCompatActivity { player.setPlayWhenReady(false); player.release(); } + if (fullScreenDialog != null && fullScreenDialog.isShowing()) { + fullScreenDialog.dismiss(); + } } @Override @@ -808,6 +808,7 @@ public class PeertubeActivity extends AppCompatActivity { fullScreenDialog.addContentView(playerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); fullScreenIcon.setImageDrawable(ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_fullscreen_exit_24)); fullScreenMode = true; + fullScreenDialog.show(); } diff --git a/app/src/main/res/drawable/ic_baseline_settings_24.xml b/app/src/main/res/drawable/ic_baseline_settings_24.xml new file mode 100644 index 0000000..a7c7678 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_settings_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/menu/main_menu.xml b/app/src/main/res/menu/main_menu.xml index 903eb43..b549790 100644 --- a/app/src/main/res/menu/main_menu.xml +++ b/app/src/main/res/menu/main_menu.xml @@ -40,6 +40,11 @@ android:icon="@drawable/ic_baseline_history_24" android:title="@string/my_history" app:showAsAction="ifRoom" /> +