mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-05-26 06:20:20 -04:00
适配竖屏
This commit is contained in:
parent
2c15b83a0f
commit
796643e549
@ -108,18 +108,28 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
.error(R.drawable.img_loading_placeholder)
|
||||
.into(tvCover);
|
||||
|
||||
String Genres = String.join(",", details.getGenres());
|
||||
List<String> backdrops = details.getBackdropImageTags();
|
||||
if(backdrops != null && backdrops.size() > 0){
|
||||
Picasso.get()
|
||||
.load(JfClient.GetBackdropUrl(Id, backdrops.get(0)))
|
||||
.placeholder(R.drawable.img_loading_placeholder)
|
||||
.error(R.drawable.img_loading_placeholder)
|
||||
.into((ImageView) findViewById(R.id.tvBackdrop));
|
||||
}
|
||||
|
||||
tvTitle.setText(Name);
|
||||
tvDetails.append(details.getProductionYear() == null ? "" : "年份:" + details.getProductionYear() + " ");
|
||||
tvDetails.append(Genres.equals("") ? "" : "风格:" + Genres + "\n");
|
||||
tvDetails.append(details.getCommunityRating() == null ? "" : "评分:" + details.getCommunityRating() + " ");
|
||||
tvDetails.append(details.getOfficialRating() == null ? "" : "评级:" + details.getOfficialRating() + "\n");
|
||||
((TextView)findViewById(R.id.tvYear)).setText(details.getProductionYear() == null ? "" : details.getProductionYear());
|
||||
long duration = (details.getRunTimeTicks() / 10000 / 1000 / 60);
|
||||
((TextView)findViewById(R.id.tvDuration)).setText(duration > 0 ? String.valueOf(duration) + "分钟" : "");
|
||||
((TextView)findViewById(R.id.tvRating)).setText(details.getCommunityRating() == null ? "" : details.getCommunityRating());
|
||||
((TextView)findViewById(R.id.tvLevel)).setText(details.getOfficialRating() == null ? "" : details.getOfficialRating());
|
||||
|
||||
String Genres = String.join(",", details.getGenres());
|
||||
tvDetails.append(Genres.equals("") ? "" : "风格:" + Genres + "\n");
|
||||
if (details.getMediaStreams() != null) {
|
||||
String video = "";
|
||||
String audio = "";
|
||||
String subtitle = "";
|
||||
ArrayList<String> audio = new ArrayList<>();
|
||||
ArrayList<String> subtitle = new ArrayList<>();
|
||||
for (int i = 0; i < details.getMediaStreams().size(); i++) {
|
||||
MediaStreams ms = details.getMediaStreams().get(i);
|
||||
String mstype = ms.getType();
|
||||
@ -127,17 +137,15 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
video += ms.getDisplayTitle();
|
||||
} else if (mstype.equals("Audio")) {
|
||||
if (ms.getLanguage() != null && !ms.getLanguage().equals(""))
|
||||
audio += ms.getLanguage() + "、";
|
||||
else audio += ms.getCodec() + ";";
|
||||
audio.add(ms.getLanguage());
|
||||
} else if (mstype.equals("Subtitle")) {
|
||||
if (ms.getLanguage() != null && !ms.getLanguage().equals(""))
|
||||
subtitle += ms.getLanguage() + "、";
|
||||
else subtitle += ms.getCodec() + ";";
|
||||
subtitle.add(ms.getLanguage());
|
||||
}
|
||||
}
|
||||
tvDetails.append(video.equals("") ? "" : "视频:" + video + "\n");
|
||||
tvDetails.append(audio.equals("") ? "" : "音频:" + audio + "\n");
|
||||
tvDetails.append(subtitle.equals("") ? "" : "字幕:" + subtitle + "\n");
|
||||
tvDetails.append(video.equals("") ? "" : "格式:" + video + "\n");
|
||||
tvDetails.append(audio.size() > 1 ? "音轨:" + String.join(",",audio) + "\n" : "");
|
||||
tvDetails.append(subtitle.size() > 1 ? "字幕:" + String.join(",",subtitle) + "\n" : "");
|
||||
}
|
||||
String overview = details.getOverview() == null ? "" : details.getOverview();
|
||||
tvDetails.append("简介: " + Html.fromHtml(overview));
|
||||
@ -147,7 +155,7 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
if (type.equals("Series")) {
|
||||
fillSeason(details.getId());
|
||||
} else if (type.equals("Movie")) {
|
||||
fillMovie(details, details.getId());
|
||||
fillMovie(details);
|
||||
} else if (type.equals("Person")) {
|
||||
tvDetails.append("\n出生日期:" + Utils.UtcToLocal(details.getPremiereDate()) + "\n");
|
||||
if (null != details.getProductionLocations()) {
|
||||
@ -164,8 +172,8 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
}
|
||||
}
|
||||
|
||||
private void fillMovie(Item item, String focusId) {
|
||||
item.setName("播放: " + item.getName());
|
||||
private void fillMovie(Item item) {
|
||||
item.setName(item.getName());
|
||||
List<Item> plist = new ArrayList<>();
|
||||
plist.add(item);
|
||||
if (item.getPartCount() > 0) {
|
||||
@ -190,7 +198,8 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
JfClient.GetSeasons(SeriesId, new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Items seasons) {
|
||||
for (Item item : seasons.getItems()) {
|
||||
for (int i=0;i<seasons.getItems().size();i++) {
|
||||
Item item = seasons.getItems().get(i);
|
||||
TabLayout.Tab tab = tabContainer.newTab();
|
||||
tab.setText(item.getName());
|
||||
tab.view.setTag(item);
|
||||
@ -207,11 +216,14 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
tab.view.setSelected(true);
|
||||
tab.view.performClick();
|
||||
}
|
||||
} else {
|
||||
}else if(i == 0){
|
||||
tabContainer.getTabAt(0).view.performClick();
|
||||
}
|
||||
//tabContainer.getTabAt(0).view.setFocusable(false);
|
||||
}
|
||||
if(tabContainer.getTabCount() > 1){
|
||||
tabContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}, errcb);
|
||||
}
|
||||
@ -233,8 +245,12 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
}
|
||||
|
||||
private void fillItems(List<Item> items) {
|
||||
int spanCount = 3;
|
||||
if(getResources().getDisplayMetrics().widthPixels >getResources().getDisplayMetrics().heightPixels ){
|
||||
spanCount = 6;
|
||||
}
|
||||
JTAdapter jtAdapter = new JTAdapter(items);
|
||||
V7GridLayoutManager layoutManager = new V7GridLayoutManager(mGridView.getContext(), 6);
|
||||
V7GridLayoutManager layoutManager = new V7GridLayoutManager(mGridView.getContext(), spanCount);
|
||||
jtAdapter.setOnItemClickListener(this);
|
||||
mGridView.setVisibility(View.VISIBLE);
|
||||
mGridView.setLayoutManager(layoutManager);
|
||||
@ -289,7 +305,7 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
((TextView) findViewById(R.id.tvListTitle)).setText("演员作品:");
|
||||
List<Item> items = iitems.getItems();
|
||||
JAdapter jAdapter = new JAdapter(items, false);
|
||||
V7GridLayoutManager layoutManager = new V7GridLayoutManager(mGridView.getContext(), 4);
|
||||
V7GridLayoutManager layoutManager = new V7GridLayoutManager(mGridView.getContext(), getSpanCount());
|
||||
jAdapter.setOnItemClickListener(new JAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onClick(Item item) {
|
||||
@ -313,11 +329,6 @@ public class DetailActivity extends BaseActivity implements JAdapter.OnItemClick
|
||||
String itemId = item.getId();
|
||||
String type = item.getType();
|
||||
Intent intent = null;
|
||||
// if (type.equals("Season")) {
|
||||
// intent = new Intent(this, DetailActivity.class);
|
||||
// intent.putExtra("itemId", itemId);
|
||||
// startActivity(intent);
|
||||
// } else
|
||||
if (type.equals("Episode")) {
|
||||
JfClient.playList.clear();
|
||||
JTAdapter JT = (JTAdapter) mGridView.getAdapter();
|
||||
|
@ -1,367 +0,0 @@
|
||||
package org.sifacai.vlcjellyfin.Ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.owen.tvrecyclerview.widget.V7GridLayoutManager;
|
||||
import com.owen.tvrecyclerview.widget.V7LinearLayoutManager;
|
||||
import com.squareup.picasso.Picasso;
|
||||
|
||||
import org.sifacai.vlcjellyfin.Bean.ImageTags;
|
||||
import org.sifacai.vlcjellyfin.Bean.Item;
|
||||
import org.sifacai.vlcjellyfin.Bean.Items;
|
||||
import org.sifacai.vlcjellyfin.Bean.MediaStreams;
|
||||
import org.sifacai.vlcjellyfin.Bean.People;
|
||||
import org.sifacai.vlcjellyfin.Bean.UserData;
|
||||
import org.sifacai.vlcjellyfin.Component.JAdapter;
|
||||
import org.sifacai.vlcjellyfin.Component.JRecyclerView;
|
||||
import org.sifacai.vlcjellyfin.Player.Video;
|
||||
import org.sifacai.vlcjellyfin.Player.VlcPlayerActivity;
|
||||
import org.sifacai.vlcjellyfin.R;
|
||||
import org.sifacai.vlcjellyfin.Utils.JfClient;
|
||||
import org.sifacai.vlcjellyfin.Utils.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DetailActivityP extends BaseActivity implements JAdapter.OnItemClickListener {
|
||||
private String TAG = "详情:";
|
||||
private String ItemId;
|
||||
private ImageView tvCover;
|
||||
private TextView tvTitle;
|
||||
private TextView tvDetails;
|
||||
private ImageView tvPlay;
|
||||
private JRecyclerView mGridView;
|
||||
private JRecyclerView mPeopleGridView;
|
||||
private LinearLayout tvPeopleLayout;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_detail_p);
|
||||
getSupportActionBar().hide();
|
||||
|
||||
if (JfClient.UserId.equals("") || JfClient.AccessToken.equals("")) {
|
||||
finish();
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
tvCover = findViewById(R.id.tvCover);
|
||||
tvTitle = findViewById(R.id.tvTitle);
|
||||
tvDetails = findViewById(R.id.tvDetails);
|
||||
tvPlay = findViewById(R.id.tvPlay);
|
||||
mGridView = findViewById(R.id.mGridView);
|
||||
tvPeopleLayout = findViewById(R.id.tvPersonLayout);
|
||||
mPeopleGridView = findViewById(R.id.mPersonGridView);
|
||||
|
||||
Intent intent = getIntent();
|
||||
ItemId = intent.getStringExtra("itemId");
|
||||
if (ItemId.equals("")) {
|
||||
finish();
|
||||
} else {
|
||||
showLoadingDialog("加载中……");
|
||||
initData(ItemId);
|
||||
}
|
||||
}
|
||||
|
||||
private void initData(String itemId) {
|
||||
JfClient.GetItemInfo(itemId, new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Item item) {
|
||||
fillDetails(item);
|
||||
}
|
||||
}, new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onError(String str) {
|
||||
errcb.onError(str);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void fillDetails(Item details) {
|
||||
String Id = details.getId();
|
||||
String Name = details.getName();
|
||||
String imgurl = JfClient.GetImgUrl(Id, details.getImageTags() == null ? "" : details.getImageTags().getPrimary());
|
||||
Picasso.get()
|
||||
.load(imgurl)
|
||||
.placeholder(R.drawable.img_loading_placeholder)
|
||||
.error(R.drawable.img_loading_placeholder)
|
||||
.into(tvCover);
|
||||
|
||||
String Genres = String.join(",", details.getGenres());
|
||||
|
||||
tvTitle.setText(Name);
|
||||
tvDetails.append(details.getProductionYear() == null ? "" : "年份:" + details.getProductionYear() + " ");
|
||||
tvDetails.append(Genres.equals("") ? "" : "风格:" + Genres + "\n");
|
||||
tvDetails.append(details.getCommunityRating() == null ? "" : "评分:" + details.getCommunityRating() + " ");
|
||||
tvDetails.append(details.getOfficialRating() == null ? "" : "评级:" + details.getOfficialRating() + "\n");
|
||||
|
||||
if (details.getMediaStreams() != null) {
|
||||
String video = "";
|
||||
String audio = "";
|
||||
String subtitle = "";
|
||||
for (int i = 0; i < details.getMediaStreams().size(); i++) {
|
||||
MediaStreams ms = details.getMediaStreams().get(i);
|
||||
String mstype = ms.getType();
|
||||
if (mstype.equals("Video")) {
|
||||
video += ms.getDisplayTitle();
|
||||
} else if (mstype.equals("Audio")) {
|
||||
if (ms.getLanguage()!=null && !ms.getLanguage().equals("")) audio += ms.getLanguage() + "、";
|
||||
else audio += ms.getCodec() + ";";
|
||||
} else if (mstype.equals("Subtitle")) {
|
||||
if (ms.getLanguage() != null && !ms.getLanguage().equals("")) subtitle += ms.getLanguage() + "、";
|
||||
else subtitle += ms.getCodec() + ";";
|
||||
}
|
||||
}
|
||||
tvDetails.append(video.equals("") ? "" : "视频:" + video + "\n");
|
||||
tvDetails.append(audio.equals("") ? "" : "音频:" + audio + "\n");
|
||||
tvDetails.append(subtitle.equals("") ? "" : "字幕:" + subtitle + "\n");
|
||||
}
|
||||
String overview = details.getOverview() == null ? "" : details.getOverview();
|
||||
tvDetails.append("简介: " + Html.fromHtml(overview));
|
||||
|
||||
//填充列表
|
||||
String type = details.getType();
|
||||
if (type.equals("Series")) {
|
||||
fillSeason(ItemId);
|
||||
} else if (type.equals("Season")) {
|
||||
String SeriesName = details.getSeriesName() == null ? "" : details.getSeriesName() + "-";
|
||||
tvTitle.setText(SeriesName + details.getName());
|
||||
String SeriesId = details.getSeriesId();
|
||||
fillEpisodes(SeriesId, ItemId);
|
||||
} else if (type.equals("Episode")) {
|
||||
String SeriesName = details.getSeriesName() == null ? "" : details.getSeriesName() + "-";
|
||||
String SeasonName = details.getSeasonName() == null ? "" : details.getSeasonName();
|
||||
tvTitle.setText(SeriesName + SeasonName);
|
||||
String SeriesId = details.getSeriesId();
|
||||
String SeasonId = details.getSeasonId();
|
||||
fillEpisodes(SeriesId, SeasonId);
|
||||
} else if (type.equals("Movie")) {
|
||||
fillMovie(details);
|
||||
} else if (type.equals("Person")) {
|
||||
tvDetails.append("\n出生日期:" + Utils.UtcToLocal(details.getPremiereDate()) + "\n");
|
||||
if(null != details.getProductionLocations()) {
|
||||
tvDetails.append("出生地:" + String.join(",", details.getProductionLocations()));
|
||||
}
|
||||
fillItemsByPerson(Id);
|
||||
}
|
||||
|
||||
List<People> Peoples = details.getPeople();
|
||||
if (Peoples != null) {
|
||||
if (Peoples.size() > 0) {
|
||||
fillPeople(Peoples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fillMovie(Item item) {
|
||||
|
||||
item.setName("播放: " + item.getName());
|
||||
List<Item> plist = new ArrayList<>();
|
||||
plist.add(item);
|
||||
if (item.getPartCount() > 0) {
|
||||
JfClient.GetAddPart(item.getId(), new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Items parts) {
|
||||
plist.addAll(parts.getItems());
|
||||
fillItems(plist);
|
||||
}
|
||||
}, null);
|
||||
} else {
|
||||
fillItems(plist);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充季
|
||||
*
|
||||
* @param SeriesId
|
||||
*/
|
||||
private void fillSeason(String SeriesId) {
|
||||
JfClient.GetSeasons(SeriesId, new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Items seasons) {
|
||||
fillItems(seasons.getItems());
|
||||
}
|
||||
}, errcb);
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充集
|
||||
*
|
||||
* @param SeriesId
|
||||
* @param SeasonId
|
||||
* @return
|
||||
*/
|
||||
private void fillEpisodes(String SeriesId, String SeasonId) {
|
||||
JfClient.GetEpisodes(SeriesId, SeasonId, new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Items episodes) {
|
||||
fillItems(episodes.getItems());
|
||||
}
|
||||
}, errcb);
|
||||
}
|
||||
|
||||
private void fillItems(List<Item> items) {
|
||||
JAdapter jAdapter = new JAdapter(items, false);
|
||||
V7LinearLayoutManager layoutManager = new V7LinearLayoutManager(mGridView.getContext());
|
||||
layoutManager.setOrientation(V7LinearLayoutManager.HORIZONTAL);
|
||||
jAdapter.setOnItemClickListener(this);
|
||||
mGridView.setVisibility(View.VISIBLE);
|
||||
mGridView.setLayoutManager(layoutManager);
|
||||
mGridView.setAdapter(jAdapter);
|
||||
dismissLoadingDialog();
|
||||
mGridView.requestFocus();
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充演员表
|
||||
*
|
||||
* @param Peoples
|
||||
*/
|
||||
private void fillPeople(List<People> Peoples) {
|
||||
List<Item> Pitems = new ArrayList<>();
|
||||
for (People p : Peoples) {
|
||||
Item it = new Item();
|
||||
it.setId(p.getId());
|
||||
if (p.getType().equals("Director")) {
|
||||
it.setName("导演:" + p.getName());
|
||||
} else if (p.getType().equals("Actor")) {
|
||||
it.setName("演员:" + p.getName());
|
||||
} else {
|
||||
it.setName(p.getName());
|
||||
}
|
||||
it.setType(p.getType());
|
||||
it.setImageTags(new ImageTags());
|
||||
it.getImageTags().setPrimary(p.getPrimaryImageTag());
|
||||
Pitems.add(it);
|
||||
}
|
||||
|
||||
tvPeopleLayout.setVisibility(View.VISIBLE);
|
||||
JAdapter jAdapter = new JAdapter(Pitems, false);
|
||||
V7LinearLayoutManager layoutManager = new V7LinearLayoutManager(mPeopleGridView.getContext());
|
||||
layoutManager.setOrientation(V7LinearLayoutManager.HORIZONTAL);
|
||||
jAdapter.setOnItemClickListener(this);
|
||||
mPeopleGridView.setLayoutManager(layoutManager);
|
||||
mPeopleGridView.setAdapter(jAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充演员作品
|
||||
*
|
||||
* @param personid
|
||||
*/
|
||||
private void fillItemsByPerson(String personid) {
|
||||
String Term = "&SortBy=DateCreated&SortOrder=Descending&PersonIds=" + personid;
|
||||
Term += "&IncludeItemTypes=Movie,Series";
|
||||
JfClient.GetItemsByTerm(Term, new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onSuccess(Items iitems) {
|
||||
((TextView) findViewById(R.id.tvListTitle)).setText("演员作品:");
|
||||
List<Item> items = iitems.getItems();
|
||||
JAdapter jAdapter = new JAdapter(items, false);
|
||||
V7GridLayoutManager layoutManager = new V7GridLayoutManager(mGridView.getContext(), 4);
|
||||
jAdapter.setOnItemClickListener(new JAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onClick(Item item) {
|
||||
String itemId = item.getId();
|
||||
Intent intent = new Intent(DetailActivityP.this, DetailActivityP.class);
|
||||
intent.putExtra("itemId", itemId);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
mGridView.setVisibility(View.VISIBLE);
|
||||
mGridView.setLayoutManager(layoutManager);
|
||||
mGridView.setAdapter(jAdapter);
|
||||
dismissLoadingDialog();
|
||||
mGridView.requestFocus();
|
||||
}
|
||||
}, errcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(Item item) {
|
||||
String itemId = item.getId();
|
||||
String type = item.getType();
|
||||
Intent intent = null;
|
||||
if (type.equals("Season")) {
|
||||
intent = new Intent(this, DetailActivityP.class);
|
||||
intent.putExtra("itemId", itemId);
|
||||
startActivity(intent);
|
||||
} else if (type.equals("Episode")) {
|
||||
JfClient.playList.clear();
|
||||
JAdapter JA = (JAdapter) mGridView.getAdapter();
|
||||
List<Item> ja = JA.getData();
|
||||
if (ja != null) {
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
Video media = getMedia(ja.get(i));
|
||||
JfClient.playList.add(media);
|
||||
if (itemId.equals(media.Id)) {
|
||||
JfClient.playIndex = i;
|
||||
}
|
||||
}
|
||||
toVlcPlayer();
|
||||
}
|
||||
} else if (type.equals("Movie") || type.equals("Video")) {
|
||||
JfClient.playList.clear();
|
||||
JfClient.playList.add(getMedia(item));
|
||||
JfClient.playIndex = 0;
|
||||
toVlcPlayer();
|
||||
} else if (type.equals("Actor") || type.equals("Director")) {
|
||||
intent = new Intent(this, DetailActivityP.class);
|
||||
intent.putExtra("itemId", itemId);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 组合播放媒体
|
||||
*
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
public Video getMedia(Item item) {
|
||||
Video media = new Video();
|
||||
media.Id = item.getId();
|
||||
media.Name = item.getName();
|
||||
media.cover = "";
|
||||
media.Url = JfClient.GetPlayUrl(media.Id);
|
||||
if (item.getUserData() != null) {
|
||||
UserData userdata = item.getUserData();
|
||||
media.startPositionTicks = userdata.getPlaybackPositionTicks();
|
||||
}
|
||||
return media;
|
||||
}
|
||||
|
||||
public void toVlcPlayer() {
|
||||
Intent intent;
|
||||
if(JfClient.config.isExtensionPlayer()){
|
||||
String videourl = JfClient.playList.get(JfClient.playIndex).Url;
|
||||
Uri uri = Uri.parse(videourl);
|
||||
intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(uri,"video/mp4");
|
||||
}else{
|
||||
intent = new Intent(this, VlcPlayerActivity.class);
|
||||
}
|
||||
this.startActivity(intent);
|
||||
}
|
||||
|
||||
private JfClient.JJCallBack errcb = new JfClient.JJCallBack() {
|
||||
@Override
|
||||
public void onError(String str) {
|
||||
ShowToask(str);
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
};
|
||||
}
|
@ -179,6 +179,12 @@ public class JfClient {
|
||||
return url;
|
||||
}
|
||||
|
||||
public static String GetBackdropUrl(String itemid, String tagid) {
|
||||
String url = config.getJellyfinUrl() + "/Items/" + itemid + "/Images/Backdrop";
|
||||
url += "?maxWidth=1280&quality=90&tag=" + tagid;
|
||||
return url;
|
||||
}
|
||||
|
||||
public static String GetImgUrl(Item item) {
|
||||
if (item.getImageTags() == null) return "";
|
||||
if (item.getImageTags().getPrimary() == null || item.getImageTags().getPrimary().equals(""))
|
||||
|
@ -1,123 +1,186 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/padding_border"
|
||||
tools:context=".Ui.DetailActivity">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fadingEdge="vertical"
|
||||
android:scrollbars="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
<ImageView
|
||||
android:id="@+id/tvBackdrop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
android:maxHeight="720dp"
|
||||
android:src="@drawable/img_loading_placeholder"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout
|
||||
android:id="@+id/title_panel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="180dp"
|
||||
android:background="#99000000"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvBackdrop"></LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tvCover"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="280dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginTop="100dp"
|
||||
android:src="@drawable/img_loading_placeholder"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLength="16"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text=""
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="30dp"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvCover"
|
||||
app:layout_constraintTop_toTopOf="@+id/title_panel" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvYear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text=""
|
||||
app:layout_constraintStart_toEndOf="@+id/tvCover"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDuration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text=""
|
||||
app:layout_constraintStart_toEndOf="@+id/tvYear"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLevel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text=""
|
||||
app:layout_constraintStart_toEndOf="@+id/tvDuration"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRating"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:text=""
|
||||
app:layout_constraintStart_toEndOf="@+id/tvLevel"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetails"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:text=""
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvCover" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvListTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="播放列表:"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDetails" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvListTitle"
|
||||
app:tabGravity="start"
|
||||
app:tabMode="scrollable">
|
||||
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
|
||||
<org.sifacai.vlcjellyfin.Component.JRecyclerView
|
||||
android:id="@+id/mGridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:padding="@dimen/padding_border"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tab_container"
|
||||
app:tv_horizontalSpacingWithMargins="@dimen/vh_space_width"
|
||||
app:tv_selectedItemIsCentered="true"
|
||||
app:tv_verticalSpacingWithMargins="@dimen/vh_space_width" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tvPersonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/mGridView">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="演员表:" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tvCover"
|
||||
android:layout_width="420dp"
|
||||
android:layout_height="620dp"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@drawable/icon_img_placeholder" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/padding_border"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingRight="@dimen/padding_border"
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:text="标题:"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="30dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetails"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:minHeight="200dp"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvListTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="播放列表:" />
|
||||
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabGravity="start"
|
||||
app:tabMode="scrollable">
|
||||
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
|
||||
<org.sifacai.vlcjellyfin.Component.JRecyclerView
|
||||
android:id="@+id/mGridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:padding="@dimen/padding_border"
|
||||
android:visibility="gone"
|
||||
app:tv_horizontalSpacingWithMargins="@dimen/vh_space_width"
|
||||
app:tv_selectedItemIsCentered="true"
|
||||
app:tv_verticalSpacingWithMargins="@dimen/vh_space_width" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tvPersonLayout"
|
||||
<org.sifacai.vlcjellyfin.Component.JRecyclerView
|
||||
android:id="@+id/mPersonGridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:layout_height="312dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:padding="@dimen/padding_border"
|
||||
app:tv_horizontalSpacingWithMargins="@dimen/vh_space_width"
|
||||
app:tv_selectedItemIsCentered="true"
|
||||
app:tv_verticalSpacingWithMargins="@dimen/vh_space_width" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="演员表:" />
|
||||
|
||||
<org.sifacai.vlcjellyfin.Component.JRecyclerView
|
||||
android:id="@+id/mPersonGridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="312dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:padding="@dimen/padding_border"
|
||||
app:tv_horizontalSpacingWithMargins="@dimen/vh_space_width"
|
||||
app:tv_selectedItemIsCentered="true"
|
||||
app:tv_verticalSpacingWithMargins="@dimen/vh_space_width" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</ScrollView>
|
@ -1,125 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/padding_border"
|
||||
tools:context=".Ui.DetailActivity">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fadingEdge="vertical"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tvCover"
|
||||
android:layout_width="420dp"
|
||||
android:layout_height="620dp"
|
||||
android:scaleType="fitXY"
|
||||
app:srcCompat="@drawable/icon_img_placeholder" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/padding_border"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingRight="@dimen/padding_border"
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:text="标题:"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="30dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDetails"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="200dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvListTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="播放列表:" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tvPlay"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:background="@drawable/shape_user_focus_vholder"
|
||||
android:focusable="true"
|
||||
android:padding="10dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_outline_play_circle_outline_128"
|
||||
android:visibility="gone" />
|
||||
|
||||
<org.sifacai.vlcjellyfin.Component.JRecyclerView
|
||||
android:id="@+id/mGridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:padding="@dimen/padding_border"
|
||||
android:visibility="gone"
|
||||
app:tv_horizontalSpacingWithMargins="@dimen/vh_space_width"
|
||||
app:tv_selectedItemIsCentered="true"
|
||||
app:tv_verticalSpacingWithMargins="@dimen/vh_space_width" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tvPersonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone" >
|
||||
|
||||
<TextView
|
||||
android:text="演员表:"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
<org.sifacai.vlcjellyfin.Component.JRecyclerView
|
||||
android:id="@+id/mPersonGridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="312dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:padding="@dimen/padding_border"
|
||||
app:tv_horizontalSpacingWithMargins="@dimen/vh_space_width"
|
||||
app:tv_selectedItemIsCentered="true"
|
||||
app:tv_verticalSpacingWithMargins="@dimen/vh_space_width" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user