From 750b86f2d41874ce5ee716294b105fa591fe46fd Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Wed, 17 Jan 2024 10:16:12 +0100 Subject: [PATCH 1/2] add translatable strings Signed-off-by: David Luhmer --- .../owncloudnewsreader/PodcastFragmentActivity.java | 13 ++++++------- News-Android-App/src/main/res/values/strings.xml | 6 +++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java index 9689dc89e..b12336cdf 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/PodcastFragmentActivity.java @@ -329,21 +329,20 @@ public void removePodcastMedia(final RssItem rssItem, final Consumer ca } AlertDialog.Builder alertDialog = new AlertDialog.Builder(this) - .setNegativeButton("Remove", (dialogInterface, i) -> { + .setNegativeButton(getString(R.string.dialog_podcast_remove_confirm), (dialogInterface, i) -> { boolean success = file.delete() && file.getParentFile().delete(); // remove audio file and parent folder if (!success) { - Toast.makeText(PodcastFragmentActivity.this, "Failed to remove media for \"" + podcastItem.title + "\"", Toast.LENGTH_SHORT).show(); + Toast.makeText(PodcastFragmentActivity.this, getString(R.string.dialog_podcast_status_failed, podcastItem.title), Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(PodcastFragmentActivity.this, "Media for \"" + podcastItem.title + "\" has been removed", Toast.LENGTH_SHORT).show(); + Toast.makeText(PodcastFragmentActivity.this, getString(R.string.dialog_podcast_status_success, podcastItem.title), Toast.LENGTH_SHORT).show(); } - callback.accept(success); }) - .setNeutralButton("Cancel", (dialogInterface, i) -> { + .setNeutralButton(getString(android.R.string.cancel), (dialogInterface, i) -> { callback.accept(false); }) - .setTitle("Are you sure?") - .setMessage("Do you want to remove downloaded media for \"" + podcastItem.title + "?\""); + .setTitle(getString(R.string.dialog_podcast_remove_title)) + .setMessage(getString(R.string.dialog_podcast_remove_body, podcastItem.title)); alertDialog.show(); } diff --git a/News-Android-App/src/main/res/values/strings.xml b/News-Android-App/src/main/res/values/strings.xml index 5fbfe1d26..9f977717e 100644 --- a/News-Android-App/src/main/res/values/strings.xml +++ b/News-Android-App/src/main/res/values/strings.xml @@ -228,7 +228,11 @@ Exit Player Playback Speed Downloading podcast - + Are you sure? + Do you want to remove downloaded media for %1$s? + Failed to remove media for %1$s + Media for %1$s has been removed + Remove About From 007c87db17fc5fd6ef85a076131552f3b9c1d218 Mon Sep 17 00:00:00 2001 From: David Luhmer Date: Wed, 17 Jan 2024 10:17:34 +0100 Subject: [PATCH 2/2] fix app crashes / show downloaded article count / refactorings Signed-off-by: David Luhmer --- .../SubscriptionExpandableListAdapter.java | 244 ++++++------------ .../adapter/NewsListRecyclerAdapter.java | 28 +- .../database/DatabaseConnectionOrm.java | 11 +- 3 files changed, 104 insertions(+), 179 deletions(-) diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ListView/SubscriptionExpandableListAdapter.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ListView/SubscriptionExpandableListAdapter.java index 6d6f98f9b..3ced3d259 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ListView/SubscriptionExpandableListAdapter.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/ListView/SubscriptionExpandableListAdapter.java @@ -78,7 +78,7 @@ public class SubscriptionExpandableListAdapter extends BaseExpandableListAdapter private boolean showOnlyUnread = false; private SparseArray starredCountFeeds; - private SparseArray downloadedPodcastsCount; + private int downloadedPodcastsCount; private SparseArray unreadCountFolders; private SparseArray unreadCountFeeds; @@ -117,7 +117,7 @@ public SubscriptionExpandableListAdapter(Context mContext, DatabaseConnectionOrm unreadCountFeeds = new SparseArray<>(); unreadCountFolders = new SparseArray<>(); starredCountFeeds = new SparseArray<>(); - downloadedPodcastsCount = new SparseArray<>(); + downloadedPodcastsCount = 0; mCategoriesArrayList = new ArrayList<>(); mItemsArrayList = new SparseArray<>(); @@ -153,33 +153,24 @@ public View getChildView(int groupPosition, int childPosition, } - if(item != null) - { - String headerText = (item.header != null) ? item.header : ""; - viewHolder.binding.summary.setText(headerText); - + if (item != null) { + String headerText = (item.header != null) ? item.header : ""; + viewHolder.binding.summary.setText(headerText); String unreadCount; - if(item.idFolder == ALL_STARRED_ITEMS.getValue()) { + if (item.idFolder == ALL_STARRED_ITEMS.getValue()) { unreadCount = starredCountFeeds.get((int) item.id_database); - } else if(item.idFolder == ALL_DOWNLOADED_PODCASTS.getValue()) { - unreadCount = downloadedPodcastsCount.get((int) item.id_database); } else { unreadCount = unreadCountFeeds.get((int) item.id_database); } - if(unreadCount != null) - viewHolder.binding.tvUnreadCount.setText(unreadCount); - else - viewHolder.binding.tvUnreadCount.setText(""); + viewHolder.binding.tvUnreadCount.setText(unreadCount != null ? unreadCount : ""); favIconHandler.loadFavIconForFeed(item.favIcon, viewHolder.binding.iVFavicon); - } - else - { - viewHolder.binding.summary.setText(mContext.getString(R.string.login_dialog_text_something_went_wrong)); - viewHolder.binding.tvUnreadCount.setText(""); - viewHolder.binding.iVFavicon.setImageDrawable(null); + } else { + viewHolder.binding.summary.setText(mContext.getString(R.string.login_dialog_text_something_went_wrong)); + viewHolder.binding.tvUnreadCount.setText(""); + viewHolder.binding.iVFavicon.setImageDrawable(null); } return convertView; @@ -285,10 +276,15 @@ public View getGroupView(final int groupPosition, final boolean isExpanded, View skipGetUnread = true; } - if(!skipGetUnread) { + if (!skipGetUnread) { String unreadCount = unreadCountFolders.get((int) group.id_database); - if(unreadCount != null) + if (unreadCount != null) { viewHolder.binding.tVFeedsCount.setText(unreadCount); + } + } + + if (group.id_database == ALL_DOWNLOADED_PODCASTS.getValue()) { + viewHolder.binding.tVFeedsCount.setText(String.valueOf(downloadedPodcastsCount)); } @@ -296,10 +292,9 @@ public View getGroupView(final int groupPosition, final boolean isExpanded, View int contentDescriptionId = R.string.content_desc_none; - if(group.idFolder != null) - { + if (group.idFolder != null) { viewHolder.binding.imgViewExpandableIndicator.setVisibility(View.GONE); - if(group.idFolder == ITEMS_WITHOUT_FOLDER.getValue()) + if (group.idFolder == ITEMS_WITHOUT_FOLDER.getValue()) { ConcreteFeedItem concreteFeedItem = ((ConcreteFeedItem) group); favIconHandler.loadFavIconForFeed(concreteFeedItem.favIcon, viewHolder.binding.imgViewFavicon); @@ -380,21 +375,14 @@ public Tuple, SparseArray>> showOnlyUnread = mPrefs.getBoolean(SettingsActivity.CB_SHOWONLYUNREAD_STRING, false); ArrayList mCategories = new ArrayList<>(); - SparseArray> mItems = new SparseArray<>(); - mCategories.add(new FolderSubscribtionItem(mContext.getString(R.string.allUnreadFeeds), null, ALL_UNREAD_ITEMS.getValue())); mCategories.add(new FolderSubscribtionItem(mContext.getString(R.string.starredFeeds), null, ALL_STARRED_ITEMS.getValue())); - + mCategories.add(new FolderSubscribtionItem(mContext.getString(R.string.downloadedPodcasts), null, ALL_DOWNLOADED_PODCASTS.getValue())); StopWatch sw = new StopWatch(); sw.start(); - List folderList; - //if(showOnlyUnread) { - // folderList = dbConn.getListOfFoldersWithUnreadItems(); - //} else { - folderList = dbConn.getListOfFolders(); - //} + List folderList = dbConn.getListOfFolders(); sw.stop(); Log.v(TAG, "Time needed (fetch folder list): " + sw); @@ -408,6 +396,7 @@ public Tuple, SparseArray>> mCategories.add(new ConcreteFeedItem(feed.getFeedTitle(), (long) ITEMS_WITHOUT_FOLDER.getValue(), feed.getId(), feed.getFaviconUrl(), feed.getId())); } + SparseArray> mItems = new SparseArray<>(); for (int groupPosition = 0; groupPosition < mCategories.size(); groupPosition++) { //int parent_id = (int)getGroupId(groupPosition); @@ -420,6 +409,8 @@ public Tuple, SparseArray>> feedItemList = dbConn.getAllFeedsWithUnreadRssItems(); } else if (parent_id == ALL_STARRED_ITEMS.getValue()) { feedItemList = dbConn.getAllFeedsWithStarredRssItems(); + } else if (parent_id == ALL_DOWNLOADED_PODCASTS.getValue()) { + feedItemList = dbConn.getAllFeedsWithDownloadedPodcasts(mContext); } else { for (Folder folder : folderList) {//Find the current selected folder if (folder.getId() == parent_id) {//Current item @@ -444,12 +435,60 @@ public void ReloadAdapterAsync() { new ReloadAdapterAsyncTask().execute((Void) null); } + @SuppressLint("NewApi") // wrongly reports setSelectionFromTop is only available in lollipop + public void notifyCountDataSetChanged(SparseArray unreadCountFolders, SparseArray unreadCountFeeds, SparseArray starredCountFeeds, int downloadedPodcastsCount) { + this.unreadCountFolders = unreadCountFolders; + this.unreadCountFeeds = unreadCountFeeds; + this.starredCountFeeds = starredCountFeeds; + this.downloadedPodcastsCount = downloadedPodcastsCount; + + BlockingExpandableListView bView = (BlockingExpandableListView) listView; + + int firstVisPos = bView.getFirstVisiblePosition(); + View firstVisView = bView.getChildAt(0); + int top = firstVisView != null ? firstVisView.getTop() : 0; + + // Number of items added before the first visible item + int itemsAddedBeforeFirstVisible = 0; + + bView.setBlockLayoutChildren(true); + notifyDataSetChanged(); + bView.setBlockLayoutChildren(false); + + // Call setSelectionFromTop to change the ListView position + if(bView.getCount() >= firstVisPos + itemsAddedBeforeFirstVisible) + bView.setSelectionFromTop(firstVisPos + itemsAddedBeforeFirstVisible, top); + } + + private class ReloadAdapterAsyncTask extends AsyncTask, SparseArray>>> { + + @Override + protected Tuple, SparseArray>> doInBackground(Void... voids) { + StopWatch stopWatch = new StopWatch(); + stopWatch.start(); + Tuple, SparseArray>> ad = loadCategoriesAndItemsFromDatabase(); + stopWatch.stop(); + Log.v(TAG, "Reload Adapter - time taken: " + stopWatch); + return ad; + } + + @Override + protected void onPostExecute(Tuple, SparseArray>> arrayListSparseArrayTuple) { + mCategoriesArrayList = arrayListSparseArrayTuple.key; + mItemsArrayList = arrayListSparseArrayTuple.value; + notifyDataSetChanged(); // inform list view that the data changed + notifyDataSetChangedAsync(); + super.onPostExecute(arrayListSparseArrayTuple); + } + + } + private class NotifyDataSetChangedAsyncTask extends AsyncTask { SparseArray starredCountFeedsTemp; - SparseArray downloadedPodcastsCountFeedsTemp; SparseArray unreadCountFoldersTemp; SparseArray unreadCountFeedsTemp; SparseArray urlsToFavIconsTemp; + int downloadedPodcastsCountTemp; @Override protected Void doInBackground(Void... voids) { @@ -462,7 +501,7 @@ protected Void doInBackground(Void... voids) { unreadCountFeedsTemp = temp[1]; // dbConn.getUnreadItemCountForFeed(); starredCountFeedsTemp = dbConn.getStarredItemCount(); - downloadedPodcastsCountFeedsTemp = dbConn.getDownloadedPodcastsCount(mContext); + downloadedPodcastsCountTemp = dbConn.getDownloadedPodcastsCount(mContext); urlsToFavIconsTemp = dbConn.getUrlsToFavIcons(); stopwatch.stop(); @@ -478,12 +517,16 @@ protected void onPostExecute(Void aVoid) { if(item instanceof FolderSubscribtionItem && unreadCountFoldersTemp.get(((Long) item.id_database).intValue()) == null) { - Log.v(TAG, "Remove folder item!!!"); - mCategoriesArrayList.remove(i); - i--; + Log.v(TAG, "Remove folder item: " + item.header); + + // we need to keep the ALL_DOWNLOADED_PODCASTS in case at least one article is in there + if (!(item.id_database == ALL_DOWNLOADED_PODCASTS.getValue() && downloadedPodcastsCount > 0)) { + mCategoriesArrayList.remove(i); + i--; + } } else if(item instanceof ConcreteFeedItem && unreadCountFeedsTemp.get(((Long) item.id_database).intValue()) == null) { - Log.v(TAG, "Remove feed item!!!"); + Log.v(TAG, "Remove feed item: " + item.header); mCategoriesArrayList.remove(i); i--; } /* else { @@ -503,130 +546,11 @@ protected void onPostExecute(Void aVoid) { } } - notifyCountDataSetChanged(unreadCountFoldersTemp, unreadCountFeedsTemp, starredCountFeedsTemp, downloadedPodcastsCountFeedsTemp); + notifyCountDataSetChanged(unreadCountFoldersTemp, unreadCountFeedsTemp, starredCountFeedsTemp, downloadedPodcastsCountTemp); super.onPostExecute(aVoid); } } - private class ReloadAdapterAsyncTask extends AsyncTask, SparseArray>>> { - - public ReloadAdapterAsyncTask() { - - } - - @Override - protected Tuple, SparseArray>> doInBackground(Void... voids) { - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - Tuple, SparseArray>> ad = loadCategoriesAndItemsFromDatabase(); - stopWatch.stop(); - Log.v(TAG, "Reload Adapter - time taken: " + stopWatch); - return ad; - } - - @Override - protected void onPostExecute(Tuple, SparseArray>> arrayListSparseArrayTuple) { - mCategoriesArrayList = arrayListSparseArrayTuple.key; - mItemsArrayList = arrayListSparseArrayTuple.value; - notifyDataSetChanged(); // inform list view that the data changed - notifyDataSetChangedAsync(); - super.onPostExecute(arrayListSparseArrayTuple); - } - - } - - public Tuple, SparseArray>> ReloadAdapter() - { - showOnlyUnread = mPrefs.getBoolean(SettingsActivity.CB_SHOWONLYUNREAD_STRING, false); - - ArrayList mCategoriesArrayListAsync = new ArrayList<>(); - mCategoriesArrayListAsync.add(new FolderSubscribtionItem(mContext.getString(R.string.allUnreadFeeds), null, ALL_UNREAD_ITEMS.getValue())); - mCategoriesArrayListAsync.add(new FolderSubscribtionItem(mContext.getString(R.string.starredFeeds), null, ALL_STARRED_ITEMS.getValue())); - mCategoriesArrayListAsync.add(new FolderSubscribtionItem(mContext.getString(R.string.downloadedPodcasts), null, ALL_DOWNLOADED_PODCASTS.getValue())); - - - StopWatch sw = new StopWatch(); - sw.start(); - - List folderList; - //if(showOnlyUnread) { - // folderList = dbConn.getListOfFoldersWithUnreadItems(); - //} else { - folderList = dbConn.getListOfFolders(); - //} - - sw.stop(); - Log.v(TAG, "Time needed (fetch folder list): " + sw.toString()); - - - for(Folder folder : folderList) { - mCategoriesArrayListAsync.add(new FolderSubscribtionItem(folder.getLabel(), null, folder.getId())); - } - - for(Feed feed : dbConn.getListOfFeedsWithoutFolders(showOnlyUnread)) { - mCategoriesArrayListAsync.add(new ConcreteFeedItem(feed.getFeedTitle(), (long) ITEMS_WITHOUT_FOLDER.getValue(), feed.getId(), feed.getFaviconUrl(), feed.getId())); - } - - SparseArray> mItemsArrayListAsync = new SparseArray<>(); - - for(int groupPosition = 0; groupPosition < mCategoriesArrayListAsync.size(); groupPosition++) { - //int parent_id = (int)getGroupId(groupPosition); - int parent_id = (int) mCategoriesArrayListAsync.get(groupPosition).id_database; - mItemsArrayListAsync.append(parent_id, new ArrayList<>()); - - List feedItemList = null; - - if(parent_id == ALL_UNREAD_ITEMS.getValue()) { - feedItemList = dbConn.getAllFeedsWithUnreadRssItems(); - } else if(parent_id == ALL_STARRED_ITEMS.getValue()) { - feedItemList = dbConn.getAllFeedsWithStarredRssItems(); - } else if (parent_id == ALL_DOWNLOADED_PODCASTS.getValue()) { - feedItemList = dbConn.getAllFeedsWithDownloadedPodcasts(mContext); - } else { - for(Folder folder : folderList) {//Find the current selected folder - if (folder.getId() == parent_id) {//Current item - feedItemList = dbConn.getAllFeedsWithUnreadRssItemsForFolder(folder.getId()); - break; - } - } - } - - if(feedItemList != null) { - for (Feed feed : feedItemList) { - ConcreteFeedItem newItem = new ConcreteFeedItem(feed.getFeedTitle(), (long) parent_id, feed.getId(), feed.getFaviconUrl(), feed.getId()); - mItemsArrayListAsync.get(parent_id).add(newItem); - } - } - } - - return new Tuple<>(mCategoriesArrayListAsync, mItemsArrayListAsync); - } - - @SuppressLint("NewApi") // wrongly reports setSelectionFromTop is only available in lollipop - public void notifyCountDataSetChanged(SparseArray unreadCountFolders, SparseArray unreadCountFeeds, SparseArray starredCountFeeds, SparseArray downloadedPodcastsCount) { - this.unreadCountFolders = unreadCountFolders; - this.unreadCountFeeds = unreadCountFeeds; - this.starredCountFeeds = starredCountFeeds; - this.downloadedPodcastsCount = downloadedPodcastsCount; - - BlockingExpandableListView bView = (BlockingExpandableListView) listView; - - int firstVisPos = bView.getFirstVisiblePosition(); - View firstVisView = bView.getChildAt(0); - int top = firstVisView != null ? firstVisView.getTop() : 0; - - // Number of items added before the first visible item - int itemsAddedBeforeFirstVisible = 0; - - bView.setBlockLayoutChildren(true); - notifyDataSetChanged(); - bView.setBlockLayoutChildren(false); - - // Call setSelectionFromTop to change the ListView position - if(bView.getCount() >= firstVisPos + itemsAddedBeforeFirstVisible) - bView.setSelectionFromTop(firstVisPos + itemsAddedBeforeFirstVisible, top); - } - public void setHandlerListener(ExpListTextClicked listener) { diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/NewsListRecyclerAdapter.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/NewsListRecyclerAdapter.java index 291d48c81..7a3f0ef51 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/NewsListRecyclerAdapter.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/NewsListRecyclerAdapter.java @@ -74,11 +74,7 @@ public NewsListRecyclerAdapter(FragmentActivity activity, RecyclerView recyclerV EventBus.getDefault().register(this); - if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) { - - final LinearLayoutManager linearLayoutManager = - (LinearLayoutManager) recyclerView.getLayoutManager(); - + if (recyclerView.getLayoutManager() instanceof LinearLayoutManager linearLayoutManager) { recyclerView .addOnScrollListener(new RecyclerView.OnScrollListener() { @@ -92,7 +88,8 @@ public void onScrolled(@NonNull RecyclerView recyclerView, .findLastVisibleItemPosition(); if (!loading && adapterTotalItemCount <= (lastVisibleItem + visibleThreshold) && - adapterTotalItemCount < totalItemCount) { + adapterTotalItemCount < totalItemCount && + adapterTotalItemCount > 0) { loading = true; Log.v(TAG, "start load more task..."); @@ -100,10 +97,15 @@ public void onScrolled(@NonNull RecyclerView recyclerView, recyclerView.post(() -> { // End has been reached // Do something - lazyList.add(null); - notifyItemInserted(lazyList.size() - 1); - - AsyncTaskHelper.StartAsyncTask(new LoadMoreItemsAsyncTask()); + try { + lazyList.add(null); + notifyItemInserted(lazyList.size() - 1); + AsyncTaskHelper.StartAsyncTask(new LoadMoreItemsAsyncTask()); + } catch (UnsupportedOperationException ex) { + Log.e(TAG, "error while lazy loading more items"); + // this can happen in case a podcast download is running and + // the user tries to open the Downloaded Podcast View + } }); } } @@ -378,7 +380,7 @@ protected List doInBackground(Void... params) { List rssItems = refreshAdapterData(); sw.stop(); - Log.v(TAG, "Time needed (refreshing adapter): " + sw.toString()); + Log.v(TAG, "Time needed (refreshing adapter): " + sw); return rssItems; } @@ -407,7 +409,7 @@ protected List doInBackground(Void... params) { List items = dbConn.getCurrentRssItemView(cachedPages++); sw.stop(); - Log.v(TAG, "Time needed (loading more): " + sw.toString()); + Log.v(TAG, "Time needed (loading more): " + sw); return items; } @@ -440,7 +442,7 @@ protected CurrentRssViewDataHolder doInBackground(Void... params) { holder.rssItems = list; sw.stop(); - Log.v(TAG, "Reloaded CurrentRssView - time taken: " + sw.toString()); + Log.v(TAG, "Reloaded CurrentRssView - time taken: " + sw); return holder; } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java index 662969432..1ddd060a5 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/database/DatabaseConnectionOrm.java @@ -70,7 +70,7 @@ public enum SORT_DIRECTION { asc, desc } private final static int PageSize = 25; - private Context context; + private final Context context; protected @Inject @Named("databaseFileName") String databasePath; @@ -750,16 +750,15 @@ public SparseArray getStarredItemCount() { return getStringSparseArrayFromSQL(buildSQL, 0, 1); } - public SparseArray getDownloadedPodcastsCount(Context context) { + public int getDownloadedPodcastsCount(Context context) { var ids = NewsFileUtils.getDownloadedPodcastsFingerprints(context); var files = Arrays.stream(ids).map((f) -> "\"" + f + "\"").collect(Collectors.toList()); - String buildSQL = "SELECT " + RssItemDao.Properties.FeedId.columnName + ", COUNT(1)" + // rowid as _id, + String buildSQL = "SELECT COUNT(1)" + " FROM " + RssItemDao.TABLENAME + - " WHERE " + RssItemDao.Properties.Fingerprint.columnName + " in (" + String.join(",", files) + ")" + - " GROUP BY " + RssItemDao.Properties.FeedId.columnName; + " WHERE " + RssItemDao.Properties.Fingerprint.columnName + " in (" + String.join(",", files) + ")"; - return getStringSparseArrayFromSQL(buildSQL, 0, 1); + return (int) getLongValueBySQL(buildSQL); } public void clearDatabaseOverSize()