Git Product home page Git Product logo

mobilliumandroidguidelines's Introduction

Mobillium logo

Mobillium Project Guidelines

Project & code-style guideline of Mobillium Android Development Team.

Table of Contents

Colors
CustomViews & CustomLayouts
Dimens
ID's in XML
Resources
Strings
Styles
Text Sizes

📃Resources Naming Standarts

🔸Colors

lowercase_underscore
Rule Definition Example
<widget/where>_<description> widget/where = widget name or where it's used <color name="image_logo_tint">@color/mobillium_blue</color>
<color name="button_primary">@color/pistachio</color>
<color name="mobillium_blue">#4b7bec</color>
<color name="pistachio">#93c572</color>

🔸CustomViews and CustomLayouts

Class: PascalCase, Layout: lowercase_underscore
Rule Definition Example
CV<What><Type> What = Name for the custom view
Type = Usually, what it extends
CVPinTextView
CVNumPadLayout
cv_<what>_<type> Layout file of custom view or layout cv_pin_textview
cv_numpad_layout

🔸Dimens

lowercase_underscore
Rule Definition Example
<where>_screen_<widget>_<description>
or
<where>_<widget>_<description>
or
<widget>_<description>
or
<attribute>_<description>
where = where it's used(activity,fragment,dialog)
widget = widget name(button, image etc)
attribute = margin, padding
<dimen name="user_detail_screen_cardview_radius">4dp</dimen>
<dimen name="dialog_icon_height">16dp</dimen>
<dimen name="image_width">120dp</dimen>
<dimen name="margin_medium">16dp</dimen>

🔸ID's in XML

lowerCamelCase
Rule Definition Example
<view><What> view = Short name of the view
Button - btn
Spinner - spn
EditText - et
TextView - tv
RecyclerView - rv
ConstraintLayout - cl
LinearLayout - ll
btnLogin
tvUserName
clProductContainer

🔸Resources

lowercase_underscore
Resource Rule Definition Example
Icons ic_<what>_<description>? what = Name of the icon
description = Description (optional)
ic_arrow_right
Images img_<what>_<description>? img_profile_placeholder
Custom Drawables custom_<what>_<description>? custom_button_round
Partial Layouts partial_<what>_<description>? Parts of other layouts that are <include>d partial_stats_container
Dialogs dialog_<what>_<description>? Dialog layouts dialog_change_theme
Item Views item_<what>_<description>? Item views of List Adapters item_bank_account

🔸Strings.xml

lowercase_underscore
Rule Definition Example
<where>_screen_<description>_<type>
or
<where>_<description>_<type>
or
common_<description>
where = DieticianDetailActivity + screen
description = Credit card type
type = Header
<string name="dietician_detail_screen_credit_card_type_header"> Credit Card Type </string>
<string name="common_loading">Loading...</string>

🔸Styles

PascalCase
Rule Definition Example
<Widget><Description>
or
<Where><Description>
For header texts <style name="TextHeader" parent="Widget.AppCompat.TextView">
<Widget><Description>.<Style> Extends all styles from TextHeader and adds new color style <style name="TextHeader.Black">

🔸Text Sizes

lowercase_underscore
Rule Definition Example
text_size_<description> description = caption, small, medium, normal, big, headline <dimen name="text_size_caption "> 12sp </dimen>

mobilliumandroidguidelines's People

Contributors

akndmr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.