From 8805638d52218f231d803251ad8c80e5d2b8e082 Mon Sep 17 00:00:00 2001 From: Stefan Schueller Date: Sun, 27 Jan 2019 16:00:30 +0100 Subject: [PATCH 1/9] Larger fullscreen button target --- .../schueller/peertube/fragment/VideoPlayerFragment.java | 8 +++++--- app/src/main/res/layout/video_playback_controls.xml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java index b92023d..62e8d24 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java @@ -138,9 +138,11 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL torrentStatus = activity.findViewById(R.id.exo_torrent_status); // Full screen Icon - TextView fullscreenButton = activity.findViewById(R.id.exo_fullscreen); - fullscreenButton.setText(R.string.video_expand_icon); - new Iconics.IconicsBuilder().ctx(context).on(fullscreenButton).build(); + TextView fullscreenText = activity.findViewById(R.id.exo_fullscreen); + FrameLayout fullscreenButton = activity.findViewById(R.id.exo_fullscreen_button); + + fullscreenText.setText(R.string.video_expand_icon); + new Iconics.IconicsBuilder().ctx(context).on(fullscreenText).build(); fullscreenButton.setOnClickListener(view -> { Log.d(TAG, "Fullscreen"); diff --git a/app/src/main/res/layout/video_playback_controls.xml b/app/src/main/res/layout/video_playback_controls.xml index f15235b..beeb5fc 100644 --- a/app/src/main/res/layout/video_playback_controls.xml +++ b/app/src/main/res/layout/video_playback_controls.xml @@ -109,8 +109,8 @@ Date: Sun, 27 Jan 2019 16:17:28 +0100 Subject: [PATCH 2/9] - Removed extra spacing - Fixed duration colors --- app/src/main/res/layout/row_video.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/row_video.xml b/app/src/main/res/layout/row_video.xml index c8d2a26..16e7546 100644 --- a/app/src/main/res/layout/row_video.xml +++ b/app/src/main/res/layout/row_video.xml @@ -5,14 +5,19 @@ android:layout_height="wrap_content" card_view:cardCornerRadius="0dp" card_view:cardElevation="0dp" - card_view:cardUseCompatPadding="true"> + card_view:contentPadding="0dp" + card_view:cardPreventCornerOverlap="false" + card_view:cardUseCompatPadding="false"> + android:paddingTop="0dp" + android:paddingRight="0dp" + android:paddingLeft="0dp" + android:paddingBottom="8dp"> Date: Sun, 27 Jan 2019 16:22:44 +0100 Subject: [PATCH 3/9] - Duration display adjustment - Avatar click to owner page --- .../net/schueller/peertube/adapter/VideoAdapter.java | 9 ++++++++- app/src/main/res/layout/row_video.xml | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java b/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java index cccdb33..e55e40b 100644 --- a/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java +++ b/app/src/main/java/net/schueller/peertube/adapter/VideoAdapter.java @@ -107,13 +107,20 @@ public class VideoAdapter extends RecyclerView.Adapter { Intent intent = new Intent(context, AccountActivity.class); intent.putExtra(EXTRA_ACCOUNTDISPLAYNAME, displayNameAndHost); context.startActivity(intent); }); + // avatar click + holder.avatar.setOnClickListener(v -> { + Intent intent = new Intent(context, AccountActivity.class); + intent.putExtra(EXTRA_ACCOUNTDISPLAYNAME, displayNameAndHost); + context.startActivity(intent); + }); + holder.mView.setOnClickListener(v -> { // Log.v("VideoAdapter", "click: " + videoList.get(position).getName()); diff --git a/app/src/main/res/layout/row_video.xml b/app/src/main/res/layout/row_video.xml index 16e7546..afc2c1e 100644 --- a/app/src/main/res/layout/row_video.xml +++ b/app/src/main/res/layout/row_video.xml @@ -30,6 +30,7 @@ android:scaleType="fitXY" /> + android:background="#232323"/> Date: Sun, 27 Jan 2019 16:29:59 +0100 Subject: [PATCH 4/9] - Added avatar to account view --- .../peertube/activity/AccountActivity.java | 14 ++++++++++++++ app/src/main/res/layout/activity_account.xml | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java b/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java index 3c15e1e..0c70e66 100644 --- a/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java @@ -23,6 +23,7 @@ import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.View; +import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; @@ -30,6 +31,7 @@ import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.LabelVisibilityMode; import com.mikepenz.fontawesome_typeface_library.FontAwesome; import com.mikepenz.iconics.IconicsDrawable; +import com.squareup.picasso.Picasso; import net.schueller.peertube.R; import net.schueller.peertube.adapter.ChannelAdapter; @@ -37,6 +39,7 @@ import net.schueller.peertube.adapter.VideoAdapter; import net.schueller.peertube.helper.APIUrlHelper; import net.schueller.peertube.helper.MetaDataHelper; import net.schueller.peertube.model.Account; +import net.schueller.peertube.model.Avatar; import net.schueller.peertube.model.ChannelList; import net.schueller.peertube.model.VideoList; import net.schueller.peertube.network.GetUserService; @@ -191,6 +194,17 @@ public class AccountActivity extends CommonActivity { joined.setText(account.getCreatedAt().toString()); + ImageView accountAvatar = findViewById(R.id.account_avatar); + + // set Avatar + Avatar avatar = account.getAvatar(); + if (avatar != null) { + String avatarPath = avatar.getPath(); + Picasso.with(AccountActivity.this) + .load(APIUrlHelper.getUrl(AccountActivity.this) + avatarPath) + .into(accountAvatar); + } + } else { Toast.makeText(AccountActivity.this, getString(R.string.api_error), Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index 15b09c1..0a1283b 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -45,6 +45,15 @@ android:layout_marginEnd="12dp" android:orientation="vertical"> + + Date: Sun, 27 Jan 2019 16:53:55 +0100 Subject: [PATCH 5/9] - Moved account to top menu - Added overview placeholder (to be implemented later) - Refactored keys --- README.md | 2 + .../peertube/activity/VideoListActivity.java | 113 ++++++++++++++---- .../main/res/menu/menu_bottom_video_list.xml | 17 ++- app/src/main/res/menu/menu_top_videolist.xml | 7 ++ app/src/main/res/values-ar/strings.xml | 2 +- app/src/main/res/values-bn/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-tr/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values/strings.xml | 8 +- 11 files changed, 122 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index cca7e40..d1d3a12 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ Android PeerTube Client +

