* Copyright (C) 2012-2013 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* Copyright (C) 2012-2013 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
import android.accounts.Account;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.accounts.Account;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
mDownloaderBinder = (FileDownloaderBinder) service;
if (mRequestWaitingForBinder) {
mRequestWaitingForBinder = false;
mDownloaderBinder = (FileDownloaderBinder) service;
if (mRequestWaitingForBinder) {
mRequestWaitingForBinder = false;
onPageSelected(mViewPager.getCurrentItem());
}
} else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploader.class))) {
onPageSelected(mViewPager.getCurrentItem());
}
} else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploader.class))) {
@Override
public void onServiceDisconnected(ComponentName component) {
if (component.equals(new ComponentName(PreviewImageActivity.this, FileDownloader.class))) {
@Override
public void onServiceDisconnected(ComponentName component) {
if (component.equals(new ComponentName(PreviewImageActivity.this, FileDownloader.class))) {
mDownloaderBinder = null;
} else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploader.class))) {
mDownloaderBinder = null;
} else if (component.equals(new ComponentName(PreviewImageActivity.this, FileUploader.class))) {
//Log.e(TAG, "ACTIVITY, ONRESUME");
mDownloadFinishReceiver = new DownloadFinishReceiver();
IntentFilter filter = new IntentFilter(FileDownloader.DOWNLOAD_FINISH_MESSAGE);
//Log.e(TAG, "ACTIVITY, ONRESUME");
mDownloadFinishReceiver = new DownloadFinishReceiver();
IntentFilter filter = new IntentFilter(FileDownloader.DOWNLOAD_FINISH_MESSAGE);
showDetailsIntent.putExtra(FileDetailFragment.EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this));
showDetailsIntent.putExtra(FileDetailActivity.EXTRA_MODE, FileDetailActivity.MODE_DETAILS);
startActivity(showDetailsIntent);
showDetailsIntent.putExtra(FileDetailFragment.EXTRA_ACCOUNT, AccountUtils.getCurrentOwnCloudAccount(this));
showDetailsIntent.putExtra(FileDetailActivity.EXTRA_MODE, FileDetailActivity.MODE_DETAILS);
startActivity(showDetailsIntent);
} else if (!mDownloaderBinder.isDownloading(mAccount, file)) {
Intent i = new Intent(this, FileDownloader.class);
} else if (!mDownloaderBinder.isDownloading(mAccount, file)) {
Intent i = new Intent(this, FileDownloader.class);
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
//boolean isOffscreen = Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
//boolean isOffscreen = Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();