This project follows the MVP architecture .
For more info Model-View-Presenter.
Class names should be in UpperCamelCase.
For class that extends Android component should end with name of component. eg. UserBasicInfoActivity
, AadhaarDetailsFragment
, ChangePasswordDialog
, UserListAdapter
Layout file names are written in lowercase_underscore.
Layout files should match the name of the Android components that they are intended for but moving the top level component name to the beginning. For example, if we are creating a layout for the SignInActivity
, the name of the layout file should be activity_sign_in.xml
.
Component | Class Name | Layout Name |
---|---|---|
Activity | UserBasicInfoActivity |
activity_user_basic_info.xml |
Fragment | AadhaarDetailsFragment |
fragment_aadhaar_detials.xml |
Dialog | ChangePasswordDialog |
dialog_change_password.xml |
AdapterView item | --- | item_person.xml |
Partial layout | --- | partial_stats_bar.xml |
ID names in xml are written in lowercase_underscore.
Id's for view should start with view name . e.g button_login
, et_user_name
,
View | id name |
---|---|
Button | button_login |
EditText | et_user_name |
RecyclerView | rv_users |
TextInputLayout | til_user_name |
RadioButton | rb_male |
RadioGroup | rg_gender |
TextView | tv_header |
ID names are written in camel case.
Id's for view should start with view name . e.g buttonLogin
, etUserName
,
View | id name |
---|---|
Button | buttonLogin |
EditText | etUserName |
RecyclerView | rv_users |
TextInputLayout | tilUserName |
RadioButton | rbMale |
RadioGroup | rgGender |
TextView | tvHeader |
Values resource should start with component name. e.g colorWhite
, dimesButtonWidth
styleGlobalButton
Component | key name |
---|---|
color.xml | colorScreenBackground |
style.xml | styleGlobalButton |
dimens.xml | dimensLoginButtonWidth |