Removed excess of logs

This commit is contained in:
David A. Velasco 2013-02-28 17:52:15 +01:00
parent 638b7767cb
commit 31827bce0c
5 changed files with 13 additions and 158 deletions

View file

@ -105,7 +105,6 @@ public class FileDownloadFragment extends SherlockFragment implements OnClickLis
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.e(TAG, "PREVIEW_DOWNLOAD_FRAGMENT ONCREATE " + ((mFile == null)? "(NULL)" : mFile.getFileName()));
}
@ -142,7 +141,6 @@ public class FileDownloadFragment extends SherlockFragment implements OnClickLis
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
Log.e(TAG, "PREVIEW_DOWNLOAD_FRAGMENT ONATTACH " + ((mFile == null)?" (NULL)":mFile.getFileName()));
try {
mContainerActivity = (ContainerActivity) activity;
@ -158,7 +156,6 @@ public class FileDownloadFragment extends SherlockFragment implements OnClickLis
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Log.e(TAG, "PREVIEW_DOWNLOAD_FRAGMENT ONACTIVITYCREATED " + ((mFile == null)?" (NULL)":mFile.getFileName()));
if (mAccount != null) {
mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver());;
}
@ -175,13 +172,11 @@ public class FileDownloadFragment extends SherlockFragment implements OnClickLis
@Override
public void onStart() {
super.onStart();
Log.e(TAG, "FILE_DOWNLOAD_FRAGMENT ONSTART " + mFile.getFileName());
listenForTransferProgress();
}
@Override
public void onResume() {
Log.e(TAG, "PREVIEW_DOWNLOAD_FRAGMENT ONRESUME " + mFile.getFileName());
super.onResume();
}
@ -189,21 +184,18 @@ public class FileDownloadFragment extends SherlockFragment implements OnClickLis
@Override
public void onPause() {
super.onPause();
Log.e(TAG, "PREVIEW_DOWNLOAD_FRAGMENT ONPAUSE " + mFile.getFileName());
}
@Override
public void onStop() {
super.onStop();
Log.e(TAG, "FILE_DOWNLOAD_FRAGMENT ONSTOP " + mFile.getFileName());
leaveTransferProgress();
}
@Override
public void onDestroy() {
super.onDestroy();
Log.e(TAG, "FILE_DOWNLOAD_FRAGMENT ONDESTROY " + mFile.getFileName());
}

View file

