- Each component and template should not exceed 400 lines.
- Make functions smaller. The maximum lines on a function should not exceed 10-15 lines (derived from Uncle Bob’s clean code)
- Use consistent name for all assets. Make classes upper camel case. Class name should be noun and method names should be verb.
- Append symbol name with conventional suffix. (for example, the login component can be named as LoginComponent with Component suffixed).
- File name should have conventional suffix. For example, a component can have its name suffixed with component.
- Use lower camel case for naming selectors and components.
- Separate words with hyphens in selectors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Android.Support.Design.Internal; | |
| using Android.Support.Design.Widget; | |
| namespace MyProject.App.Droid.Helpers | |
| { | |
| public static class AndroidHelpers | |
| { | |
| public static void SetShiftMode(this BottomNavigationView bottomNavigationView, bool enableShiftMode, bool enableItemShiftMode) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Hoverable Behaviour (changing when the mouse is on the widget by O. Poyen. | |
| License: LGPL | |
| """ | |
| __author__ = 'Olivier POYEN' | |
| from kivy.properties import BooleanProperty, ObjectProperty | |
| from kivy.core.window import Window | |
| class HoverBehavior(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Escape JSON | |
| */ | |
| var escapeJSON = exports.escapeJSON = function(json) { | |
| var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; | |
| var meta = { // table of character substitutions | |
| '\b': '\\b', | |
| '\t': '\\t', | |
| '\n': '\\n', | |
| '\f': '\\f', |