Skip to content

Instantly share code, notes, and snippets.

@zi6xuan
zi6xuan / .eslintrc.js
Created March 1, 2018 00:09
vscode eslint 配置文件参考
module.exports = {
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"plugins": [
"react",
"react-native"
],
@zi6xuan
zi6xuan / layout.xml
Created February 20, 2018 07:45
android:layout_weight="1"实现自动填充剩余空间
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.nttd.app.test.CarMessage.fragments.NormalFragment">
<ScrollView
android:layout_width="match_parent"
@zi6xuan
zi6xuan / round_point.xml
Created February 20, 2018 05:37
通过shape绘制一个多层圆点,第一层背景主要用来当作外层描边,第二层是粗描边和内圆颜色
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="center">
<shape android:shape="oval">
<solid android:color="@color/colorPrimaryDark" />
</shape>
</item>
<item
android:bottom="1dp"
android:gravity="center"
android:left="1dp"
@zi6xuan
zi6xuan / bottom_border.xml
Last active February 20, 2018 01:25
通过shape绘制矩形,实现下划线,通过填充矩形实现的方法不太好,因为有背景色存在,这个方法只有下划线背景是透明的
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="1px"
android:left="-2px"
android:right="-2px"
android:top="-2px">
<shape>
<stroke