1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
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 
17 package com.android.documentsui;
18 
19 import com.android.documentsui.base.DocumentStack;
20 import com.android.documentsui.base.State;
21 
22 /**
23  * Provides support for specializing the DirectoryFragment to the "host" Activity.
24  * Feel free to expand the role of this class to handle other specializations.
25  */
26 public abstract class ActivityConfig {
27 
28     // 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.
canSelectType(String docMimeType, int docFlags, State state)31     public boolean canSelectType(String docMimeType, int docFlags, State state) {
32         return true;
33     }
34 
isDocumentEnabled(String docMimeType, int docFlags, State state)35     public boolean isDocumentEnabled(String docMimeType, int docFlags, State state) {
36         return true;
37     }
38 
39     /**
40      * 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      */
managedModeEnabled(DocumentStack stack)43     public boolean managedModeEnabled(DocumentStack stack) {
44         return false;
45     }
46 
47     /**
48      * Whether drag n' drop is allowed in this context
49      */
dragAndDropEnabled()50     public boolean dragAndDropEnabled() {
51         return false;
52     }
53 }
54