mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-06-03 00:58:06 -04:00
添加进度
This commit is contained in:
parent
ba452b2962
commit
3cb9752483
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@ -12,6 +12,7 @@
|
|||||||
<entry key="..\:/code/VlcJellyfin/app/src/main/res/layout/popmenu.xml" value="0.14479166666666668" />
|
<entry key="..\:/code/VlcJellyfin/app/src/main/res/layout/popmenu.xml" value="0.14479166666666668" />
|
||||||
<entry key="..\:/code/VlcJellyfin/app/src/main/res/layout/popmenu_item.xml" value="0.14479166666666668" />
|
<entry key="..\:/code/VlcJellyfin/app/src/main/res/layout/popmenu_item.xml" value="0.14479166666666668" />
|
||||||
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/img_loading_placeholder.xml" value="0.1625" />
|
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/img_loading_placeholder.xml" value="0.1625" />
|
||||||
|
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/played_percentage.xml" value="0.1615" />
|
||||||
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/popmenu_focus.xml" value="0.1625" />
|
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/popmenu_focus.xml" value="0.1625" />
|
||||||
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/shape_user_focus.xml" value="0.1625" />
|
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/shape_user_focus.xml" value="0.1625" />
|
||||||
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/shape_user_focus_VH.xml" value="0.1625" />
|
<entry key="..\:/work/VlcJellyfin/app/src/main/res/drawable/shape_user_focus_VH.xml" value="0.1625" />
|
||||||
|
@ -6,6 +6,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@ -26,6 +27,7 @@ public class JAdapter extends RecyclerView.Adapter {
|
|||||||
public String type;
|
public String type;
|
||||||
public TextView tvName;
|
public TextView tvName;
|
||||||
public ImageView tvCover;
|
public ImageView tvCover;
|
||||||
|
public SeekBar tvPlayedPercentage;
|
||||||
|
|
||||||
public VH(View v) {
|
public VH(View v) {
|
||||||
super(v);
|
super(v);
|
||||||
@ -33,6 +35,7 @@ public class JAdapter extends RecyclerView.Adapter {
|
|||||||
type = "";
|
type = "";
|
||||||
tvName = v.findViewById(R.id.tvName);
|
tvName = v.findViewById(R.id.tvName);
|
||||||
tvCover = v.findViewById(R.id.ivThumb);
|
tvCover = v.findViewById(R.id.ivThumb);
|
||||||
|
tvPlayedPercentage = v.findViewById(R.id.tvPlayedPercentage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,9 +65,24 @@ public class JAdapter extends RecyclerView.Adapter {
|
|||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
VH v = (VH)holder;
|
VH v = (VH)holder;
|
||||||
JsonObject jo = items.get(position).getAsJsonObject();
|
JsonObject jo = items.get(position).getAsJsonObject();
|
||||||
|
String SeriesName = Utils.getJsonString(jo,"SeriesName").getAsString();
|
||||||
|
String SeasonName = Utils.getJsonString(jo,"SeasonName").getAsString();
|
||||||
|
String Name = Utils.getJsonString(jo,"Name").getAsString();
|
||||||
String itemid = jo.get("Id").getAsString();
|
String itemid = jo.get("Id").getAsString();
|
||||||
v.id = itemid;
|
v.id = itemid;
|
||||||
v.tvName.setText(" " + jo.get("Name").getAsString());
|
v.tvName.setText(" " + SeriesName + " " + SeasonName + " " + Name);
|
||||||
|
|
||||||
|
if(jo.has("UserData")){
|
||||||
|
JsonObject ujo = jo.get("UserData").getAsJsonObject();
|
||||||
|
if(ujo.has("PlayedPercentage")){
|
||||||
|
int pp = ujo.get("PlayedPercentage").getAsInt();
|
||||||
|
v.tvPlayedPercentage.setVisibility(View.VISIBLE);
|
||||||
|
v.tvPlayedPercentage.setMax(100);
|
||||||
|
v.tvPlayedPercentage.setProgress(pp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(jo.has("CollectionType")){
|
if(jo.has("CollectionType")){
|
||||||
v.type = jo.get("CollectionType").getAsString();
|
v.type = jo.get("CollectionType").getAsString();
|
||||||
}
|
}
|
||||||
|
27
app/src/main/res/drawable/played_percentage.xml
Normal file
27
app/src/main/res/drawable/played_percentage.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:id="@android:id/background"
|
||||||
|
android:gravity="center_vertical|fill_horizontal">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<size android:height="2dp" />
|
||||||
|
<solid android:color="#00ffffff" />
|
||||||
|
<corners android:radius="2dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item
|
||||||
|
android:id="@android:id/progress"
|
||||||
|
android:gravity="center_vertical|fill_horizontal">
|
||||||
|
<scale android:scaleWidth="100%">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<size android:height="2dp" />
|
||||||
|
<!--<solid android:color="#707d93" />-->
|
||||||
|
<gradient
|
||||||
|
android:angle="0"
|
||||||
|
android:endColor="#1890ff"
|
||||||
|
android:startColor="#1890ff" />
|
||||||
|
<corners android:radius="2dp" />
|
||||||
|
</shape>
|
||||||
|
</scale>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -34,6 +34,21 @@
|
|||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/tvPlayedPercentage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:max="100"
|
||||||
|
android:progress="0"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:thumb="@null"
|
||||||
|
android:progressDrawable="@drawable/played_percentage"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
@ -17,13 +17,13 @@
|
|||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:scaleType="fitXY" />
|
android:scaleType="fitXY" />
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@color/color_99000000"
|
android:background="@color/color_99000000"
|
||||||
android:padding="1dp">
|
android:padding="1dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvName"
|
android:id="@+id/tvName"
|
||||||
@ -34,6 +34,22 @@
|
|||||||
android:padding="0dp"
|
android:padding="0dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/tvPlayedPercentage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dp"
|
||||||
|
android:max="100"
|
||||||
|
android:progress="0"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:paddingEnd="0dp"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:thumb="@null"
|
||||||
|
android:progressDrawable="@drawable/played_percentage"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
Loading…
x
Reference in New Issue
Block a user