Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 1 | /* |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 2 | * Copyright (C) 2016 The Android Open Source Project |
Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 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 | |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 17 | package com.android.documentsui; |
Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 18 | |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 19 | import com.android.documentsui.base.DocumentStack; |
| 20 | import com.android.documentsui.base.State; |
Steve McKay | b85f90c | 2015-11-09 17:38:35 +0900 | [diff] [blame] | 21 | |
Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 22 | /** |
Dooper | 3975fa2 | 2017-06-02 10:32:00 -0700 | [diff] [blame] | 23 | * Provides support for specializing the DirectoryFragment to the "host" Activity. |
Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 24 | * Feel free to expand the role of this class to handle other specializations. |
| 25 | */ |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 26 | public abstract class ActivityConfig { |
Steve McKay | b85f90c | 2015-11-09 17:38:35 +0900 | [diff] [blame] | 27 | |
Steve McKay | b85f90c | 2015-11-09 17:38:35 +0900 | [diff] [blame] | 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. |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 31 | public boolean canSelectType(String docMimeType, int docFlags, State state) { |
Steve McKay | b85f90c | 2015-11-09 17:38:35 +0900 | [diff] [blame] | 32 | return true; |
| 33 | } |
| 34 | |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 35 | public boolean isDocumentEnabled(String docMimeType, int docFlags, State state) { |
Tomasz Mikolajewski | 3ff65c3 | 2016-04-20 16:50:25 +0900 | [diff] [blame] | 36 | return true; |
Steve McKay | b85f90c | 2015-11-09 17:38:35 +0900 | [diff] [blame] | 37 | } |
| 38 | |
Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 39 | /** |
Steve McKay | 9d7085f | 2016-03-07 11:51:31 -0800 | [diff] [blame] | 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 | */ |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 43 | public boolean managedModeEnabled(DocumentStack stack) { |
Steve McKay | ce0b14c | 2016-05-03 11:25:52 -0700 | [diff] [blame] | 44 | return false; |
| 45 | } |
Steve McKay | 9d7085f | 2016-03-07 11:51:31 -0800 | [diff] [blame] | 46 | |
| 47 | /** |
Garfield, Tan | 63aed6a | 2016-04-21 14:07:47 -0700 | [diff] [blame] | 48 | * Whether drag n' drop is allowed in this context |
| 49 | */ |
Garfield Tan | 208945c | 2016-10-04 14:36:38 -0700 | [diff] [blame] | 50 | public boolean dragAndDropEnabled() { |
Steve McKay | ce0b14c | 2016-05-03 11:25:52 -0700 | [diff] [blame] | 51 | return false; |
| 52 | } |
Steve McKay | dad3e16 | 2015-10-27 15:57:53 -0700 | [diff] [blame] | 53 | } |