mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-04-20 17:53:15 +00:00
Merge pull request #12117 from malania02/dev
Show download date of downloaded videos
This commit is contained in:
commit
276bf390b2
@ -71,6 +71,9 @@ import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.text.DateFormat;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
@ -208,11 +211,17 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
|
||||
h.pause.setTitle(mission.unknownLength ? R.string.stop : R.string.pause);
|
||||
updateProgress(h);
|
||||
mPendingDownloadsItems.add(h);
|
||||
|
||||
h.date.setText("");
|
||||
} else {
|
||||
h.progress.setMarquee(false);
|
||||
h.status.setText("100%");
|
||||
h.progress.setProgress(1.0f);
|
||||
h.size.setText(Utility.formatBytes(item.mission.length));
|
||||
|
||||
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());
|
||||
Date date = new Date(item.mission.timestamp);
|
||||
h.date.setText(dateFormat.format(date));
|
||||
}
|
||||
}
|
||||
|
||||
@ -832,6 +841,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
|
||||
ImageView icon;
|
||||
TextView name;
|
||||
TextView size;
|
||||
TextView date;
|
||||
ProgressDrawable progress;
|
||||
|
||||
PopupMenu popupMenu;
|
||||
@ -862,6 +872,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
|
||||
name = itemView.findViewById(R.id.item_name);
|
||||
icon = itemView.findViewById(R.id.item_icon);
|
||||
size = itemView.findViewById(R.id.item_size);
|
||||
date = itemView.findViewById(R.id.item_date);
|
||||
|
||||
name.setSelected(true);
|
||||
|
||||
|
@ -82,6 +82,18 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/item_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/item_name"
|
||||
android:layout_alignParentRight="true"
|
||||
android:padding="6dp"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -62,6 +62,18 @@
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/item_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/item_name"
|
||||
android:layout_toLeftOf="@id/item_more"
|
||||
android:padding="6dp"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_more"
|
||||
style="?attr/buttonBarButtonStyle"
|
||||
|
Loading…
x
Reference in New Issue
Block a user