[![Latest release](https://img.shields.io/github/release/sschueller/peertube-android.svg)](https://github.com/sschueller/peertube-android/releases/latest) [![F-Droid](https://img.shields.io/f-droid/v/net.schueller.peertube.svg)](https://f-droid.org/de/packages/net.schueller.peertube/) +

diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index f69700a..f851b73 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -26,18 +26,22 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.preference.PreferenceManager; import android.provider.SearchRecentSuggestions; + import androidx.annotation.NonNull; import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.LabelVisibilityMode; + import androidx.core.app.ActivityCompat; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + import android.os.Bundle; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.appcompat.widget.SearchView; import androidx.appcompat.widget.Toolbar; + import android.util.Log; import android.view.Menu; import android.view.MenuInflater; @@ -45,8 +49,10 @@ import android.view.MenuItem; import android.view.View; import android.widget.TextView; import android.widget.Toast; + import com.mikepenz.fontawesome_typeface_library.FontAwesome; import com.mikepenz.iconics.IconicsDrawable; + import net.schueller.peertube.R; import net.schueller.peertube.adapter.VideoAdapter; import net.schueller.peertube.helper.APIUrlHelper; @@ -119,6 +125,9 @@ public class VideoListActivity extends CommonActivity { menu.findItem(R.id.action_settings).setIcon( new IconicsDrawable(this, FontAwesome.Icon.faw_cog).actionBar()); + menu.findItem(R.id.action_account).setIcon( + new IconicsDrawable(this, FontAwesome.Icon.faw_user_circle).actionBar()); + MenuItem searchMenuItem = menu.findItem(R.id.action_search); searchMenuItem.setIcon( @@ -178,10 +187,19 @@ public class VideoListActivity extends CommonActivity { return false; case R.id.action_settings: // Toast.makeText(this, "Login Selected", Toast.LENGTH_SHORT).show(); - Intent intent = new Intent(this, SettingsActivity.class); - this.startActivity(intent); + Intent intentSettings = new Intent(this, SettingsActivity.class); + this.startActivity(intentSettings); return true; + case R.id.action_account: + if (!Session.getInstance().isLoggedIn()) { + Intent intentLogin = new Intent(this, LoginActivity.class); + this.startActivity(intentLogin); + } else { + Intent intentMe = new Intent(this, MeActivity.class); + this.startActivity(intentMe); + } + return false; default: break; } @@ -350,23 +368,24 @@ public class VideoListActivity extends CommonActivity { // Add Icon font Menu navMenu = navigation.getMenu(); - navMenu.findItem(R.id.navigation_home).setIcon( - new IconicsDrawable(this, FontAwesome.Icon.faw_home)); + navMenu.findItem(R.id.navigation_overview).setIcon( + new IconicsDrawable(this, FontAwesome.Icon.faw_globe)); navMenu.findItem(R.id.navigation_trending).setIcon( new IconicsDrawable(this, FontAwesome.Icon.faw_fire)); + navMenu.findItem(R.id.navigation_recent).setIcon( + new IconicsDrawable(this, FontAwesome.Icon.faw_plus_circle)); navMenu.findItem(R.id.navigation_local).setIcon( new IconicsDrawable(this, FontAwesome.Icon.faw_home)); navMenu.findItem(R.id.navigation_subscriptions).setIcon( new IconicsDrawable(this, FontAwesome.Icon.faw_folder)); - navMenu.findItem(R.id.navigation_account).setIcon( - new IconicsDrawable(this, FontAwesome.Icon.faw_user_circle)); +// navMenu.findItem(R.id.navigation_account).setIcon( +// new IconicsDrawable(this, FontAwesome.Icon.faw_user_circle)); // Click Listener navigation.setOnNavigationItemSelectedListener(menuItem -> { switch (menuItem.getItemId()) { - case R.id.navigation_home: - //Log.v(TAG, "navigation_home"); - + case R.id.navigation_overview: + // TODO if (!isLoading) { sort = "-createdAt"; currentStart = 0; @@ -387,6 +406,16 @@ public class VideoListActivity extends CommonActivity { loadVideos(currentStart, count, sort, filter); } + return true; + case R.id.navigation_recent: + if (!isLoading) { + sort = "-createdAt"; + currentStart = 0; + filter = null; + subscriptions = false; + loadVideos(currentStart, count, sort, filter); + } + return true; case R.id.navigation_local: //Log.v(TAG, "navigation_trending"); @@ -420,23 +449,63 @@ public class VideoListActivity extends CommonActivity { } - case R.id.navigation_account: - //Log.v(TAG, "navigation_account"); - //Toast.makeText(VideoListActivity.this, "Account Not Implemented", Toast.LENGTH_SHORT).show(); - - if (!Session.getInstance().isLoggedIn()) { - Intent intent = new Intent(this, LoginActivity.class); - this.startActivity(intent); - } else { - Intent intent = new Intent(this, MeActivity.class); - this.startActivity(intent); - } - - return false; +// case R.id.navigation_account: +// //Log.v(TAG, "navigation_account"); +// //Toast.makeText(VideoListActivity.this, "Account Not Implemented", Toast.LENGTH_SHORT).show(); +// +// if (!Session.getInstance().isLoggedIn()) { +// Intent intent = new Intent(this, LoginActivity.class); +// this.startActivity(intent); +// } else { +// Intent intent = new Intent(this, MeActivity.class); +// this.startActivity(intent); +// } +// +// return false; } return false; }); + // TODO: on double click jump to top and reload +// navigation.setOnNavigationItemReselectedListener(menuItemReselected -> { +// switch (menuItemReselected.getItemId()) { +// case R.id.navigation_home: +// if (!isLoading) { +// sort = "-createdAt"; +// currentStart = 0; +// filter = null; +// subscriptions = false; +// loadVideos(currentStart, count, sort, filter); +// } +// case R.id.navigation_trending: +// if (!isLoading) { +// sort = "-trending"; +// currentStart = 0; +// filter = null; +// subscriptions = false; +// loadVideos(currentStart, count, sort, filter); +// } +// case R.id.navigation_local: +// if (!isLoading) { +// sort = "-publishedAt"; +// filter = "local"; +// currentStart = 0; +// subscriptions = false; +// loadVideos(currentStart, count, sort, filter); +// } +// case R.id.navigation_subscriptions: +// if (Session.getInstance().isLoggedIn()) { +// if (!isLoading) { +// sort = "-publishedAt"; +// filter = null; +// currentStart = 0; +// subscriptions = true; +// loadVideos(currentStart, count, sort, filter); +// } +// } +// } +// }); + } } diff --git a/app/src/main/res/menu/menu_bottom_video_list.xml b/app/src/main/res/menu/menu_bottom_video_list.xml index 2d4e290..990d2d9 100644 --- a/app/src/main/res/menu/menu_bottom_video_list.xml +++ b/app/src/main/res/menu/menu_bottom_video_list.xml @@ -3,8 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> + + - + + + + diff --git a/app/src/main/res/menu/menu_top_videolist.xml b/app/src/main/res/menu/menu_top_videolist.xml index b63fae3..121e62d 100644 --- a/app/src/main/res/menu/menu_top_videolist.xml +++ b/app/src/main/res/menu/menu_top_videolist.xml @@ -19,4 +19,11 @@ android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption" app:showAsAction="ifRoom" /> + + \ No newline at end of file diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 37a45b8..1d8746c 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -22,7 +22,7 @@ الإعدادات - الرئيسية + الرئيسية المتصدرة الإشتراكات الحساب diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 97bc39a..264c8d8 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -25,7 +25,7 @@ " লগআউট" - হোম + হোম "Trending" Subscriptions একাউন্ট diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index f31f9c9..8f4f8d4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -23,7 +23,7 @@ Paramètres - Accueil + Accueil Tendances Abonnements Compte diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index c15328e..34b64a9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -21,7 +21,7 @@ Выйти - Домашняя + Домашняя Популярные Подписки Аккаунт diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index a4534ed..5e0e37e 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -24,7 +24,7 @@ Çıkış yap - Ev + Ev Eğilimler Abonelikler Hesap diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0fe712e..87c7c7b 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -6,7 +6,7 @@ 服务 设置 搜索 - 主页 + 主页 趋势 订阅 帐号 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9e96b61..8db3e6b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,11 +23,15 @@ Search Settings Logout + Account - Home + Overview Trending + Recent + Local Subscriptions + Account @@ -300,7 +304,6 @@ Background Playback If enabled, continues to play video in background. - Local Account Report @@ -342,5 +345,4 @@ like dislike - From 3d4d74ef7b899f36b37e9b6229705f3359af18be Mon Sep 17 00:00:00 2001 From: Stefan Schueller Date: Sun, 27 Jan 2019 16:56:36 +0100 Subject: [PATCH 6/9] - Fixed download button wrapping --- app/src/main/res/layout/fragment_video_meta.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/fragment_video_meta.xml b/app/src/main/res/layout/fragment_video_meta.xml index d434647..1db093d 100644 --- a/app/src/main/res/layout/fragment_video_meta.xml +++ b/app/src/main/res/layout/fragment_video_meta.xml @@ -75,7 +75,7 @@ android:orientation="horizontal"> @@ -102,7 +102,7 @@ android:layout_weight="1" /> @@ -129,7 +129,7 @@ android:layout_weight="1" /> @@ -157,7 +157,7 @@ android:layout_weight="1" /> From 88b53324eab30a1e71347150463f2ffa35caad82 Mon Sep 17 00:00:00 2001 From: Stefan Schueller Date: Sun, 27 Jan 2019 17:08:00 +0100 Subject: [PATCH 7/9] - Fixed player control positions - Added fade to player controls --- .../main/res/layout/fragment_video_player.xml | 1 + .../main/res/layout/video_playback_controls.xml | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/layout/fragment_video_player.xml b/app/src/main/res/layout/fragment_video_player.xml index f05d160..5f9591c 100644 --- a/app/src/main/res/layout/fragment_video_player.xml +++ b/app/src/main/res/layout/fragment_video_player.xml @@ -6,6 +6,7 @@ android:layout_height="match_parent"> + android:layout_weight="1" + /> + android:paddingTop="8dp"> - - + android:layout_weight="1" + /> From b607e08f0e94312196d8b8b24f6ab910f1607eb4 Mon Sep 17 00:00:00 2001 From: Stefan Schueller Date: Sun, 27 Jan 2019 17:11:22 +0100 Subject: [PATCH 8/9] - Version 1.0.26 --- CHANGELOG.md | 10 ++++++++++ app/build.gradle | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea2b717..0269056 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +### Version 1.0.26 Tag: v1.0.26 (2019-01-27) + * Larger fullscreen button target + * Fixed duration colors + * Avatar click to owner page + * Added avatar to account view + * Moved account to top menu + * Added overview placeholder + * Fixed download button wrapping + * Added fade to player controls + ### Version 1.0.25 Tag: v1.0.25 (2019-01-20) * Account overview page and videos list * Turkish (tr) Translation added (@oktay454) diff --git a/app/build.gradle b/app/build.gradle index 5b0ca7b..355efc8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "net.schueller.peertube" minSdkVersion 21 targetSdkVersion 28 - versionCode 1025 - versionName "1.0.25" + versionCode 1026 + versionName "1.0.26" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ext { libVersions = [ From a7af8ed2f248c7c9a960766455973bf02c0b211e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Sun, 27 Jan 2019 18:13:00 +0100 Subject: [PATCH 9/9] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d1d3a12..cca7e40 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,8 @@ Android PeerTube Client -

[![Latest release](https://img.shields.io/github/release/sschueller/peertube-android.svg)](https://github.com/sschueller/peertube-android/releases/latest) [![F-Droid](https://img.shields.io/f-droid/v/net.schueller.peertube.svg)](https://f-droid.org/de/packages/net.schueller.peertube/) -