Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2019-11-03 17:16:39 +0300
committerAndy Scherzinger <info@andy-scherzinger.de>2019-11-13 13:47:23 +0300
commit693f408276d575e6994187c1efd716721e2c42fb (patch)
treedf9758125c7eb9cd85b936d7f87eae730ad26b4a /CONTRIBUTING.md
parented8b9cbb721250e0984af74187275ce6e53c05b7 (diff)
Improve menu file name pattern
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a57f5b423d..45c48f7961 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,6 +23,8 @@
1. Backport pull request
1. Pull requests that also need changes on library
1. Adding new files
+ 1. File naming
+ 1. Menu files
1. Translations
1. Releases
1. Types
@@ -236,6 +238,24 @@ Source code of app:
-->
```
+## File naming
+
+The file naming patterns are inspired and based on [Ribot's Android Project And Code Guidelines](https://github.com/ribot/android-guidelines/blob/c1d8c9c904eb31bf01fe24aadb963b74281fe79a/project_and_code_guidelines.md).
+
+### Menu files
+
+Similar to layout files, menu files should match the name of the component. For example, if we are defining a menu file that is going to be used in the `UserProfileActivity`, then the name of the file should be `activity_user_profile.xml`. Same pattern applies for menus used in adapter view items, dialogs, etc.
+
+| Component | Class Name | Menu Name |
+| ---------------- | ---------------------- | ----------------------------- |
+| Activity | `UserProfileActivity` | `activity_user_profile.xml` |
+| Fragment | `SignUpFragment` | `fragment_sign_up.xml` |
+| Dialog | `ChangePasswordDialog` | `dialog_change_password.xml` |
+| AdapterView item | --- | `item_person.xml` |
+| Partial layout | --- | `partial_stats_bar.xml` |
+
+A good practice is to not include the word `menu` as part of the name because these files are already located in the `menu` directory. In case a component uses several menus in different places (via popup menus) then the resource name would be extended. For example, if the user profile activity has two popup menus for configuring the users settings and one for the handling group assignments then the file names for the menus would be: `activity_user_profile_user_settings.xml` and `activity_user_profile_group_assignments.xml`.
+
## Translations
We manage translations via [Transifex](https://www.transifex.com/nextcloud/nextcloud/android/). So just request joining the translation team for Android on the site and start translating. All translations will then be automatically pushed to this repository, there is no need for any pull request for translations.