fixed history items not having proper indexes
This commit is contained in:
parent
542121d446
commit
82b24c4ea2
20 changed files with 121 additions and 229 deletions
|
|
@ -2,7 +2,7 @@
|
|||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 1,
|
||||
"identityHash": "1709c1d446102722d4dc7f2cb96cd40e",
|
||||
"identityHash": "e2280d10a40623d3a51ecf5205500351",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "results",
|
||||
|
|
@ -142,7 +142,7 @@
|
|||
},
|
||||
{
|
||||
"tableName": "downloads",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT NOT NULL, `title` TEXT NOT NULL, `author` TEXT NOT NULL, `duration` TEXT NOT NULL, `thumb` TEXT NOT NULL, `formatId` INTEGER NOT NULL, `formatDesc` TEXT NOT NULL, `downloadPath` TEXT NOT NULL, `website` TEXT NOT NULL, `downloadSize` TEXT NOT NULL)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT NOT NULL, `title` TEXT NOT NULL, `author` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `thumb` TEXT NOT NULL, `formatId` INTEGER NOT NULL, `formatDesc` TEXT NOT NULL, `downloadPath` TEXT NOT NULL, `website` TEXT NOT NULL, `downloadSize` TEXT NOT NULL, `progress` REAL NOT NULL, `custom` INTEGER NOT NULL, `customTemplateId` INTEGER NOT NULL)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
|
|
@ -169,8 +169,14 @@
|
|||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "duration",
|
||||
"columnName": "duration",
|
||||
"fieldPath": "startTime",
|
||||
"columnName": "startTime",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "endTime",
|
||||
"columnName": "endTime",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
|
|
@ -209,6 +215,24 @@
|
|||
"columnName": "downloadSize",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "progress",
|
||||
"columnName": "progress",
|
||||
"affinity": "REAL",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "custom",
|
||||
"columnName": "custom",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "customTemplateId",
|
||||
"columnName": "customTemplateId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
|
|
@ -224,7 +248,7 @@
|
|||
"views": [],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1709c1d446102722d4dc7f2cb96cd40e')"
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'e2280d10a40623d3a51ecf5205500351')"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -34,12 +34,12 @@ import java.util.Calendar;
|
|||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class HistoryRecyclerViewAdapter extends ListAdapter<HistoryItem, HistoryRecyclerViewAdapter.ViewHolder> {
|
||||
public class HistoryAdapter extends ListAdapter<HistoryItem, HistoryAdapter.ViewHolder> {
|
||||
private ArrayList<Integer> checkedItems;
|
||||
private final OnItemClickListener onItemClickListener;
|
||||
private Activity activity;
|
||||
|
||||
public HistoryRecyclerViewAdapter(OnItemClickListener onItemClickListener, Activity activity) {
|
||||
public HistoryAdapter(OnItemClickListener onItemClickListener, Activity activity) {
|
||||
super(DIFF_CALLBACK);
|
||||
this.checkedItems = new ArrayList<>();
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
|
|
@ -78,7 +78,7 @@ public class HistoryRecyclerViewAdapter extends ListAdapter<HistoryItem, History
|
|||
View cardView = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.downloads_card, parent, false);
|
||||
|
||||
return new HistoryRecyclerViewAdapter.ViewHolder(cardView, onItemClickListener);
|
||||
return new HistoryAdapter.ViewHolder(cardView, onItemClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -4,14 +4,12 @@ import android.app.Activity;
|
|||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
|
@ -25,13 +23,13 @@ import com.squareup.picasso.Picasso;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class HomeRecyclerViewAdapter extends RecyclerView.Adapter<HomeRecyclerViewAdapter.ViewHolder> {
|
||||
public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.ViewHolder> {
|
||||
private ArrayList<Video> videoList;
|
||||
private ArrayList<Integer> checkedVideos;
|
||||
private final OnItemClickListener onItemClickListener;
|
||||
private Activity activity;
|
||||
|
||||
public HomeRecyclerViewAdapter(ArrayList<Video> videos, OnItemClickListener onItemClickListener, Activity activity){
|
||||
public HomeAdapter(ArrayList<Video> videos, OnItemClickListener onItemClickListener, Activity activity){
|
||||
this.videoList = videos;
|
||||
this.checkedVideos = new ArrayList<>();
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
|
|
@ -58,7 +56,7 @@ public class HomeRecyclerViewAdapter extends RecyclerView.Adapter<HomeRecyclerVi
|
|||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View cardView = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.result_card, parent, false);
|
||||
return new HomeRecyclerViewAdapter.ViewHolder(cardView, onItemClickListener);
|
||||
return new HomeAdapter.ViewHolder(cardView, onItemClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -90,13 +88,13 @@ public class HomeRecyclerViewAdapter extends RecyclerView.Adapter<HomeRecyclerVi
|
|||
|
||||
// Bottom Info ----------------------------------
|
||||
|
||||
TextView bottomInfo = card.findViewById(R.id.result_info_bottom);
|
||||
String info = video.getAuthor();
|
||||
TextView author = card.findViewById(R.id.author);
|
||||
author.setText(video.getAuthor());
|
||||
|
||||
TextView duration = card.findViewById(R.id.duration);
|
||||
if (!video.getDuration().isEmpty()){
|
||||
if (!video.getAuthor().isEmpty()) info += " • ";
|
||||
info += video.getDuration();
|
||||
duration.setText(video.getDuration());
|
||||
}
|
||||
bottomInfo.setText(info);
|
||||
|
||||
// BUTTONS ----------------------------------
|
||||
String videoID = video.getVideoId();
|
||||
|
|
@ -10,11 +10,15 @@ data class DownloadItem(
|
|||
val url: String,
|
||||
val title: String,
|
||||
val author: String,
|
||||
val duration: String,
|
||||
val startTime: String,
|
||||
val endTime: String,
|
||||
val thumb: String,
|
||||
val formatId: Int,
|
||||
val formatDesc: String,
|
||||
val downloadPath: String,
|
||||
val website: String,
|
||||
val downloadSize: String
|
||||
val downloadSize: String,
|
||||
val progress: Float,
|
||||
val custom: Boolean,
|
||||
val customTemplateId: Int
|
||||
)
|
||||
|
|
@ -30,7 +30,6 @@ class HistoryRepository(private val historyDao: HistoryDao) {
|
|||
}
|
||||
|
||||
suspend fun delete(item: HistoryItem, deleteFile: Boolean){
|
||||
Log.e("ASd", item.id.toString())
|
||||
historyDao.delete(item.id)
|
||||
if (deleteFile){
|
||||
val fileUtil = FileUtil()
|
||||
|
|
@ -54,7 +53,7 @@ class HistoryRepository(private val historyDao: HistoryDao) {
|
|||
val fileUtil = FileUtil()
|
||||
items.value?.forEach { item ->
|
||||
if (!fileUtil.exists(item.downloadPath)){
|
||||
delete(item, false)
|
||||
historyDao.delete(item.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class CustomCommandActivity extends AppCompatActivity {
|
|||
topAppBar = findViewById(R.id.custom_command_toolbar);
|
||||
topAppBar.setNavigationOnClickListener(view -> onBackPressed());
|
||||
output = findViewById(R.id.custom_command_output);
|
||||
output.setMovementMethod(new ScrollingMovementMethod());
|
||||
output.setTextIsSelectable(true);
|
||||
|
||||
input = findViewById(R.id.command_edittext);
|
||||
input.requestFocus();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.deniscerri.ytdlnis.MainActivity
|
||||
import com.deniscerri.ytdlnis.R
|
||||
import com.deniscerri.ytdlnis.adapter.HistoryRecyclerViewAdapter
|
||||
import com.deniscerri.ytdlnis.adapter.HistoryAdapter
|
||||
import com.deniscerri.ytdlnis.database.DatabaseManager
|
||||
import com.deniscerri.ytdlnis.database.models.HistoryItem
|
||||
import com.deniscerri.ytdlnis.database.repository.HistoryRepository.HistorySort
|
||||
|
|
@ -39,7 +39,7 @@ import java.io.File
|
|||
/**
|
||||
* A fragment representing a list of Items.
|
||||
*/
|
||||
class DownloadsFragment : Fragment(), HistoryRecyclerViewAdapter.OnItemClickListener,
|
||||
class DownloadsFragment : Fragment(), HistoryAdapter.OnItemClickListener,
|
||||
OnClickListener, OnLongClickListener {
|
||||
private lateinit var historyViewModel : HistoryViewModel
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ class DownloadsFragment : Fragment(), HistoryRecyclerViewAdapter.OnItemClickList
|
|||
private var shimmerCards: ShimmerFrameLayout? = null
|
||||
private var topAppBar: MaterialToolbar? = null
|
||||
private var recyclerView: RecyclerView? = null
|
||||
private var historyRecyclerViewAdapter: HistoryRecyclerViewAdapter? = null
|
||||
private var historyAdapter: HistoryAdapter? = null
|
||||
private var bottomSheet: BottomSheetDialog? = null
|
||||
private var sortSheet: BottomSheetDialog? = null
|
||||
private var uiHandler: Handler? = null
|
||||
|
|
@ -102,14 +102,14 @@ class DownloadsFragment : Fragment(), HistoryRecyclerViewAdapter.OnItemClickList
|
|||
downloadsList = mutableListOf()
|
||||
allDownloadsList = mutableListOf()
|
||||
|
||||
historyRecyclerViewAdapter =
|
||||
HistoryRecyclerViewAdapter(
|
||||
historyAdapter =
|
||||
HistoryAdapter(
|
||||
this,
|
||||
activity
|
||||
)
|
||||
recyclerView = view.findViewById(R.id.recyclerviewdownloadss)
|
||||
recyclerView?.layoutManager = LinearLayoutManager(context)
|
||||
recyclerView?.adapter = historyRecyclerViewAdapter
|
||||
recyclerView?.adapter = historyAdapter
|
||||
|
||||
noResults?.visibility = GONE
|
||||
selectionChips?.visibility = VISIBLE
|
||||
|
|
@ -131,7 +131,7 @@ class DownloadsFragment : Fragment(), HistoryRecyclerViewAdapter.OnItemClickList
|
|||
}
|
||||
|
||||
historyViewModel.getFilteredList().observe(viewLifecycleOwner) {
|
||||
historyRecyclerViewAdapter!!.submitList(it)
|
||||
historyAdapter!!.submitList(it)
|
||||
downloadsList = it
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ class DownloadsFragment : Fragment(), HistoryRecyclerViewAdapter.OnItemClickList
|
|||
historyViewModel.delete(item, deleteFile[0])
|
||||
}
|
||||
selectedObjects = ArrayList()
|
||||
historyRecyclerViewAdapter!!.clearCheckedVideos()
|
||||
historyAdapter!!.clearCheckedVideos()
|
||||
deleteFab!!.visibility = GONE
|
||||
}
|
||||
deleteDialog.show()
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import androidx.fragment.app.Fragment;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.deniscerri.ytdlnis.MainActivity;
|
||||
import com.deniscerri.ytdlnis.R;
|
||||
import com.deniscerri.ytdlnis.adapter.HomeRecyclerViewAdapter;
|
||||
import com.deniscerri.ytdlnis.adapter.HomeAdapter;
|
||||
import com.deniscerri.ytdlnis.util.InfoUtil;
|
||||
import com.deniscerri.ytdlnis.database.DatabaseManager;
|
||||
import com.deniscerri.ytdlnis.database.Video;
|
||||
|
|
@ -56,7 +56,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.OnItemClickListener, View.OnClickListener {
|
||||
public class HomeFragment extends Fragment implements HomeAdapter.OnItemClickListener, View.OnClickListener {
|
||||
private boolean downloading = false;
|
||||
private View fragmentView;
|
||||
private LinearProgressIndicator progressBar;
|
||||
|
|
@ -64,7 +64,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
private LinkedList<String> inputQueries;
|
||||
private int inputQueriesLength = 0;
|
||||
private RecyclerView recyclerView;
|
||||
private HomeRecyclerViewAdapter homeRecyclerViewAdapter;
|
||||
private HomeAdapter homeAdapter;
|
||||
private ScrollView searchSuggestions;
|
||||
private LinearLayout searchSuggestionsLinearLayout;
|
||||
private ShimmerFrameLayout shimmerCards;
|
||||
|
|
@ -131,7 +131,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
item = findVideo(url);
|
||||
if (type.equals("audio")) item.setDownloadingAudio(false);
|
||||
else if (type.equals("video")) item.setDownloadingVideo(false);
|
||||
homeRecyclerViewAdapter.notifyItemChanged(resultObjects.indexOf(item));
|
||||
homeAdapter.notifyItemChanged(resultObjects.indexOf(item));
|
||||
|
||||
downloading = false;
|
||||
topAppBar.getMenu().findItem(R.id.cancel_download).setVisible(false);
|
||||
|
|
@ -148,7 +148,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
updateDownloadingStatusOnResult(item, type, false);
|
||||
if (type.equals("audio")) item.setDownloadedAudio(1);
|
||||
else item.setDownloadedVideo(1);
|
||||
homeRecyclerViewAdapter.notifyItemChanged(resultObjects.indexOf(findVideo(url)));
|
||||
homeAdapter.notifyItemChanged(resultObjects.indexOf(findVideo(url)));
|
||||
updateDownloadStatusOnResult(item, type, true);
|
||||
downloading = false;
|
||||
topAppBar.getMenu().findItem(R.id.cancel_download).setVisible(false);
|
||||
|
|
@ -231,8 +231,8 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
searchSuggestions = fragmentView.findViewById(R.id.search_suggestions_scroll_view);
|
||||
searchSuggestionsLinearLayout = fragmentView.findViewById(R.id.search_suggestions_linear_layout);
|
||||
|
||||
homeRecyclerViewAdapter = new HomeRecyclerViewAdapter(resultObjects, this, activity);
|
||||
recyclerView.setAdapter(homeRecyclerViewAdapter);
|
||||
homeAdapter = new HomeAdapter(resultObjects, this, activity);
|
||||
recyclerView.setAdapter(homeAdapter);
|
||||
|
||||
initMenu();
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
databaseManager.clearResults();
|
||||
databaseManager.close();
|
||||
inputQueriesLength = inputQueries.size();
|
||||
homeRecyclerViewAdapter.clear();
|
||||
homeAdapter.clear();
|
||||
|
||||
shimmerCards.startShimmer();
|
||||
shimmerCards.setVisibility(View.VISIBLE);
|
||||
|
|
@ -291,7 +291,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
|
||||
|
||||
private void initCards() {
|
||||
homeRecyclerViewAdapter.clear();
|
||||
homeAdapter.clear();
|
||||
Handler uiHandler = new Handler(Looper.getMainLooper());
|
||||
try {
|
||||
Thread thread = new Thread(() -> {
|
||||
|
|
@ -316,7 +316,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
}
|
||||
}else {
|
||||
if (!downloading){
|
||||
homeRecyclerViewAdapter.add(resultObjects);
|
||||
homeAdapter.add(resultObjects);
|
||||
for (int i = 0; i < resultObjects.size(); i++){
|
||||
Video tmp = resultObjects.get(i);
|
||||
if(tmp.isDownloading()){
|
||||
|
|
@ -328,8 +328,8 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
}
|
||||
|
||||
uiHandler.post(() -> {
|
||||
if (homeRecyclerViewAdapter.getItemCount() != resultObjects.size()){
|
||||
homeRecyclerViewAdapter.add(resultObjects);
|
||||
if (homeAdapter.getItemCount() != resultObjects.size()){
|
||||
homeAdapter.add(resultObjects);
|
||||
}
|
||||
shimmerCards.stopShimmer();
|
||||
shimmerCards.setVisibility(View.GONE);
|
||||
|
|
@ -396,7 +396,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
|
||||
shimmerCards.startShimmer();
|
||||
shimmerCards.setVisibility(View.VISIBLE);
|
||||
homeRecyclerViewAdapter.clear();
|
||||
homeAdapter.clear();
|
||||
Thread thread = new Thread(() -> {
|
||||
parseQuery(true);
|
||||
// DOWNLOAD ALL BUTTON
|
||||
|
|
@ -504,7 +504,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
if (resetResults) databaseManager.clearResults();
|
||||
databaseManager.addToResults(resultObjects);
|
||||
homeRecyclerViewAdapter.add(res);
|
||||
homeAdapter.add(res);
|
||||
shimmerCards.stopShimmer();
|
||||
shimmerCards.setVisibility(View.GONE);
|
||||
});
|
||||
|
|
@ -537,7 +537,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
if (resetResults) databaseManager.clearResults();
|
||||
databaseManager.addToResults(resultObjects);
|
||||
homeRecyclerViewAdapter.add(res);
|
||||
homeAdapter.add(res);
|
||||
shimmerCards.stopShimmer();
|
||||
shimmerCards.setVisibility(View.GONE);
|
||||
});
|
||||
|
|
@ -556,7 +556,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
if (resetResults) databaseManager.clearResults();
|
||||
if (resetResults){
|
||||
resultObjects.clear();
|
||||
homeRecyclerViewAdapter.clear();
|
||||
homeAdapter.clear();
|
||||
}
|
||||
do {
|
||||
InfoUtil.PlaylistTuple tmp = infoUtil.getPlaylist(inputQuery, nextPageToken);
|
||||
|
|
@ -565,7 +565,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
resultObjects.addAll(tmp_vids);
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
databaseManager.addToResults(tmp_vids);
|
||||
homeRecyclerViewAdapter.add(tmp_vids);
|
||||
homeAdapter.add(tmp_vids);
|
||||
shimmerCards.stopShimmer();
|
||||
shimmerCards.setVisibility(View.GONE);
|
||||
});
|
||||
|
|
@ -583,7 +583,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
resultObjects.addAll(video);
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
if (resetResults) databaseManager.clearResults();
|
||||
homeRecyclerViewAdapter.add(video);
|
||||
homeAdapter.add(video);
|
||||
databaseManager.addToResults(resultObjects);
|
||||
});
|
||||
}
|
||||
|
|
@ -675,7 +675,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
if (v != null) {
|
||||
if (type.equals("audio")) v.setDownloadingAudio(isDownloading);
|
||||
else if (type.equals("video")) v.setDownloadingVideo(isDownloading);
|
||||
homeRecyclerViewAdapter.updateVideoListItem(v, resultObjects.indexOf(v));
|
||||
homeAdapter.updateVideoListItem(v, resultObjects.indexOf(v));
|
||||
databaseManager = new DatabaseManager(context);
|
||||
try {
|
||||
databaseManager.updateDownloadingStatusOnResult(v.getVideoId(), type, isDownloading);
|
||||
|
|
@ -719,7 +719,7 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
//remove previously selected
|
||||
for (int i = 0; i < selectedObjects.size(); i++) {
|
||||
Video vid = findVideo(selectedObjects.get(i).getURL());
|
||||
homeRecyclerViewAdapter.notifyItemChanged(resultObjects.indexOf(vid));
|
||||
homeAdapter.notifyItemChanged(resultObjects.indexOf(vid));
|
||||
}
|
||||
selectedObjects = new ArrayList<>();
|
||||
downloadFabs.setVisibility(View.GONE);
|
||||
|
|
@ -802,11 +802,11 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
Video vid = findVideo(selectedObjects.get(i).getURL());
|
||||
vid.setDownloadedType(type);
|
||||
updateDownloadingStatusOnResult(vid, type, true);
|
||||
homeRecyclerViewAdapter.notifyItemChanged(resultObjects.indexOf(vid));
|
||||
homeAdapter.notifyItemChanged(resultObjects.indexOf(vid));
|
||||
downloadQueue.add(vid);
|
||||
}
|
||||
selectedObjects = new ArrayList<>();
|
||||
homeRecyclerViewAdapter.clearCheckedVideos();
|
||||
homeAdapter.clearCheckedVideos();
|
||||
downloadFabs.setVisibility(View.GONE);
|
||||
|
||||
if(isStoragePermissionGranted()){
|
||||
|
|
@ -985,11 +985,11 @@ public class HomeFragment extends Fragment implements HomeRecyclerViewAdapter.On
|
|||
Video vid = findVideo(selectedObjects.get(i).getURL());
|
||||
vid.setDownloadedType(type);
|
||||
updateDownloadingStatusOnResult(vid, type, true);
|
||||
homeRecyclerViewAdapter.notifyItemChanged(resultObjects.indexOf(vid));
|
||||
homeAdapter.notifyItemChanged(resultObjects.indexOf(vid));
|
||||
downloadQueue.add(vid);
|
||||
}
|
||||
selectedObjects = new ArrayList<>();
|
||||
homeRecyclerViewAdapter.clearCheckedVideos();
|
||||
homeAdapter.clearCheckedVideos();
|
||||
downloadFabs.setVisibility(View.GONE);
|
||||
|
||||
if(isStoragePermissionGranted()){
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<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="M19,19H5V5h7V3H5c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2v-7h-2v7zM14,3v2h3.59l-9.83,9.83 1.41,1.41L19,6.41V10h2V3h-7z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:height="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?attr/colorAccent" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:height="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?android:textColorPrimary" android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<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="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
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="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:height="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?android:colorAccent" android:pathData="M4.27,3L3,4.27l9,9v0.28c-0.59,-0.34 -1.27,-0.55 -2,-0.55 -2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4v-1.73L19.73,21 21,19.73 4.27,3zM14,7h4V3h-6v5.18l2,2z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:height="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?android:textColorPrimary" android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:height="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?android:colorAccent" android:pathData="M21,6.5l-4,4V7c0,-0.55 -0.45,-1 -1,-1H9.82L21,17.18V6.5zM3.27,2L2,3.27 4.73,6H4c-0.55,0 -1,0.45 -1,1v10c0,0.55 0.45,1 1,1h12c0.21,0 0.39,-0.08 0.54,-0.18L19.73,21 21,19.73 3.27,2z"/>
|
||||
</vector>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:alpha="1.0"/>
|
||||
</shape>
|
||||
|
|
@ -43,6 +43,7 @@
|
|||
<TextView
|
||||
android:id="@+id/custom_command_output"
|
||||
android:layout_width="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:gravity="bottom"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
|
|
|||
|
|
@ -1,112 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout android:id="@+id/downloads_element_bottom_sheet"
|
||||
style="@style/Widget.Material3.BottomSheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_gravity="center"
|
||||
>
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:layout_width="wrap_content"
|
||||
app:singleLine="true"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/test1"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/test2"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/test3"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/test5"
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:checked="true"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Material3.Button.TextButton.Icon"
|
||||
android:id="@+id/bottom_sheet_link"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:layout_gravity="center"
|
||||
app:icon="@drawable/ic_link"
|
||||
android:text="@string/app_name" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="right"
|
||||
android:layout_margin="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
||||
android:id="@+id/bottomsheet_remove_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="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"
|
||||
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"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
|
@ -46,29 +46,51 @@
|
|||
android:alpha="0.7"
|
||||
android:scaleY="100" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_title"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:paddingStart="10dp"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="2"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowColor="@color/black" />
|
||||
android:layout_height="100dp"
|
||||
android:dividerPadding="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="2"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingStart="10dp"
|
||||
android:textSize="10sp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="1.5"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowColor="@color/black" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/result_info_bottom"
|
||||
android:layout_width="250dp"
|
||||
android:id="@+id/duration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="bottom"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:paddingStart="10dp"
|
||||
android:textSize="12sp"
|
||||
|
|
|
|||
Loading…
Reference in a new issue