Forked from drewhannay/Android Studio TAG Class Template
Last active
July 23, 2021 10:38
-
-
Save tw-Frey/492d80fa74f810d9137bf71657d70244 to your computer and use it in GitHub Desktop.
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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
| #parse("File Header.java") | |
| public class ${NAME} { | |
| private static final String TAG = "${NAME}"; | |
| } |
Author
Author
https://blog.mindorks.com/applying-proguard-in-an-android-application
Do not use something like MainFragment.class.getSimpleName() as a fragment TAG. Proguard may assign the same name (A.class) to two different fragments in different packages while obfuscating. In this case, two fragments will have the same TAG. It will lead to the bug in your application.
Author
Kotlin Class Template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
class ${NAME} {
companion object {
/**
* ${NAME} (類名:String)
*/
const val TAG = "${NAME}"
}
}
Author
Kotlin Enum Template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
enum class ${NAME} {
;
companion object {
/**
* ${NAME} (類名:String)
*/
const val TAG = "${NAME}"
}
}
Author
Kotlin Interface Template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
interface ${NAME} {
companion object {
/**
* ${NAME} (類名:String)
*/
const val TAG = "${NAME}"
}
}
Author
File Header
/**
* #標題(必填) APP主頁面
* #描述(選填) 最主要的卡牌。這是歡迎頁結束後的下一個頁面
* #頁面進入流程(選填) APP開起來➜歡迎頁➜點擊底下五大按鈕第一個 首頁➜點選頁面上方第1個Tab 首頁
* #屬性(選填) 頁面
* #標籤(選填) main,activity,mvvm
* #註解(選填) MainActivity涵蓋了上方的Title、中間頁面和下方五個頁籤
*
* - Created by FreddY on ${YEAR}/${MONTH}/${DAY}.
*
* #主維護(選填)
* #副維護(選填)
*/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.drewhannay.com/2016/02/android-logcat-tag-best-practices.html
File→Settings→Appearance & Behavior→Editor→File and Code Templates→Class