Created preview fragment to show previews for audio, video and images; shown when...
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / fragment / FileDetailFragment.java
index f37c609..e90dbf7 100644 (file)
@@ -116,7 +116,8 @@ import eu.alefzero.webdav.WebdavUtils;
  */\r
 public class FileDetailFragment extends SherlockFragment implements\r
         OnClickListener, OnTouchListener, \r
  */\r
 public class FileDetailFragment extends SherlockFragment implements\r
         OnClickListener, OnTouchListener, \r
-        ConfirmationDialogFragment.ConfirmationDialogFragmentListener, OnRemoteOperationListener, EditNameDialogListener {\r
+        ConfirmationDialogFragment.ConfirmationDialogFragmentListener, OnRemoteOperationListener, EditNameDialogListener,\r
+        FileFragment {\r
 \r
     public static final String EXTRA_FILE = "FILE";\r
     public static final String EXTRA_ACCOUNT = "ACCOUNT";\r
 \r
     public static final String EXTRA_FILE = "FILE";\r
     public static final String EXTRA_ACCOUNT = "ACCOUNT";\r
@@ -425,28 +426,7 @@ public class FileDetailFragment extends SherlockFragment implements
     @Override\r
     public boolean onTouch(View v, MotionEvent event) {\r
         if (v == mPreview && event.getAction() == MotionEvent.ACTION_DOWN && mFile != null && mFile.isDown()) {\r
     @Override\r
     public boolean onTouch(View v, MotionEvent event) {\r
         if (v == mPreview && event.getAction() == MotionEvent.ACTION_DOWN && mFile != null && mFile.isDown()) {\r
-            if (mFile.isAudio()) {\r
-                if (!mMediaServiceBinder.isPlaying(mFile)) {\r
-                    Log.d(TAG, "starting playback of " + mFile.getStoragePath());\r
-                    mMediaServiceBinder.start(mAccount, mFile);\r
-                    // this is a patch; need to synchronize this with the onPrepared() coming from MediaPlayer in the MediaService\r
-                    /*\r
-                    mMediaController.postDelayed(new Runnable() {\r
-                        @Override\r
-                        public void run() {\r
-                            mMediaController.show(0);\r
-                        }\r
-                    } , 300);\r
-                    */\r
-                } else {\r
-                    if (mMediaController.isShowing()) {\r
-                        mMediaController.hide();\r
-                    } else {\r
-                        mMediaController.show(MediaService.MEDIA_CONTROL_LIFE);\r
-                    }\r
-                }\r
-                \r
-            } else if (mFile.isVideo()) {\r
+            if (mFile.isVideo()) {\r
                 startVideoActivity();\r
             }\r
         }\r
                 startVideoActivity();\r
             }\r
         }\r
@@ -620,10 +600,9 @@ public class FileDetailFragment extends SherlockFragment implements
 \r
     \r
     /**\r
 \r
     \r
     /**\r
-     * Can be used to get the file that is currently being displayed.\r
-     * @return The file on the screen.\r
+     * {@inheritDoc}\r
      */\r
      */\r
-    public OCFile getDisplayedFile(){\r
+    public OCFile getFile(){\r
         return mFile;\r
     }\r
     \r
         return mFile;\r
     }\r
     \r