小编Tep*_*ian的帖子

Android TV RecyclerView重点互动

我目前使用常规RecyclerViewGridLayoutManager不同spanCount的depeding viewType为Android TV的应用.一切都很好,但我有两个问题:

  1. 如果您长按dpad以在项目之间快速滚动,有时焦点将丢失到不属于RecyclerView的子视图.
  2. 如何告知将RecyclerView当前聚焦视图保持在网格中心?

似乎列出的问题是通过使用VerticalGridViewfrom LeanBack库修复的,但LayoutManger它使用的是内部的,不支持spanCount.

android android-tv android-recyclerview

26
推荐指数
1
解决办法
8077
查看次数

访问流缓冲区HttpWebRequest

我正在尝试在Windows Phone 7应用程序中流式传输,我正在使用它ManagedMediaHelpers.在HttpWebRequest获得源源不断的作品,但不会调用因为连续流的回调URL.

如何在没有回调Url的帮助下访问流?在其他帖子上有人说O需要使用反射,但是有人知道热实现吗?这是我的代码:

req = (HttpWebRequest) WebRequest.Create(
    "http://streamer-dtc-aa01.somafm.com:80/stream/1018");

// if this is false it will fire up the callback Url 
// but the mediastreamsource will throw an exception 
// saying the it needs to be true
req.AllowReadStreamBuffering = true; 

IAsyncResult result = req.BeginGetResponse(RequestComplete,null);

private void RequestComplete(IAsyncResult r)
{
    HttpWebResponse resp = req.EndGetResponse(r) as HttpWebResponse;
    Stream str = resp.GetResponseStream();

    mss = new Mp3MediaStreamSource(str, resp.ContentLength);
    Deployment.Current.Dispatcher.BeginInvoke(() => {
        this.me.Volume = 100;
        this.me.SetSource(mss);
    });
}
Run Code Online (Sandbox Code Playgroud)

c# streaming httpwebrequest windows-phone-7

7
推荐指数
1
解决办法
1261
查看次数