android - 如何在 ubuntu 的 android studio 中添加新的实时模板
问题描述
我正在使用 ubuntu 20.04,我最近正在研究 android studio 中的实时模板
但我没有找到模板文件夹
我搜索了每一个地方,就像这种自我感觉一样
或者这个
或者
和很多其他网站,没找到
我正在使用安卓工作室 4.1
谢谢你的帮助
解决方案
有一个解决方法。您可以从以前的 android studio 版本导出(或手动创建“设置文件”),而不是在预期目录中复制/粘贴文件。然后你“只是”必须将它作为设置导入。
我的“template_settings.zip”包含:
- 选项
- 模板
- “IntelliJ IDEA 全局设置”文件
- “安装的.txt”
在“模板”文件夹中,您可以放置一个文件“MyAndroidLog.xml”,其中包含:
<templateSet group="MyAndroidLog">
<template name="loguw" value="LogUtils.w(BuildConfig.DEBUG, LOG_TAG, "$METHOD_NAME$: $content$");" description="Custom Log.w(TAG, String) with LogUtils" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME" expression="methodName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
</templateSet>
请告诉我是否不够清楚!
推荐阅读
- swift - Swift 使用委托创建一个类
- sql - 参考 SQL Server 中的多个列连接两个表
- c# - 允许微调器按时间间隔递增/递减 TimePicker WPF
- ios - Xcode IB 警告 UICollectionViewCell 中 UIStackView 的位置不明确,尽管它不应该是
- .net - 代表 MSA(Microsoft 个人)和 AAD 帐户的 Azure Ad v2.0 端点
- python - 如果整个字符串不匹配,re.sub 不替换
- r - ggplot facet wrap 变量作为函数中的参数
- pact-lang - 契约形式验证属性
- jpa - 单独创建但一起使用的 Kotlin 数据库实体/对象的可空性
- javascript - 在没有 API 的情况下获取 Instagram 个人资料的关注者数量