mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
Recovery of instant uploads in temporary disabled
This commit is contained in:
parent
053aad5ae1
commit
9b758dfa70
3 changed files with 18 additions and 5 deletions
|
@ -801,7 +801,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
|
||||||
// we add only for instant-uploads the InstantUploadActivity and the
|
// we add only for instant-uploads the InstantUploadActivity and the
|
||||||
// db entry
|
// db entry
|
||||||
Intent detailUploadIntent = null;
|
Intent detailUploadIntent = null;
|
||||||
if (upload.isInstant()) {
|
if (upload.isInstant() && InstantUploadActivity.IS_ENABLED) {
|
||||||
detailUploadIntent = new Intent(this, InstantUploadActivity.class);
|
detailUploadIntent = new Intent(this, InstantUploadActivity.class);
|
||||||
detailUploadIntent.putExtra(FileUploader.KEY_ACCOUNT, upload.getAccount());
|
detailUploadIntent.putExtra(FileUploader.KEY_ACCOUNT, upload.getAccount());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -753,9 +753,21 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIALOG_CHOOSE_UPLOAD_SOURCE: {
|
case DIALOG_CHOOSE_UPLOAD_SOURCE: {
|
||||||
final String[] items = { getString(R.string.actionbar_upload_files),
|
|
||||||
getString(R.string.actionbar_upload_from_apps),
|
String[] items = null;
|
||||||
getString(R.string.actionbar_failed_instant_upload) };
|
|
||||||
|
String[] allTheItems = { getString(R.string.actionbar_upload_files),
|
||||||
|
getString(R.string.actionbar_upload_from_apps),
|
||||||
|
getString(R.string.actionbar_failed_instant_upload) };
|
||||||
|
|
||||||
|
String[] commonItems = { getString(R.string.actionbar_upload_files),
|
||||||
|
getString(R.string.actionbar_upload_from_apps) };
|
||||||
|
|
||||||
|
if (InstantUploadActivity.IS_ENABLED)
|
||||||
|
items = allTheItems;
|
||||||
|
else
|
||||||
|
items = commonItems;
|
||||||
|
|
||||||
builder = new AlertDialog.Builder(this);
|
builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(R.string.actionbar_upload);
|
builder.setTitle(R.string.actionbar_upload);
|
||||||
builder.setItems(items, new DialogInterface.OnClickListener() {
|
builder.setItems(items, new DialogInterface.OnClickListener() {
|
||||||
|
@ -775,7 +787,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
|
||||||
action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
|
action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
startActivityForResult(Intent.createChooser(action, getString(R.string.upload_chooser_title)),
|
startActivityForResult(Intent.createChooser(action, getString(R.string.upload_chooser_title)),
|
||||||
ACTION_SELECT_CONTENT_FROM_APPS);
|
ACTION_SELECT_CONTENT_FROM_APPS);
|
||||||
} else if (item == 2) {
|
} else if (item == 2 && InstantUploadActivity.IS_ENABLED) {
|
||||||
Account account = AccountUtils.getCurrentOwnCloudAccount(FileDisplayActivity.this);
|
Account account = AccountUtils.getCurrentOwnCloudAccount(FileDisplayActivity.this);
|
||||||
Intent action = new Intent(FileDisplayActivity.this, InstantUploadActivity.class);
|
Intent action = new Intent(FileDisplayActivity.this, InstantUploadActivity.class);
|
||||||
action.putExtra(FileUploader.KEY_ACCOUNT, account);
|
action.putExtra(FileUploader.KEY_ACCOUNT, account);
|
||||||
|
|
|
@ -75,6 +75,7 @@ public class InstantUploadActivity extends Activity {
|
||||||
private static final String LOG_TAG = InstantUploadActivity.class.getSimpleName();
|
private static final String LOG_TAG = InstantUploadActivity.class.getSimpleName();
|
||||||
private LinearLayout listView;
|
private LinearLayout listView;
|
||||||
private static final String retry_chexbox_tag = "retry_chexbox_tag";
|
private static final String retry_chexbox_tag = "retry_chexbox_tag";
|
||||||
|
public static final boolean IS_ENABLED = false;
|
||||||
private static int MAX_LOAD_IMAGES = 5;
|
private static int MAX_LOAD_IMAGES = 5;
|
||||||
private int lastLoadImageIdx = 0;
|
private int lastLoadImageIdx = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue