blob: 5b70fd5a35a6b607d4bc46db1665326bf1ed2ec5 [file] [log] [blame]
Steve McKaydad3e162015-10-27 15:57:53 -07001/*
Garfield Tan208945c2016-10-04 14:36:38 -07002 * Copyright (C) 2016 The Android Open Source Project
Steve McKaydad3e162015-10-27 15:57:53 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Garfield Tan208945c2016-10-04 14:36:38 -070017package com.android.documentsui;
Steve McKaydad3e162015-10-27 15:57:53 -070018
Garfield Tan208945c2016-10-04 14:36:38 -070019import com.android.documentsui.base.DocumentStack;
20import com.android.documentsui.base.State;
Steve McKayb85f90c2015-11-09 17:38:35 +090021
Steve McKaydad3e162015-10-27 15:57:53 -070022/**
23 * Providers support for specializing the DirectoryFragment to the "host" Activity.
24 * Feel free to expand the role of this class to handle other specializations.
25 */
Garfield Tan208945c2016-10-04 14:36:38 -070026public abstract class ActivityConfig {
Steve McKayb85f90c2015-11-09 17:38:35 +090027
Steve McKayb85f90c2015-11-09 17:38:35 +090028 // Subtly different from isDocumentEnabled. The reason may be illuminated as follows.
29 // A folder is enabled such that it may be double clicked, even in settings
30 // when the folder itself cannot be selected. This may also be true of container types.
Garfield Tan208945c2016-10-04 14:36:38 -070031 public boolean canSelectType(String docMimeType, int docFlags, State state) {
Steve McKayb85f90c2015-11-09 17:38:35 +090032 return true;
33 }
34
Garfield Tan208945c2016-10-04 14:36:38 -070035 public boolean isDocumentEnabled(String docMimeType, int docFlags, State state) {
Tomasz Mikolajewski3ff65c32016-04-20 16:50:25 +090036 return true;
Steve McKayb85f90c2015-11-09 17:38:35 +090037 }
38
Steve McKaydad3e162015-10-27 15:57:53 -070039 /**
Steve McKay9d7085f2016-03-07 11:51:31 -080040 * When managed mode is enabled, active downloads will be visible in the UI.
41 * Presumably this should only be true when in the downloads directory.
42 */
Garfield Tan208945c2016-10-04 14:36:38 -070043 public boolean managedModeEnabled(DocumentStack stack) {
Steve McKayce0b14c2016-05-03 11:25:52 -070044 return false;
45 }
Steve McKay9d7085f2016-03-07 11:51:31 -080046
47 /**
Garfield, Tan63aed6a2016-04-21 14:07:47 -070048 * Whether drag n' drop is allowed in this context
49 */
Garfield Tan208945c2016-10-04 14:36:38 -070050 public boolean dragAndDropEnabled() {
Steve McKayce0b14c2016-05-03 11:25:52 -070051 return false;
52 }
Steve McKaydad3e162015-10-27 15:57:53 -070053}