mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-05-26 06:20:20 -04:00
添加投屏
This commit is contained in:
parent
b80b587305
commit
009a35f1d1
@ -10,6 +10,8 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.sifacai.vlcjellyfin.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class AVTransportAdapter extends RecyclerView.Adapter{
|
||||
@ -24,16 +26,16 @@ public class AVTransportAdapter extends RecyclerView.Adapter{
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View ll = LayoutInflater.from(context).inflate(android.R.layout.simple_spinner_item, parent, false);
|
||||
View ll = LayoutInflater.from(context).inflate(R.layout.item_text, parent, false);
|
||||
return new RecyclerView.ViewHolder(ll) {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
TextView tv = holder.itemView.findViewById(android.R.id.text1);
|
||||
TextView tv = holder.itemView.findViewById(R.id.item_title);
|
||||
tv.setText(avTransports.get(position).moduleName);
|
||||
tv.setOnClickListener(new View.OnClickListener() {
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(listener != null){
|
||||
|
@ -106,7 +106,17 @@ public class DlnaActivity extends BaseActivity {
|
||||
Controller.GetMediaInfo(avTransport.controlURL,new JfClient.JJCallBack(){
|
||||
@Override
|
||||
public void onSuccess(String str) {
|
||||
Controller.Play(avTransport.controlURL,null);
|
||||
Controller.Play(avTransport.controlURL,new JfClient.JJCallBack(){
|
||||
@Override
|
||||
public void onSuccess(String str) {
|
||||
ShowToask("已发送!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String str) {
|
||||
ShowToask(str);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,6 +14,7 @@
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_outline_arrow_back_ios_48" />
|
||||
|
||||
<ImageView
|
||||
@ -48,7 +49,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:padding="6dp"
|
||||
android:background="@drawable/shape_user_focus"
|
||||
android:src="@drawable/ic_outline_search_48" />
|
||||
@ -60,7 +60,6 @@
|
||||
android:layout_marginLeft="@dimen/button_margin_left"
|
||||
android:background="@drawable/shape_user_focus"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="100dp"
|
||||
android:text="排序"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dlna_tool_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:src="@drawable/baseline_sync_white_42dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
22
app/src/main/res/layout/item_text.xml
Normal file
22
app/src/main/res/layout/item_text.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/vh_padding_border"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_icon"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@drawable/icon_img_placeholder" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</FrameLayout>
|
Loading…
Reference in New Issue
Block a user