import{_ as c}from"./nagasaki_soyo-RK2z5Lcj.js";import{_ as p,r as t,o as d,c as A,b as s,d as e,a as l,w as o,e as r}from"./app--CGKFO0X.js";const y={},u=s("h1",{id:"介绍",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),e(" 介绍")],-1),B=s("blockquote",null,[s("p",null,[s("code",null,"Hikage"),e(" (发音 /ˈhɪkɑːɡeɪ/) 是一个 Android 响应式 UI 构建工具。")])],-1),C=s("h2",{id:"背景",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#背景","aria-hidden":"true"},"#"),e(" 背景")],-1),D=s("p",null,[e("这是一个 Android 响应式 UI 构建工具，它的设计聚焦于 "),s("strong",null,"实时代码构建 UI"),e("。")],-1),m={href:"https://github.com/Lagrio",target:"_blank",rel:"noopener noreferrer"},h=s("strong",null,"hikage",-1),b=r('<details><summary>为什么要...</summary><div align="center"><img src="'+c+'" width="100" height="100" alt="LOGO"><p><strong>なんで春日影レイアウト使いの？</strong></p></div></details><p>不同于 Jetpack Compose 的声明式 UI，Hikage 专注于 Android 原生平台，它的设计目标是为了让开发者能够快速构建 UI 并可直接支持 Android 原生组件。</p><p><strong><u>Hikage 只是一个 UI 构建工具，自身并不提供任何 UI 组件</u></strong>。</p><p>拒绝重复造轮子，我们的方案始终是兼容与高效，现在你可以抛弃 ViewBinding 和 XML 甚至是 <code>findViewById</code>，直接来尝试使用代码布局吧。</p>',4),_=s("code",null,"Hikage",-1),g={href:"https://github.com/BetterAndroid/BetterAndroid",target:"_blank",rel:"noopener noreferrer"},v=s("code",null,"Hikage",-1),F=s("code",null,"BetterAndroid",-1),k=s("h2",{id:"用途",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#用途","aria-hidden":"true"},"#"),e(" 用途")],-1),f=s("p",null,"Hikage 主要适用于专注原生 Android 平台开发的开发者，自从 Kotlin 作为主要开发语言后，依然没有一套比较完美的工具能够使用 DSL 实现动态代码布局， 所以没有使用 Jetpack Compose 的项目依然需要使用原始的 XML，虽然有着 ViewBinding 的支持，但是依然不是很友好。",-1),x={href:"https://github.com/Kotlin/anko",target:"_blank",rel:"noopener noreferrer"},H={href:"https://github.com/LouisCAD/Splitties",target:"_blank",rel:"noopener noreferrer"},L=s("blockquote",null,[s("p",null,"各种 DSL 布局方案对比")],-1),I=s("div",{class:"language-kotlin line-numbers-mode","data-ext":"kt"},[s("pre",{class:"shiki github-dark-dimmed",style:{"background-color":"#22272e"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCBDFB"}},"LinearLayout"),s("span",{style:{color:"#ADBAC7"}},"(")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    lparams "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#DCBDFB"}},"LayoutParams"),s("span",{style:{color:"#ADBAC7"}},"(matchParent "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#6CB6FF"}},"true"),s("span",{style:{color:"#ADBAC7"}},") {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        topMargin "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#6CB6FF"}},"16"),s("span",{style:{color:"#ADBAC7"}},".dp")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    },")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    init "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        orientation "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," LinearLayout.VERTICAL")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        gravity "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Gravity.CENTER")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    }")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},") {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    "),s("span",{style:{color:"#DCBDFB"}},"TextView"),s("span",{style:{color:"#ADBAC7"}}," {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        text "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#96D0FF"}},'"Hello, World!"')]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        textSize "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#6CB6FF"}},"16f")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        gravity "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Gravity.CENTER")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    }")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"}")]),e(`
`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),w=s("div",{class:"language-kotlin line-numbers-mode","data-ext":"kt"},[s("pre",{class:"shiki github-dark-dimmed",style:{"background-color":"#22272e"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCBDFB"}},"verticalLayout"),s("span",{style:{color:"#ADBAC7"}}," {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    gravity "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Gravity.CENTER")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    "),s("span",{style:{color:"#DCBDFB"}},"textView"),s("span",{style:{color:"#ADBAC7"}},"("),s("span",{style:{color:"#96D0FF"}},'"Hello, World!"'),s("span",{style:{color:"#ADBAC7"}},") {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        textSize "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#6CB6FF"}},"16f")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        gravity "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Gravity.CENTER")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    }")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"}."),s("span",{style:{color:"#DCBDFB"}},"lparams"),s("span",{style:{color:"#ADBAC7"}},"(")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    width "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," matchParent,")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    height "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," matchParent")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},") {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    topMargin "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#DCBDFB"}},"dip"),s("span",{style:{color:"#ADBAC7"}},"("),s("span",{style:{color:"#6CB6FF"}},"16"),s("span",{style:{color:"#ADBAC7"}},")")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"}")]),e(`
`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),E=s("div",{class:"language-kotlin line-numbers-mode","data-ext":"kt"},[s("pre",{class:"shiki github-dark-dimmed",style:{"background-color":"#22272e"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCBDFB"}},"Column"),s("span",{style:{color:"#ADBAC7"}},"(")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    modifier "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Modifier."),s("span",{style:{color:"#DCBDFB"}},"padding"),s("span",{style:{color:"#ADBAC7"}},"(top "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#6CB6FF"}},"16"),s("span",{style:{color:"#ADBAC7"}},".dp),")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    verticalArrangement "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Arrangement.Center,")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    horizontalAlignment "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," Alignment.CenterHorizontally")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},") {")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    "),s("span",{style:{color:"#DCBDFB"}},"Text"),s("span",{style:{color:"#ADBAC7"}},"(")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        text "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#96D0FF"}},'"Hello, World!"'),s("span",{style:{color:"#ADBAC7"}},",")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        fontSize "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," "),s("span",{style:{color:"#6CB6FF"}},"16"),s("span",{style:{color:"#ADBAC7"}},".sp,")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"        textAlign "),s("span",{style:{color:"#F47067"}},"="),s("span",{style:{color:"#ADBAC7"}}," TextAlign.Center")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"    )")]),e(`
`),s("span",{class:"line"},[s("span",{style:{color:"#ADBAC7"}},"}")]),e(`
`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),G=r('<p>Hikage 的基础部分<strong>完全不需要借助外部及额外的编译插件</strong>，它能<strong>即插即用</strong>并在<strong>任何地方创建</strong>一个可被设置到父布局以及 <code>Window</code> 上的 <code>View</code> 对象。</p><p>Hikage <strong>全面兼容</strong>混合式布局，你可以在 Hikage 中嵌入 XML (使用 <code>R.layout</code> 方案装载布局)、ViewBinding 甚至是 Jetpack Compose。</p><h2 id="语言要求" tabindex="-1"><a class="header-anchor" href="#语言要求" aria-hidden="true">#</a> 语言要求</h2><p>推荐使用 Kotlin 作为首选开发语言，本项目完全使用 Kotlin 编写，且不再有计划兼容 Java。</p><p>文档全部的 Demo 示例代码都将使用 Kotlin 进行描述，如果你完全不会使用 Kotlin，那么你将有可能无法正常使用本项目。</p><h2 id="功能贡献" tabindex="-1"><a class="header-anchor" href="#功能贡献" aria-hidden="true">#</a> 功能贡献</h2>',6),V={href:"https://github.com/BetterAndroid/Hikage/issues",target:"_blank",rel:"noopener noreferrer"};function T(S,M){const n=t("ExternalLinkIcon"),a=t("CodeGroupItem"),i=t("CodeGroup");return d(),A("div",null,[u,B,C,D,s("p",null,[e("项目图标由 "),s("a",m,[e("MaiTungTM"),l(n)]),e(" 设计，名称取自 「BanG Dream It's MyGO!!!!!」 中的原创歌曲《春日影》(Haru"),h,e(")。")]),b,s("p",null,[_,e(" 配合我们的另一个项目 "),s("a",g,[e("BetterAndroid"),l(n)]),e(" 使用效果更佳，同时 "),v,e(" 自身将自动引用 "),F,e(" 相关依赖作为核心内容。")]),k,f,s("p",null,[e("Hikage 继承了 "),s("a",x,[e("Anko"),l(n)]),e("、"),s("a",H,[e("Splitties"),l(n)]),e(" 的设计方案以及借鉴了 Jetpack Compose 的 DSL 函数命名方案， 并且在此基础上进行了大量改进，使得它在使用成本上更贴近原生，写法上更贴近 Jetpack Compose。")]),L,l(i,null,{default:o(()=>[l(a,{title:"Hikage"},{default:o(()=>[I]),_:1}),l(a,{title:"Anko、Splitties"},{default:o(()=>[w]),_:1}),l(a,{title:"Jetpack Compose"},{default:o(()=>[E]),_:1})]),_:1}),G,s("p",null,[e("本项目的维护离不开各位开发者的支持和贡献，目前这个项目处于初期阶段，可能依然存在一些问题或者缺少你需要的功能， 如果可能，欢迎提交 PR 为此项目贡献你认为需要的功能或前往 "),s("a",V,[e("GitHub Issues"),l(n)]),e(" 向我们提出建议。")])])}const R=p(y,[["render",T],["__file","home.html.vue"]]);export{R as default};
