我希望ExoPlayer在我的应用程序中实现Google .他们的文档对我来说似乎很模糊,而我正在寻找的是从URL播放视频,没有复杂的自定义设置或类似的东西.没有找到任何关于如何做的教程.他们在git上的例子对于我需要的东西来说太复杂了,因为我不熟悉视频流,所以我并不了解.我到目前为止所做的就是显示一个com.google.android.exoplayer.AspectRatioFrameLayout.
基本上,我有一个URL.我需要播放视频,并onConfigurationChanged在用户翻转屏幕时进行处理.
有人可以帮忙吗?
目前在我的应用程序中,我有自己的URI方案来检测用户何时点击特定的URI.
Manifest文件中使用的代码如下:
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="com.test/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
如果用户在浏览器中单击具有我的自定义URI的链接,它现在将弹出一个选项供用户选择我的应用程序.
但是,在启动进一步处理时,如何传递此数据作为我的应用程序的链接?基本上我如何将数据从浏览器传递到我的应用程序?
提前致谢
我正在创建一个 android 应用程序,我在其中缩放ImageView[捏缩放(带图像翻译)],而且我必须ImageView只用两个手指移动来旋转它。因为我想通过单指移动来翻译Image [scroll]。当我没有添加旋转代码时,捏合缩放和平移工作得很好,但是在添加旋转编码后,图像在单指移动时旋转并且不平移。我想有一个检查,只要用户是在两个手指移动ImageView,然后图像应转动,否则不能使图像翻译将不会受到干扰。如何实现?这是我的代码。任何帮助将不胜感激
public class CustomizedImageView extends ImageView {
Matrix matrix;
// We can be in one of these 3 states
static final int NONE = 0;
static final int DRAG = 1;
static final int ZOOM = 2;
int mode = NONE;
// Remember some things for zooming
PointF last = new PointF();
PointF start = new PointF();
float minScale = 1f;
float maxScale = 3f;
float[] …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,有两种语言版本 - 英语和希伯来语.
我使用翻译编辑器添加了希伯来语字符串,我根据用户选择更改了语言环境.
更改Locale时,它会像我想要的那样将字符串设置为希伯来语,但它也会将工具栏方向从右向左更改为希伯来语,并将标题和后退按钮置于右侧.
英语区域设置(默认):
有没有办法让工具栏方向像英文一样?我想保留工具栏左侧的后退按钮和标题.
编辑:在添加android:layoutDirection="ltr"或之后添加android:supportsRtl="false"到toolbarxml.箭头向后.怎么解决它?
在android中GearVR,是否可以在普通/电话模式下启动应用程序,然后Unity/VR在用户单击按钮进入时转换为VR?
到目前为止,应用程序要么VR以"vr_only"作为选项完全启动,要么正常启动并Oculus在我们尝试"vr_both"或"vr_dual"时转到Home.
这样的事情是可能的,还是我们必须制作两个独立的应用程序?请注意,使用Unity中的"虚拟现实支持"选项将不起作用Gear.
我想要实现的是将我的一款Android游戏直播到电视(使用DLNA/Wifi Direct连接).我可以以某种方式这样做吗?我仍然想用手机控制我的游戏(原样),但我会在电视上看到我的游戏画面.那里有解决方案吗?
谢谢!
我想将页面标题居中。标题可能看起来像(1) Dokument1或(3) GreatDocument。我想要左右边距,60dp并且文档名称具有可变长度。当我使用wrap_content居中@+id/title效果很好时,但是边距不适用于长文档名称。当我使用0dp边距时,会受到尊重,但居中不起作用。
如何使 ConstraintLayout 中的打包链居中,同时具有动态长度和边距。
<android.support.constraint.ConstraintLayout
android:id="@+id/top_bar_xml"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/open_brackets"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="("
android:gravity="center_vertical"
android:layout_marginStart="60dp"
android:textSize="20sp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintEnd_toStartOf="@id/page_count"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/page_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:gravity="center_vertical"
android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/open_brackets"
app:layout_constraintEnd_toStartOf="@id/close_brackets"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/close_brackets"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=") "
android:gravity="center_vertical"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/page_count"
app:layout_constraintEnd_toStartOf="@id/title"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="60dp"
android:text="DocumentTitle"
android:textSize="20sp"
android:gravity="center_vertical"
android:ellipsize="end"
app:layout_constraintStart_toEndOf="@+id/close_brackets"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
(我通过删除对页数和标题的 ViewModel 的引用来简化示例;该文档下面有其他具有较低边距的视图)
android ×8
translation ×2
exoplayer ×1
gear-vr ×1
kotlin ×1
locale ×1
localization ×1
oculus ×1
pinchzoom ×1
rotation ×1