+<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2013 The Android Open Source Project
+ ownCloud Android client application
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Copyright (C) 2015 ownCloud Inc.
- http://www.apache.org/licenses/LICENSE-2.0
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2,
+ as published by the Free Software Foundation.
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/drawer_textView"
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/itemLayout"
android:layout_width="fill_parent"
- android:layout_height="56dp"
- android:gravity="center_vertical"
- android:paddingLeft="16dp"
- android:paddingRight="16dp"
- android:textColor="#000"
- android:textSize="18dp" />
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:orientation="horizontal"
+ android:background="@color/background_color"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp">
+
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/itemTitle"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:textColor="@color/textColor"
+ android:text="@string/app_name"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
+</LinearLayout>
android:baselineAligned="false"\r
android:orientation="horizontal" >\r
\r
- \r
+\r
<FrameLayout\r
android:id="@+id/left_fragment_container"\r
android:layout_width="0dp"\r
android:layout_weight="2" />\r
</LinearLayout>\r
\r
- \r
- <LinearLayout\r
- xmlns:android="http://schemas.android.com/apk/res/android"\r
- android:id="@+id/left_drawer"\r
- android:layout_width="240dp"\r
- android:layout_height="match_parent"\r
- android:layout_gravity="start"\r
- android:background="@color/background_color"\r
- android:baselineAligned="false"\r
- android:clickable="true"\r
- android:orientation="vertical">\r
\r
<LinearLayout\r
- android:layout_width="match_parent"\r
- android:layout_height="wrap_content"\r
- android:layout_margin="5dp">\r
-\r
- <ImageView\r
- android:id="@+id/drawer_userIcon"\r
- android:layout_width="40dp"\r
- android:layout_height="40dp"\r
- android:src="@drawable/abs__ab_solid_dark_holo" />\r
+ xmlns:android="http://schemas.android.com/apk/res/android"\r
+ android:id="@+id/left_drawer"\r
+ android:layout_width="240dp"\r
+ android:layout_height="match_parent"\r
+ android:layout_gravity="start"\r
+ android:background="@color/background_color"\r
+ android:baselineAligned="false"\r
+ android:clickable="true"\r
+ android:orientation="vertical">\r
\r
- <TextView\r
- android:id="@+id/drawer_username"\r
- android:layout_width="wrap_content"\r
+ <LinearLayout\r
+ android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
- android:layout_gravity="center_vertical"\r
- android:layout_marginLeft="5dp"\r
- android:layout_marginStart="5dp"\r
- android:textAppearance="?android:attr/textAppearanceLarge" />\r
+ android:layout_margin="5dp">\r
\r
- </LinearLayout>\r
+ <ImageView\r
+ android:id="@+id/drawer_userIcon"\r
+ android:layout_width="40dp"\r
+ android:layout_height="40dp"\r
+ android:src="@drawable/abs__ab_solid_dark_holo" />\r
\r
- <TextView\r
- android:layout_width="fill_parent"\r
- android:layout_height="2dip"\r
- android:background="@color/list_item_lastmod_and_filesize_text" />\r
+ <TextView\r
+ android:id="@+id/drawer_username"\r
+ android:layout_width="wrap_content"\r
+ android:layout_height="wrap_content"\r
+ android:layout_gravity="center_vertical"\r
+ android:layout_marginLeft="5dp"\r
+ android:layout_marginStart="5dp"\r
+ android:textAppearance="?android:attr/textAppearanceLarge" />\r
\r
- <ListView\r
- android:id="@+id/drawer_list"\r
- android:layout_width="fill_parent"\r
- android:layout_height="match_parent"\r
- android:background="@color/background_color"\r
- android:choiceMode="singleChoice"\r
- />\r
-</LinearLayout>\r
+ </LinearLayout>\r
+\r
+ <TextView\r
+ android:layout_width="fill_parent"\r
+ android:layout_height="2dip"\r
+ android:background="@color/list_item_lastmod_and_filesize_text" />\r
+\r
+ <ListView\r
+ android:id="@+id/drawer_list"\r
+ android:layout_width="fill_parent"\r
+ android:layout_height="match_parent"\r
+ android:background="@color/background_color"\r
+ android:choiceMode="singleChoice"\r
+ />\r
+ </LinearLayout>\r
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2015 ownCloud Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ 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
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
+
+<resources>
+ <!-- Nav Drawer Menu Items -->
+ <string-array name="drawer_items">
+ <item>@string/prefs_accounts</item>
+ <item>@string/drawer_item_all_files</item>
+ <!--<item>@string/drawer_item_on_device</item>-->
+ <item>@string/actionbar_settings</item>
+ <item>@string/actionbar_logger</item>
+ </string-array>
+
+ <!-- Nav Drawer Content Descriptions -->
+ <string-array name="drawer_content_descriptions">
+ <item>@string/drawer_item_accounts</item>
+ <item>@string/drawer_item_all_files</item>
+ <!--<item>@string/drawer_item_on_device</item>-->
+ <item>@string/drawer_item_settings</item>
+ <item>@string/drawer_item_logs</item>
+ </string-array>
+
+</resources>
\ No newline at end of file
<!-- TODO re-enable when server-side folder size calculation is available
<item>Biggest - Smallest</item> -->
</string-array>
- <string-array name="drawer_items">
- <item>Accounts</item>
- <item>All Files</item>
- <item>On device</item>
- <item>Settings</item>
- </string-array>
+ <string name="drawer_item_accounts">Accounts</string>
+ <string name="drawer_item_all_files">All files</string>
+ <!-- TODO re-enable when "On Device" is available
+ <string name="drawer_item_on_device">On device</string>-->
+ <string name="drawer_item_settings">Settings</string>
+ <string name="drawer_item_logs">Logs</string>
<string name="drawer_open">ownCloud</string>
<string name="drawer_close">Close</string>
<string name="prefs_category_general">General</string>
<PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
<Preference android:title="@string/prefs_help" android:key="help" />
- <Preference android:title="@string/actionbar_logger" android:key="log" />
<Preference android:title="@string/prefs_recommend" android:key="recommend" />
<Preference android:title="@string/prefs_feedback" android:key="feedback" />
<Preference android:title="@string/prefs_imprint" android:key="imprint" />
private static final String POLICY_ALWAYS_NEW_CLIENT = "always new client";
private static Context mContext;
-
+
+ // TODO Enable when "On Device" is recovered?
// TODO better place
- private static boolean mOnlyOnDevice = false;
+ // private static boolean mOnlyOnDevice = false;
public void onCreate(){
public static String getLogName() {
return getAppContext().getResources().getString(R.string.log_name);
}
-
- public static void showOnlyFilesOnDevice(boolean state){
- mOnlyOnDevice = state;
- }
-
- public static boolean getOnlyOnDevice(){
- return mOnlyOnDevice;
- }
+
+ // TODO Enable when "On Device" is recovered ?
+// public static void showOnlyFilesOnDevice(boolean state){
+// mOnlyOnDevice = state;
+// }
+//
+// public static boolean getOnlyOnDevice(){
+// return mOnlyOnDevice;
+// }
// user agent
public static String getUserAgent() {
}
- public Vector<OCFile> getFolderContent(OCFile f, boolean onlyOnDevice) {
+ public Vector<OCFile> getFolderContent(OCFile f/*, boolean onlyOnDevice*/) {
if (f != null && f.isFolder() && f.getFileId() != -1) {
- return getFolderContent(f.getFileId(), onlyOnDevice);
+ // TODO Enable when "On Device" is recovered ?
+ return getFolderContent(f.getFileId()/*, onlyOnDevice*/);
} else {
return new Vector<OCFile>();
}
- public Vector<OCFile> getFolderImages(OCFile folder, boolean onlyOnDevice) {
+ public Vector<OCFile> getFolderImages(OCFile folder/*, boolean onlyOnDevice*/) {
Vector<OCFile> ret = new Vector<OCFile>();
if (folder != null) {
- // TODO better implementation, filtering in the access to database instead of here
- Vector<OCFile> tmp = getFolderContent(folder, onlyOnDevice);
+ // TODO better implementation, filtering in the access to database instead of here
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> tmp = getFolderContent(folder/*, onlyOnDevice*/);
OCFile current = null;
for (int i=0; i<tmp.size(); i++) {
current = tmp.get(i);
File localFolder = new File(localFolderPath);
if (localFolder.exists()) {
// stage 1: remove the local files already registered in the files database
- Vector<OCFile> files = getFolderContent(folder.getFileId(), false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = getFolderContent(folder.getFileId()/*, false*/);
if (files != null) {
for (OCFile file : files) {
if (file.isFolder()) {
}
- private Vector<OCFile> getFolderContent(long parentId, boolean onlyOnDevice) {
+ private Vector<OCFile> getFolderContent(long parentId/*, boolean onlyOnDevice*/) {
Vector<OCFile> ret = new Vector<OCFile>();
if (c.moveToFirst()) {
do {
OCFile child = createFileInstance(c);
- if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){
+ // TODO Enable when "On Device" is recovered ?
+ // if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){
ret.add(child);
- }
+ // }
} while (c.moveToNext());
}
String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND "
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String [] whereArgs = new String[]{ "", mAccount.name };
-
- Vector<OCFile> files = getFolderContent(folder, false);
+
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = getFolderContent(folder /*, false*/);
for (OCFile file : files) {
whereArgs[0] = file.getRemotePath();
if (mRemoteFolderChanged) {
result = fetchAndSyncRemoteFolder(client);
} else {
- mChildren = mStorageManager.getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ mChildren = mStorageManager.getFolderContent(mLocalFolder/*, false*/);
}
}
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
- List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ List<OCFile> localFiles = mStorageManager.getFolderContent(mLocalFolder/*, false*/);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
package com.owncloud.android.operations;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
-import org.apache.http.HttpStatus;
-
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
-import com.owncloud.android.MainApp;
+
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.OperationCancelledException;
-import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
import com.owncloud.android.lib.resources.files.RemoteFile;
-import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
-import com.owncloud.android.lib.resources.shares.OCShare;
-import com.owncloud.android.syncadapter.FileSyncAdapter;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.utils.FileStorageUtils;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
import java.util.concurrent.atomic.AtomicBoolean;
//import android.support.v4.content.LocalBroadcastManager;
}
// get current data about local contents of the folder to synchronize
- List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ List<OCFile> localFiles = storageManager.getFolderContent(mLocalFolder/*, false*/);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
private void prepareOpsFromLocalKnowledge() throws OperationCancelledException {
- // TODO TOBI ist das richtig?
- List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ List<OCFile> children = getStorageManager().getFolderContent(mLocalFolder/*, false*/);
for (OCFile child : children) {
/// classify file to sync/download contents later
if (child.isFolder()) {
--- /dev/null
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.ui;
+
+public class NavigationDrawerItem {
+
+ private String mTitle;
+ private String mContentDescription;
+
+ // Constructors
+ public NavigationDrawerItem(){}
+
+ public NavigationDrawerItem(String title){
+ mTitle = title;
+ }
+
+ public NavigationDrawerItem(String title, String contentDescription){
+ mTitle = title;
+ mContentDescription = contentDescription;
+ }
+
+ // Getters and Setters
+ public String getTitle() {
+ return mTitle;
+ }
+
+ public void setTitle(String title) {
+ this.mTitle = title;
+ }
+
+ public String getContentDescription() {
+ return mContentDescription;
+ }
+
+ public void setContentDescription(String contentDescription) {
+ this.mContentDescription = contentDescription;
+ }
+}
package com.owncloud.android.ui.activity;
import java.io.File;
+import java.util.ArrayList;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
-import android.accounts.OperationCanceledException;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
-import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
+import com.owncloud.android.BuildConfig;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.operations.UnshareLinkOperation;
import com.owncloud.android.services.observer.FileObserverService;
import com.owncloud.android.syncadapter.FileSyncAdapter;
-import com.owncloud.android.ui.adapter.FileListListAdapter;
+import com.owncloud.android.ui.NavigationDrawerItem;
import com.owncloud.android.ui.adapter.NavigationDrawerListAdapter;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
private static String DIALOG_UPLOAD_SOURCE = "DIALOG_UPLOAD_SOURCE";
private static String DIALOG_CERT_NOT_SAVED = "DIALOG_CERT_NOT_SAVED";
- private NavigationDrawerListAdapter adapter = null;
-
private OCFile mWaitingToSend;
-
+
+ // Navigation Drawer
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mDrawerToggle;
- private boolean showAccounts = false;
+ private ListView mDrawerList;
+
+ // Slide menu items
+ private String[] mDrawerTitles;
+ private String[] mDrawerContentDescriptions;
+
+ private ArrayList<NavigationDrawerItem> mDrawerItems;
+
+ private NavigationDrawerListAdapter mNavigationDrawerAdapter = null;
+
+ private boolean mShowAccounts = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
// Inflate and set the layout view
setContentView(R.layout.files);
- // TODO move to another place that all activity can use it
- mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+ // Navigation Drawer
+ initDrawer();
+
+ mDualPane = getResources().getBoolean(R.bool.large_land_layout);
+ mLeftFragmentContainer = findViewById(R.id.left_fragment_container);
+ mRightFragmentContainer = findViewById(R.id.right_fragment_container);
+ if (savedInstanceState == null) {
+ createMinFragments();
+ }
+
+ // Action bar setup
+ mDirectories = new CustomArrayAdapter<String>(this, R.layout.sherlock_spinner_dropdown_item);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(true); // mandatory since Android ICS, according to the official documentation
+ getSupportActionBar().setDisplayShowCustomEnabled(true); // CRUCIAL - for displaying your custom actionbar
+ getSupportActionBar().setDisplayShowTitleEnabled(true);
+ setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/); // always AFTER setContentView(...) ; to work around bug in its implementation
+
+ // TODO Remove??, it is done in onPostCreate
+ mDrawerToggle.syncState();
+ setBackgroundText();
+
+ Log_OC.v(TAG, "onCreate() end");
+ }
+
+ private void initDrawer(){
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+ // Notification Drawer
+ LinearLayout navigationDrawerLayout = (LinearLayout) findViewById(R.id.left_drawer);
+ mDrawerList = (ListView) navigationDrawerLayout.findViewById(R.id.drawer_list);
+
+ // load Account in the Drawer Title
+ // User-Icon
+ ImageView userIcon = (ImageView) navigationDrawerLayout.findViewById(R.id.drawer_userIcon);
+ userIcon.setImageResource(DisplayUtils.getSeasonalIconId());
+
+ // Username
+ TextView username = (TextView) navigationDrawerLayout.findViewById(R.id.drawer_username);
+ Account account = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
+
+ if (account != null) {
+ int lastAtPos = account.name.lastIndexOf("@");
+ username.setText(account.name.substring(0, lastAtPos));
+ }
+
+ // load slide menu items
+ mDrawerTitles = getResources().getStringArray(R.array.drawer_items);
+
+ // nav drawer content description from resources
+ mDrawerContentDescriptions = getResources().
+ getStringArray(R.array.drawer_content_descriptions);
+
+ // nav drawer items
+ mDrawerItems = new ArrayList<NavigationDrawerItem>();
+ // adding nav drawer items to array
+ // Accounts
+ mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[0], mDrawerContentDescriptions[0]));
+ // All Files
+ mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[1], mDrawerContentDescriptions[1]));
+
+ // TODO Enable when "On Device" is recovered
+ // On Device
+ //mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[2],
+ // mDrawerContentDescriptions[2]));
+
+ // Settings
+ mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[2], mDrawerContentDescriptions[2]));
+ // Logs
+ if (BuildConfig.DEBUG) {
+ mDrawerItems.add(new NavigationDrawerItem(mDrawerTitles[3],
+ mDrawerContentDescriptions[3]));
+ }
+
+ // setting the nav drawer list adapter
+ mNavigationDrawerAdapter = new NavigationDrawerListAdapter(getApplicationContext(), this,
+ mDrawerItems);
+ mDrawerList.setAdapter(mNavigationDrawerAdapter);
+
mDrawerToggle = new ActionBarDrawerToggle(
- this,
- mDrawerLayout,
- R.drawable.ic_drawer,
- R.string.drawer_open,
- R.string.empty
- ) {
+ this,
+ mDrawerLayout,
+ R.drawable.ic_drawer,
+ R.string.drawer_open,
+ R.string.empty) {
/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
invalidateOptionsMenu();
}
};
-
- mDrawerToggle.setDrawerIndicatorEnabled(true);
-
- // Notification Drawer
- LinearLayout notificatonDrawer = (LinearLayout) findViewById(R.id.left_drawer);
-
- // ListView
- ListView listView = (ListView) notificatonDrawer.findViewById(R.id.drawer_list);
- adapter = new NavigationDrawerListAdapter(getApplicationContext(), this);
-
- listView.setAdapter(adapter);
-
- listView.setOnItemClickListener(new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- if (showAccounts && position > 0){
- position = position - 1;
- }
- switch (position){
- case 0:
- showAccounts = !showAccounts;
- adapter.setShowAccounts(showAccounts);
- adapter.notifyDataSetChanged();
- break;
- case 1:
- MainApp.showOnlyFilesOnDevice(false);
- mDrawerLayout.closeDrawers();
- break;
- case 2:
- MainApp.showOnlyFilesOnDevice(true);
- mDrawerLayout.closeDrawers();
- break;
- case 3:
- Intent settingsIntent = new Intent(getApplicationContext(), Preferences.class);
- startActivity(settingsIntent);
- break;
- }
- }
- });
-
- // User-Icon
- ImageView userIcon = (ImageView) notificatonDrawer.findViewById(R.id.drawer_userIcon);
- userIcon.setImageResource(DisplayUtils.getSeasonalIconId());
-
- // Username
- TextView username = (TextView) notificatonDrawer.findViewById(R.id.drawer_username);
- Account account = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
- if (account != null) {
- int lastAtPos = account.name.lastIndexOf("@");
- username.setText(account.name.substring(0, lastAtPos));
- }
+ mDrawerToggle.setDrawerIndicatorEnabled(true);
+ // Set the list's click listener
+ mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
-
- mDualPane = getResources().getBoolean(R.bool.large_land_layout);
- mLeftFragmentContainer = findViewById(R.id.left_fragment_container);
- mRightFragmentContainer = findViewById(R.id.right_fragment_container);
- if (savedInstanceState == null) {
- createMinFragments();
- }
-
- // Action bar setup
- mDirectories = new CustomArrayAdapter<String>(this, R.layout.sherlock_spinner_dropdown_item);
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- getSupportActionBar().setHomeButtonEnabled(true); // mandatory since Android ICS, according to the official documentation
- getSupportActionBar().setDisplayShowCustomEnabled(true); // CRUCIAL - for displaying your custom actionbar
- getSupportActionBar().setDisplayShowTitleEnabled(true);
- setSupportProgressBarIndeterminateVisibility(mSyncInProgress /*|| mRefreshSharesInProgress*/); // always AFTER setContentView(...) ; to work around bug in its implementation
-
- mDrawerToggle.syncState();
-
- setBackgroundText();
-
- Log_OC.v(TAG, "onCreate() end");
}
-
+
@Override
protected void onStart() {
Log_OC.v(TAG, "onStart() start");
/// First fragment
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
- listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory(getCurrentDir());
+ // TODO Enable when "On Device" is recovered
+ // listOfFiles.listDirectory(getCurrentDir(), MainApp.getOnlyOnDevice());
} else {
Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
}
protected void refreshListOfFilesFragment() {
OCFileListFragment fileListFragment = getListOfFilesFragment();
- if (fileListFragment != null) {
- fileListFragment.listDirectory(MainApp.getOnlyOnDevice());
+ if (fileListFragment != null) {
+ fileListFragment.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(MainApp.getOnlyOnDevice());
}
}
builder.setTitle(R.string.actionbar_sort_title)
.setSingleChoiceItems(R.array.actionbar_sortby, sortOrder , new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
-
switch (which){
- case 0:
- sortByName(true);
- break;
- case 1:
- sortByDate(false);
- break;
-
+ case 0:
+ sortByName(true);
+ break;
+ case 1:
+ sortByDate(false);
+ break;
}
-
+
dialog.dismiss();
-
}
});
builder.create().show();
super.onResume();
// refresh Navigation Drawer account list
- adapter.updateAccountList();
+ mNavigationDrawerAdapter.updateAccountList();
// refresh list of files
refreshListOfFilesFragment();
if (synchFolderRemotePath != null && currentDir.getRemotePath().equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
- fileListFragment.listDirectory(currentDir, MainApp.getOnlyOnDevice());
+ fileListFragment.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(currentDir, MainApp.getOnlyOnDevice());
}
}
setFile(currentFile);
popDirname();
}
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
- listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory(root);
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root, false);
}
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
setNavigationListWithFolder(folder);
- listOfFiles.listDirectory(folder, MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory(folder);
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(folder, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(folder, false);
} else {
// a new chance to get the mDownloadBinder through getFileDownloadBinder() - THIS IS A MESS
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
- listOfFiles.listDirectory(MainApp.getOnlyOnDevice());
+ listOfFiles.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(MainApp.getOnlyOnDevice());
}
FileFragment secondFragment = getSecondFragment();
if (secondFragment != null && secondFragment instanceof FileDetailFragment) {
mDrawerLayout.closeDrawers();
}
+ private class DrawerItemClickListener implements ListView.OnItemClickListener {
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ if (mShowAccounts && position > 0){
+ position = position - 1;
+ }
+ switch (position){
+ case 0: // Accounts
+ mShowAccounts = !mShowAccounts;
+ mNavigationDrawerAdapter.setShowAccounts(mShowAccounts);
+ mNavigationDrawerAdapter.notifyDataSetChanged();
+ break;
+
+ case 1: // All Files
+ // TODO Enable when "On Device" is recovered ?
+ //MainApp.showOnlyFilesOnDevice(false);
+ mDrawerLayout.closeDrawers();
+ break;
+
+ // TODO Enable when "On Device" is recovered ?
+// case 2:
+// MainApp.showOnlyFilesOnDevice(true);
+// mDrawerLayout.closeDrawers();
+// break;
+
+ case 2: // Settings
+ Intent settingsIntent = new Intent(getApplicationContext(),
+ Preferences.class);
+ startActivity(settingsIntent);
+ break;
+
+ case 3: // Logs
+ Intent loggerIntent = new Intent(getApplicationContext(),
+ LogHistoryActivity.class);
+ startActivity(loggerIntent);
+ break;
+ }
+ }
+ }
}
package com.owncloud.android.ui.activity;
-import java.io.IOException;
-
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
-import android.accounts.OperationCanceledException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudAccount;
if (!stateWasRecovered) {
OCFileListFragment listOfFolders = getListOfFilesFragment();
- listOfFolders.listDirectory(folder, false);
+ listOfFolders.listDirectory(folder/*, false*/);
startSyncFolderOperation(folder, false);
}
protected void refreshListOfFilesFragment() {
OCFileListFragment fileListFragment = getListOfFilesFragment();
- if (fileListFragment != null) {
- fileListFragment.listDirectory(false);
+ if (fileListFragment != null) {
+ fileListFragment.listDirectory();
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(false);
}
}
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) { // should never be null, indeed
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
- listOfFiles.listDirectory(root, false);
+ listOfFiles.listDirectory(root);
+ // TODO Enable when "On Device" is recovered ?
+ // listOfFiles.listDirectory(root, false);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
startSyncFolderOperation(root, false);
equals(synchFolderRemotePath)) {
OCFileListFragment fileListFragment = getListOfFilesFragment();
if (fileListFragment != null) {
- fileListFragment.listDirectory(currentDir, false);
+ fileListFragment.listDirectory(currentDir);
+ // TODO Enable when "On Device" is recovered ?
+ // fileListFragment.listDirectory(currentDir, false);
}
}
setFile(currentFile);
}
}
-
+
if (BuildConfig.DEBUG) {
Preference pLog = findPreference("log");
if (pLog != null ){
return true;
}
});
- }
+ }
}
boolean recommendEnabled = getResources().getBoolean(R.bool.recommend_enabled);
Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(Preferences.this);
String username = currentAccount.name.substring(0, currentAccount.name.lastIndexOf('@'));
- String recommendSubject = String.format(getString(R.string.recommend_subject), appName);
+ String recommendSubject = String.format(getString(R.string.recommend_subject),
+ appName);
String recommendText = String.format(getString(R.string.recommend_text),
appName, downloadUrl, username);
if (!stateWasRecovered) {
OCFileListFragment listOfFolders = getListOfFilesFragment();
- listOfFolders.listDirectory(folder, false);
+ // TODO Enable when "On Device" is recovered ?
+ listOfFolders.listDirectory(folder/*, false*/);
startSyncFolderOperation(folder, false);
}
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountAuthenticator;
-import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.MainApp;
-import com.owncloud.android.R;
-import com.owncloud.android.authentication.AccountAuthenticator;
-import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
-import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.ui.dialog.CreateFolderDialogFragment;
import com.owncloud.android.ui.dialog.LoadingDialog;
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// click on folder in the list
Log_OC.d(TAG, "on item click");
- Vector<OCFile> tmpfiles = getStorageManager().getFolderContent(mFile, false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> tmpfiles = getStorageManager().getFolderContent(mFile /*, false*/);
if (tmpfiles.size() <= 0) return;
// filter on dirtype
Vector<OCFile> files = new Vector<OCFile>();
mFile = getStorageManager().getFileByPath(full_path);
if (mFile != null) {
- Vector<OCFile> files = getStorageManager().getFolderContent(mFile, false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = getStorageManager().getFolderContent(mFile/*, false*/);
List<HashMap<String, Object>> data = new LinkedList<HashMap<String,Object>>();
for (OCFile f : files) {
HashMap<String, Object> h = new HashMap<String, Object>();
* @param updatedStorageManager Optional updated storage manager; used to replace \r
* mStorageManager if is different (and not NULL)\r
*/\r
- public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager, boolean onlyOnDevice) {\r
+ public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager\r
+ /*, boolean onlyOnDevice*/) {\r
mFile = directory;\r
if (updatedStorageManager != null && updatedStorageManager != mStorageManager) {\r
mStorageManager = updatedStorageManager;\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
}\r
if (mStorageManager != null) {\r
- mFiles = mStorageManager.getFolderContent(mFile, onlyOnDevice);\r
+ // TODO Enable when "On Device" is recovered ?\r
+ mFiles = mStorageManager.getFolderContent(mFile/*, onlyOnDevice*/);\r
mFilesOrig.clear();\r
mFilesOrig.addAll(mFiles);\r
\r
+/**
+ * ownCloud Android client application
+ *
+ * @author tobiasKaminsky
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.ui.adapter;
import java.nio.ByteBuffer;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
+import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.LayoutParams;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.ui.NavigationDrawerItem;
import com.owncloud.android.ui.TextDrawable;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.utils.BitmapUtils;
public class NavigationDrawerListAdapter extends BaseAdapter {
- private final static String TAG = "NavigationDrawerListAdapter";
+ private final static String TAG = NavigationDrawerListAdapter.class.getSimpleName();
+
private Context mContext;
- private ArrayList<String> mDrawerItems = new ArrayList<String>();
- ArrayList<Object> all = new ArrayList<Object>();
+
+ private ArrayList<NavigationDrawerItem> mNavigationDrawerItems;
+ private ArrayList<Object> mAll = new ArrayList<Object>();
private Account[] mAccounts;
private boolean mShowAccounts;
- private Account currentAccount;
+ private Account mCurrentAccount;
private FileDisplayActivity mFileDisplayActivity;
- public NavigationDrawerListAdapter(Context context, FileDisplayActivity fileDisplayActivity){
+ public NavigationDrawerListAdapter(Context context, FileDisplayActivity fileDisplayActivity,
+ ArrayList<NavigationDrawerItem> navigationDrawerItems){
mFileDisplayActivity = fileDisplayActivity;
mContext = context;
-
- for (String string : mContext.getResources().getStringArray(R.array.drawer_items)) {
- mDrawerItems.add(string);
- }
+ mNavigationDrawerItems = navigationDrawerItems;
updateAccountList();
- all.addAll(mDrawerItems);
+ mAll.addAll(mNavigationDrawerItems);
}
public void updateAccountList(){
AccountManager am = (AccountManager) mContext.getSystemService(mContext.ACCOUNT_SERVICE);
mAccounts = am.getAccountsByType(MainApp.getAccountType());
- currentAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
+ mCurrentAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);
}
@Override
public int getCount() {
if (mShowAccounts){
- return mDrawerItems.size() + 1;
+ return mNavigationDrawerItems.size() + 1;
} else {
- return mDrawerItems.size();
+ return mNavigationDrawerItems.size();
}
}
LayoutInflater inflator = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- if (all.size() > position) {
+ if (mAll.size() > position) {
// Normal entry
- if (all.get(position) instanceof String){
+ if (mAll.get(position) instanceof NavigationDrawerItem){
+ NavigationDrawerItem navItem = (NavigationDrawerItem) mAll.get(position);
+
View view = inflator.inflate(R.layout.drawer_list_item, null);
view.setMinimumHeight(40);
- TextView textView = (TextView) view.findViewById(R.id.drawer_textView);
-
- String entry = (String) all.get(position);
- textView.setText(entry);
+ LinearLayout itemLayout = (LinearLayout) view.findViewById(R.id.itemLayout);
+ itemLayout.setContentDescription(navItem.getContentDescription());
+ TextView itemText = (TextView) view.findViewById(R.id.itemTitle);
+ itemText.setText(navItem.getTitle());
return view;
}
// Account
- if (all.get(position) instanceof Account[]){
+ if (mAll.get(position) instanceof Account[]){
final View view = inflator.inflate(R.layout.drawer_account_group, null);
final RadioGroup group = (RadioGroup) view.findViewById(R.id.drawer_radio_group);
RadioButton rb = new RadioButton(mContext);
rb.setText(account.name);
+ rb.setContentDescription(account.name);
rb.setTextColor(Color.BLACK);
rb.setEllipsize(TextUtils.TruncateAt.MIDDLE);
rb.setSingleLine();
params.setMargins(15, 5, 5, 5);
// Check the current account that is being used
- if (account.name.equals(currentAccount.name)) {
+ if (account.name.equals(mCurrentAccount.name)) {
rb.setChecked(true);
} else {
rb.setChecked(false);
// TODO update Account List after creating a new account and on fresh installation
public void setShowAccounts(boolean value){
- all.clear();
- all.addAll(mDrawerItems);
+ mAll.clear();
+ mAll.addAll(mNavigationDrawerItems);
if (value){
- all.add(1, mAccounts);
+ mAll.add(1, mAccounts);
}
mShowAccounts = value;
}
boolean containsKeepInSync = false;
if (mTargetFile.isFolder()) {
- Vector<OCFile> files = storageManager.getFolderContent(mTargetFile, false);
+ // TODO Enable when "On Device" is recovered ?
+ Vector<OCFile> files = storageManager.getFolderContent(mTargetFile/*, false*/);
for(OCFile file: files) {
containsKeepInSync = file.keepInSync() || containsKeepInSync;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.ContextMenu;
-import android.view.LayoutInflater;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.TextView;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
moveCount++;
} // exit is granted because storageManager.getFileByPath("/") never returns null
mFile = parentDir;
-
- listDirectory(mFile, MainApp.getOnlyOnDevice());
+
+ // TODO Enable when "On Device" is recovered ?
+ listDirectory(mFile /*, MainApp.getOnlyOnDevice()*/);
onRefresh(false);
if (file != null) {
if (file.isFolder()) {
// update state and view of this fragment
- listDirectory(file, MainApp.getOnlyOnDevice());
+ // TODO Enable when "On Device" is recovered ?
+ listDirectory(file/*, MainApp.getOnlyOnDevice()*/);
// then, notify parent activity to let it update its state and view
mContainerActivity.onBrowsedDownTo(file);
// save index and top position
/**
* Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
*/
- public void listDirectory(boolean onlyOnDevice){
- listDirectory(null, onlyOnDevice);
+ public void listDirectory(/*boolean onlyOnDevice*/){
+ listDirectory(null);
+ // TODO Enable when "On Device" is recovered ?
+ // listDirectory(null, onlyOnDevice);
}
public void refreshDirectory(){
- listDirectory(getCurrentFile(), MainApp.getOnlyOnDevice());
+ // TODO Enable when "On Device" is recovered ?
+ listDirectory(getCurrentFile()/*, MainApp.getOnlyOnDevice()*/);
}
/**
*
* @param directory File to be listed
*/
- public void listDirectory(OCFile directory, boolean onlyOnDevice) {
+ public void listDirectory(OCFile directory/*, boolean onlyOnDevice*/) {
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
if (storageManager != null) {
directory = storageManager.getFileById(directory.getParentId());
}
- mAdapter.swapDirectory(directory, storageManager, onlyOnDevice);
+ // TODO Enable when "On Device" is recovered ?
+ mAdapter.swapDirectory(directory, storageManager/*, onlyOnDevice*/);
if (mFile == null || !mFile.equals(directory)) {
mCurrentListView.setSelection(0);
}
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
import com.ortiz.touch.ExtendedViewPager;
-import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.FileDataStorageManager;
// should not be necessary
parentFolder = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
}
- mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(), parentFolder, getAccount(), getStorageManager(), MainApp.getOnlyOnDevice());
+ // TODO Enable when "On Device" is recovered ?
+ mPreviewImagePagerAdapter = new PreviewImagePagerAdapter(getSupportFragmentManager(),
+ parentFolder, getAccount(), getStorageManager()/*, MainApp.getOnlyOnDevice()*/);
mViewPager = (ExtendedViewPager) findViewById(R.id.fragmentPager);
int position = mHasSavedPosition ? mSavedPosition : mPreviewImagePagerAdapter.getFilePosition(getFile());
position = (position >= 0) ? position : 0;
*/
package com.owncloud.android.ui.preview;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.utils.FileStorageUtils;
/**
* Constructor.
*
- * @param fragmentManager {@link FragmentManager} instance that will handle the {@link Fragment}s provided by the adapter.
+ * @param fragmentManager {@link FragmentManager} instance that will handle
+ * the {@link Fragment}s provided by the adapter.
* @param parentFolder Folder where images will be searched for.
* @param storageManager Bridge to database.
*/
- public PreviewImagePagerAdapter(FragmentManager fragmentManager, OCFile parentFolder, Account account, FileDataStorageManager storageManager, boolean onlyOnDevice) {
+ public PreviewImagePagerAdapter(FragmentManager fragmentManager, OCFile parentFolder,
+ Account account, FileDataStorageManager storageManager /*,
+ boolean onlyOnDevice*/) {
super(fragmentManager);
if (fragmentManager == null) {
mAccount = account;
mStorageManager = storageManager;
- mImageFiles = mStorageManager.getFolderImages(parentFolder, false);
+ // TODO Enable when "On Device" is recovered ?
+ mImageFiles = mStorageManager.getFolderImages(parentFolder/*, false*/);
mImageFiles = FileStorageUtils.sortFolder(mImageFiles);
OCFile file = mImageFiles.get(i);
Fragment fragment = null;
if (file.isDown()) {
- fragment = PreviewImageFragment.newInstance(file, mObsoletePositions.contains(Integer.valueOf(i)));
+ fragment = PreviewImageFragment.newInstance(file,
+ mObsoletePositions.contains(Integer.valueOf(i)));
} else if (mDownloadErrors.contains(Integer.valueOf(i))) {
fragment = FileDownloadFragment.newInstance(file, mAccount, true);