@ -134,7 +134,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
position = (position >= 0) ? position : 0;
mViewPager.setAdapter(mPreviewImagePagerAdapter);
mViewPager.setOnPageChangeListener(this);
Log.e(TAG, "Setting initial position " + position);
mViewPager.setCurrentItem(position);
if (position == 0 && !mFile.isDown()) {
// this is necessary because mViewPager.setCurrentItem(0) just after setting the adapter does not result in a call to #onPageSelected(0)
@ -146,7 +145,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
@Override
public void onStart() {
super.onStart();
Log.e(TAG, "PREVIEW ACTIVITY ON START");
mDownloadConnection = new PreviewImageServiceConnection();
bindService(new Intent(this, FileDownloader.class), mDownloadConnection, Context.BIND_AUTO_CREATE);
mUploadConnection = new PreviewImageServiceConnection();
@ -167,11 +165,10 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
public void onServiceConnected(ComponentName component, IBinder service) {
if (component.equals(new ComponentName(PreviewImageActivity.this, FileDownloader.class))) {
Log.e(TAG, "PREVIEW_IMAGE Download service connected");
mDownloaderBinder = (FileDownloaderBinder) service;
if (mRequestWaitingForBinder) {
mRequestWaitingForBinder = false;
Log.e(TAG, "Simulating reselection of current page after connection of download binder");
Log.d(TAG, "Simulating reselection of current page after connection of download binder");
onPageSelected(mViewPager.getCurrentItem());
}
@ -237,7 +234,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
@Override
protected void onResume() {
super.onResume();
Log.e(TAG, "PREVIEW ACTIVITY ONRESUME");
mDownloadFinishReceiver = new DownloadFinishReceiver();
IntentFilter filter = new IntentFilter(FileDownloader.DOWNLOAD_FINISH_MESSAGE);
registerReceiver(mDownloadFinishReceiver, filter);
@ -247,7 +243,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
@Override
protected void onPostResume() {
super.onPostResume();
Log.e(TAG, "PREVIEW ACTIVITY ONPOSTRESUME");
}
@Override
@ -325,9 +320,8 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
private void requestForDownload(OCFile file) {
Log.e(TAG, "REQUEST FOR DOWNLOAD : " + file.getFileName());
if (mDownloaderBinder == null) {
Log.e(TAG, "requestForDownload called without binder to download service");
Log.d(TAG, "requestForDownload called without binder to download service");
} else if (!mDownloaderBinder.isDownloading(mAccount, file)) {
Intent i = new Intent(this, FileDownloader.class);
@ -344,7 +338,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
*/
@Override
public void onPageSelected(int position) {
Log.e(TAG, "onPageSelected " + position);
if (mDownloaderBinder == null) {
mRequestWaitingForBinder = true;
@ -353,7 +346,6 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
getSupportActionBar().setTitle(currentFile.getFileName());
if (!currentFile.isDown()) {
requestForDownload(currentFile);
//updateCurrentDownloadFragment(true);
}
}
}
@ -413,12 +405,9 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
if (position >= 0) {
/// ITS MY BUSSINESS
Log.e(TAG, "downloaded file FOUND in adapter");
if (downloadWasFine) {
mPreviewImagePagerAdapter.updateFile(position, file);
//Log.e(TAG, "BEFORE NOTIFY DATA SET CHANGED");
mPreviewImagePagerAdapter.notifyDataSetChanged();
//Log.e(TAG, "AFTER NOTIFY DATA SET CHANGED");
} else if (isCurrent) {
updateCurrentDownloadFragment(false);
@ -437,16 +426,8 @@ public class PreviewImageActivity extends SherlockFragmentActivity implements Fi
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.e(TAG, "TOUCH!!! **********************");
if (event.getAction() == MotionEvent.ACTION_DOWN) {
Log.e(TAG, "TOUCH DOWN!!! **********************");
} else if (event.getAction() == MotionEvent.ACTION_UP) {
Log.e(TAG, "TOUCH UP!!! **********************");
toggleFullScreen();
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
Log.e(TAG, "TOUCH MOVE!!! **********************");
if (event.getAction() == MotionEvent.ACTION_UP) {
toggleFullScreen();
}
return true;
}

View file

@ -133,7 +133,6 @@ public class PreviewImageFragment extends SherlockFragment implements FileFrag
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.e(TAG, "PREVIEW_IMAGE_FRAGMENT ONCREATE " + ((mFile == null)? "(NULL)" : mFile.getFileName()));
mHandler = new Handler();
setHasOptionsMenu(true);
}
@ -205,7 +204,6 @@ public class PreviewImageFragment extends SherlockFragment implements FileFrag
@Override
public void onStart() {
super.onStart();
Log.e(TAG, "PREVIEW_IMAGE_FRAGMENT ONSTART " + mFile.getFileName());
if (mFile != null) {
BitmapLoader bl = new BitmapLoader(mImageView);
bl.execute(new String[]{mFile.getStoragePath()});
@ -273,7 +271,6 @@ public class PreviewImageFragment extends SherlockFragment implements FileFrag
@Override
public void onResume() {
super.onResume();
Log.e(TAG, "PREVIEW_IMAGE_FRAGMENT ONRESUME " + mFile.getFileName());
/*
mDownloadFinishReceiver = new DownloadFinishReceiver();
IntentFilter filter = new IntentFilter(
@ -290,7 +287,6 @@ public class PreviewImageFragment extends SherlockFragment implements FileFrag
@Override
public void onPause() {
Log.e(TAG, "PREVIEW_IMAGE_FRAGMENT ONPAUSE " + mFile.getFileName());
super.onPause();
/*
if (mVideoPreview.getVisibility() == View.VISIBLE) {
@ -306,16 +302,9 @@ public class PreviewImageFragment extends SherlockFragment implements FileFrag
}
@Override
public void onStop() {
super.onStop();
Log.e(TAG, "PREVIEW_IMAGE_FRAGMENT ONSTOP " + mFile.getFileName());
}
@Override
public void onDestroy() {
super.onDestroy();
Log.e(TAG, "PREVIEW_IMAGE_FRAGMENT ONDESTROY " + mFile.getFileName());
if (mBitmap != null) {
mBitmap.recycle();
}

View file

@ -43,8 +43,8 @@ import com.owncloud.android.ui.fragment.FileFragment;
*
* @author David A. Velasco
*/
public class PreviewImagePagerAdapter extends PagerAdapter {
//public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
//public class PreviewImagePagerAdapter extends PagerAdapter {
public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
private static final String TAG = PreviewImagePagerAdapter.class.getSimpleName();
@ -54,11 +54,13 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
private Set<Integer> mObsoletePositions;
private DataStorageManager mStorageManager;
/*
private final FragmentManager mFragmentManager;
private FragmentTransaction mCurTransaction = null;
private ArrayList<Fragment.SavedState> mSavedState = new ArrayList<Fragment.SavedState>();
private ArrayList<Fragment> mFragments = new ArrayList<Fragment>();
private Fragment mCurrentPrimaryItem = null;
*/
/**
* Constructor.
@ -68,7 +70,7 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
* @param storageManager Bridge to database.
*/
public PreviewImagePagerAdapter(FragmentManager fragmentManager, OCFile parentFolder, Account account, DataStorageManager storageManager) {
//super(fragmentManager);
super(fragmentManager);
if (fragmentManager == null) {
throw new IllegalArgumentException("NULL FragmentManager instance");
@ -85,7 +87,7 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
mImageFiles = mStorageManager.getDirectoryImages(parentFolder);
mObsoleteFragments = new HashSet<Object>();
mObsoletePositions = new HashSet<Integer>();
mFragmentManager = fragmentManager;
//mFragmentManager = fragmentManager;
}
@ -100,7 +102,6 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
public Fragment getItem(int i) {
Log.e(TAG, "GETTING PAGE " + i);
OCFile file = mImageFiles.get(i);
Fragment fragment = null;
if (file.isDown()) {
@ -133,7 +134,6 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
@Override
public int getItemPosition(Object object) {
Log.e(TAG, "getItemPosition ");
if (mObsoleteFragments.contains(object)) {
mObsoleteFragments.remove(object);
return POSITION_NONE;
@ -152,17 +152,16 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
return (FileFragment) instantiateItem(null, position);
} catch (Exception e) {
Log.e(TAG, "Wrong access to fragment in gallery ", e);
return null;
}
}
/**
/* -*
* Called when a change in the shown pages is going to start being made.
*
* @param container The containing View which is displaying this adapter's page views.
*/
*- /
@Override
public void startUpdate(ViewGroup container) {
Log.e(TAG, "** startUpdate");
@ -308,5 +307,5 @@ public class PreviewImagePagerAdapter extends PagerAdapter {
}
}
}
*/
}

View file

@ -452,112 +452,6 @@ public class PreviewMediaFragment extends SherlockFragment implements
super.onDestroy();
}
/*
@Override
public View getView() {
return super.getView() == null ? mView : super.getView();
}
*/
/*
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.fdDownloadBtn: {
FileDownloaderBinder downloaderBinder = mContainerActivity.getFileDownloaderBinder();
FileUploaderBinder uploaderBinder = mContainerActivity.getFileUploaderBinder();
if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, mFile)) {
downloaderBinder.cancel(mAccount, mFile);
if (mFile.isDown()) {
setButtonsForDown();
} else {
setButtonsForRemote();
}
} else if (uploaderBinder != null && uploaderBinder.isUploading(mAccount, mFile)) {
uploaderBinder.cancel(mAccount, mFile);
if (!mFile.fileExists()) {
// TODO make something better
if (getActivity() instanceof FileDisplayActivity) {
// double pane
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.file_details_container, new PreviewMediaFragment(null, null), FTAG); // empty FileDetailFragment
transaction.commit();
mContainerActivity.onFileStateChanged();
} else {
getActivity().finish();
}
} else if (mFile.isDown()) {
setButtonsForDown();
} else {
setButtonsForRemote();
}
} else {
mLastRemoteOperation = new SynchronizeFileOperation(mFile, null, mStorageManager, mAccount, true, false, getActivity());
WebdavClient wc = OwnCloudClientUtils.createOwnCloudClient(mAccount, getSherlockActivity().getApplicationContext());
mLastRemoteOperation.execute(wc, this, mHandler);
// update ui
boolean inDisplayActivity = getActivity() instanceof FileDisplayActivity;
getActivity().showDialog((inDisplayActivity)? FileDisplayActivity.DIALOG_SHORT_WAIT : FileDetailActivity.DIALOG_SHORT_WAIT);
setButtonsForTransferring(); // disable button immediately, although the synchronization does not result in a file transference
}
break;
}
case R.id.fdKeepInSync: {
CheckBox cb = (CheckBox) getView().findViewById(R.id.fdKeepInSync);
mFile.setKeepInSync(cb.isChecked());
mStorageManager.saveFile(mFile);
/// register the OCFile instance in the observer service to monitor local updates;
/// if necessary, the file is download
Intent intent = new Intent(getActivity().getApplicationContext(),
FileObserverService.class);
intent.putExtra(FileObserverService.KEY_FILE_CMD,
(cb.isChecked()?
FileObserverService.CMD_ADD_OBSERVED_FILE:
FileObserverService.CMD_DEL_OBSERVED_FILE));
intent.putExtra(FileObserverService.KEY_CMD_ARG_FILE, mFile);
intent.putExtra(FileObserverService.KEY_CMD_ARG_ACCOUNT, mAccount);
Log.e(TAG, "starting observer service");
getActivity().startService(intent);
if (mFile.keepInSync()) {
onClick(getView().findViewById(R.id.fdDownloadBtn)); // force an immediate synchronization
}
break;
}
case R.id.fdRenameBtn: {
EditNameDialog dialog = EditNameDialog.newInstance(getString(R.string.rename_dialog_title), mFile.getFileName(), this);
dialog.show(getFragmentManager(), "nameeditdialog");
break;
}
case R.id.fdRemoveBtn: {
ConfirmationDialogFragment confDialog = ConfirmationDialogFragment.newInstance(
R.string.confirmation_remove_alert,
new String[]{mFile.getFileName()},
mFile.isDown() ? R.string.confirmation_remove_remote_and_local : R.string.confirmation_remove_remote,
mFile.isDown() ? R.string.confirmation_remove_local : -1,
R.string.common_cancel);
confDialog.setOnConfirmationListener(this);
mCurrentDialog = confDialog;
mCurrentDialog.show(getFragmentManager(), FTAG_CONFIRMATION);
break;
}
case R.id.fdOpenBtn: {
openFile();
break;
}
default:
Log.e(TAG, "Incorrect view clicked!");
}
}
*/
@Override
public boolean onTouch(View v, MotionEvent event) {