You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/android/README.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ This document, expected to be followed by any developers at 47 Degrees, is a sub
8
8
9
9
Developers should pay special attention to these naming conventions as they differ from those in the standard Java Coding Conventions.
10
10
11
-
## 1.1. Resource Files
11
+
## 1.1. Common Resource Files
12
12
13
13
The folder *values* will have different files that will store information for our project.
14
14
Some of the most common files and their name are
@@ -20,15 +20,37 @@ Some of the most common files and their name are
20
20
***plurals.xml**: Plurals. Contains references to strings.xml
21
21
***arrays.xml**: Arrays. Contains references to strings.xml
22
22
23
-
## 1.3. Java Packages & Class Names
23
+
## 1.2. Java Packages & Class Names
24
24
25
25
An android App should generally follow the following package structure
26
26
27
-
* com.company.product.android
27
+
***com.company.product.android**
28
28
- **activities**: All Activities with the word Activity pre-fixed by the Activity name: *[Name]*Activity e.g. MainActivity
29
29
- **adapters**: All Adapters with the word Adapter pre-fixed by the Adapter name: *[Name]*Adapter e.g. UserListAdapter
30
30
- **services**: All Services including API clients and other persistence related services e.g. UserService
31
31
- **components**: All reusable components utilized in Activity and Fragments e.g. UserProfileComponent
32
32
- **dialogs**: All Fragment Dialogs with the word Dialog pre-fixed by the dialog name: *[Name]*Dialog e.g. DeleteAccountConfirmationDialog
33
33
- **fragments**: All Fragments with the word Fragment pre-fixed by the Fragment name: *[Name]*Fragment e.g. UserMapLocationFragment
34
-
- **utils**: All cross package utilities with the word Utils pre-fixed by the Utility name: *[Name]*Utils e.g. StringUtils
34
+
- **utils**: All cross package utilities with the word Utils pre-fixed by the Utility name: *[Name]*Utils e.g. StringUtils
35
+
36
+
## 1.3. Resource Names
37
+
38
+
The following structure should be followed when naming images in order to find and reuse resources fast and efficiently and avoid duplication across different layouts and components.
39
+
40
+
GROUP TYPE NAME [STATE][SUFFIX]
41
+
42
+
***Group**: Application area or screen. If the resource is used in different parts of applications 'common' should be used instead. e.g. actionbar, menu, media, popup, footer, audio, etc.
43
+
***Type**: Resource Type. e.g. background, icon, button, textfield, list, menuitem, radiobutton, checkbox, tab, dialog, title, etc.
44
+
***Name**: Descriptive name as to what the resource is about. e.g. play, stop.
45
+
***State** (Optional): The optional state of a parent resource. e.g. A button could be in 'normal', 'pressed', 'disabled' and 'selected'. A checkbox could be 'on' or 'off'. These resources should NEVER be used directly in layout but rather as state selectors.
46
+
***Suffix** (Optional): An arbitrary suffix that helps to further identify a property of the resource. Ex: bright, dark, opaque, layer, etc.
47
+
48
+
Below are some examples of properly named resources.
0 commit comments