added "open file from downloaded item" functionality and deleting multiple downloaded items by long clicking / selecting them
This commit is contained in:
parent
32cbc52339
commit
c855b6ad2e
13 changed files with 238 additions and 50 deletions
|
|
@ -320,7 +320,7 @@
|
|||
<PersistentState>
|
||||
<option name="values">
|
||||
<map>
|
||||
<entry key="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/icons/material/materialicons/credit_card/baseline_credit_card_24.xml" />
|
||||
<entry key="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/icons/material/materialicons/file_open/baseline_file_open_24.xml" />
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
|
|
@ -331,7 +331,7 @@
|
|||
<option name="values">
|
||||
<map>
|
||||
<entry key="color" value="00a6ff" />
|
||||
<entry key="outputName" value="ic_card" />
|
||||
<entry key="outputName" value="ic_baseline_file_open_24" />
|
||||
<entry key="sourceFile" value="C:\Users\denis\Desktop\adaptiveproduct_youtube_foreground_color_108 (1).svg" />
|
||||
</map>
|
||||
</option>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_app_icon.xml" value="0.1965" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_back.xml" value="0.109" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_baseline_keyboard_arrow_right_24.xml" value="0.109" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_baseline_open_in_new_24.xml" value="0.197" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_cancel.xml" value="0.2395" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_card.xml" value="0.2395" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/drawable/ic_chapters.xml" value="0.109" />
|
||||
|
|
@ -83,7 +84,7 @@
|
|||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/activity_main.xml" value="0.18" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/activity_settings.xml" value="0.16875" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/download_all_card.xml" value="0.25" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/downloads_bottom_sheet.xml" value="0.18854166666666666" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/downloads_bottom_sheet.xml" value="0.33" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/downloads_card.xml" value="0.33" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/downloads_card_shimmer.xml" value="0.18854166666666666" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/downloads_filter_sheet.xml" value="0.18854166666666666" />
|
||||
|
|
@ -91,7 +92,7 @@
|
|||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/downloads_sort_sheet.xml" value="0.33" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/empty_history_hint.xml" value="0.2" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/filter_chip.xml" value="0.18854166666666666" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/fragment_downloads.xml" value="0.33" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/fragment_downloads.xml" value="0.22" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/fragment_history.xml" value="0.2" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/fragment_home.xml" value="0.16" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/layout/fragment_more.xml" value="0.33" />
|
||||
|
|
@ -120,6 +121,7 @@
|
|||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/xml/download_preferences.xml" value="0.16875" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/xml/more_preferences.xml" value="0.22" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/xml/notification_preferences.xml" value="0.16875" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/xml/provider_paths.xml" value="0.19010416666666666" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/xml/root_preferences.xml" value="0.25" />
|
||||
<entry key="..\:/Users/denis/Documents/GitHub/ytdlnis/app/src/main/res/xml/update_preferences.xml" value="0.16875" />
|
||||
</map>
|
||||
|
|
|
|||
18
README.md
18
README.md
|
|
@ -40,6 +40,24 @@
|
|||
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/6.png" width="30%" />
|
||||
</div>
|
||||
|
||||
## Create a YouTube API Key
|
||||
|
||||
Using your personal api key will increase youtube result speed inside the app drastically. On top of that, the app will show you trending videos on youtube every time you open the app. <br>
|
||||
Here is how to do it:
|
||||
|
||||
- Go to [Google Console](https://console.cloud.google.com/projectselector2/apis/dashboard)
|
||||
- Accept Terms & Services and click Create Project
|
||||
- Click "Enabled API's and Services"
|
||||
- Search for "Youtube Data API V3" click and enable it
|
||||
- Click the Credentials tab on the left
|
||||
- Click "Create Credentials" and choose API Key
|
||||
|
||||
Copy the key that appears and paste it in this app's settings.
|
||||
|
||||
## Connect with YouTube Revanced
|
||||
|
||||
The App's package name is com.deniscerri.ytdl
|
||||
|
||||
## License
|
||||
|
||||
[GNU GPL v3.0](https://github.com/deniscerri/ytdlnis/blob/main/LICENSE)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,16 @@
|
|||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
<receiver android:name=".receiver.NotificationReceiver" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.deniscerri.ytdl.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -24,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import com.deniscerri.ytdlnis.R;
|
||||
import com.deniscerri.ytdlnis.database.Video;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.card.MaterialCardView;
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator;
|
||||
import com.squareup.picasso.Picasso;
|
||||
|
||||
|
|
@ -32,6 +33,7 @@ import java.util.ArrayList;
|
|||
|
||||
public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<DownloadsRecyclerViewAdapter.ViewHolder> {
|
||||
private ArrayList<Video> videoList;
|
||||
private ArrayList<Integer> checkedVideos;
|
||||
private ArrayList<String> websites;
|
||||
private final OnItemClickListener onItemClickListener;
|
||||
private Activity activity;
|
||||
|
|
@ -39,6 +41,7 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
public DownloadsRecyclerViewAdapter(ArrayList<Video> videos, OnItemClickListener onItemClickListener, Activity activity){
|
||||
this.videoList = videos;
|
||||
this.websites = new ArrayList<>();
|
||||
this.checkedVideos = new ArrayList<>();
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
this.activity = activity;
|
||||
}
|
||||
|
|
@ -49,7 +52,7 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private CardView cardView;
|
||||
private MaterialCardView cardView;
|
||||
|
||||
public ViewHolder(@NonNull View itemView, OnItemClickListener onItemClickListener) {
|
||||
super(itemView);
|
||||
|
|
@ -69,7 +72,7 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
Video video = videoList.get(position);
|
||||
CardView card = holder.cardView;
|
||||
MaterialCardView card = holder.cardView;
|
||||
// THUMBNAIL ----------------------------------
|
||||
ImageView thumbnail = card.findViewById(R.id.downloads_image_view);
|
||||
String imageURL= video.getThumb();
|
||||
|
|
@ -106,6 +109,8 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
LinearProgressIndicator progressBar = card.findViewById(R.id.download_progress);
|
||||
progressBar.setTag(video.getURL()+video.getDownloadedType()+"##progress");
|
||||
|
||||
boolean filePresent = true;
|
||||
|
||||
if (video.isQueuedDownload()){
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
btn.setOnClickListener(view -> onItemClickListener.onButtonClick(position));
|
||||
|
|
@ -117,7 +122,6 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
//IS IN THE FILE SYSTEM?
|
||||
String path = video.getDownloadPath();
|
||||
File file = new File(path);
|
||||
boolean filePresent = true;
|
||||
if(!file.exists() && !path.isEmpty()){
|
||||
filePresent = false;
|
||||
thumbnail.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(){{setSaturation(0f);}}));
|
||||
|
|
@ -138,7 +142,38 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
|
||||
}
|
||||
|
||||
card.setOnClickListener(view -> onItemClickListener.onCardClick(position));
|
||||
if(checkedVideos.contains(position)){
|
||||
card.setChecked(true);
|
||||
card.setStrokeWidth(5);
|
||||
}else{
|
||||
card.setChecked(false);
|
||||
card.setStrokeWidth(0);
|
||||
}
|
||||
|
||||
boolean finalFilePresent = filePresent;
|
||||
card.setOnLongClickListener(view -> {
|
||||
checkCard(card, position);
|
||||
return true;
|
||||
});
|
||||
card.setOnClickListener(view -> {
|
||||
if(checkedVideos.size() > 0){
|
||||
checkCard(card, position);
|
||||
}else{
|
||||
onItemClickListener.onCardClick(position, finalFilePresent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void checkCard(MaterialCardView card, int position){
|
||||
if(card.isChecked()){
|
||||
card.setStrokeWidth(0);
|
||||
checkedVideos.remove(Integer.valueOf(position));
|
||||
}else{
|
||||
card.setStrokeWidth(5);
|
||||
checkedVideos.add(position);
|
||||
}
|
||||
card.setChecked(!card.isChecked());
|
||||
onItemClickListener.onCardSelect(position, card.isChecked());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -147,7 +182,8 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
}
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onCardClick(int position);
|
||||
void onCardClick(int position, boolean isPresent);
|
||||
void onCardSelect(int position, boolean isChecked);
|
||||
void onButtonClick(int position);
|
||||
}
|
||||
|
||||
|
|
@ -175,4 +211,13 @@ public class DownloadsRecyclerViewAdapter extends RecyclerView.Adapter<Downloads
|
|||
notifyItemRangeRemoved(0, size);
|
||||
}
|
||||
|
||||
public void clearCheckedVideos(){
|
||||
int size = checkedVideos.size();
|
||||
for (int i = 0; i < size; i++){
|
||||
int position = checkedVideos.get(i);
|
||||
notifyItemChanged(position);
|
||||
}
|
||||
checkedVideos.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import android.media.MediaScannerConnection;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.os.Handler;
|
||||
|
|
@ -39,6 +40,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog;
|
|||
import com.google.android.material.chip.Chip;
|
||||
import com.google.android.material.chip.ChipGroup;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator;
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
|
|
@ -51,7 +53,7 @@ import java.util.Locale;
|
|||
/**
|
||||
* A fragment representing a list of Items.
|
||||
*/
|
||||
public class DownloadsFragment extends Fragment implements DownloadsRecyclerViewAdapter.OnItemClickListener, View.OnClickListener{
|
||||
public class DownloadsFragment extends Fragment implements DownloadsRecyclerViewAdapter.OnItemClickListener, View.OnClickListener, View.OnLongClickListener{
|
||||
private boolean downloading = false;
|
||||
private View fragmentView;
|
||||
private DBManager dbManager;
|
||||
|
|
@ -71,7 +73,9 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
private LinearLayout selectionChips;
|
||||
private ChipGroup websiteGroup;
|
||||
private ArrayList<Video> downloadsObjects;
|
||||
public ArrayList<Video> selectedObjects;
|
||||
private LinearProgressIndicator progressBar;
|
||||
private ExtendedFloatingActionButton deleteFab;
|
||||
private String format = "";
|
||||
private String website = "";
|
||||
private String sort = "DESC";
|
||||
|
|
@ -252,8 +256,14 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
no_results = fragmentView.findViewById(R.id.downloads_no_results);
|
||||
selectionChips = fragmentView.findViewById(R.id.downloads_selection_chips);
|
||||
websiteGroup = fragmentView.findViewById(R.id.website_chip_group);
|
||||
deleteFab = fragmentView.findViewById(R.id.delete_selected_fab);
|
||||
|
||||
deleteFab.setTag("deleteSelected");
|
||||
deleteFab.setOnClickListener(this);
|
||||
|
||||
uiHandler = new Handler(Looper.getMainLooper());
|
||||
downloadsObjects = new ArrayList<>();
|
||||
selectedObjects = new ArrayList<>();
|
||||
downloading = mainActivity.isDownloadServiceRunning();
|
||||
|
||||
recyclerView = fragmentView.findViewById(R.id.recycler_view_downloads);
|
||||
|
|
@ -557,15 +567,65 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
if(id == R.id.bottomsheet_remove_button){
|
||||
removedownloadsItem((Integer) v.getTag());
|
||||
}else if(id == R.id.bottom_sheet_link){
|
||||
copyLinkToClipBoard((Integer) v.getTag());
|
||||
}else if(id == R.id.bottomsheet_open_link_button){
|
||||
openLinkIntent((Integer) v.getTag());
|
||||
}else if(id == R.id.bottomsheet_open_file_button){
|
||||
openFileIntent((Integer) v.getTag());
|
||||
}else if (id == R.id.delete_selected_fab){
|
||||
removeSelectedItems();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
int id = v.getId();
|
||||
if(id == R.id.bottom_sheet_link){
|
||||
copyLinkToClipBoard((Integer) v.getTag());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void removeSelectedItems(){
|
||||
if(bottomSheet != null) bottomSheet.hide();
|
||||
final boolean[] delete_file = {false};
|
||||
dbManager = new DBManager(context);
|
||||
|
||||
MaterialAlertDialogBuilder delete_dialog = new MaterialAlertDialogBuilder(fragmentContext);
|
||||
delete_dialog.setTitle(getString(R.string.you_are_going_to_delete_multiple_items));
|
||||
delete_dialog.setMultiChoiceItems(new String[]{getString(R.string.delete_files_too)}, new boolean[]{false}, (dialogInterface, i, b) -> delete_file[0] = b);
|
||||
delete_dialog.setNegativeButton(getString(R.string.cancel), (dialogInterface, i) -> {
|
||||
dialogInterface.cancel();
|
||||
});
|
||||
delete_dialog.setPositiveButton(getString(R.string.ok), (dialogInterface, i) -> {
|
||||
for (int j = 0; j < selectedObjects.size(); j++){
|
||||
Video v = selectedObjects.get(j);
|
||||
int position = downloadsObjects.indexOf(v);
|
||||
downloadsObjects.remove(v);
|
||||
downloadsRecyclerViewAdapter.notifyItemRemoved(position);
|
||||
downloadsRecyclerViewAdapter.setVideoList(downloadsObjects);
|
||||
dbManager.clearHistoryItem(v, delete_file[0]);
|
||||
}
|
||||
updateWebsiteChips();
|
||||
dbManager.close();
|
||||
selectedObjects = new ArrayList<>();
|
||||
downloadsRecyclerViewAdapter.clearCheckedVideos();
|
||||
deleteFab.setVisibility(View.GONE);
|
||||
|
||||
if(downloadsObjects.size() == 0){
|
||||
uiHandler.post(() -> {
|
||||
no_results.setVisibility(View.VISIBLE);
|
||||
selectionChips.setVisibility(View.GONE);
|
||||
websiteGroup.removeAllViews();
|
||||
});
|
||||
}
|
||||
});
|
||||
delete_dialog.show();
|
||||
}
|
||||
|
||||
private void removedownloadsItem(int position){
|
||||
if(bottomSheet != null) bottomSheet.hide();
|
||||
final boolean[] delete_file = {false};
|
||||
dbManager = new DBManager(context);
|
||||
|
||||
Video v = downloadsObjects.get(position);
|
||||
MaterialAlertDialogBuilder delete_dialog = new MaterialAlertDialogBuilder(fragmentContext);
|
||||
|
|
@ -578,9 +638,9 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
downloadsObjects.remove(position);
|
||||
downloadsRecyclerViewAdapter.notifyItemRemoved(position);
|
||||
downloadsRecyclerViewAdapter.setVideoList(downloadsObjects);
|
||||
downloadsRecyclerViewAdapter.setWebsiteList();
|
||||
updateWebsiteChips();
|
||||
dbManager.clearHistoryItem(v, delete_file[0]);
|
||||
dbManager.close();
|
||||
|
||||
if(downloadsObjects.size() == 0){
|
||||
uiHandler.post(() -> {
|
||||
|
|
@ -610,8 +670,22 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
startActivity(i);
|
||||
}
|
||||
|
||||
private void openFileIntent(int position){
|
||||
String downloadPath =downloadsObjects.get(position).getDownloadPath();
|
||||
File file = new File(downloadPath);
|
||||
|
||||
Uri uri = FileProvider.getUriForFile(fragmentContext, fragmentContext.getPackageName() + ".fileprovider", file);
|
||||
String mime = mainActivity.getContentResolver().getType(uri);
|
||||
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setDataAndType(uri, mime);
|
||||
i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
if(bottomSheet != null) bottomSheet.hide();
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCardClick(int position) {
|
||||
public void onCardClick(int position, boolean isFilePresent) {
|
||||
bottomSheet = new BottomSheetDialog(fragmentContext);
|
||||
bottomSheet.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
bottomSheet.setContentView(R.layout.downloads_bottom_sheet);
|
||||
|
|
@ -628,19 +702,32 @@ public class DownloadsFragment extends Fragment implements DownloadsRecyclerView
|
|||
link.setText(url);
|
||||
link.setTag(position);
|
||||
link.setOnClickListener(this);
|
||||
link.setOnLongClickListener(this);
|
||||
|
||||
Button remove = bottomSheet.findViewById(R.id.bottomsheet_remove_button);
|
||||
remove.setTag(position);
|
||||
remove.setOnClickListener(this);
|
||||
|
||||
Button openLink = bottomSheet.findViewById(R.id.bottomsheet_open_link_button);
|
||||
openLink.setTag(position);
|
||||
openLink.setOnClickListener(this);
|
||||
Button openFile = bottomSheet.findViewById(R.id.bottomsheet_open_file_button);
|
||||
openFile.setTag(position);
|
||||
openFile.setOnClickListener(this);
|
||||
if (!isFilePresent) openFile.setVisibility(View.GONE);
|
||||
|
||||
bottomSheet.show();
|
||||
bottomSheet.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCardSelect(int position, boolean add) {
|
||||
Video video = downloadsObjects.get(position);
|
||||
if (add) selectedObjects.add(video); else selectedObjects.remove(video);
|
||||
if(selectedObjects.size() > 1){
|
||||
deleteFab.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
deleteFab.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onButtonClick(int position) {
|
||||
Video vid = downloadsObjects.get(position);
|
||||
|
|
|
|||
5
app/src/main/res/drawable/ic_baseline_file_open_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_file_open_24.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="24dp" android:tint="#00A6FF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M14,2H6C4.9,2 4,2.9 4,4v16c0,1.1 0.89,2 1.99,2H15v-8h5V8L14,2zM13,9V3.5L18.5,9H13zM17,21.66V16h5.66v2h-2.24l2.95,2.95l-1.41,1.41L19,19.41l0,2.24H17z"/>
|
||||
</vector>
|
||||
|
|
@ -50,8 +50,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="right"
|
||||
android:layout_margin="20dp"
|
||||
android:gravity="end"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
|
|
@ -59,18 +59,18 @@
|
|||
android:id="@+id/bottomsheet_remove_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:icon="@drawable/ic_baseline_delete_outline_24"
|
||||
android:text="@string/Remove" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Material3.Button.TonalButton.Icon"
|
||||
android:id="@+id/bottomsheet_open_link_button"
|
||||
style="@style/Widget.Material3.Button.ElevatedButton.Icon"
|
||||
android:id="@+id/bottomsheet_open_file_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/Open_Link"
|
||||
app:icon="@drawable/ic_baseline_open_in_new_24"
|
||||
android:autoLink="all"/>
|
||||
android:text="@string/Open_File"
|
||||
app:icon="@drawable/ic_baseline_file_open_24"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<androidx.cardview.widget.CardView
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/downloads_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
|
@ -22,6 +23,8 @@
|
|||
app:cardElevation="10dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
app:cardBackgroundColor="@color/black"
|
||||
android:checkable="true"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
|
|
@ -111,10 +114,9 @@
|
|||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -100,37 +100,19 @@
|
|||
</HorizontalScrollView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/recycler_view_downloads"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/chips_recycler_horizontalscrollview"
|
||||
android:scrollbars="vertical"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="150dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
>
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/recycler_view_progress_downloads"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/chips_recycler_horizontalscrollview"
|
||||
android:scrollbars="vertical"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:clipToPadding="false"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="150dp"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
>
|
||||
android:scrollbars="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
|
||||
<com.facebook.shimmer.ShimmerFrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
|
|
@ -177,6 +159,24 @@
|
|||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/delete_selected_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/delete_selected_fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:text="@string/delete_selected"
|
||||
app:icon="@drawable/ic_delete_all"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
<include layout="@layout/downloads_no_results"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
|
|
|||
|
|
@ -123,4 +123,10 @@
|
|||
<string name="add_chapter">Vendos Kapituj</string>
|
||||
<string name="show_download_card">Shfaq kartën e shkarkimit</string>
|
||||
<string name="download_card_summary">Konfiguro videon përpara se sa ta shkarkosh</string>
|
||||
<string name="mutliple_titles">Disa Tituj</string>
|
||||
<string name="mutliple_authors">Disa Autorë</string>
|
||||
<string name="Open_File">Hap Skedarin</string>
|
||||
<string name="delete_selected">Fshi të zgjedhurat</string>
|
||||
<string name="you_are_going_to_delete_multiple_items">Je duke fshirë disa elementë</string>
|
||||
<string name="delete_files_too">Fshi skedarët nga sistemi</string>
|
||||
</resources>
|
||||
|
|
@ -130,4 +130,8 @@
|
|||
<string name="download_card_summary">Configure the item before downloading it</string>
|
||||
<string name="mutliple_titles">Multiple Titles</string>
|
||||
<string name="mutliple_authors">Multiple Authors</string>
|
||||
<string name="Open_File">Open File</string>
|
||||
<string name="delete_selected">Delete Selected</string>
|
||||
<string name="you_are_going_to_delete_multiple_items">You are going to delete multiple items</string>
|
||||
<string name="delete_files_too">Delete the files from the system</string>
|
||||
</resources>
|
||||
|
|
|
|||
9
app/src/main/res/xml/provider_paths.xml
Normal file
9
app/src/main/res/xml/provider_paths.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<external-path
|
||||
name="external_files"
|
||||
path="." />
|
||||
<cache-path
|
||||
name="cache"
|
||||
path="." />
|
||||
</paths>
|
||||
Loading…
Reference in a new issue