RollingGlory is Company or Creative Digital Media studio based in Bandung, Indonesia.
GloryConventionLint is judgment code for Convention lint in IDE Android Studio support java and kotlin.
- CamelCase Convention
- CapitalizationCase Convention
- ClassCase Convention
- ConstantCase Convention
- MethodCase Convention
- XmlCase Convention
- XmlIDCase Convention
Don't forget, configuration gradle your must use lintChecks, don't use implementation, kapt or api.
dependencies {
lintChecks 'com.rollingglory:gloryconventionlint-android:0.0.3'
}
allprojects {
repositories {
maven {
url "https://dl.bintray.com/rollingglory/GloryConventionLint-android"
}
}
}
Example phrase : areInject, whatFlavor, loadMore
LOCAL | GLOBAL | |||||
variable | method | class | variable | method | class | |
not final | ✔️ | ✔️ | ||||
not static | ✔️ | ✔️ | ||||
not final static | ✔️ | ✔️ | ||||
final | ||||||
static | ✔️ | ✔️ | ||||
final static |
Example phrase : LoginActivity, UserFragment, UserSession
LOCAL | GLOBAL | |||||
variable | method | class | variable | method | class | |
not final | ✔️ | ✔️ | ||||
not static | ✔️ | ✔️ | ||||
not final static | ✔️ | ✔️ | ||||
final | ✔️ | ✔️ | ||||
static | ✔️ | ✔️ | ||||
final static | ✔️ | ✔️ |
Extends Of | Package's | Naming Convention | Example Phrase | |
PreFix | PostFix | |||
Activity AppCompatActivity FragmentActivity |
android.app.Activity android.support.v7.app.AppCompatActivity androidx.appcompat.app.AppCompatActivity android.support.v4.app.FragmentActivity androidx.fragment.app.FragmentActivity |
Activity | YourclassActivity | |
Fragment DialogFragment |
android.support.v4.app.Fragment androidx.fragment.app.Fragment android.support.v4.app.DialogFragment androidx.fragment.app.DialogFragment |
Fragment | YourclassFragment | |
Service IntentService JobService JobIntentService |
android.app.Service android.app.IntentService android.app.job.JobService android.support.v4.app.JobIntentService androidx.core.app.JobIntentService |
Service | YourclassService | |
BroadcastReceiver | android.content.BroadcastReceiver | Receiver | YourclassReceiver |
Example phrase : SCOPE_USER, SIZE_BLOCK, POSTION_DEFAULT
LOCAL | GLOBAL | ||||||
variable | method | class | variable | method | class | enum | |
not final | ✔️ | ||||||
not static | ✔️ | ||||||
not final static | ✔️ | ||||||
final | |||||||
static | |||||||
final static | ✔️ | ✔️ |
If class extends AppCompatActivity, you should override method onCreate(Bundle savedInstanceState) first sequence.
class HomeActivity extends AppCompatActivity{
//onCreate method should first squence in class
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void onPause() {
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
}
Resource | Naming Convention | Example Phrase | |
PreFix's | PostFix's | ||
Layout | activity_ fragment_ layout_ item_ dialog_ partial_ |
fragment_login | |
Drawable | ic_ bg_ |
ic_notification | |
Menu | menu_ |
menu_dashboard | |
Font | -regular -bold -semi-bold -italic |
robot-regular |
Class | Package's | ID Convention | Example ID's | |
PreFix's | PostFix's | |||
TextView | android.widget.TextView | @+id/tv_ | @+id/tv_yourid | |
EditText | android.widget.EditText | @+id/et_ | @+id/et_yourid | |
Button | android.widget.Button | @+id/btn_ | @+id/btn_yourid | |
ImageView | android.widget.ImageView | @+id/iv_ | @+id/iv_yourid | |
LinearLayout RelativeLayout ConstraintLayout CoordinatorLayout |
android.widget.LinearLayout android.widget.RelativeLayout android.support.constraint.ConstraintLayout androidx.constraintlayout.widget.ConstraintLayout android.support.design.widget.CoordinatorLayout androidx.coordinatorlayout.widget.CoordinatorLayout |
@+id/content_ | @+id/content_yourid | |
AppBarLayout | android.support.design.widget.AppBarLayout com.google.android.material.appbar.AppBarLayout |
@+id/ab_ | @+id/ab_yourid | |
CollapsingToolbarLayout | android.support.design.widget.CollapsingToolbarLayout com.google.android.material.appbar.CollapsingToolbarLayout |
@+id/ctl_ | @+id/ctl_yourid | |
NavigationMenu | android.support.design.internal.NavigationMenu com.google.android.material.internal.NavigationMenu |
@+id/nm_ | @+id/nm_yourid | |
NavigationMenu | android.support.v7.widget.CardView androidx.cardview.widget.CardView |
@+id/cv_ | @+id/cv_yourid | |
TabLayout | android.support.design.widget.TabLayout com.google.android.material.tabs.TabLayout |
@+id/tab_ | @+id/tab_yourid | |
TabItem | android.support.design.widget.TabItem com.google.android.material.tabs.TabItem |
@+id/tab_item_ | @+id/tab_item_yourid | |
TextInputLayout | android.support.design.widget.TextInputLayout com.google.android.material.textfield.TextInputLayout |
@+id/til_ | @+id/til_yourid | |
DrawerLayout | android.support.v4.widget.DrawerLayout androidx.drawerlayout.widget.DrawerLayout |
@+id/dl_ | @+id/dl_yourid | |
FloatingActionButton | android.support.design.widget.FloatingActionButton com.google.android.material.floatingactionbutton.FloatingActionButton |
@+id/fab_ | @+id/fab_yourid |
GloryConventionLint will automatically create rules for both languages.
Please this can be used for your company's project, with MIT License.
This might work for the Java Intelij IDE, but it's more recommended to use Intelij Android Studio
*This works for android studio 3.x.x, if you still use android studio 2.x.x please open Next to do
You can follow us at https://rollingglory.com/