mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-24 00:50:32 +00:00
Add duration view to video detail fragment
- Add "textAllCaps" to the mini stream layout - Closes #609
This commit is contained in:
parent
594c55afa6
commit
562f7e7e41
@ -16,7 +16,6 @@ import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.animation.FastOutSlowInInterpolator;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
@ -92,8 +91,6 @@ import io.reactivex.Single;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.functions.Function;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
import static org.schabi.newpipe.util.AnimationUtils.animateView;
|
||||
@ -138,9 +135,9 @@ public class VideoDetailFragment
|
||||
/*//////////////////////////////////////////////////////////////////////////
|
||||
// Views
|
||||
//////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
private Menu menu;
|
||||
|
||||
private Toolbar toolbar;
|
||||
private Spinner spinnerToolbar;
|
||||
|
||||
private ParallaxScrollView parallaxScrollRootView;
|
||||
@ -160,6 +157,7 @@ public class VideoDetailFragment
|
||||
private TextView detailControlsAddToPlaylist;
|
||||
private TextView detailControlsDownload;
|
||||
private TextView appendControlsDetail;
|
||||
private TextView detailDurationView;
|
||||
|
||||
private LinearLayout videoDescriptionRootLayout;
|
||||
private TextView videoUploadDateView;
|
||||
@ -461,9 +459,7 @@ public class VideoDetailFragment
|
||||
@Override
|
||||
protected void initViews(View rootView, Bundle savedInstanceState) {
|
||||
super.initViews(rootView, savedInstanceState);
|
||||
|
||||
toolbar = activity.findViewById(R.id.toolbar);
|
||||
spinnerToolbar = toolbar.findViewById(R.id.toolbar_spinner);
|
||||
spinnerToolbar = activity.findViewById(R.id.toolbar).findViewById(R.id.toolbar_spinner);
|
||||
|
||||
parallaxScrollRootView = rootView.findViewById(R.id.detail_main_content);
|
||||
|
||||
@ -483,6 +479,7 @@ public class VideoDetailFragment
|
||||
detailControlsAddToPlaylist = rootView.findViewById(R.id.detail_controls_playlist_append);
|
||||
detailControlsDownload = rootView.findViewById(R.id.detail_controls_download);
|
||||
appendControlsDetail = rootView.findViewById(R.id.touch_append_detail);
|
||||
detailDurationView = rootView.findViewById(R.id.detail_duration_view);
|
||||
|
||||
videoDescriptionRootLayout = rootView.findViewById(R.id.detail_description_root_layout);
|
||||
videoUploadDateView = rootView.findViewById(R.id.detail_upload_date_view);
|
||||
@ -1098,6 +1095,7 @@ public class VideoDetailFragment
|
||||
animateView(contentRootLayoutHiding, false, 200);
|
||||
animateView(spinnerToolbar, false, 200);
|
||||
animateView(thumbnailPlayButton, false, 50);
|
||||
animateView(detailDurationView, false, 100);
|
||||
|
||||
videoTitleTextView.setText(name != null ? name : "");
|
||||
videoTitleTextView.setMaxLines(1);
|
||||
@ -1168,6 +1166,18 @@ public class VideoDetailFragment
|
||||
thumbsDisabledTextView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (info.getDuration() > 0) {
|
||||
detailDurationView.setText(Localization.getDurationString(info.getDuration()));
|
||||
detailDurationView.setBackgroundColor(ContextCompat.getColor(activity, R.color.duration_background_color));
|
||||
animateView(detailDurationView, true, 100);
|
||||
} else if (info.getStreamType() == StreamType.LIVE_STREAM) {
|
||||
detailDurationView.setText(R.string.duration_live);
|
||||
detailDurationView.setBackgroundColor(ContextCompat.getColor(activity, R.color.live_duration_background_color));
|
||||
animateView(detailDurationView, true, 100);
|
||||
} else {
|
||||
detailDurationView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
videoTitleRoot.setClickable(true);
|
||||
videoTitleToggleArrow.setVisibility(View.VISIBLE);
|
||||
videoTitleToggleArrow.setImageResource(R.drawable.arrow_down);
|
||||
@ -1201,7 +1211,6 @@ public class VideoDetailFragment
|
||||
case AUDIO_LIVE_STREAM:
|
||||
detailControlsDownload.setVisibility(View.GONE);
|
||||
spinnerToolbar.setVisibility(View.GONE);
|
||||
toolbar.setTitle(R.string.live);
|
||||
break;
|
||||
default:
|
||||
if (!info.video_streams.isEmpty() || !info.video_only_streams.isEmpty()) break;
|
||||
|
@ -70,6 +70,31 @@
|
||||
android:visibility="gone"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_duration_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:alpha=".6"
|
||||
android:background="#23000000"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="2dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingTop="2dp"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:ignore="RtlHardcoded"
|
||||
tools:text="12:38"
|
||||
tools:visibility="visible"/>
|
||||
</FrameLayout>
|
||||
|
||||
<!-- CONTENT -->
|
||||
|
@ -36,6 +36,7 @@
|
||||
android:paddingLeft="@dimen/video_item_search_duration_horizontal_padding"
|
||||
android:paddingRight="@dimen/video_item_search_duration_horizontal_padding"
|
||||
android:paddingTop="@dimen/video_item_search_duration_vertical_padding"
|
||||
android:textAllCaps="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/duration_text_color"
|
||||
android:textSize="@dimen/video_item_search_duration_text_size"
|
||||
|
@ -408,7 +408,6 @@ abrir en modo popup</string>
|
||||
<string name="use_inexact_seek_summary">La búsqueda inexacta permite al reproductor buscar posiciones más rápido con menor precisión</string>
|
||||
<string name="auto_queue_title">Auto-encolar la siguiente transmisión</string>
|
||||
<string name="auto_queue_summary">"Automáticamente añadir un vídeo relacionado cuando el reproductor llegue al último vídeo en una lista de reproducción no repetible. "</string>
|
||||
<string name="live">DIRECTO</string>
|
||||
<string name="live_sync">SINCRONIZAR</string>
|
||||
|
||||
</resources>
|
||||
|
@ -308,5 +308,4 @@
|
||||
<string name="export_data_title">יצוא מסד נתונים</string>
|
||||
<string name="external_player_unsupported_link_type">נגנים חיצוניים לא תומכים בסוגי קישורים אלה</string>
|
||||
<string name="invalid_url_toast">כתובת שגויה</string>
|
||||
<string name="live">חי</string>
|
||||
</resources>
|
||||
|
@ -409,7 +409,6 @@
|
||||
<string name="use_inexact_seek_summary">La ricerca imprecisa permette al riproduttore di spostarti nelle posizioni più velocemente con una precisione ridotta</string>
|
||||
<string name="auto_queue_title">Metti in coda automaticamente il prossimo flusso</string>
|
||||
<string name="auto_queue_summary">Aggiungi automaticamente un flusso correlato mentre il playback parte dall\'ultimo flusso in una cosa non ripetitiva.</string>
|
||||
<string name="live">IN DIRETTA</string>
|
||||
<string name="live_sync">SINCRONIZZAZIONE</string>
|
||||
|
||||
</resources>
|
||||
|
@ -404,7 +404,6 @@ te openen in pop-upmodus</string>
|
||||
<string name="use_inexact_seek_summary">Minder exact spoelen laat de speler sneller posities zoeken met verminderde precisie</string>
|
||||
<string name="auto_queue_title">Volgende stream automatisch in wachtrij plaatsen</string>
|
||||
<string name="auto_queue_summary">Automatisch een gerealteerde stream toekennen als het afspelen van de laatste stream strat in een niet-herhalende afspeelwachtlijst.</string>
|
||||
<string name="live">LIVE</string>
|
||||
<string name="live_sync">SYNCHRONISEREN</string>
|
||||
|
||||
</resources>
|
||||
|
@ -383,7 +383,6 @@ abrir em modo popup</string>
|
||||
<string name="use_inexact_seek_summary">Usar índice de indexação inexato</string>
|
||||
<string name="auto_queue_title">Adicionar a próxima stream à fila automaticamente</string>
|
||||
<string name="auto_queue_summary">Anexar automaticamente uma stream relacionada quando a reprodução iniciar na última stream em uma fila não repetitiva</string>
|
||||
<string name="live">Ao Vivo</string>
|
||||
<string name="live_sync">Sincronizar</string>
|
||||
|
||||
</resources>
|
||||
|
@ -399,7 +399,6 @@
|
||||
<string name="use_inexact_seek_summary">İsabetsiz konumlama, oynatıcının konumları düşürülmüş duyarlıkla saptamasını sağlar</string>
|
||||
<string name="auto_queue_title">Sonraki akışı kendiliğinden kuyrukla</string>
|
||||
<string name="auto_queue_summary">Yinelemeyen oynatma kuyruğundaki son akış başladığında ilişkili akışı kuyruğun sonuna kendiliğinden ekle.</string>
|
||||
<string name="live">CANLI</string>
|
||||
<string name="live_sync">EŞZAMANLA</string>
|
||||
|
||||
</resources>
|
||||
|
@ -390,7 +390,6 @@
|
||||
<string name="use_inexact_seek_summary">Неточне шукання дозволяє програвачеві рухатися позиціями швидше, проте з меншою точністю</string>
|
||||
<string name="auto_queue_title">Автоматично додати до черги наступний стрим</string>
|
||||
<string name="auto_queue_summary">Автоматично додавати пов\'язаний стрим, під час початку програвання останнього стриму.</string>
|
||||
<string name="live">НАЖИВО</string>
|
||||
<string name="live_sync">СИНХРОНІЗАЦІЯ</string>
|
||||
|
||||
</resources>
|
||||
|
@ -385,7 +385,6 @@
|
||||
<string name="use_inexact_seek_summary">不精確的尋找,允許玩家以更低的精確更快找到位置</string>
|
||||
<string name="auto_queue_title">自動佇列下一個串流</string>
|
||||
<string name="auto_queue_summary">在非重複播放佇列中的最後一個串流上開始播放時,自動附上相關串流。</string>
|
||||
<string name="live">直播</string>
|
||||
<string name="live_sync">同步</string>
|
||||
|
||||
</resources>
|
||||
|
@ -113,7 +113,6 @@
|
||||
<string name="show_age_restricted_content_title">Show age restricted content</string>
|
||||
<string name="video_is_age_restricted">Age Restricted Video. Allowing such material is possible from Settings.</string>
|
||||
<string name="duration_live">live</string>
|
||||
<string name="live">LIVE</string>
|
||||
<string name="downloads">Downloads</string>
|
||||
<string name="downloads_title">Downloads</string>
|
||||
<string name="error_report_title">Error report</string>
|
||||
|
Loading…
Reference in New Issue
Block a user