Android Studio常用的Live Templates汇总

来源:互联网 发布:手机淘宝店铺装修 编辑:程序博客网 时间:2024/05/22 17:32
  • newInstance - 在Fragment中生成 newInstance 方法

  • Toast - 生成 Toast.makeText(context, “”,Toast.LENGTH_SHORT).show();

  • fbc - 生成 findViewById

  • const - 定义一个 android style int 常量

  • logd - 生成 Log.d(TAG, “”);

  • logm - Log 当前方法名称和参数

  • logr - Log 当前方法结果

  • logt - 当前类生成 log tag

  • psf - public static final

  • sout - 打印一个字符串到 System.out

  • soutm - 打印当前类名和方法到 System.out

  • soutp - 打印方法参数和返回值到 System.out

  • visible - 设置 view VISIBLE

  • gone - 设置 view GONE

  • noInstance - private 构造方法

  • fixme: “adds // FIXME”

  • todo: “adds // TODO”

  • appNs: “adds application namespace”

  • lh: “android:layout_height=”“”

  • lhm: “android:layout_height=”match_parent”“

  • lhw: “android:layout_height=”wrap_content”“

  • lw: “android:layout_width=”“”

  • lwm: “android:layout_width=”match_parent”“

  • lww: “android:layout_width=”wrap_content”“

  • toolsNs: “adds tools namespace to Android xml file”