├── .gitignore ├── .idea ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── compiler.xml ├── encodings.xml ├── gradle.xml ├── jarRepositories.xml ├── kotlinc.xml ├── misc.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── android │ │ └── attachproject │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── android │ │ │ └── attachproject │ │ │ ├── AttachmentAdapter.kt │ │ │ ├── Main2Activity.java │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── bg_circle.xml │ │ ├── ic_add.xml │ │ ├── ic_close.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_pdf.xml │ │ └── ic_plus_empty_image.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_main2.xml │ │ ├── content_main.xml │ │ ├── content_main2.xml │ │ └── row_attachment.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── android │ └── attachproject │ └── ExampleUnitTest.kt ├── attachmentmanager ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── mirza │ │ └── attachmentmanager │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mirza │ │ │ └── attachmentmanager │ │ │ ├── fragments │ │ │ ├── AttachmentBottomSheet.kt │ │ │ └── AttachmentFragment.kt │ │ │ ├── managers │ │ │ ├── AttachmentManager.kt │ │ │ ├── ConstantManager.kt │ │ │ └── PermissionManager.kt │ │ │ ├── models │ │ │ ├── AttachmentDetail.kt │ │ │ └── Tuple.kt │ │ │ └── utils │ │ │ ├── AttachmentUtil.kt │ │ │ ├── FileUtil.kt │ │ │ └── ImageUtils.kt │ └── res │ │ ├── drawable │ │ ├── ic_am_attach_file.xml │ │ ├── ic_am_camera.xml │ │ ├── ic_am_close.xml │ │ └── ic_am_photo.xml │ │ ├── layout │ │ ├── fragment_attachment.xml │ │ ├── layout_attachment_dialog.xml │ │ └── layout_attachment_sheet.xml │ │ ├── values-ar │ │ └── strings.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ └── strings.xml │ │ └── xml │ │ └── file_provider.xml │ └── test │ └── java │ └── com │ └── mirza │ └── attachmentmanager │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 | 116 | 118 |
119 |
-------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AttachmentManager 2 | 3 | [![](https://jitpack.io/v/Zaid-Mirza/AttachmentManager.svg)](https://jitpack.io/#Zaid-Mirza/AttachmentManager) 4 | [![API](https://img.shields.io/badge/API-26%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=23) 5 | ![Language](https://img.shields.io/badge/language-Kotlin-orange.svg) 6 |
7 |
8 | Developed by 9 | Zaid Mirza and 10 | 11 | contributors 12 | 13 |
14 |
15 | 16 | You can use this lightweight library to implement the attachment feature (taking pictures using the camera, picking up files/images from gallery or file system, or google drive). The library helps you to simplify all the processes related to picking files without worrying about system permissions 17 | 18 | ### Language Support 19 | 20 | * English 21 | * Arabic 22 | 23 | ### Warning! 24 | 25 | 1. This library is build using **AndroidX**.So, I recommend you to migrate your project to **AndroidX** otherwise it may cause problem using both androidx and support libs togather. 26 | 27 | 2. You might face error ``` Invoke-customs are only supported starting with android 0 --min-api 26 ``` 28 | .To solve this add below lines in app level **build.gradle** file. 29 | 30 | ```groovy 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_17 33 | targetCompatibility JavaVersion.VERSION_17 34 | } 35 | ``` 36 | 37 | 38 | 39 | # Prerequisite 40 | 41 | 1. Add permissions and provider in **AndroidManifest.xml** 42 | 43 | ```xml 44 | 45 | 47 | 48 | 49 | 50 | 51 | ``` 52 | ```xml 53 | 59 | 63 | 64 | ``` 65 | 66 | 2. Create **file_provider.xml** in res/xml 67 | ```xml 68 | 69 | 70 | 73 | 76 | 77 | ``` 78 | 79 | 3. If you are targeting Android 11+, you need to add following queries in **AndroidManifest.xml** 80 | ```xml 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | ``` 95 | 96 | 4. Update project level **build.gradle** file. 97 | ```groovy 98 | allprojects { 99 | repositories { 100 | jcenter() 101 | maven { url "https://jitpack.io" } //Make sure to add this in your project 102 | } 103 | } 104 | ``` 105 | 106 | ```groovy 107 | implementation 'com.github.Zaid-Mirza:AttachmentManager:3.0.0' 108 | ``` 109 | 110 | # Usage 111 | 112 | 113 | 1. Initiate AttachmentManager object using builder pattern 114 | 115 | **Kotlin** 116 | 117 | ```kotlin 118 | private var attachmentManager: AttachmentManager? = null 119 | var gallery = arrayOf("image/png", 120 | "image/jpg", 121 | "image/jpeg") 122 | var files = arrayOf("application/msword", 123 | "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // .ppt & .pptx 124 | "application/pdf") 125 | 126 | override fun onCreate(savedInstanceState: Bundle?) { 127 | super.onCreate(savedInstanceState) 128 | setContentView(R.layout.activity_main) 129 | 130 | attachmentManager = AttachmentManager.AttachmentBuilder(this) // must pass Context 131 | .fragment(null) // pass fragment reference if you are in fragment 132 | .setUiTitle("Choose File") // title of dialog or bottom sheet 133 | .allowMultiple(false) // set true if you want make multiple selection, default is false 134 | .asBottomSheet(true) // set true if you need to show selection as bottom sheet, default is as Dialog 135 | .setOptionsTextColor(android.R.color.holo_green_light) // change text color 136 | .setImagesColor(R.color.colorAccent) // change icon color 137 | .hide(HideOption.DOCUMENT) // You can hide any option do you want 138 | .setMaxPhotoSize(200000) // Set max photo size in bytes 139 | .galleryMimeTypes(gallery) // mime types for gallery 140 | .filesMimeTypes(files) // mime types for files 141 | .build(); // Hide any of the three options 142 | 143 | } 144 | 145 | ``` 146 | **Java** 147 | ```java 148 | private AttachmentManager attachmentManager = null; 149 | String[] gallery = {"image/png", 150 | "image/jpg", 151 | "image/jpeg"}; 152 | String[] files = { "application/msword", 153 | "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // .ppt & .pptx 154 | "application/pdf"}; 155 | 156 | @Override 157 | protected void onCreate(Bundle savedInstanceState) { 158 | super.onCreate(savedInstanceState); 159 | setContentView(R.layout.activity_main); 160 | attachmentManager = new AttachmentManager.AttachmentBuilder(this) // must pass Context 161 | .fragment(null) // pass fragment reference if you are in fragment 162 | .setUiTitle("Choose File") // title of dialog or bottom sheet 163 | .allowMultiple(false) // set true if you want make multiple selection, default is false 164 | .asBottomSheet(true) // set true if you need to show selection as bottom sheet, default is as Dialog 165 | .setOptionsTextColor(android.R.color.holo_green_light) // change text color 166 | .setImagesColor(R.color.colorAccent) // change icon color 167 | .hide(HideOption.DOCUMENT) // You can hide any option do you want 168 | .setMaxPhotoSize(200000) // Set max photo size in bytes 169 | .galleryMimeTypes(gallery) // mime types for gallery 170 | .filesMimeTypes(files) // mime types for files 171 | .build(); // Hide any of the three options 172 | } 173 | ``` 174 | 175 | 3. Declare registerForActivityResult 176 | 177 | **Kotlin** 178 | ```kotlin 179 | private var mLauncher = registerForActivityResult(StartActivityForResult()) { result -> 180 | 181 | val list = attachmentManager?.manipulateAttachments(this,result.resultCode,result.data) 182 | Toast.makeText(this, list?.size.toString(), Toast.LENGTH_LONG).show() 183 | } 184 | ```` 185 | **Java** 186 | ```java 187 | ActivityResultLauncher mLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { 188 | 189 | ArrayList list = attachmentManager.manipulateAttachments(this,result.getResultCode(),result.getData()); 190 | 191 | }); 192 | ``` 193 | 4. Call **openSelection()** method to show selection UI and pass ActivityResultLauncher 194 | 195 | **Kotlin** 196 | ```kotlin 197 | attachmentManager?.openSelection(mLauncher) 198 | ```` 199 | **Java** 200 | ```java 201 | attachmentManager.openSelection(mLauncher); 202 | ``` 203 | 204 | 5. Override onRequestPermissionsResult (Optional) 205 | 206 | **Kotlin** 207 | ```kotlin 208 | override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { 209 | attachmentManager?.handlePermissionResponse(requestCode, permissions, grantResults) 210 | } 211 | 212 | ``` 213 | **Java** 214 | ```java 215 | @Override 216 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { 217 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); 218 | attachmentManager.handlePermissionResponse(requestCode,permissions,grantResults); 219 | } 220 | ``` 221 | ### Other Usage 222 | 223 | 1. You can open gallery,camera or file system directly without showing selection UI to user 224 | 225 | ***Kotlin*** 226 | ```kotlin 227 | attachmentManager?.startCamera(mLauncher) 228 | // OR 229 | attachmentManager?.openGallery(mLauncher) 230 | // OR 231 | attachmentManager?.openFilSystem(mLauncher) 232 | ``` 233 | 234 | **Java** 235 | ```java 236 | attachmentManager.startCamera(mLauncher); 237 | // OR 238 | attachmentManager.openGallery(mLauncher); 239 | // OR 240 | attachmentManager.openFilSystem(mLauncher); 241 | ``` 242 | 243 | ## Note 244 | 245 | Any kind of improvements and suggestions are welcomed. Also, if you are using this library in your project then please do provide me your app url. I will list your app here. 246 | 247 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'org.jetbrains.kotlin.android' 4 | id 'kotlin-kapt' 5 | } 6 | 7 | android { 8 | compileSdk 34 9 | namespace("com.android.attachproject") 10 | defaultConfig { 11 | applicationId "com.android.attachproject" 12 | minSdkVersion 26 13 | targetSdkVersion 34 14 | versionCode 1 15 | versionName "1.0" 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | 24 | } 25 | buildFeatures { 26 | viewBinding true 27 | } 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_17 30 | targetCompatibility JavaVersion.VERSION_17 31 | } 32 | 33 | } 34 | 35 | dependencies { 36 | implementation fileTree(dir: 'libs', include: ['*.jar']) 37 | implementation project(':attachmentmanager') 38 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 39 | implementation 'androidx.appcompat:appcompat:1.7.0' 40 | implementation 'androidx.constraintlayout:constraintlayout:2.2.0' 41 | implementation 'com.google.android.material:material:1.12.0' 42 | implementation 'com.google.android.gms:play-services-location:21.3.0' 43 | testImplementation 'junit:junit:4.13.2' 44 | implementation 'commons-io:commons-io:2.6' 45 | implementation 'com.github.bumptech.glide:glide:4.13.0' 46 | kapt 'com.github.bumptech.glide:compiler:4.13.0' 47 | androidTestImplementation 'androidx.test:runner:1.6.2' 48 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' 49 | } 50 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/android/attachproject/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.android.attachproject 2 | 3 | import androidx.test.InstrumentationRegistry 4 | import androidx.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.android.attachproject", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 31 | 32 | 36 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 62 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/attachproject/AttachmentAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.android.attachproject 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.android.attachproject.databinding.RowAttachmentBinding 8 | import com.bumptech.glide.Glide 9 | import com.bumptech.glide.load.DecodeFormat 10 | import com.bumptech.glide.request.RequestOptions 11 | import com.google.android.material.shape.CornerFamily 12 | import com.mirza.attachmentmanager.models.AttachmentDetail 13 | 14 | 15 | 16 | class AttachmentAdapter(private var list: ArrayList) : RecyclerView.Adapter() { 17 | 18 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { 19 | return ViewHolder( 20 | RowAttachmentBinding.inflate(LayoutInflater.from(parent.context), parent, false) 21 | 22 | ) 23 | } 24 | 25 | override fun getItemCount(): Int { 26 | return list.size 27 | } 28 | 29 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { 30 | holder.bind(list, this) 31 | } 32 | 33 | class ViewHolder(val binding: RowAttachmentBinding) : RecyclerView.ViewHolder(binding.root) { 34 | fun bind(list: ArrayList, attachmentAdapter: AttachmentAdapter) = with(itemView) { 35 | val attachmentDetail = list[adapterPosition] 36 | binding.deleteAttachmentImageView.tag = adapterPosition 37 | // val bitmap = attachmentDetail.uri?.let { ImageUtils.getCapturedImage(it) } 38 | 39 | binding.attachmentImageView.shapeAppearanceModel = binding.attachmentImageView.shapeAppearanceModel 40 | .toBuilder() 41 | .setAllCorners(CornerFamily.ROUNDED, resources.getDimension(com.mirza.attachmentmanager.R.dimen.small_margin)) 42 | .build() 43 | 44 | val requestOptions = RequestOptions() 45 | requestOptions.format(DecodeFormat.PREFER_ARGB_8888) 46 | requestOptions.disallowHardwareConfig() 47 | 48 | if(attachmentDetail.mimeType?.contains("pdf") == true) { 49 | Glide.with(itemView).applyDefaultRequestOptions(requestOptions) 50 | .load(R.drawable.ic_pdf).into(binding.attachmentImageView) 51 | }else{ 52 | if (attachmentDetail.uri != null) 53 | Glide.with(itemView).applyDefaultRequestOptions(requestOptions) 54 | .load(attachmentDetail.uri).into(binding.attachmentImageView) 55 | else { 56 | Glide.with(itemView).applyDefaultRequestOptions(requestOptions) 57 | .load(R.drawable.ic_add).into(binding.attachmentImageView) 58 | } 59 | } 60 | 61 | 62 | binding.deleteAttachmentImageView.setOnClickListener { 63 | removeAndUpdate(list, attachmentAdapter) 64 | 65 | } 66 | } 67 | 68 | private fun removeAndUpdate( 69 | list: ArrayList, 70 | attachmentAdapter: AttachmentAdapter 71 | ) { 72 | list.removeAt(adapterPosition) 73 | attachmentAdapter.notifyDataSetChanged() 74 | } 75 | 76 | } 77 | 78 | 79 | fun updateData(arrayList: ArrayList) { 80 | list = arrayList 81 | notifyDataSetChanged() 82 | } 83 | 84 | fun getItems(): ArrayList { 85 | return list 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/android/attachproject/Main2Activity.java: -------------------------------------------------------------------------------- 1 | package com.android.attachproject; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | 7 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 8 | import com.mirza.attachmentmanager.managers.AttachmentManager; 9 | import com.mirza.attachmentmanager.managers.HideOption; 10 | import com.mirza.attachmentmanager.models.AttachmentDetail; 11 | import com.mirza.attachmentmanager.utils.FileUtil; 12 | 13 | import androidx.activity.result.ActivityResult; 14 | import androidx.activity.result.ActivityResultCallback; 15 | import androidx.activity.result.ActivityResultLauncher; 16 | import androidx.activity.result.contract.ActivityResultContracts; 17 | import androidx.annotation.NonNull; 18 | import androidx.annotation.Nullable; 19 | import androidx.appcompat.app.AppCompatActivity; 20 | import androidx.appcompat.widget.Toolbar; 21 | 22 | import android.util.Log; 23 | import android.widget.Toast; 24 | 25 | import java.util.ArrayList; 26 | 27 | public class Main2Activity extends AppCompatActivity { 28 | 29 | 30 | private AttachmentManager attachmentManager = null; 31 | String[] gallery = {"image/*"}; 32 | String[] files = { "application/msword", 33 | "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // .ppt & .pptx 34 | "application/pdf"}; 35 | 36 | ActivityResultLauncher mLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), result -> { 37 | 38 | ArrayList list = attachmentManager.manipulateAttachments(this,result.getResultCode(),result.getData()); 39 | 40 | }); 41 | 42 | 43 | @Override 44 | protected void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | setContentView(R.layout.activity_main2); 47 | Toolbar toolbar = findViewById(R.id.toolbar); 48 | setSupportActionBar(toolbar); 49 | 50 | attachmentManager = new AttachmentManager.AttachmentBuilder(this) // must pass Context 51 | .fragment(null) // pass fragment reference if you are in fragment 52 | .setUiTitle("Choose File") // title of dialog or bottom sheet 53 | .allowMultiple(false) // set true if you want make multiple selection, default is false 54 | .asBottomSheet(true) // set true if you need to show selection as bottom sheet, default is as Dialog 55 | .setOptionsTextColor(android.R.color.holo_green_light) // change text color 56 | .setImagesColor(R.color.colorAccent) // change icon color 57 | .hide(HideOption.DOCUMENT)// You can hide any option do you want 58 | .setMaxPhotoSize(200000) // Set max photo size in bytes 59 | .galleryMimeTypes(gallery) // mime types for gallery 60 | .filesMimeTypes(files) // mime types for files 61 | .build(); // Hide any of the three options 62 | 63 | Toast.makeText(this, "", Toast.LENGTH_LONG).show(); 64 | FloatingActionButton fab = findViewById(R.id.fab); 65 | fab.setOnClickListener(view -> attachmentManager.openSelection(mLauncher)); 66 | 67 | } 68 | 69 | 70 | @Override 71 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { 72 | super.onRequestPermissionsResult(requestCode, permissions, grantResults); 73 | attachmentManager.handlePermissionResponse(requestCode, permissions, grantResults,mLauncher); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/android/attachproject/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.android.attachproject 2 | 3 | 4 | import android.os.Bundle 5 | import android.widget.Toast 6 | import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult 7 | import androidx.appcompat.app.AppCompatActivity; 8 | import androidx.recyclerview.widget.GridLayoutManager 9 | import androidx.recyclerview.widget.RecyclerView 10 | import com.android.attachproject.databinding.ActivityMainBinding 11 | import com.mirza.attachmentmanager.managers.AttachmentManager 12 | import com.mirza.attachmentmanager.managers.HideOption 13 | import com.mirza.attachmentmanager.models.AttachmentDetail 14 | import com.mirza.attachmentmanager.utils.FileUtil 15 | import java.util.ArrayList 16 | 17 | class MainActivity : AppCompatActivity() { 18 | 19 | private lateinit var binding: ActivityMainBinding 20 | private var attachmentManager: AttachmentManager? = null 21 | private var attachmentAdapter: AttachmentAdapter? = null 22 | private var allAttachments : ArrayList?= arrayListOf() 23 | private var mLauncher = registerForActivityResult(StartActivityForResult()) { result -> 24 | 25 | allAttachments = attachmentAdapter?.getItems() 26 | 27 | 28 | attachmentManager?.manipulateAttachments(this,result.resultCode,result.data)?.let { 29 | 30 | 31 | if(it.size > 0 && it[0].mimeType?.contains("pdf",ignoreCase = true) == true) { 32 | if (it.size > 0 && it[0].size!! <= 2000000) { 33 | allAttachments?.addAll(it) 34 | } else { 35 | Toast.makeText( 36 | this, 37 | "File size can't be more than 2MB", 38 | Toast.LENGTH_LONG 39 | ).show() 40 | } 41 | }else if (it.size > 0){ 42 | allAttachments?.addAll(it) 43 | }else{ 44 | 45 | } 46 | it.forEach { 47 | val path = FileUtil.getPath(it.uri!!,this) 48 | val ss = "" 49 | } 50 | 51 | } 52 | attachmentAdapter?.updateData(allAttachments!!) 53 | } 54 | var gallery = arrayOf( 55 | "image/png", 56 | "image/jpg", 57 | "image/jpeg" 58 | ) 59 | var files = arrayOf( 60 | "application/msword", 61 | "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // .ppt & .pptx 62 | "application/pdf" 63 | ) 64 | 65 | 66 | 67 | override fun onCreate(savedInstanceState: Bundle?) { 68 | super.onCreate(savedInstanceState) 69 | binding = ActivityMainBinding.inflate(layoutInflater) 70 | setContentView(binding.root) 71 | setSupportActionBar(binding.toolbar) 72 | 73 | 74 | 75 | attachmentManager = AttachmentManager.AttachmentBuilder(this) // must pass Context 76 | .fragment(null) // pass fragment reference if you are in fragment 77 | .setUiTitle("Choose File") // title of dialog or bottom sheet 78 | .allowMultiple(false) // set true if you want make multiple selection, default is false 79 | .asBottomSheet(true) // set true if you need to show selection as bottom sheet, default is as Dialog 80 | .setOptionsTextColor(android.R.color.holo_green_light) // change text color 81 | .setImagesColor(R.color.colorAccent) // change icon color 82 | // You can hide any option do you want 83 | .setMaxPhotoSize(200000) // Set max photo size in bytes 84 | .galleryMimeTypes(gallery) // mime types for gallery 85 | .filesMimeTypes(files) // mime types for files 86 | .build(); // Hide any of the three options 87 | binding.fab.setOnClickListener { 88 | 89 | attachmentManager?.openSelection(mLauncher) 90 | } 91 | 92 | binding.contentLayout.attachmentRecyclerView.layoutManager = 93 | GridLayoutManager(this, 1, RecyclerView.HORIZONTAL, false) 94 | attachmentAdapter = AttachmentAdapter(allAttachments!!) 95 | binding.contentLayout.attachmentRecyclerView.adapter = attachmentAdapter 96 | binding.contentLayout.addAttachmentImageView.setOnClickListener { 97 | attachmentManager?.openSelection(mLauncher) 98 | } 99 | } 100 | 101 | 102 | 103 | override fun onRequestPermissionsResult( 104 | requestCode: Int, 105 | permissions: Array, 106 | grantResults: IntArray 107 | ) { 108 | super.onRequestPermissionsResult(requestCode, permissions, grantResults) 109 | attachmentManager?.handlePermissionResponse( 110 | requestCode, 111 | permissions, 112 | grantResults, 113 | mLauncher 114 | ) 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 75 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pdf.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 16 | 19 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_plus_empty_image.xml: -------------------------------------------------------------------------------- 1 | 7 | 13 | 20 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 19 | 25 | 26 | 31 | 32 | 38 | 39 | 46 | 47 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main2.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/row_attachment.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 22 | 23 | 24 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zaid-Mirza/AttachmentManager/826dab50cc1c2d95087bfe3e897b01527b0300b0/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | @android:color/white 7 | #e60000 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 100dp 4 | 1dp 5 | 22dp 6 | 2dp 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AttachProject 3 | Main2Activity 4 | Attachments 5 | Close 6 | Add Attachments 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |