Skip to content

Commit 6e1a58d

Browse files
Stypoxwhistlingwoods
authored andcommitted
Merge pull request TeamNewPipe#12117 from malania02/dev
Show download date of downloaded videos
1 parent 91337b1 commit 6e1a58d

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
import java.util.ArrayList;
7777
import java.util.Arrays;
7878
import java.util.Iterator;
79+
import java.util.Date;
80+
import java.util.Locale;
81+
import java.text.DateFormat;
7982

8083
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
8184
import io.reactivex.rxjava3.core.Observable;
@@ -217,11 +220,17 @@ public void onBindViewHolder(@NonNull ViewHolder view, @SuppressLint("RecyclerVi
217220
h.pause.setTitle(mission.unknownLength ? R.string.stop : R.string.pause);
218221
updateProgress(h);
219222
mPendingDownloadsItems.add(h);
223+
224+
h.date.setText("");
220225
} else {
221226
h.progress.setMarquee(false);
222227
h.status.setText("100%");
223228
h.progress.setProgress(1.0f);
224229
h.size.setText(Utility.formatBytes(item.mission.length));
230+
231+
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
232+
Date date = new Date(item.mission.timestamp);
233+
h.date.setText(dateFormat.format(date));
225234
}
226235
}
227236

@@ -862,6 +871,7 @@ class ViewHolderItem extends RecyclerView.ViewHolder {
862871
ImageView icon;
863872
TextView name;
864873
TextView size;
874+
TextView date;
865875
ProgressDrawable progress;
866876

867877
PopupMenu popupMenu;
@@ -892,6 +902,7 @@ class ViewHolderItem extends RecyclerView.ViewHolder {
892902
name = itemView.findViewById(R.id.item_name);
893903
icon = itemView.findViewById(R.id.item_icon);
894904
size = itemView.findViewById(R.id.item_size);
905+
date = itemView.findViewById(R.id.item_date);
895906

896907
name.setSelected(true);
897908

app/src/main/res/layout/mission_item.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@
8282
android:textColor="@color/white"
8383
android:textSize="12sp" />
8484

85+
<org.schabi.newpipe.views.NewPipeTextView
86+
android:id="@+id/item_date"
87+
android:layout_width="wrap_content"
88+
android:layout_height="wrap_content"
89+
android:layout_below="@id/item_name"
90+
android:layout_alignParentRight="true"
91+
android:padding="6dp"
92+
android:singleLine="true"
93+
android:text=""
94+
android:textColor="@color/white"
95+
android:textSize="12sp" />
96+
8597
</RelativeLayout>
8698

8799
</RelativeLayout>

app/src/main/res/layout/mission_item_linear.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@
6262
android:textSize="12sp"
6363
android:textStyle="bold" />
6464

65+
<org.schabi.newpipe.views.NewPipeTextView
66+
android:id="@+id/item_date"
67+
android:layout_width="wrap_content"
68+
android:layout_height="wrap_content"
69+
android:layout_below="@id/item_name"
70+
android:layout_toLeftOf="@id/item_more"
71+
android:padding="6dp"
72+
android:singleLine="true"
73+
android:text=""
74+
android:textColor="@color/white"
75+
android:textSize="12sp" />
76+
6577
<ImageView
6678
android:id="@+id/item_more"
6779
style="?attr/buttonBarButtonStyle"

0 commit comments

Comments
 (0)