public ExoPlayerRecyclerEvent(PlayerControlView controlView, PRecyclerView recyclerView, Holders.VideoAdapterViewHolder holder) { XRecyclerView = recyclerView; if (controlView == null) { return; } mFullScreenIcon = controlView.FindViewById <ImageView>(Resource.Id.exo_fullscreen_icon); mFullScreenButton = controlView.FindViewById <FrameLayout>(Resource.Id.exo_fullscreen_button); VideoPlayButton = controlView.FindViewById <ImageButton>(Resource.Id.exo_play); VideoResumeButton = controlView.FindViewById <ImageButton>(Resource.Id.exo_pause); VolumeControl = controlView.FindViewById <ImageView>(Resource.Id.exo_volume_icon); if (!AppSettings.ShowFullScreenVideoPost) { mFullScreenIcon.Visibility = ViewStates.Gone; mFullScreenButton.Visibility = ViewStates.Gone; } if (holder.VideoProgressBar != null) { LoadingProgressBar = holder.VideoProgressBar; } SetVolumeControl(XRecyclerView.VolumeStateProvider == VolumeState.On? VolumeState.On: VolumeState.Off); if (!VolumeControl.HasOnClickListeners) { VolumeControl.Click += (sender, args) => { ToggleVolume(); }; } }
private void Init(Context context) { try { MainContext = context.ApplicationContext; Instance = this; HasFixedSize = true; SetItemViewCacheSize(20); ClearAnimation(); var display = Context.GetSystemService(Context.WindowService).JavaCast <IWindowManager>().DefaultDisplay; var point = new Point(); display.GetSize(point); VideoSurfaceDefaultHeight = point.X; ScreenDefaultHeight = point.Y; VideoSurfaceView = new PlayerView(MainContext) { ResizeMode = AspectRatioFrameLayout.ResizeModeFixedWidth }; //===================== Exo Player ======================== SetPlayer(); //============================================= MainScrollEvent = new RecyclerScrollListener(MainContext, this); AddOnScrollListener(MainScrollEvent); AddOnChildAttachStateChangeListener(new ChildAttachStateChangeListener(this)); MainScrollEvent.LoadMoreEvent += MainScrollEvent_LoadMoreEvent; MainScrollEvent.IsLoading = false; } catch (Exception e) { Console.WriteLine(e); } }
public RecyclerScrollListener(Context ctx, PRecyclerView recyclerView) { XRecyclerView = recyclerView; IsLoading = false; }
public ChildAttachStateChangeListener(PRecyclerView recyclerView) { XRecyclerView = recyclerView; }
public NewClicker(FrameLayout fullScreenButton, string videoUrl, PRecyclerView wRecyclerViewController) { WRecyclerViewController = wRecyclerViewController; FullScreenButton = fullScreenButton; VideoUrl = videoUrl; }