X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/bdc0332c23b326d21193f71ff7db2cf587de0c43..5dc43aab3cc1243f9989dd6a0c7dd3350c3f709b:/src/com/owncloud/android/ui/fragment/FileFragment.java diff --git a/src/com/owncloud/android/ui/fragment/FileFragment.java b/src/com/owncloud/android/ui/fragment/FileFragment.java index 30549513..4c6f3e71 100644 --- a/src/com/owncloud/android/ui/fragment/FileFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileFragment.java @@ -17,10 +17,11 @@ package com.owncloud.android.ui.fragment; -import android.content.Intent; import android.support.v4.app.Fragment; +import com.actionbarsherlock.app.SherlockFragment; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.files.FileHandler; import com.owncloud.android.ui.activity.TransferServiceGetter; /** @@ -29,22 +30,49 @@ import com.owncloud.android.ui.activity.TransferServiceGetter; * @author David A. Velasco * */ -public interface FileFragment { +public class FileFragment extends SherlockFragment { + + private OCFile mFile; + + + /** + * Creates an empty fragment. + * + * It's necessary to keep a public constructor without parameters; the system uses it when tries to reinstantiate a fragment automatically. + */ + public FileFragment() { + mFile = null; + } /** + * Creates an instance for a given {@OCFile}. + * + * @param file + */ + public FileFragment(OCFile file) { + mFile = file; + } + + /** * Getter for the hold {@link OCFile} * * @return The {@link OCFile} hold */ - public OCFile getFile(); + public OCFile getFile() { + return mFile; + } + protected void setFile(OCFile file) { + mFile = file; + } + /** * Interface to implement by any Activity that includes some instance of FileFragment * * @author David A. Velasco */ - public interface ContainerActivity extends TransferServiceGetter { + public interface ContainerActivity extends TransferServiceGetter, FileHandler { /** * Callback method invoked when the detail fragment wants to notice its container @@ -65,7 +93,7 @@ public interface FileFragment { * * @param file File to show details */ - public void showFragmentWithDetails(OCFile file); + public void showDetails(OCFile file); }