diff --git a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java
index dc47d13..42b8847 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java
@@ -34,6 +34,7 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
import org.jetbrains.annotations.NotNull;
+import app.fedilab.fedilabtube.asynctasks.RetrieveFeedsAsyncTask;
import app.fedilab.fedilabtube.asynctasks.RetrievePeertubeInformationAsyncTask;
import app.fedilab.fedilabtube.helper.Helper;
@@ -92,16 +93,19 @@ public class MainActivity extends AppCompatActivity {
MenuItem uploadItem = menu.findItem(R.id.action_upload);
MenuItem myVideosItem = menu.findItem(R.id.action_myvideos);
MenuItem playslistItem = menu.findItem(R.id.action_playlist);
+ MenuItem subscriptionItem = menu.findItem(R.id.action_subscription);
if (Helper.isLoggedIn(MainActivity.this)) {
instanceItem.setVisible(false);
uploadItem.setVisible(true);
myVideosItem.setVisible(true);
playslistItem.setVisible(true);
+ subscriptionItem.setVisible(true);
} else {
instanceItem.setVisible(true);
uploadItem.setVisible(false);
myVideosItem.setVisible(false);
playslistItem.setVisible(false);
+ subscriptionItem.setVisible(false);
}
return true;
}
@@ -121,9 +125,20 @@ public class MainActivity extends AppCompatActivity {
return true;
} else if (item.getItemId() == R.id.action_myvideos) {
Intent intent = new Intent(MainActivity.this, MyVideosActivity.class);
+ Bundle bundle = new Bundle();
+ bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.MYVIDEOS);
+ intent.putExtras(bundle);
startActivity(intent);
return true;
- } else if (item.getItemId() == R.id.action_playlist) {
+ } else if (item.getItemId() == R.id.action_subscription) {
+ Intent intent = new Intent(MainActivity.this, MyVideosActivity.class);
+ Bundle bundle = new Bundle();
+ bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.PSUBSCRIPTIONS);
+ intent.putExtras(bundle);
+ startActivity(intent);
+ return true;
+ }
+ else if (item.getItemId() == R.id.action_playlist) {
Intent intent = new Intent(MainActivity.this, AllPlaylistsActivity.class);
startActivity(intent);
return true;
diff --git a/app/src/main/java/app/fedilab/fedilabtube/MyVideosActivity.java b/app/src/main/java/app/fedilab/fedilabtube/MyVideosActivity.java
index 36d5dde..8ad2372 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/MyVideosActivity.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/MyVideosActivity.java
@@ -28,6 +28,7 @@ import app.fedilab.fedilabtube.interfaces.OnRetrieveFeedsInterface;
public class MyVideosActivity extends AppCompatActivity implements OnRetrieveFeedsInterface {
+ private RetrieveFeedsAsyncTask.Type type;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -37,13 +38,21 @@ public class MyVideosActivity extends AppCompatActivity implements OnRetrieveFee
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- setTitle(R.string.my_videos);
+ Bundle b = getIntent().getExtras();
+ if(b != null)
+ type = (RetrieveFeedsAsyncTask.Type) b.get("type");
+
+ if( type == RetrieveFeedsAsyncTask.Type.MYVIDEOS) {
+ setTitle(R.string.my_videos);
+ }else if (type == RetrieveFeedsAsyncTask.Type.PSUBSCRIPTIONS) {
+ setTitle(R.string.subscriptions);
+ }
if (savedInstanceState == null) {
DisplayStatusFragment displayStatusFragment = new DisplayStatusFragment();
Bundle bundle = new Bundle();
- bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.MYVIDEOS);
+ bundle.putSerializable("type", type);
displayStatusFragment.setArguments(bundle);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.container, displayStatusFragment).commit();
diff --git a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayStatusFragment.java b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayStatusFragment.java
index 78d8934..93cb56d 100644
--- a/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayStatusFragment.java
+++ b/app/src/main/java/app/fedilab/fedilabtube/fragment/DisplayStatusFragment.java
@@ -90,15 +90,18 @@ public class DisplayStatusFragment extends Fragment implements OnPostActionInter
context = getContext();
Bundle bundle = this.getArguments();
- if (getArguments() != null) {
- type = DisplayStatusFragmentArgs.fromBundle(getArguments()).getType();
- }
-
if (bundle != null) {
search_peertube = bundle.getString("search_peertube", null);
targetedId = bundle.getString("targetedid", null);
ischannel = bundle.getBoolean("ischannel", false);
+ type = (RetrieveFeedsAsyncTask.Type) bundle.get("type");
}
+
+ if (getArguments() != null && type == null) {
+ type = DisplayStatusFragmentArgs.fromBundle(getArguments()).getType();
+ }
+
+
if (ischannel) {
type = RetrieveFeedsAsyncTask.Type.CHANNEL;
}
diff --git a/app/src/main/res/drawable/ic_subscription.xml b/app/src/main/res/drawable/ic_subscription.xml
new file mode 100644
index 0000000..08a1047
--- /dev/null
+++ b/app/src/main/res/drawable/ic_subscription.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/main_menu.xml b/app/src/main/res/menu/main_menu.xml
index 86801fc..02ffb44 100644
--- a/app/src/main/res/menu/main_menu.xml
+++ b/app/src/main/res/menu/main_menu.xml
@@ -35,5 +35,9 @@
android:icon="@drawable/ic_baseline_personal_video_24"
android:title="@string/my_videos"
app:showAsAction="ifRoom" />
-
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d42610a..c3f86d1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -166,4 +166,5 @@
%1$s a été blacklisté]]>
%1$s n’est plus blacklisté]]>
Une erreur s’est produite ! L’instance n’a retourné aucun code d\autorisation !
+ Abonnements
\ No newline at end of file