android代码风格的xml排列规则生成器
xmlarrangement-android的Python项目详细描述
#xmlArrangement-android
*用于android代码样式的xml排列规则生成器textview
android:id=“@+id/example”
style=“@style/apptheme.textview.example”
android:layout\width=“wrap\u content”
android:layout\height=“48dp”
android:gravity=“center\u vertical”
工具:text=“lorem ipsum…”
android:paddingleft=“8dp”/>;
<;edittext
android:id=“@+id/name”
android:layout_width=“match_parent”
android:hint=“hint for name”
android:layout_height=“wrap_content”/>;
<;按钮
android:visibility=“gone”
android:layout廑width=“96dp”
android:layout廑height=“wrap廑content”
android:layout廑below=“@id/name”
android:layout廑alignparentright=“true”/>;
````````
textview
android:id=“@+id/example”
android:layout廑width=“wrap廑content”
android:layout廑height=“48dp”
android:paddingleft=“8dp”
style=“@style/apptheme.textview.example”
android:gravity=“center廑vertical”
工具:text=“lorem ipsum…”/>;
edittext
android:id=“@+id/name”
android:layout懔width=“match懔parent”
android:layout懔height=“wrap懔content”
android:hint=“hint for name”/>;
<;按钮
android:layout庠width=“96dp”
android:layout庠height=“wrap庠content”
android:layout庠below=“@id/name”
android:layout庠alignparentright=“true”
android:visibility=“gone”/>;
``````
1)创建一个文件来描述您想要的顺序:(忽略空行)
``txt
xmlns:android
xmlns:android
xmlns:android:android:android:id
android:android:name
/><
//1)创建一个文件来描述您想要的顺序:(空行被忽略)
` ` ` `` ` ```` txt `` txt
/>
参见[示例.txt](示例.txt)
>
*打开导出的文件并重命名方案,例如`<;code_scheme name=“newscheme”>;`
*查找行`<;codesylesettings language=“xml”>;`
*应该会看到这样的结构:
``xml
<;arrangement>;
<;rules>;
…
<;
<;arrangement>;
```
*替换`<;rules>中的内容;/rules>;`with the content of`rules.xml`
*将新文件复制到android studio代码样式路径:
**mac**:~/library/preferences/android studio x.x/config/codestyles/
**linux**:~/.androidstudiox.x/config/codestyles/
**windows**%userprofile%\.androidstudiox.x\config\codestyles
*重新启动androidstudio,转到首选项**>;**代码样式**>;**方案并应用“newscheme”。
使用pypi:
```
user@machine:~$[sudo]pip安装xmlargement android安卓系统](https://medium.com/@veraken/formatting-xml-layout-files-for-android-47aec62722fc.bt8shn2qx)
*用于android代码样式的xml排列规则生成器textview
android:id=“@+id/example”
style=“@style/apptheme.textview.example”
android:layout\width=“wrap\u content”
android:layout\height=“48dp”
android:gravity=“center\u vertical”
工具:text=“lorem ipsum…”
android:paddingleft=“8dp”/>;
<;edittext
android:id=“@+id/name”
android:layout_width=“match_parent”
android:hint=“hint for name”
android:layout_height=“wrap_content”/>;
<;按钮
android:visibility=“gone”
android:layout廑width=“96dp”
android:layout廑height=“wrap廑content”
android:layout廑below=“@id/name”
android:layout廑alignparentright=“true”/>;
````````
textview
android:id=“@+id/example”
android:layout廑width=“wrap廑content”
android:layout廑height=“48dp”
android:paddingleft=“8dp”
style=“@style/apptheme.textview.example”
android:gravity=“center廑vertical”
工具:text=“lorem ipsum…”/>;
edittext
android:id=“@+id/name”
android:layout懔width=“match懔parent”
android:layout懔height=“wrap懔content”
android:hint=“hint for name”/>;
<;按钮
android:layout庠width=“96dp”
android:layout庠height=“wrap庠content”
android:layout庠below=“@id/name”
android:layout庠alignparentright=“true”
android:visibility=“gone”/>;
``````
1)创建一个文件来描述您想要的顺序:(忽略空行)
``txt
xmlns:android
xmlns:android
xmlns:android:android:android:id
android:android:name
/><
//1)创建一个文件来描述您想要的顺序:(空行被忽略)
` ` ` `` ` ```` txt `` txt
/>
参见[示例.txt](示例.txt)
>
*打开导出的文件并重命名方案,例如`<;code_scheme name=“newscheme”>;`
*查找行`<;codesylesettings language=“xml”>;`
*应该会看到这样的结构:
``xml
<;arrangement>;
<;rules>;
…
<;
<;arrangement>;
```
*替换`<;rules>中的内容;/rules>;`with the content of`rules.xml`
*将新文件复制到android studio代码样式路径:
**mac**:~/library/preferences/android studio x.x/config/codestyles/
**linux**:~/.androidstudiox.x/config/codestyles/
**windows**%userprofile%\.androidstudiox.x\config\codestyles
*重新启动androidstudio,转到首选项**>;**代码样式**>;**方案并应用“newscheme”。
使用pypi:
```
user@machine:~$[sudo]pip安装xmlargement android安卓系统](https://medium.com/@veraken/formatting-xml-layout-files-for-android-47aec62722fc.bt8shn2qx)