Skip to content

Commit

Permalink
Revert name change
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Jul 29, 2024
1 parent a25a941 commit 7de0995
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static void launch(
final AppSettings as = ApplicationObject.settings();

final Intent intent;
if (GsFileBrowserListAdapter.isVirtualFolder(file) || file.isDirectory()) {
if (GsFileBrowserListAdapter.isVirtualStorage(file) || file.isDirectory()) {
intent = new Intent(activity, MainActivity.class);
} else {
intent = new Intent(activity, DocumentActivity.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ protected void onNewIntent(final Intent intent) {
final File file = MarkorContextUtils.getValidIntentFile(intent, null);
if (_notebook != null && file != null) {
_viewPager.setCurrentItem(tabIdToPos(R.id.nav_notebook), false);
if (file.isDirectory() || GsFileBrowserListAdapter.isVirtualFolder(file)) {
if (file.isDirectory() || GsFileBrowserListAdapter.isVirtualStorage(file)) {
_notebook.setCurrentFolder(file);
} else {
_notebook.getAdapter().showFile(file);
Expand Down Expand Up @@ -429,7 +429,7 @@ public void onFsViewerConfig(GsFileBrowserOptions.Options dopt) {
dopt.rootFolder = _appSettings.getNotebookDirectory();
final File fallback = _appSettings.getFolderToLoadByMenuId(_appSettings.getAppStartupFolderMenuId());
final File file = MarkorContextUtils.getValidIntentFile(getIntent(), fallback);
if (!GsFileBrowserListAdapter.isVirtualFolder(file) && file.isFile()) {
if (!GsFileBrowserListAdapter.isVirtualStorage(file) && file.isFile()) {
dopt.startFolder = file.getParentFile();
toShow = file;
} else {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/net/gsantner/markor/model/AppSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public void addRecentFile(final File file) {
public void setFavouriteFiles(final Collection<File> files) {
final Set<String> set = new LinkedHashSet<>();
for (final File f : files) {
if (f != null && (f.exists() || GsFileBrowserListAdapter.isVirtualFolder(f))) {
if (f != null && (f.exists() || GsFileBrowserListAdapter.isVirtualStorage(f))) {
set.add(f.getAbsolutePath());
}
}
Expand Down Expand Up @@ -600,7 +600,7 @@ public static Set<File> getFileSet(final List<String> paths) {
final Set<File> set = new LinkedHashSet<>();
for (final String fp : paths) {
final File f = new File(fp);
if (f.exists() || GsFileBrowserListAdapter.isVirtualFolder(f)) {
if (f.exists() || GsFileBrowserListAdapter.isVirtualStorage(f)) {
set.add(f);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static File getIntentFile(final Intent intent, final File fallback) {

public static File getValidIntentFile(final Intent intent, final File fallback) {
final File f = getIntentFile(intent, null);
return f != null && (f.exists() || GsFileBrowserListAdapter.isVirtualFolder(f)) ? f : fallback;
return f != null && (f.exists() || GsFileBrowserListAdapter.isVirtualStorage(f)) ? f : fallback;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ private void importFileToCurrentDirectory(Context context, File sourceFile) {
}

public void setCurrentFolder(final File folder) {
if (folder != null && (folder.canRead() || GsFileBrowserListAdapter.isVirtualFolder(folder)) && _filesystemViewerAdapter != null) {
if (folder != null && (folder.canRead() || GsFileBrowserListAdapter.isVirtualStorage(folder)) && _filesystemViewerAdapter != null) {
_filesystemViewerAdapter.setCurrentFolder(folder);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleKt;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

Expand All @@ -51,7 +50,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -215,7 +213,7 @@ public void onBindViewHolder(@NonNull FilesystemViewerViewHolder holder, int pos
holder.title.setText(isGoUp ? ".." : titleText, TextView.BufferType.SPANNABLE);
holder.title.setTextColor(ContextCompat.getColor(_context, _dopt.primaryTextColor));

if (!isFileWriteable(displayFile, isGoUp) && !isVirtualFolder(displayFile) && holder.title.length() > 0) {
if (!isFileWriteable(displayFile, isGoUp) && !isVirtualStorage(displayFile) && holder.title.length() > 0) {
try {
((Spannable) holder.title.getText()).setSpan(STRIKE_THROUGH_SPAN, 0, holder.title.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} catch (Exception ignored) {
Expand Down Expand Up @@ -294,7 +292,7 @@ public void restoreSavedInstanceState(final Bundle savedInstanceState) {
final String path = savedInstanceState.getString(EXTRA_CURRENT_FOLDER);
if (path != null) {
final File f = new File(path);
final boolean isVirtualDirectory = _virtualMapping.containsKey(f) || isVirtualFolder(f);
final boolean isVirtualDirectory = _virtualMapping.containsKey(f) || isVirtualStorage(f);

if (isVirtualDirectory && _dopt != null && _dopt.listener != null) {
_dopt.listener.onFsViewerConfig(_dopt);
Expand Down Expand Up @@ -328,7 +326,7 @@ public void reconfigure() {
}

public boolean isCurrentFolderVirtual() {
return isVirtualFolder(_currentFolder);
return isVirtualStorage(_currentFolder);
}

public static class TagContainer {
Expand Down Expand Up @@ -410,7 +408,7 @@ public void onClick(View view) {
}
} else if (file != null) {
// No pre-selection
if (file.isDirectory() || isVirtualFolder(file)) {
if (file.isDirectory() || isVirtualStorage(file)) {
loadFolder(file, isParent(file, _currentFolder) ? _currentFolder : null);
} else if (file.isFile()) {
_currentFile = file;
Expand Down Expand Up @@ -710,7 +708,7 @@ private void loadFolder(final File folder, final @Nullable File toShow) {

if (canGoUp(folder)) {
if (
isVirtualFolder(folder) ||
isVirtualStorage(folder) ||
_virtualMapping.containsValue(folder) ||
!GsFileUtils.isChild(VIRTUAL_STORAGE_ROOT, folder)
) {
Expand Down Expand Up @@ -868,7 +866,7 @@ public static class FilesystemViewerViewHolder extends RecyclerView.ViewHolder {
}
}

public static boolean isVirtualFolder(final File file) {
public static boolean isVirtualStorage(final File file) {
return VIRTUAL_STORAGE_RECENTS.equals(file) ||
VIRTUAL_STORAGE_FAVOURITE.equals(file) ||
VIRTUAL_STORAGE_POPULAR.equals(file) ||
Expand Down

0 comments on commit 7de0995

Please sign in to comment.