X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/0c75a839f20f4912ecdae32315bb3aebb0775fc7..cbdcf7d4572d90a76a4042ce6dbb3552e46b5fd0:/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 9cd1b9c7..2f1a49b1 100644 --- a/src/com/owncloud/android/ui/fragment/FileFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileFragment.java @@ -2,9 +2,8 @@ * 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 3 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 @@ -18,28 +17,56 @@ 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.ui.activity.TransferServiceGetter; + /** * Common methods for {@link Fragment}s containing {@link OCFile}s * * @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 * @@ -66,11 +93,8 @@ public interface FileFragment { * * @param file File to show details */ - public void showFragmentWithDetails(OCFile file); - - - public void notifySuccessfulDownload(OCFile file, Intent intent, boolean success); - + public void showDetails(OCFile file); + } }