Front end display user videos

This commit is contained in:
stom79 2019-01-07 17:00:03 +01:00
parent 5ee84010df
commit 0c1d123196
5 changed files with 37 additions and 4 deletions

View File

@ -861,7 +861,6 @@ public abstract class BaseMainActivity extends BaseActivity
//Scroll to top when top bar is clicked for favourites/blocked/muted
toolbarTitle.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
FragmentManager fragmentManager = getSupportFragmentManager();
Fragment fragment = (Fragment) viewPager.getAdapter().instantiateItem(viewPager, tabLayout.getSelectedTabPosition());
DisplayStatusFragment displayStatusFragment = ((DisplayStatusFragment) fragment);
displayStatusFragment.scrollToTop();
@ -2027,6 +2026,20 @@ public abstract class BaseMainActivity extends BaseActivity
fragmentTag = "FAVOURITES";
fragmentManager.beginTransaction()
.replace(R.id.main_app_container, statusFragment, fragmentTag).commit();
} else if (id == R.id.nav_my_video) {
bundle = new Bundle();
DisplayStatusFragment fragment = new DisplayStatusFragment();
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.USER);
bundle.putString("instanceType","PEERTUBE");
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
Account account = new AccountDAO(getApplicationContext(), db).getAccountByToken(token);
bundle.putString("targetedid",account.getUsername());
fragment.setArguments(bundle);
fragmentTag = "MY_VIDEOS";
fragmentManager.beginTransaction()
.replace(R.id.main_app_container, fragment, fragmentTag).commit();
} else if (id == R.id.nav_blocked) {
toot.hide();
accountsFragment = new DisplayAccountsFragment();

View File

@ -83,6 +83,7 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
POVERVIEW,
PTRENDING,
PRECENTLYADDED,
PMYVIDEOS,
PLOCAL,
CHANNEL
}
@ -284,6 +285,10 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
peertubeAPI = new PeertubeAPI(this.contextReference.get());
apiResponse = peertubeAPI.getLocalTL(max_id);
break;
case PMYVIDEOS:
peertubeAPI = new PeertubeAPI(this.contextReference.get());
apiResponse = peertubeAPI.getLocalTL(max_id);
break;
case HASHTAG:
break;
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6L2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM12,14.5v-9l6,4.5 -6,4.5z"/>
</vector>

View File

@ -61,13 +61,18 @@
android:icon="@drawable/ic_favorite_peertube_full"
android:title="@string/peertube_favorites" />
<item
android:id="@+id/nav_peertube_settings"
android:icon="@drawable/ic_settings"
android:title="@string/settings" />
android:id="@+id/nav_my_video"
android:icon="@drawable/ic_video_library"
android:title="@string/my_videos" />
<item
android:id="@+id/nav_upload"
android:icon="@drawable/ic_cloud_upload"
android:title="@string/upload_video" />
<item
android:id="@+id/nav_peertube_settings"
android:icon="@drawable/ic_settings"
android:title="@string/settings" />
</group>
</menu>
</item>

View File

@ -799,6 +799,7 @@
<string name="fullscreen">Full screen video</string>
<string name="set_video_mode">Mode for videos</string>
<string name="file_to_upload">Select the file to upload</string>
<string name="my_videos">My videos</string>
<!-- end languages -->