[mobile] add vod_id to info

pull/220/head
FongMi 2 years ago
parent 6b31cc2374
commit 982c1095f2
  1. 2
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/VideoActivity.java
  2. 20
      app/src/mobile/java/com/fongmi/android/tv/ui/dialog/InfoDialog.java
  3. 12
      app/src/mobile/res/layout/dialog_info.xml

@ -707,7 +707,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
} }
private void onInfo() { private void onInfo() {
InfoDialog.create(this).title(mBinding.control.title.getText()).headers(mPlayers.getHeaders()).url(mPlayers.getUrl()).show(); InfoDialog.create(this).title(mBinding.control.title.getText()).headers(mPlayers.getHeaders()).vid(getId()).url(mPlayers.getUrl()).show();
} }
private void onFull() { private void onFull() {

@ -1,6 +1,7 @@
package com.fongmi.android.tv.ui.dialog; package com.fongmi.android.tv.ui.dialog;
import android.app.Activity; import android.app.Activity;
import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -21,6 +22,7 @@ public class InfoDialog {
private AlertDialog dialog; private AlertDialog dialog;
private CharSequence title; private CharSequence title;
private String header; private String header;
private String vid;
private String url; private String url;
public static InfoDialog create(Activity activity) { public static InfoDialog create(Activity activity) {
@ -44,6 +46,11 @@ public class InfoDialog {
return this; return this;
} }
public InfoDialog vid(String vid) {
this.vid = vid;
return this;
}
public InfoDialog url(String url) { public InfoDialog url(String url) {
this.url = url; this.url = url;
return this; return this;
@ -65,12 +72,17 @@ public class InfoDialog {
binding.url.setText(url); binding.url.setText(url);
binding.title.setText(title); binding.title.setText(title);
binding.header.setText(header); binding.header.setText(header);
binding.header.setVisibility(header.isEmpty() ? View.GONE : View.VISIBLE); binding.vid.setText("Vid : ".concat(vid));
binding.vid.setVisibility(TextUtils.isEmpty(vid) ? View.GONE : View.VISIBLE);
binding.url.setVisibility(TextUtils.isEmpty(url) ? View.GONE : View.VISIBLE);
binding.header.setVisibility(TextUtils.isEmpty(header) ? View.GONE : View.VISIBLE);
} }
private void initEvent() { private void initEvent() {
binding.url.setOnClickListener(this::onShare); binding.url.setOnClickListener(this::onShare);
binding.url.setOnLongClickListener(this::onCopy); binding.vid.setOnLongClickListener(v -> onCopy(vid));
binding.url.setOnLongClickListener(v -> onCopy(url));
binding.header.setOnLongClickListener(v -> onCopy(header));
} }
private void onShare(View view) { private void onShare(View view) {
@ -78,9 +90,9 @@ public class InfoDialog {
dialog.dismiss(); dialog.dismiss();
} }
private boolean onCopy(View view) { private boolean onCopy(String text) {
Notify.show(R.string.copied); Notify.show(R.string.copied);
Util.copy(url); Util.copy(text);
return true; return true;
} }

@ -14,22 +14,30 @@
android:id="@+id/title" android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:linksClickable="false" android:linksClickable="false"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView
android:id="@+id/vid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"
android:textSize="14sp" />
<TextView <TextView
android:id="@+id/header" android:id="@+id/header"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="14sp" /> android:textSize="14sp" />
<TextView <TextView
android:id="@+id/url" android:id="@+id/url"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:autoLink="all" android:autoLink="all"

Loading…
Cancel
Save