use of com.amaze.filemanager.filesystem.HybridFileParcelable in project AmazeFileManager by TeamAmaze.
the class CompressedExplorerAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final CompressedItemViewHolder holder, int position) {
if (!stoppedAnimation) {
animate(holder);
}
final CompressedObjectParcelable rowItem = items.get(position);
GradientDrawable gradientDrawable = (GradientDrawable) holder.genericIcon.getBackground();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
holder.checkImageView.setBackground(new CircleGradientDrawable(compressedExplorerFragment.accentColor, utilsProvider.getAppTheme(), compressedExplorerFragment.getResources().getDisplayMetrics()));
} else
holder.checkImageView.setBackgroundDrawable(new CircleGradientDrawable(compressedExplorerFragment.accentColor, utilsProvider.getAppTheme(), compressedExplorerFragment.getResources().getDisplayMetrics()));
if (rowItem.type == CompressedObjectParcelable.TYPE_GOBACK) {
GlideApp.with(compressedExplorerFragment).load(R.drawable.ic_arrow_left_white_24dp).into(holder.genericIcon);
gradientDrawable.setColor(Utils.getColor(context, R.color.goback_item));
holder.txtTitle.setText("..");
holder.txtDesc.setText("");
holder.date.setText(R.string.goback);
} else {
GlideApp.with(compressedExplorerFragment).load(rowItem.iconData.image).into(holder.genericIcon);
final StringBuilder stringBuilder = new StringBuilder(rowItem.name);
if (compressedExplorerFragment.showLastModified)
holder.date.setText(Utils.getDate(rowItem.date, compressedExplorerFragment.year));
if (rowItem.directory) {
holder.genericIcon.setImageDrawable(folder);
gradientDrawable.setColor(Color.parseColor(compressedExplorerFragment.iconskin));
if (stringBuilder.toString().length() > 0) {
stringBuilder.deleteCharAt(rowItem.name.length() - 1);
try {
holder.txtTitle.setText(stringBuilder.toString().substring(stringBuilder.toString().lastIndexOf("/") + 1));
} catch (Exception e) {
holder.txtTitle.setText(rowItem.name.substring(0, rowItem.name.lastIndexOf("/")));
}
}
} else {
if (compressedExplorerFragment.showSize)
holder.txtDesc.setText(Formatter.formatFileSize(context, rowItem.size));
holder.txtTitle.setText(rowItem.name.substring(rowItem.name.lastIndexOf("/") + 1));
if (compressedExplorerFragment.coloriseIcons) {
ColorUtils.colorizeIcons(context, rowItem.filetype, gradientDrawable, Color.parseColor(compressedExplorerFragment.iconskin));
} else
gradientDrawable.setColor(Color.parseColor(compressedExplorerFragment.iconskin));
}
}
holder.rl.setOnLongClickListener(view -> {
if (rowItem.type != CompressedObjectParcelable.TYPE_GOBACK) {
toggleChecked(position, holder.checkImageView);
}
return true;
});
holder.genericIcon.setOnClickListener(view -> {
if (rowItem.type != CompressedObjectParcelable.TYPE_GOBACK) {
toggleChecked(position, holder.checkImageView);
} else {
compressedExplorerFragment.goBack();
}
});
if (utilsProvider.getAppTheme().equals(AppTheme.LIGHT)) {
holder.rl.setBackgroundResource(R.drawable.safr_ripple_white);
} else {
holder.rl.setBackgroundResource(R.drawable.safr_ripple_black);
}
holder.rl.setSelected(false);
if (itemsChecked[position]) {
// holder.genericIcon.setImageDrawable(compressedExplorerFragment.getResources().getDrawable(R.drawable.abc_ic_cab_done_holo_dark));
holder.checkImageView.setVisibility(View.VISIBLE);
gradientDrawable.setColor(Utils.getColor(context, R.color.goback_item));
holder.rl.setSelected(true);
} else
holder.checkImageView.setVisibility(View.INVISIBLE);
holder.rl.setOnClickListener(p1 -> {
if (rowItem.type == CompressedObjectParcelable.TYPE_GOBACK)
compressedExplorerFragment.goBack();
else {
if (compressedExplorerFragment.selection) {
toggleChecked(position, holder.checkImageView);
} else {
final StringBuilder stringBuilder = new StringBuilder(rowItem.name);
if (rowItem.directory)
stringBuilder.deleteCharAt(rowItem.name.length() - 1);
if (rowItem.directory) {
compressedExplorerFragment.changePath(stringBuilder.toString());
} else {
String fileName = compressedExplorerFragment.compressedFile.getName().substring(0, compressedExplorerFragment.compressedFile.getName().lastIndexOf("."));
String archiveCacheDirPath = compressedExplorerFragment.getActivity().getExternalCacheDir().getPath() + CompressedHelper.SEPARATOR + fileName;
HybridFileParcelable file = new HybridFileParcelable(archiveCacheDirPath + CompressedHelper.SEPARATOR + rowItem.name.replaceAll("\\\\", CompressedHelper.SEPARATOR));
file.setMode(OpenMode.FILE);
// this file will be opened once service finishes up it's extraction
compressedExplorerFragment.files.add(file);
// setting flag for binder to know
compressedExplorerFragment.isOpen = true;
Toast.makeText(compressedExplorerFragment.getContext(), compressedExplorerFragment.getContext().getResources().getString(R.string.please_wait), Toast.LENGTH_SHORT).show();
decompressor.decompress(compressedExplorerFragment.getActivity().getExternalCacheDir().getPath(), new String[] { rowItem.name });
}
}
}
});
}
use of com.amaze.filemanager.filesystem.HybridFileParcelable in project AmazeFileManager by TeamAmaze.
the class HiddenAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(HiddenViewHolder holder, int position) {
HybridFile file = items.get(position);
holder.txtTitle.setText(file.getName());
String a = file.getReadablePath(file.getPath());
holder.txtDesc.setText(a);
if (hide) {
holder.image.setVisibility(View.GONE);
}
// TODO: move the listeners to the constructor
holder.image.setOnClickListener(view -> {
if (!file.isSmb() && file.isDirectory()) {
ArrayList<HybridFileParcelable> a1 = new ArrayList<>();
HybridFileParcelable baseFile = new HybridFileParcelable(items.get(position).getPath() + "/.nomedia");
baseFile.setMode(OpenMode.FILE);
a1.add(baseFile);
new DeleteTask(context.getActivity().getContentResolver(), c).execute((a1));
}
dataUtils.removeHiddenFile(items.get(position).getPath());
items.remove(items.get(position));
notifyDataSetChanged();
});
holder.row.setOnClickListener(view -> {
materialDialog.dismiss();
new Thread(() -> {
if (file.isDirectory()) {
context.getActivity().runOnUiThread(() -> {
context.loadlist(file.getPath(), false, OpenMode.UNKNOWN);
});
} else {
if (!file.isSmb()) {
context.getActivity().runOnUiThread(() -> {
FileUtils.openFile(new File(file.getPath()), (MainActivity) context.getActivity(), sharedPrefs);
});
}
}
}).start();
});
}
use of com.amaze.filemanager.filesystem.HybridFileParcelable in project AmazeFileManager by TeamAmaze.
the class ItemPopupMenu method onMenuItemClick.
@Override
public boolean onMenuItemClick(MenuItem item) {
switch(item.getItemId()) {
case R.id.about:
GeneralDialogCreation.showPropertiesDialogWithPermissions((rowItem).generateBaseFile(), rowItem.permissions, (ThemedActivity) mainFragment.getActivity(), mainActivity.isRootExplorer(), utilitiesProvider.getAppTheme());
/*
PropertiesSheet propertiesSheet = new PropertiesSheet();
Bundle arguments = new Bundle();
arguments.putParcelable(PropertiesSheet.KEY_FILE, rowItem.generateBaseFile());
arguments.putString(PropertiesSheet.KEY_PERMISSION, rowItem.getPermissions());
arguments.putBoolean(PropertiesSheet.KEY_ROOT, ThemedActivity.rootMode);
propertiesSheet.setArguments(arguments);
propertiesSheet.show(main.getFragmentManager(), PropertiesSheet.TAG_FRAGMENT);
*/
return true;
case R.id.share:
switch(rowItem.getMode()) {
case DROPBOX:
case BOX:
case GDRIVE:
case ONEDRIVE:
FileUtils.shareCloudFile(rowItem.desc, rowItem.getMode(), context);
break;
default:
ArrayList<File> arrayList = new ArrayList<>();
arrayList.add(new File(rowItem.desc));
FileUtils.shareFiles(arrayList, mainFragment.getMainActivity(), utilitiesProvider.getAppTheme(), accentColor);
break;
}
return true;
case R.id.rename:
mainFragment.rename(rowItem.generateBaseFile());
return true;
case R.id.cpy:
case R.id.cut:
{
int op = item.getItemId() == R.id.cpy ? PasteHelper.OPERATION_COPY : PasteHelper.OPERATION_CUT;
PasteHelper pasteHelper = new PasteHelper(op, new HybridFileParcelable[] { rowItem.generateBaseFile() });
mainFragment.getMainActivity().setPaste(pasteHelper);
return true;
}
case R.id.ex:
mainFragment.getMainActivity().mainActivityHelper.extractFile(new File(rowItem.desc));
return true;
case R.id.book:
DataUtils dataUtils = DataUtils.getInstance();
dataUtils.addBook(new String[] { rowItem.title, rowItem.desc }, true);
mainFragment.getMainActivity().getDrawer().refreshDrawer();
Toast.makeText(mainFragment.getActivity(), mainFragment.getResources().getString(R.string.bookmarksadded), Toast.LENGTH_LONG).show();
return true;
case R.id.delete:
ArrayList<LayoutElementParcelable> positions = new ArrayList<>();
positions.add(rowItem);
GeneralDialogCreation.deleteFilesDialog(context, mainFragment.getElementsList(), mainFragment.getMainActivity(), positions, utilitiesProvider.getAppTheme());
return true;
case R.id.open_with:
boolean useNewStack = sharedPrefs.getBoolean(PreferencesConstants.PREFERENCE_TEXTEDITOR_NEWSTACK, false);
FileUtils.openWith(new File(rowItem.desc), mainFragment.getActivity(), useNewStack);
return true;
case R.id.encrypt:
final Intent encryptIntent = new Intent(context, EncryptService.class);
encryptIntent.putExtra(EncryptService.TAG_OPEN_MODE, rowItem.getMode().ordinal());
encryptIntent.putExtra(EncryptService.TAG_SOURCE, rowItem.generateBaseFile());
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
final EncryptDecryptUtils.EncryptButtonCallbackInterface encryptButtonCallbackInterfaceAuthenticate = new EncryptDecryptUtils.EncryptButtonCallbackInterface() {
@Override
public void onButtonPressed(Intent intent) {
}
@Override
public void onButtonPressed(Intent intent, String password) throws Exception {
EncryptDecryptUtils.startEncryption(context, rowItem.generateBaseFile().getPath(), password, intent);
}
};
EncryptDecryptUtils.EncryptButtonCallbackInterface encryptButtonCallbackInterface = new EncryptDecryptUtils.EncryptButtonCallbackInterface() {
@Override
public void onButtonPressed(Intent intent) throws Exception {
// check if a master password or fingerprint is set
if (!preferences.getString(PreferencesConstants.PREFERENCE_CRYPT_MASTER_PASSWORD, PreferencesConstants.PREFERENCE_CRYPT_MASTER_PASSWORD_DEFAULT).equals("")) {
EncryptDecryptUtils.startEncryption(context, rowItem.generateBaseFile().getPath(), PreferencesConstants.ENCRYPT_PASSWORD_MASTER, encryptIntent);
} else if (preferences.getBoolean(PreferencesConstants.PREFERENCE_CRYPT_FINGERPRINT, PreferencesConstants.PREFERENCE_CRYPT_FINGERPRINT_DEFAULT)) {
EncryptDecryptUtils.startEncryption(context, rowItem.generateBaseFile().getPath(), PreferencesConstants.ENCRYPT_PASSWORD_FINGERPRINT, encryptIntent);
} else {
// let's ask a password from user
GeneralDialogCreation.showEncryptAuthenticateDialog(context, encryptIntent, mainFragment.getMainActivity(), utilitiesProvider.getAppTheme(), encryptButtonCallbackInterfaceAuthenticate);
}
}
@Override
public void onButtonPressed(Intent intent, String password) {
}
};
if (preferences.getBoolean(PreferencesConstants.PREFERENCE_CRYPT_WARNING_REMEMBER, PreferencesConstants.PREFERENCE_CRYPT_WARNING_REMEMBER_DEFAULT)) {
// let's skip warning dialog call
try {
encryptButtonCallbackInterface.onButtonPressed(encryptIntent);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(context, mainFragment.getResources().getString(R.string.crypt_encryption_fail), Toast.LENGTH_LONG).show();
}
} else {
GeneralDialogCreation.showEncryptWarningDialog(encryptIntent, mainFragment, utilitiesProvider.getAppTheme(), encryptButtonCallbackInterface);
}
return true;
case R.id.decrypt:
EncryptDecryptUtils.decryptFile(context, mainActivity, mainFragment, mainFragment.openMode, rowItem.generateBaseFile(), rowItem.generateBaseFile().getParent(context), utilitiesProvider, false);
return true;
case R.id.return_select:
mainFragment.returnIntentResults(rowItem.generateBaseFile());
return true;
}
return false;
}
use of com.amaze.filemanager.filesystem.HybridFileParcelable in project AmazeFileManager by TeamAmaze.
the class GeneralDialogCreation method showPropertiesDialog.
private static void showPropertiesDialog(final HybridFileParcelable baseFile, final String permissions, ThemedActivity base, boolean isRoot, AppTheme appTheme, boolean showPermissions, boolean forStorage) {
final ExecutorService executor = Executors.newFixedThreadPool(3);
final Context c = base.getApplicationContext();
int accentColor = base.getColorPreference().getColor(ColorUsage.ACCENT);
long last = baseFile.getDate();
final String date = Utils.getDate(last), items = c.getString(R.string.calculating), name = baseFile.getName(), parent = baseFile.getReadablePath(baseFile.getParent(c));
MaterialDialog.Builder builder = new MaterialDialog.Builder(base);
builder.title(c.getString(R.string.properties));
builder.theme(appTheme.getMaterialDialogTheme());
View v = base.getLayoutInflater().inflate(R.layout.properties_dialog, null);
TextView itemsText = (TextView) v.findViewById(R.id.t7);
/*View setup*/
{
TextView mNameTitle = (TextView) v.findViewById(R.id.title_name);
mNameTitle.setTextColor(accentColor);
TextView mDateTitle = (TextView) v.findViewById(R.id.title_date);
mDateTitle.setTextColor(accentColor);
TextView mSizeTitle = (TextView) v.findViewById(R.id.title_size);
mSizeTitle.setTextColor(accentColor);
TextView mLocationTitle = (TextView) v.findViewById(R.id.title_location);
mLocationTitle.setTextColor(accentColor);
TextView md5Title = (TextView) v.findViewById(R.id.title_md5);
md5Title.setTextColor(accentColor);
TextView sha256Title = (TextView) v.findViewById(R.id.title_sha256);
sha256Title.setTextColor(accentColor);
((TextView) v.findViewById(R.id.t5)).setText(name);
((TextView) v.findViewById(R.id.t6)).setText(parent);
itemsText.setText(items);
((TextView) v.findViewById(R.id.t8)).setText(date);
LinearLayout mNameLinearLayout = (LinearLayout) v.findViewById(R.id.properties_dialog_name);
LinearLayout mLocationLinearLayout = (LinearLayout) v.findViewById(R.id.properties_dialog_location);
LinearLayout mSizeLinearLayout = (LinearLayout) v.findViewById(R.id.properties_dialog_size);
LinearLayout mDateLinearLayout = (LinearLayout) v.findViewById(R.id.properties_dialog_date);
// setting click listeners for long press
mNameLinearLayout.setOnLongClickListener(v1 -> {
FileUtils.copyToClipboard(c, name);
Toast.makeText(c, c.getResources().getString(R.string.name) + " " + c.getResources().getString(R.string.properties_copied_clipboard), Toast.LENGTH_SHORT).show();
return false;
});
mLocationLinearLayout.setOnLongClickListener(v12 -> {
FileUtils.copyToClipboard(c, parent);
Toast.makeText(c, c.getResources().getString(R.string.location) + " " + c.getResources().getString(R.string.properties_copied_clipboard), Toast.LENGTH_SHORT).show();
return false;
});
mSizeLinearLayout.setOnLongClickListener(v13 -> {
FileUtils.copyToClipboard(c, items);
Toast.makeText(c, c.getResources().getString(R.string.size) + " " + c.getResources().getString(R.string.properties_copied_clipboard), Toast.LENGTH_SHORT).show();
return false;
});
mDateLinearLayout.setOnLongClickListener(v14 -> {
FileUtils.copyToClipboard(c, date);
Toast.makeText(c, c.getResources().getString(R.string.date) + " " + c.getResources().getString(R.string.properties_copied_clipboard), Toast.LENGTH_SHORT).show();
return false;
});
}
CountItemsOrAndSizeTask countItemsOrAndSizeTask = new CountItemsOrAndSizeTask(c, itemsText, baseFile, forStorage);
countItemsOrAndSizeTask.executeOnExecutor(executor);
GenerateHashesTask hashGen = new GenerateHashesTask(baseFile, c, v);
hashGen.executeOnExecutor(executor);
/*Chart creation and data loading*/
{
boolean isRightToLeft = c.getResources().getBoolean(R.bool.is_right_to_left);
boolean isDarkTheme = appTheme.getMaterialDialogTheme() == Theme.DARK;
PieChart chart = (PieChart) v.findViewById(R.id.chart);
chart.setTouchEnabled(false);
chart.setDrawEntryLabels(false);
chart.setDescription(null);
chart.setNoDataText(c.getString(R.string.loading));
chart.setRotationAngle(!isRightToLeft ? 0f : 180f);
chart.setHoleColor(Color.TRANSPARENT);
chart.setCenterTextColor(isDarkTheme ? Color.WHITE : Color.BLACK);
chart.getLegend().setEnabled(true);
chart.getLegend().setForm(Legend.LegendForm.CIRCLE);
chart.getLegend().setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
chart.getLegend().setTypeface(Typeface.create("sans-serif-medium", Typeface.NORMAL));
chart.getLegend().setTextColor(isDarkTheme ? Color.WHITE : Color.BLACK);
chart.animateY(1000);
if (forStorage) {
final String[] LEGENDS = new String[] { c.getString(R.string.used), c.getString(R.string.free) };
final int[] COLORS = { Utils.getColor(c, R.color.piechart_red), Utils.getColor(c, R.color.piechart_green) };
long totalSpace = baseFile.getTotal(c), freeSpace = baseFile.getUsableSpace(), usedSpace = totalSpace - freeSpace;
List<PieEntry> entries = new ArrayList<>();
entries.add(new PieEntry(usedSpace, LEGENDS[0]));
entries.add(new PieEntry(freeSpace, LEGENDS[1]));
PieDataSet set = new PieDataSet(entries, null);
set.setColors(COLORS);
set.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
set.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
set.setSliceSpace(5f);
set.setAutomaticallyDisableSliceSpacing(true);
set.setValueLinePart2Length(1.05f);
set.setSelectionShift(0f);
PieData pieData = new PieData(set);
pieData.setValueFormatter(new SizeFormatter(c));
pieData.setValueTextColor(isDarkTheme ? Color.WHITE : Color.BLACK);
String totalSpaceFormatted = Formatter.formatFileSize(c, totalSpace);
chart.setCenterText(new SpannableString(c.getString(R.string.total) + "\n" + totalSpaceFormatted));
chart.setData(pieData);
} else {
LoadFolderSpaceDataTask loadFolderSpaceDataTask = new LoadFolderSpaceDataTask(c, appTheme, chart, baseFile);
loadFolderSpaceDataTask.executeOnExecutor(executor);
}
chart.invalidate();
}
if (!forStorage && showPermissions) {
final MainFragment main = ((MainActivity) base).mainFragment;
AppCompatButton appCompatButton = (AppCompatButton) v.findViewById(R.id.permissionsButton);
appCompatButton.setAllCaps(true);
final View permissionsTable = v.findViewById(R.id.permtable);
final View button = v.findViewById(R.id.set);
if (isRoot && permissions.length() > 6) {
appCompatButton.setVisibility(View.VISIBLE);
appCompatButton.setOnClickListener(v15 -> {
if (permissionsTable.getVisibility() == View.GONE) {
permissionsTable.setVisibility(View.VISIBLE);
button.setVisibility(View.VISIBLE);
setPermissionsDialog(permissionsTable, button, baseFile, permissions, c, main);
} else {
button.setVisibility(View.GONE);
permissionsTable.setVisibility(View.GONE);
}
});
}
}
builder.customView(v, true);
builder.positiveText(base.getResources().getString(R.string.ok));
builder.positiveColor(accentColor);
builder.dismissListener(dialog -> executor.shutdown());
MaterialDialog materialDialog = builder.build();
materialDialog.show();
materialDialog.getActionButton(DialogAction.NEGATIVE).setEnabled(false);
/*
View bottomSheet = c.findViewById(R.id.design_bottom_sheet);
BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
bottomSheetBehavior.setPeekHeight(BottomSheetBehavior.STATE_DRAGGING);
*/
}
use of com.amaze.filemanager.filesystem.HybridFileParcelable in project AmazeFileManager by TeamAmaze.
the class MainFragment method onListItemClicked.
/**
* method called when list item is clicked in the adapter
*
* @param isBackButton is it the back button aka '..'
* @param position the position
* @param e the list item
* @param imageView the check {@link RoundedImageView} that is to be animated
*/
public void onListItemClicked(boolean isBackButton, int position, LayoutElementParcelable e, ImageView imageView) {
if (results) {
// check to initialize search results
// if search task is been running, cancel it
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
SearchWorkerFragment fragment = (SearchWorkerFragment) fragmentManager.findFragmentByTag(MainActivity.TAG_ASYNC_HELPER);
if (fragment != null) {
if (fragment.mSearchAsyncTask.getStatus() == AsyncTask.Status.RUNNING) {
fragment.mSearchAsyncTask.cancel(true);
}
getActivity().getSupportFragmentManager().beginTransaction().remove(fragment).commit();
}
mRetainSearchTask = true;
results = false;
} else {
mRetainSearchTask = false;
MainActivityHelper.SEARCH_TEXT = null;
}
if (selection) {
if (isBackButton) {
selection = false;
if (mActionMode != null)
mActionMode.finish();
mActionMode = null;
} else {
// the first {goback} item if back navigation is enabled
adapter.toggleChecked(position, imageView);
}
} else {
if (isBackButton) {
goBackItemClick();
} else {
// hiding search view if visible
if (getMainActivity().getAppbar().getSearchView().isEnabled()) {
getMainActivity().getAppbar().getSearchView().hideSearchView();
}
String path = !e.hasSymlink() ? e.desc : e.symlink;
if (e.isDirectory) {
computeScroll();
loadlist(path, false, openMode);
} else if (e.desc.endsWith(CryptUtil.CRYPT_EXTENSION)) {
// decrypt the file
isEncryptOpen = true;
encryptBaseFile = new HybridFileParcelable(getActivity().getExternalCacheDir().getPath() + "/" + e.generateBaseFile().getName().replace(CryptUtil.CRYPT_EXTENSION, ""));
encryptBaseFiles.add(encryptBaseFile);
EncryptDecryptUtils.decryptFile(getContext(), getMainActivity(), ma, openMode, e.generateBaseFile(), getActivity().getExternalCacheDir().getPath(), utilsProvider, true);
} else {
if (getMainActivity().mReturnIntent) {
// are we here to return an intent to another app
returnIntentResults(e.generateBaseFile());
} else {
switch(e.getMode()) {
case SMB:
try {
SmbFile smbFile = new SmbFile(e.desc);
launchSMB(smbFile, e.longSize, getMainActivity());
} catch (MalformedURLException ex) {
ex.printStackTrace();
}
break;
case SFTP:
Toast.makeText(getContext(), getResources().getString(R.string.please_wait), Toast.LENGTH_LONG).show();
SshClientUtils.launchSftp(e.generateBaseFile(), getMainActivity());
break;
case OTG:
FileUtils.openFile(OTGUtil.getDocumentFile(e.desc, getContext(), false), (MainActivity) getActivity(), sharedPref);
break;
case DROPBOX:
case BOX:
case GDRIVE:
case ONEDRIVE:
Toast.makeText(getContext(), getResources().getString(R.string.please_wait), Toast.LENGTH_LONG).show();
CloudUtil.launchCloud(e.generateBaseFile(), openMode, getMainActivity());
break;
default:
FileUtils.openFile(new File(e.desc), (MainActivity) getActivity(), sharedPref);
break;
}
dataUtils.addHistoryFile(e.desc);
}
}
}
}
}
Aggregations