├── .editorconfig ├── .github └── workflows │ └── docs-deploy.yml ├── .gitignore ├── .idea ├── .gitignore ├── AndroidProjectSystem.xml ├── icon.svg ├── inspectionProfiles │ └── Project_Default.xml ├── kotlinc.xml ├── ktlint-plugin.xml ├── markdown.xml ├── migrations.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README-zh-CN.md ├── README.md ├── build.gradle.kts ├── docs-source ├── .gitignore ├── .vscode │ └── settings.json ├── build-dokka.sh ├── package.json ├── src │ ├── .vuepress │ │ ├── config.ts │ │ ├── configs │ │ │ ├── template.ts │ │ │ └── utils.ts │ │ ├── public │ │ │ └── images │ │ │ │ ├── logo.svg │ │ │ │ └── nagasaki_soyo.png │ │ └── styles │ │ │ └── index.scss │ ├── en │ │ ├── about │ │ │ ├── about.md │ │ │ ├── changelog.md │ │ │ ├── contacts.md │ │ │ └── future.md │ │ ├── config │ │ │ └── r8-proguard.md │ │ ├── guide │ │ │ ├── home.md │ │ │ └── quick-start.md │ │ ├── index.md │ │ └── library │ │ │ ├── hikage-compiler.md │ │ │ ├── hikage-core.md │ │ │ ├── hikage-extension-betterandroid.md │ │ │ ├── hikage-extension-compose.md │ │ │ ├── hikage-extension.md │ │ │ ├── hikage-widget-androidx.md │ │ │ └── hikage-widget-material.md │ ├── index.md │ └── zh-cn │ │ ├── about │ │ ├── about.md │ │ ├── changelog.md │ │ ├── contacts.md │ │ └── future.md │ │ ├── config │ │ └── r8-proguard.md │ │ ├── guide │ │ ├── home.md │ │ └── quick-start.md │ │ ├── index.md │ │ └── library │ │ ├── hikage-compiler.md │ │ ├── hikage-core.md │ │ ├── hikage-extension-betterandroid.md │ │ ├── hikage-extension-compose.md │ │ ├── hikage-extension.md │ │ ├── hikage-widget-androidx.md │ │ └── hikage-widget-material.md └── yarn.lock ├── gradle.properties ├── gradle ├── sweet-dependency │ └── sweet-dependency-config.yaml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── hikage-compiler ├── build.gradle.kts └── src │ └── main │ └── java │ └── com │ └── highcapable │ └── hikage │ └── compiler │ ├── DeclaredSymbol.kt │ ├── HikageProcessor.kt │ ├── extension │ └── HikageProcessor.kt │ └── subprocessor │ ├── HikageViewGenerator.kt │ └── base │ └── BaseSymbolProcessor.kt ├── hikage-core-lint ├── build.gradle.kts └── src │ └── main │ └── java │ └── com │ └── highcapable │ └── hikage │ └── core │ └── lint │ ├── DeclaredSymbol.kt │ ├── HikageIssueRegistry.kt │ └── detector │ ├── HikageSafeTypeCastDetector.kt │ ├── HikageableBeyondScopeDetector.kt │ ├── HikageableFunctionsDetector.kt │ ├── WidgetsUsageDetector.kt │ ├── entity │ └── ReportDetail.kt │ └── extension │ └── Detector.kt ├── hikage-core ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── highcapable │ │ │ └── hikage │ │ │ ├── annotation │ │ │ ├── HikageView.kt │ │ │ ├── HikageViewDeclaration.kt │ │ │ └── Hikageable.kt │ │ │ ├── bypass │ │ │ ├── HikageAttrsView.kt │ │ │ └── XmlBlockBypass.kt │ │ │ ├── core │ │ │ ├── Hikage.kt │ │ │ ├── base │ │ │ │ ├── Exceptions.kt │ │ │ │ ├── HikageFactory.kt │ │ │ │ └── Hikageable.kt │ │ │ ├── builder │ │ │ │ └── HikageBuilder.kt │ │ │ ├── extension │ │ │ │ └── ResourcesScope.kt │ │ │ ├── preview │ │ │ │ └── HikagePreview.kt │ │ │ └── runtime │ │ │ │ └── State.kt │ │ │ └── widget │ │ │ └── android │ │ │ └── Widgets.kt │ └── res │ │ └── layout │ │ └── layout_hikage_attrs_view.xml │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── ExampleUnitTest.kt ├── hikage-extension-betterandroid ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── extension │ │ └── betterandroid │ │ └── ui │ │ └── component │ │ └── adapter │ │ ├── CommonAdapterBuilder.kt │ │ ├── PagerAdapterBuilder.kt │ │ ├── RecyclerAdapterBuilder.kt │ │ └── viewholder │ │ └── HikageHolderDelegate.kt │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── ExampleUnitTest.kt ├── hikage-extension-compose ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── extension │ │ └── androidx │ │ └── compose │ │ ├── ComposeView.kt │ │ └── HikageView.kt │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── ExampleUnitTest.kt ├── hikage-extension ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── extension │ │ ├── Activity.kt │ │ ├── Dialog.kt │ │ ├── PopupWindow.kt │ │ ├── ViewGroup.kt │ │ ├── Window.kt │ │ └── widget │ │ ├── ConstraintLayout.kt │ │ └── RelativeLayout.kt │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── ExampleUnitTest.kt ├── hikage-widget-androidx ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── widget │ │ └── androidx │ │ ├── appcompat │ │ └── Widgets.kt │ │ ├── cardview │ │ └── CardView.kt │ │ ├── constraintlayout │ │ └── ConstraintLayout.kt │ │ ├── coordinatorlayout │ │ └── CoordinatorLayout.kt │ │ ├── core │ │ └── Widgets.kt │ │ ├── drawerlayout │ │ └── DrawerLayout.kt │ │ ├── recyclerview │ │ └── RecyclerView.kt │ │ ├── slidingpanelayout │ │ └── SlidingPaneLayout.kt │ │ ├── swiperefreshlayout │ │ └── SwipeRefreshLayout.kt │ │ └── viewpager │ │ └── ViewPager.kt │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── ExampleUnitTest.kt ├── hikage-widget-material ├── build.gradle.kts ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── widget │ │ └── google │ │ └── material │ │ ├── appbar │ │ └── AppBarLayout.kt │ │ ├── bottomappbar │ │ └── BottomAppBar.kt │ │ ├── bottomnavigation │ │ └── BottomNavigationView.kt │ │ ├── bottomsheet │ │ └── BottomSheetDragHandleView.kt │ │ ├── button │ │ └── MaterialButton.kt │ │ ├── card │ │ └── MaterialCardView.kt │ │ ├── checkbox │ │ └── MaterialCheckBox.kt │ │ ├── chip │ │ └── Chip.kt │ │ ├── circularreveal │ │ └── CircularLayout.kt │ │ ├── divider │ │ └── MaterialDivider.kt │ │ ├── floatingactionbutton │ │ └── FloatingActionButton.kt │ │ ├── imageview │ │ └── ShapeableImageView.kt │ │ ├── materialswitch │ │ └── MaterialSwitch.kt │ │ ├── navigation │ │ └── NavigationView.kt │ │ ├── navigationrail │ │ └── NavigationRailView.kt │ │ ├── progressindicator │ │ └── ProgressIndicator.kt │ │ ├── radiobutton │ │ └── MaterialRadioButton.kt │ │ ├── search │ │ └── SearchBar.kt │ │ ├── slider │ │ └── Slider.kt │ │ ├── switchmaterial │ │ └── SwitchMaterial.kt │ │ ├── tabs │ │ └── TabLayout.kt │ │ ├── textfield │ │ └── TextInputLayout.kt │ │ └── textview │ │ └── MaterialTextView.kt │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── ExampleUnitTest.kt ├── img-src ├── icon.svg └── nagasaki_soyo.png ├── samples └── app │ ├── build.gradle.kts │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── highcapable │ │ └── hikage │ │ └── demo │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-playstore.png │ ├── java │ │ └── com │ │ │ └── highcapable │ │ │ └── hikage │ │ │ └── demo │ │ │ ├── DemoApp.kt │ │ │ └── ui │ │ │ ├── MainActivity.kt │ │ │ ├── base │ │ │ └── BaseActivity.kt │ │ │ ├── preview │ │ │ └── SamplePreview.kt │ │ │ └── widget │ │ │ └── CheckableChip.kt │ └── res │ │ ├── drawable │ │ └── ic_launcher_foreground.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ └── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── highcapable │ └── hikage │ └── demo │ └── ExampleUnitTest.kt └── settings.gradle.kts /.editorconfig: -------------------------------------------------------------------------------- 1 | # noinspection EditorConfigKeyCorrectness 2 | [{*.kt,*.kts}] 3 | ktlint_standard_annotation = disabled 4 | ktlint_standard_filename = disabled 5 | ktlint_standard_wrapping = disabled 6 | ktlint_standard_import-ordering = enabled 7 | ktlint_standard_max-line-length = disabled 8 | ktlint_standard_multiline-if-else = disabled 9 | ktlint_standard_argument-list-wrapping = disabled 10 | ktlint_standard_parameter-list-wrapping = disabled 11 | ktlint_standard_trailing-comma-on-declaration-site = disabled 12 | ktlint_function_signature_body_expression_wrapping = multiline 13 | ktlint_standard_string-template-indent = disabled 14 | ktlint_standard_function-signature = disabled 15 | ktlint_standard_trailing-comma-on-call-site = disabled 16 | ktlint_standard_multiline-expression-wrapping = disabled 17 | ktlint_standard_no-empty-first-line-in-class-body = disabled 18 | ktlint_standard_if-else-wrapping = disabled 19 | ktlint_standard_if-else-bracing = disabled 20 | ktlint_standard_statement-wrapping = disabled 21 | ktlint_standard_blank-line-before-declaration = disabled 22 | ktlint_standard_no-empty-file = disabled 23 | ktlint_standard_property-naming = disabled 24 | ktlint_standard_function-naming = disabled 25 | ktlint_standard_chain-method-continuation = disabled 26 | ktlint_standard_class-signature = disabled 27 | ktlint_standard_condition-wrapping = disabled 28 | ktlint_standard_class-signature = disabled 29 | ktlint_standard_no-trailing-spaces = disabled 30 | ktlint_standard_multiline-loop = disabled 31 | ij_continuation_indent_size = 2 32 | indent_size = 4 33 | indent_style = space 34 | insert_final_newline = false 35 | max_line_length = 150 -------------------------------------------------------------------------------- /.github/workflows/docs-deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to GitHub pages 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [ main ] 7 | paths: 8 | - 'hikage-core/src/**' 9 | - 'hikage-extension/src/**' 10 | - 'hikage-extension-betterandroid/src/**' 11 | - 'hikage-extension-compose/src/**' 12 | - 'docs-source/**' 13 | - '.github/workflows/**' 14 | 15 | permissions: 16 | contents: write 17 | pages: write 18 | id-token: write 19 | 20 | jobs: 21 | docs: 22 | if: ${{ success() }} 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v4 26 | with: 27 | fetch-depth: 0 28 | - name: Setup Node.js 29 | uses: actions/setup-node@v4 30 | with: 31 | node-version: 18 32 | - name: Prepare Java 17 33 | uses: actions/setup-java@v4 34 | with: 35 | java-version: 17 36 | java-package: jdk 37 | distribution: 'temurin' 38 | cache: 'gradle' 39 | - name: Cache Gradle Dependencies 40 | uses: actions/cache@v3 41 | with: 42 | path: | 43 | ~/.gradle/caches 44 | ~/.gradle/wrapper 45 | !~/.gradle/caches/build-cache-* 46 | key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }} 47 | restore-keys: | 48 | gradle-deps 49 | - name: Build VuePress site 50 | run: | 51 | cd docs-source 52 | yarn -i 53 | yarn docs:build-gh-pages 54 | - name: Deploy to GitHub Pages 55 | uses: crazy-max/ghaction-github-pages@v4 56 | with: 57 | target_branch: gh-pages 58 | build_dir: docs-source/dist 59 | env: 60 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Fully .gtignore for IntelliJ, Android Studio and Gradle based Java projects 2 | ## References: 3 | ## - https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 4 | ## - https://github.com/android/platform-samples/blob/main/.gitignore 5 | 6 | # User-specific stuff 7 | .idea/**/workspace.xml 8 | .idea/**/tasks.xml 9 | .idea/**/usage.statistics.xml 10 | .idea/**/dictionaries 11 | .idea/**/shelf 12 | 13 | # AWS User-specific 14 | .idea/**/aws.xml 15 | 16 | # Generated files 17 | .idea/**/contentModel.xml 18 | 19 | # Sensitive or high-churn files 20 | .idea/**/dataSources/ 21 | .idea/**/dataSources.ids 22 | .idea/**/dataSources.local.xml 23 | .idea/**/sqlDataSources.xml 24 | .idea/**/dynamic.xml 25 | .idea/**/uiDesigner.xml 26 | .idea/**/dbnavigator.xml 27 | 28 | # Gradle 29 | .idea/**/gradle.xml 30 | .idea/**/libraries 31 | 32 | # Gradle and Maven with auto-import 33 | .idea/.name 34 | .idea/artifacts 35 | .idea/compiler.xml 36 | .idea/jarRepositories.xml 37 | .idea/modules.xml 38 | .idea/*.iml 39 | .idea/modules 40 | .idea/caches 41 | .idea/material_theme** 42 | .idea/other.xml 43 | *.iml 44 | *.ipr 45 | 46 | # Kotlin 47 | .kotlin 48 | 49 | # Misc 50 | .idea/misc.xml 51 | 52 | # CMake 53 | cmake-build-*/ 54 | 55 | # Mongo Explorer plugin 56 | .idea/**/mongoSettings.xml 57 | 58 | # File-based project format 59 | *.iws 60 | 61 | # IntelliJ 62 | out/ 63 | 64 | # mpeltonen/sbt-idea plugin 65 | .idea_modules/ 66 | 67 | # JIRA plugin 68 | atlassian-ide-plugin.xml 69 | 70 | # Cursive Clojure plugin 71 | .idea/replstate.xml 72 | 73 | # SonarLint plugin 74 | .idea/sonarlint/ 75 | 76 | # Crashlytics plugin (for Android Studio and IntelliJ) 77 | com_crashlytics_export_strings.xml 78 | crashlytics.properties 79 | crashlytics-build.properties 80 | fabric.properties 81 | 82 | # Editor-based Rest Client 83 | .idea/httpRequests 84 | 85 | # Android studio 3.1+ serialized cache file 86 | .idea/caches/build_file_checksums.ser 87 | 88 | # Android studio 3.1+ additional 89 | .idea/deployment*.xml 90 | .idea/assetWizardSettings.xml 91 | .idea/androidTestResultsUserPreferences.xml 92 | 93 | # Android projects 94 | **/local.properties 95 | /captures 96 | .externalNativeBuild 97 | .cxx 98 | 99 | # Gradle projects 100 | .gradle 101 | build/ 102 | 103 | # Mkdocs temporary serving folder 104 | docs-gen 105 | site 106 | *.bak 107 | .idea/appInsightsSettings.xml 108 | 109 | # Mac OS 110 | .DS_Store -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/AndroidProjectSystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/ktlint-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MANUAL 5 | 6 | -------------------------------------------------------------------------------- /.idea/markdown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs-source/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /src/.vuepress/.cache 3 | /src/.vuepress/.temp 4 | /dist -------------------------------------------------------------------------------- /docs-source/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /docs-source/build-dokka.sh: -------------------------------------------------------------------------------- 1 | cd .. 2 | ./gradlew :hikage-core:publishKDoc :hikage-extension:publishKDoc :hikage-extension-betterandroid:publishKDoc :hikage-extension-compose:publishKDoc -------------------------------------------------------------------------------- /docs-source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hikage_docs", 3 | "license": "Apache-2.0", 4 | "devDependencies": { 5 | "@mr-hope/vuepress-plugin-copy-code": "^1.30.0", 6 | "@vuepress/plugin-prismjs": "2.0.0-rc.0", 7 | "@vuepress/plugin-search": "2.0.0-rc.0", 8 | "@vuepress/plugin-shiki": "2.0.0-rc.0", 9 | "vuepress": "2.0.0-rc.0" 10 | }, 11 | "scripts": { 12 | "docs:dev": "vuepress dev src", 13 | "docs:build": "vuepress build src", 14 | "docs:build-gh-pages": "vuepress build src && touch dist/.nojekyll && sh build-dokka.sh" 15 | }, 16 | "dependencies": {} 17 | } -------------------------------------------------------------------------------- /docs-source/src/.vuepress/config.ts: -------------------------------------------------------------------------------- 1 | import { defaultTheme } from 'vuepress'; 2 | import { shikiPlugin } from '@vuepress/plugin-shiki'; 3 | import { searchPlugin } from '@vuepress/plugin-search'; 4 | import { navBarItems, sideBarItems, configs, pageLinkRefs } from './configs/template'; 5 | import { env, markdown } from './configs/utils'; 6 | 7 | export default { 8 | dest: configs.dev.dest, 9 | port: configs.dev.port, 10 | base: configs.website.base, 11 | head: [['link', { rel: 'icon', href: configs.website.icon }]], 12 | title: configs.website.title, 13 | description: configs.website.locales['/en/'].description, 14 | locales: configs.website.locales, 15 | theme: defaultTheme({ 16 | logo: configs.website.logo, 17 | repo: configs.github.repo, 18 | docsRepo: configs.github.repo, 19 | docsBranch: configs.github.branch, 20 | docsDir: configs.github.dir, 21 | editLinkPattern: ':repo/edit/:branch/:path', 22 | sidebar: sideBarItems, 23 | sidebarDepth: 2, 24 | locales: { 25 | '/en/': { 26 | navbar: navBarItems['/en/'], 27 | selectLanguageText: 'English (US)', 28 | selectLanguageName: 'English', 29 | editLinkText: 'Edit this page on GitHub', 30 | tip: 'Tips', 31 | warning: 'Notice', 32 | danger: 'Pay Attention', 33 | }, 34 | '/zh-cn/': { 35 | navbar: navBarItems['/zh-cn/'], 36 | selectLanguageText: '简体中文 (CN)', 37 | selectLanguageName: '简体中文', 38 | editLinkText: '在 GitHub 上编辑此页', 39 | notFound: ['这里什么都没有', '我们怎么到这来了?', '这是一个 404 页面', '看起来我们进入了错误的链接'], 40 | backToHome: '回到首页', 41 | contributorsText: '贡献者', 42 | lastUpdatedText: '上次更新', 43 | tip: '小提示', 44 | warning: '注意', 45 | danger: '特别注意', 46 | openInNewWindow: '在新窗口中打开', 47 | toggleColorMode: '切换颜色模式' 48 | } 49 | }, 50 | }), 51 | extendsMarkdown: (md: markdownit) => { 52 | markdown.injectLinks(md, env.dev ? pageLinkRefs.dev : pageLinkRefs.prod); 53 | }, 54 | plugins: [ 55 | shikiPlugin({ theme: 'github-dark-dimmed' }), 56 | searchPlugin({ 57 | isSearchable: (page) => page.path !== '/', 58 | locales: { 59 | '/en/': { placeholder: 'Search' }, 60 | '/zh-cn/': { placeholder: '搜索' } 61 | } 62 | }) 63 | ] 64 | }; -------------------------------------------------------------------------------- /docs-source/src/.vuepress/configs/utils.ts: -------------------------------------------------------------------------------- 1 | export const env = { 2 | dev: process.env.NODE_ENV === 'development' 3 | }; 4 | 5 | export const i18n = { 6 | space: ' ', 7 | string: (content: string, locale: string) => { 8 | return '/' + locale + content; 9 | }, 10 | array: (contents: string[], locale: string) => { 11 | const newContents: string[] = []; 12 | contents.forEach((content) => { 13 | newContents.push(i18n.string(content, locale)); 14 | }); 15 | return newContents; 16 | } 17 | }; 18 | 19 | export const markdown = { 20 | injectLinks: (md: markdownit, maps: Record[]) => { 21 | const defaultRender = md.renderer.rules.link_open || function (tokens, idx, options, _env, self) { 22 | return self.renderToken(tokens, idx, options); 23 | }; 24 | md.renderer.rules.link_open = function (tokens, idx, options, env, self) { 25 | const hrefIndex = tokens[idx].attrIndex('href'); 26 | let current = tokens[idx].attrs!![hrefIndex][1]; 27 | for (const map of maps) { 28 | for (const [search, replace] of Object.entries(map)) { 29 | if (current.startsWith(search)) { 30 | current = current.replace(search, replace); 31 | tokens[idx].attrs!![hrefIndex][1] = current; 32 | break; 33 | } 34 | } 35 | } 36 | return defaultRender(tokens, idx, options, env, self); 37 | }; 38 | } 39 | }; -------------------------------------------------------------------------------- /docs-source/src/.vuepress/public/images/nagasaki_soyo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/docs-source/src/.vuepress/public/images/nagasaki_soyo.png -------------------------------------------------------------------------------- /docs-source/src/en/about/about.md: -------------------------------------------------------------------------------- 1 | # About This Document 2 | 3 | > This document is powered by [VuePress](https://v2.vuepress.vuejs.org/en). 4 | 5 | ## License 6 | 7 | [Apache-2.0](https://github.com/BetterAndroid/Hikage/blob/main/LICENSE) 8 | 9 | ```:no-line-numbers 10 | Apache License Version 2.0 11 | 12 | Copyright (C) 2019 HighCapable 13 | 14 | Licensed under the Apache License, Version 2.0 (the "License"); 15 | you may not use this file except in compliance with the License. 16 | You may obtain a copy of the License at 17 | 18 | https://www.apache.org/licenses/LICENSE-2.0 19 | 20 | Unless required by applicable law or agreed to in writing, software 21 | distributed under the License is distributed on an "AS IS" BASIS, 22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | See the License for the specific language governing permissions and 24 | limitations under the License. 25 | ``` 26 | 27 | Copyright © 2019 HighCapable -------------------------------------------------------------------------------- /docs-source/src/en/about/changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | > The version update history of `Hikage` is recorded here. 4 | 5 | ::: danger 6 | 7 | We will only maintain the latest API version, if you are using an outdate API version, you voluntarily renounce any possibility of maintenance. 8 | 9 | ::: 10 | 11 | ::: warning 12 | 13 | To avoid translation time consumption, Changelog will use **Google Translation** from **Chinese** to **English**, please refer to the original text for actual reference. 14 | 15 | Time zone of version release date: **UTC+8** 16 | 17 | ::: 18 | 19 | ## hikage-core 20 | 21 | ### 1.0.1 | 2025.05.06 22 | 23 | - Fixed the issue where the KSP source code was not successfully released 24 | - Added states management feature 25 | 26 | ### 1.0.0 | 2025.04.20 27 | 28 | - The first version is submitted to Maven 29 | 30 | ## hikage-compiler 31 | 32 | ### 1.0.0 | 2025.04.20 33 | 34 | - The first version is submitted to Maven 35 | 36 | ## hikage-extension 37 | 38 | ### 1.0.0 | 2025.04.20 39 | 40 | - The first version is submitted to Maven 41 | 42 | ## hikage-extension-betterandroid 43 | 44 | ### 1.0.0 | 2025.04.20 45 | 46 | - The first version is submitted to Maven 47 | 48 | ## hikage-extension-compose 49 | 50 | ### 1.0.0 | 2025.04.20 51 | 52 | - The first version is submitted to Maven 53 | 54 | ## hikage-widget-androidx 55 | 56 | ### 1.0.0 | 2025.04.20 57 | 58 | - The first version is submitted to Maven 59 | 60 | ## hikage-widget-material 61 | 62 | ### 1.0.0 | 2025.04.20 63 | 64 | - The first version is submitted to Maven -------------------------------------------------------------------------------- /docs-source/src/en/about/contacts.md: -------------------------------------------------------------------------------- 1 | # Contact Us 2 | 3 | > If you have any questions in use, or have any constructive suggestions, you can contact us. 4 | 5 | Join our developers group. 6 | 7 | - [Click to join Telegram group](https://t.me/BetterAndroid) 8 | - [Click to join Telegram group (Developer)](https://t.me/HighCapable_Dev) 9 | 10 | Find me on **Twitter** [@fankesyooni](https://twitter.com/fankesyooni). 11 | 12 | ## Help with Maintenance 13 | 14 | Thank you for choosing and using `Hikage`. 15 | 16 | If you have code-related suggestions and requests, you can submit a Pull Request on GitHub. -------------------------------------------------------------------------------- /docs-source/src/en/about/future.md: -------------------------------------------------------------------------------- 1 | # Looking for Future 2 | 3 | > The future is bright and uncertain, let us look forward to the future development space of `Hikage`. 4 | 5 | ## Future Plans 6 | 7 | > Features that `Hikage` may add later are included here. 8 | 9 | ### Process AttrtibuteSet 10 | 11 | `Hikage` will support processing `AttributeSet` in the future to dock with the original XML properties to implement the takeover 12 | of some third-party components that are not open to customization of layout properties in the code. 13 | 14 | `Hikage` currently supports automated creation of `XmlBlock`, but does not support the direct processing 15 | of customized `AttributeSet`. Because of its historical problems and high processing difficulty, it may compromise whether to continue to improve this function in the later stage. 16 | 17 | > The following example 18 | 19 | ```kotlin 20 | TextView( 21 | id = "text_view", 22 | // Attributes passed through AttributeSet. 23 | attrs = { 24 | namespace("android") { 25 | set("text", "Hello, World!") 26 | set("textSize", "16sp") 27 | set("gravity", "center") 28 | } 29 | } 30 | ) { 31 | // Attributes passed through code. 32 | text = "Hello, World!" 33 | textSize = 16f 34 | gravity = Gravity.CENTER 35 | } 36 | ``` 37 | 38 | ### Generate Components ID 39 | 40 | `Hikage` may support the direct call function to generate component IDs customized with strings as required in the future. 41 | 42 | > The following example 43 | 44 | ```kotlin 45 | object MyLayout : HikageBuilder { 46 | 47 | override fun build() = Hikageable(context) { 48 | LinearLayout( 49 | id = "lin_layout", 50 | lparams = LayoutParams(matchParent = true), 51 | init = { 52 | orientation = LinearLayout.VERTICAL 53 | gravity = Gravity.CENTER 54 | } 55 | ) { 56 | TextView(id = "text_view") { 57 | text = "Hello, World!" 58 | textSize = 16f 59 | gravity = Gravity.CENTER 60 | } 61 | } 62 | } 63 | } 64 | 65 | val context: Context 66 | // Create TypedHikage. 67 | val myLayout = MyLayout.asTyped().build().create(context) 68 | // Or, use lazy init. 69 | val myLayout by context.lazyTypedHikage(MyLayout) 70 | // Directly call the ID generated from the string. 71 | val linLayout = myLayout.linLayout 72 | val textView = myLayout.textView 73 | // Get the root layout, i.e. LinearLayout. 74 | val root = myLayout.root 75 | ``` -------------------------------------------------------------------------------- /docs-source/src/en/config/r8-proguard.md: -------------------------------------------------------------------------------- 1 | # R8 & Proguard Obfuscate 2 | 3 | > In most scenarios, the app packages can be compressed through obfuscation, 4 | > here is an introduction to how to configure obfuscation rules. 5 | 6 | `Hikage` does not require additional configuration of obfuscation rules, since `View` loaded by Hikage does not need to be defined in XML, they can be equally obfuscated. 7 | 8 | You can force them to be confused with your custom `View`, such as `com.yourpackage.YourView`, using the following rules. 9 | 10 | ``` 11 | -allowobfuscation class com.yourpackage.YourView 12 | ``` 13 | 14 | If you must prevent `Hikage` from being confused or something that occurs after being confused, you can use the following rules to prevent `Hikage` from being confused. 15 | 16 | ``` 17 | -keep class com.highcapable.hikage** 18 | ``` -------------------------------------------------------------------------------- /docs-source/src/en/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | title: Home 4 | heroImage: /images/logo.svg 5 | actions: 6 | - text: Get Started 7 | link: /en/guide/home 8 | type: primary 9 | - text: Changelog 10 | link: /en/about/changelog 11 | type: secondary 12 | features: 13 | - title: Native Control 14 | details: Using View as the foundation and Kotlin as the development language, 100% dynamic code layout, no additional configuration required, supports custom Views. 15 | - title: Fully Compatible 16 | details: Supports embedding and mixing XML, ViewBinding, and Jetpack Compose, and provides support for Material components and Jetpack. 17 | - title: Quickly Started 18 | details: Simple and easy to use it now! Do not need complex configuration and full development experience, Integrate dependencies and enjoy yourself. 19 | footer: Apache-2.0 License | Copyright (C) 2019 HighCapable 20 | --- 21 | 22 | ### Layout, it's that flexible. 23 | 24 | :::: code-group 25 | ::: code-group-item Hikage (Kotlin DSL) 26 | 27 | ```kotlin 28 | LinearLayout( 29 | lparams = LayoutParams(matchParent = true), 30 | init = { 31 | orientation = LinearLayout.VERTICAL 32 | gravity = Gravity.CENTER 33 | } 34 | ) { 35 | TextView(id = "text_view") { 36 | text = "Hello, World!" 37 | textSize = 16f 38 | gravity = Gravity.CENTER 39 | } 40 | } 41 | ``` 42 | 43 | ::: 44 | ::: code-group-item XML 45 | 46 | ```xml 47 | 48 | 53 | 54 | 61 | 62 | ``` 63 | 64 | ::: 65 | :::: -------------------------------------------------------------------------------- /docs-source/src/en/library/hikage-extension-betterandroid.md: -------------------------------------------------------------------------------- 1 | # hikage-extension-betterandroid 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | This is a Hikage extension dependency for [BetterAndroid](https://github.com/BetterAndroid/BetterAndroid) UI component-related features. 10 | 11 | ## Configure Dependency 12 | 13 | You can add this module to your project using the following method. 14 | 15 | ### SweetDependency (Recommended) 16 | 17 | Add dependency in your project's `SweetDependency` configuration file. 18 | 19 | ```yaml 20 | libraries: 21 | com.highcapable.hikage: 22 | hikage-extension-betterandroid: 23 | version: + 24 | ``` 25 | 26 | Configure dependency in your project `build.gradle.kts`. 27 | 28 | ```kotlin 29 | implementation(com.highcapable.hikage.hikage.extension.betterandroid) 30 | ``` 31 | 32 | ### Traditional Method 33 | 34 | Configure dependency in your project `build.gradle.kts`. 35 | 36 | ```kotlin 37 | implementation("com.highcapable.hikage:hikage-extension-betterandroid:") 38 | ``` 39 | 40 | Please change `` to the version displayed at the top of this document. 41 | 42 | ## Function Introduction 43 | 44 | You can view the KDoc [click here](kdoc://hikage-extension-betterandroid). 45 | 46 | ### Adapter Extension 47 | 48 | Hikage provides layout extension function for BetterAndroid's [Adapter](https://betterandroid.github.io/BetterAndroid/en/library/ui-component#adapter), 49 | you can use the Hikage layout directly on the original extension method of the adapter. 50 | 51 | It uses the `ViewHolderDelegate` provided by BetterAndroid to create extension methods. 52 | 53 | Here is a simple example based on `RecyclerView`. 54 | 55 | > The following example 56 | 57 | ```kotlin 58 | // Assume this is the dataset you need to bind to. 59 | val listData = ArrayList() 60 | // Create and bind to a custom RecyclerView.Adapter. 61 | val adapter = recyclerView.bindAdapter { 62 | onBindData { listData } 63 | onBindItemView( 64 | Hikageable = { 65 | TextView(id = "text_view") { 66 | text = "Hello, World!" 67 | textSize = 16f 68 | } 69 | } 70 | ) { hikage, bean, position -> 71 | hikage.get("text_view").text = bean.name 72 | } 73 | } 74 | ``` -------------------------------------------------------------------------------- /docs-source/src/en/library/hikage-extension-compose.md: -------------------------------------------------------------------------------- 1 | # hikage-extension-compose 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | This is a Hikage extension dependency for Jetpack Compose component-related features. 10 | 11 | ## Configure Dependency 12 | 13 | You can add this module to your project using the following method. 14 | 15 | ::: warning 16 | 17 | This module relies on the Jetpack Compose compiler plugin. 18 | Please make sure that your project has integrated Jetpack Compose-related dependencies. 19 | Please refer to [here](https://developer.android.com/develop/ui/compose/compiler) for details. 20 | 21 | ::: 22 | 23 | ### SweetDependency (Recommended) 24 | 25 | Add dependency in your project's `SweetDependency` configuration file. 26 | 27 | ```yaml 28 | libraries: 29 | com.highcapable.hikage: 30 | hikage-extension-compose: 31 | version: + 32 | ``` 33 | 34 | Configure dependency in your project `build.gradle.kts`. 35 | 36 | ```kotlin 37 | implementation(com.highcapable.hikage.hikage.extension.compose) 38 | ``` 39 | 40 | ### Traditional Method 41 | 42 | Configure dependency in your project `build.gradle.kts`. 43 | 44 | ```kotlin 45 | implementation("com.highcapable.hikage:hikage-extension-compose:") 46 | ``` 47 | 48 | Please change `` to the version displayed at the top of this document. 49 | 50 | ## Function Introduction 51 | 52 | You can view the KDoc [click here](kdoc://hikage-extension-compose). 53 | 54 | ### Use Jetpack Compose in Hikage 55 | 56 | You can use the following methods to embed Jetpack Compose components in a Hikage layout. 57 | 58 | > The following example 59 | 60 | ```kotlin 61 | Hikageable { 62 | ComposeView( 63 | lparams = LayoutParams(matchParent = true) 64 | ) { 65 | Text("Hello, World!") 66 | } 67 | } 68 | ``` 69 | 70 | ### Use Hikage in Jetpack Compose 71 | 72 | You can use the following methods to embed Hikage components in a Jetpack Compose layout. 73 | 74 | > The following example 75 | 76 | ```kotlin 77 | Column( 78 | modifier = Modifier.fillMaxSize() 79 | ) { 80 | HikageView { 81 | TextView( 82 | lparams = LayoutParams(matchParent = true) 83 | ) { 84 | text = "Hello, World!" 85 | textSize = 20f 86 | } 87 | } 88 | } 89 | ``` -------------------------------------------------------------------------------- /docs-source/src/en/library/hikage-widget-androidx.md: -------------------------------------------------------------------------------- 1 | # hikage-widget-androidx 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | This is a Hikage extension dependency for Jetpack Compact component-related features. 10 | 11 | ## Configure Dependency 12 | 13 | You can add this module to your project using the following method. 14 | 15 | ### SweetDependency (Recommended) 16 | 17 | Add dependency in your project's `SweetDependency` configuration file. 18 | 19 | ```yaml 20 | libraries: 21 | com.highcapable.hikage: 22 | hikage-widget-androidx: 23 | version: + 24 | ``` 25 | 26 | Configure dependency in your project `build.gradle.kts`. 27 | 28 | ```kotlin 29 | implementation(com.highcapable.hikage.hikage.widget.androidx) 30 | ``` 31 | 32 | ### Traditional Method 33 | 34 | Configure dependency in your project `build.gradle.kts`. 35 | 36 | ```kotlin 37 | implementation("com.highcapable.hikage:hikage-widget-androidx:") 38 | ``` 39 | 40 | Please change `` to the version displayed at the top of this document. 41 | 42 | ## Function Introduction 43 | 44 | This dependency inherits the available components from Jetpack Compact, which you can directly reference to use in Hikage. 45 | 46 | > The following example 47 | 48 | ```kotlin 49 | LinearLayoutCompact( 50 | lparams = LayoutParams(matchParent = true) { 51 | topMargin = 16.dp 52 | }, 53 | init = { 54 | orientation = LinearLayoutCompat.VERTICAL 55 | gravity = Gravity.CENTER 56 | } 57 | ) { 58 | AppCompatTextView { 59 | text = "Hello, World!" 60 | textSize = 16f 61 | gravity = Gravity.CENTER 62 | } 63 | } 64 | ``` -------------------------------------------------------------------------------- /docs-source/src/en/library/hikage-widget-material.md: -------------------------------------------------------------------------------- 1 | # hikage-widget-material 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | This is a Hikage extension dependency for Google Material (MDC) component-related features. 10 | 11 | ## Configure Dependency 12 | 13 | You can add this module to your project using the following method. 14 | 15 | ### SweetDependency (Recommended) 16 | 17 | Add dependency in your project's `SweetDependency` configuration file. 18 | 19 | ```yaml 20 | libraries: 21 | com.highcapable.hikage: 22 | hikage-widget-material: 23 | version: + 24 | ``` 25 | 26 | Configure dependency in your project `build.gradle.kts`. 27 | 28 | ```kotlin 29 | implementation(com.highcapable.hikage.hikage.widget.material) 30 | ``` 31 | 32 | ### Traditional Method 33 | 34 | Configure dependency in your project `build.gradle.kts`. 35 | 36 | ```kotlin 37 | implementation("com.highcapable.hikage:hikage-widget-material:") 38 | ``` 39 | 40 | Please change `` to the version displayed at the top of this document. 41 | 42 | ## Function Introduction 43 | 44 | This dependency inherits the available components from Google Material (MDC), which you can directly reference to use in Hikage. 45 | 46 | > The following example 47 | 48 | ```kotlin 49 | LinearLayout( 50 | lparams = LayoutParams(matchParent = true) { 51 | topMargin = 16.dp 52 | }, 53 | init = { 54 | orientation = LinearLayout.VERTICAL 55 | gravity = Gravity.CENTER 56 | } 57 | ) { 58 | MaterialTextView { 59 | text = "Hello, World!" 60 | textSize = 16f 61 | gravity = Gravity.CENTER 62 | } 63 | MaterialButton { 64 | text = "Hello, World!" 65 | textSize = 16f 66 | gravity = Gravity.CENTER 67 | } 68 | TextInputLayout( 69 | lparams = LayoutParams { 70 | topMargin = 16.dp 71 | }, 72 | init = { 73 | minWidth = 200.dp 74 | hint = "Enter your text" 75 | } 76 | ) { 77 | TextInputEditText() 78 | } 79 | } 80 | ``` -------------------------------------------------------------------------------- /docs-source/src/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | navbar: false 4 | sidebar: false 5 | title: null 6 | heroAlt: null 7 | heroText: null 8 | tagline: Select a language 9 | actions: 10 | - text: English 11 | link: /en/ 12 | type: secondary 13 | - text: 简体中文 14 | link: /zh-cn/ 15 | type: secondary 16 | footer: Apache-2.0 License | Copyright (C) 2019 HighCapable 17 | --- -------------------------------------------------------------------------------- /docs-source/src/zh-cn/about/about.md: -------------------------------------------------------------------------------- 1 | # 关于此文档 2 | 3 | > 此文档由 [VuePress](https://v2.vuepress.vuejs.org/zh) 强力驱动。 4 | 5 | ## 许可证 6 | 7 | [Apache-2.0](https://github.com/BetterAndroid/Hikage/blob/main/LICENSE) 8 | 9 | ```:no-line-numbers 10 | Apache License Version 2.0 11 | 12 | Copyright (C) 2019 HighCapable 13 | 14 | Licensed under the Apache License, Version 2.0 (the "License"); 15 | you may not use this file except in compliance with the License. 16 | You may obtain a copy of the License at 17 | 18 | https://www.apache.org/licenses/LICENSE-2.0 19 | 20 | Unless required by applicable law or agreed to in writing, software 21 | distributed under the License is distributed on an "AS IS" BASIS, 22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | See the License for the specific language governing permissions and 24 | limitations under the License. 25 | ``` 26 | 27 | 版权所有 © 2019 HighCapable -------------------------------------------------------------------------------- /docs-source/src/zh-cn/about/changelog.md: -------------------------------------------------------------------------------- 1 | # 更新日志 2 | 3 | > 这里记录了 `Hikage` 的版本更新历史。 4 | 5 | ::: danger 6 | 7 | 我们只会对最新的 API 版本进行维护,若你正在使用过时的 API 版本则代表你自愿放弃一切维护的可能性。 8 | 9 | ::: 10 | 11 | ## hikage-core 12 | 13 | ### 1.0.1 | 2025.05.06 14 | 15 | - 修复 KSP 源码没有成功发布的问题 16 | - 新增状态管理功能 17 | 18 | ### 1.0.0 | 2025.04.20 19 | 20 | - 首个版本提交至 Maven 21 | 22 | ## hikage-compiler 23 | 24 | ### 1.0.0 | 2025.04.20 25 | 26 | - 首个版本提交至 Maven 27 | 28 | ## hikage-extension 29 | 30 | ### 1.0.0 | 2025.04.20 31 | 32 | - 首个版本提交至 Maven 33 | 34 | ## hikage-extension-betterandroid 35 | 36 | ### 1.0.0 | 2025.04.20 37 | 38 | - 首个版本提交至 Maven 39 | 40 | ## hikage-extension-compose 41 | 42 | ### 1.0.0 | 2025.04.20 43 | 44 | - 首个版本提交至 Maven 45 | 46 | ## hikage-widget-androidx 47 | 48 | ### 1.0.0 | 2025.04.20 49 | 50 | - 首个版本提交至 Maven 51 | 52 | ## hikage-widget-material 53 | 54 | ### 1.0.0 | 2025.04.20 55 | 56 | - 首个版本提交至 Maven -------------------------------------------------------------------------------- /docs-source/src/zh-cn/about/contacts.md: -------------------------------------------------------------------------------- 1 | # 联系我们 2 | 3 | > 如在使用中有任何问题,或有任何建设性的建议,都可以联系我们。 4 | 5 | 加入我们的开发者群组。 6 | 7 | - [点击加入 Telegram 群组](https://t.me/BetterAndroid) 8 | - [点击加入 Telegram 群组 (开发者)](https://t.me/HighCapable_Dev) 9 | - [点击加入 QQ 群 (开发者)](https://qm.qq.com/cgi-bin/qm/qr?k=Pnsc5RY6N2mBKFjOLPiYldbAbprAU3V7&jump_from=webapi&authKey=X5EsOVzLXt1dRunge8ryTxDRrh9/IiW1Pua75eDLh9RE3KXE+bwXIYF5cWri/9lf) 10 | 11 | 在 **酷安** 找到我 [@星夜不荟](http://www.coolapk.com/u/876977)。 12 | 13 | ## 助力维护 14 | 15 | 感谢您选择并使用 `Hikage`,如有代码相关的建议和请求,可在 GitHub 提交 Pull Request。 -------------------------------------------------------------------------------- /docs-source/src/zh-cn/about/future.md: -------------------------------------------------------------------------------- 1 | # 展望未来 2 | 3 | > 未来是美好的,也是不确定的,让我们共同期待 `Hikage` 在未来的发展空间。 4 | 5 | ## 未来的计划 6 | 7 | > 这里收录了 `Hikage` 可能会在后期添加的功能。 8 | 9 | ### 处理 AttrtibuteSet 10 | 11 | `Hikage` 未来将会支持处理 `AttributeSet` 来对接 XML 原始的属性以实现接管一些并未在代码中对布局属性开放自定义的第三方组件。 12 | 13 | `Hikage` 目前已经支持自动化创建 `XmlBlock`,但尚未支持直接处理自定义的 `AttributeSet`,因为其历史遗留问题和处理难度较高,可能会折中考虑后期是否要继续完善此功能。 14 | 15 | > 示例如下 16 | 17 | ```kotlin 18 | TextView( 19 | id = "text_view", 20 | // 通过 AttributeSet 传入的属性 21 | attrs = { 22 | namespace("android") { 23 | set("text", "Hello, World!") 24 | set("textSize", "16sp") 25 | set("gravity", "center") 26 | } 27 | } 28 | ) { 29 | // 通过代码传入的属性 30 | text = "Hello, World!" 31 | textSize = 16f 32 | gravity = Gravity.CENTER 33 | } 34 | ``` 35 | 36 | ### 生成组件 ID 37 | 38 | `Hikage` 未来可能会根据需求支持生成使用字符串自定义的组件 ID 的直接调用功能。 39 | 40 | > 示例如下 41 | 42 | ```kotlin 43 | object MyLayout : HikageBuilder { 44 | 45 | override fun build() = Hikageable(context) { 46 | LinearLayout( 47 | id = "lin_layout", 48 | lparams = LayoutParams(matchParent = true), 49 | init = { 50 | orientation = LinearLayout.VERTICAL 51 | gravity = Gravity.CENTER 52 | } 53 | ) { 54 | TextView(id = "text_view") { 55 | text = "Hello, World!" 56 | textSize = 16f 57 | gravity = Gravity.CENTER 58 | } 59 | } 60 | } 61 | } 62 | 63 | val context: Context 64 | // 创建 TypedHikage 65 | val myLayout = MyLayout.asTyped().build().create(context) 66 | // 或者,使用懒加载 67 | val myLayout by context.lazyTypedHikage(MyLayout) 68 | // 直接调用根据字符串生成的 ID 69 | val linLayout = myLayout.linLayout 70 | val textView = myLayout.textView 71 | // 获取根布局,即 LinearLayout 72 | val root = myLayout.root 73 | ``` -------------------------------------------------------------------------------- /docs-source/src/zh-cn/config/r8-proguard.md: -------------------------------------------------------------------------------- 1 | # R8 与 Proguard 混淆 2 | 3 | > 大部分场景下应用程序安装包可通过混淆压缩体积,这里介绍了混淆规则的配置方法。 4 | 5 | `Hikage` 不需要额外配置混淆规则,由于 Hikage 装载的 `View` 不需要在 XML 中被定义,它们也可以同样被混淆。 6 | 7 | 你可以将你的自定义 `View`,例如 `com.yourpackage.YourView` 使用以下规则强制让它们被混淆。 8 | 9 | ``` 10 | -allowobfuscation class com.yourpackage.YourView 11 | ``` 12 | 13 | 如果你一定要防止 `Hikage` 被混淆或者混淆后发生了问题,那么你可以使用以下规则来防止 `Hikage` 被混淆。 14 | 15 | ``` 16 | -keep class com.highcapable.hikage** 17 | ``` -------------------------------------------------------------------------------- /docs-source/src/zh-cn/guide/home.md: -------------------------------------------------------------------------------- 1 | # 介绍 2 | 3 | > `Hikage` (发音 /ˈhɪkɑːɡeɪ/) 是一个 Android 响应式 UI 构建工具。 4 | 5 | ## 背景 6 | 7 | 这是一个 Android 响应式 UI 构建工具,它的设计聚焦于 **实时代码构建 UI**。 8 | 9 | 项目图标由 [MaiTungTM](https://github.com/Lagrio) 设计,名称取自 「BanG Dream It's MyGO!!!!!」 中的原创歌曲《春日影》(Haru**hikage**)。 10 | 11 | 为什么要... 12 | 13 | 14 | 15 | **なんで春日影レイアウト使いの?** 16 | 17 | 18 | 19 | 不同于 Jetpack Compose 的声明式 UI,Hikage 专注于 Android 原生平台,它的设计目标是为了让开发者能够快速构建 UI 并可直接支持 Android 原生组件。 20 | 21 | **Hikage 只是一个 UI 构建工具,自身并不提供任何 UI 组件**。 22 | 23 | 拒绝重复造轮子,我们的方案始终是兼容与高效,现在你可以抛弃 ViewBinding 和 XML 甚至是 `findViewById`,直接来尝试使用代码布局吧。 24 | 25 | `Hikage` 配合我们的另一个项目 [BetterAndroid](https://github.com/BetterAndroid/BetterAndroid) 使用效果更佳,同时 `Hikage` 自身将自动引用 `BetterAndroid` 相关依赖作为核心内容。 26 | 27 | ## 用途 28 | 29 | Hikage 主要适用于专注原生 Android 平台开发的开发者,自从 Kotlin 作为主要开发语言后,依然没有一套比较完美的工具能够使用 DSL 实现动态代码布局, 30 | 所以没有使用 Jetpack Compose 的项目依然需要使用原始的 XML,虽然有着 ViewBinding 的支持,但是依然不是很友好。 31 | 32 | Hikage 继承了 [Anko](https://github.com/Kotlin/anko)、[Splitties](https://github.com/LouisCAD/Splitties) 的设计方案以及借鉴了 Jetpack Compose 的 DSL 函数命名方案, 33 | 并且在此基础上进行了大量改进,使得它在使用成本上更贴近原生,写法上更贴近 Jetpack Compose。 34 | 35 | > 各种 DSL 布局方案对比 36 | 37 | :::: code-group 38 | ::: code-group-item Hikage 39 | 40 | ```kotlin 41 | LinearLayout( 42 | lparams = LayoutParams(matchParent = true) { 43 | topMargin = 16.dp 44 | }, 45 | init = { 46 | orientation = LinearLayout.VERTICAL 47 | gravity = Gravity.CENTER 48 | } 49 | ) { 50 | TextView { 51 | text = "Hello, World!" 52 | textSize = 16f 53 | gravity = Gravity.CENTER 54 | } 55 | } 56 | ``` 57 | 58 | ::: 59 | ::: code-group-item Anko、Splitties 60 | 61 | ```kotlin 62 | verticalLayout { 63 | gravity = Gravity.CENTER 64 | textView("Hello, World!") { 65 | textSize = 16f 66 | gravity = Gravity.CENTER 67 | } 68 | }.lparams( 69 | width = matchParent, 70 | height = matchParent 71 | ) { 72 | topMargin = dip(16) 73 | } 74 | ``` 75 | 76 | ::: 77 | ::: code-group-item Jetpack Compose 78 | 79 | ```kotlin 80 | Column( 81 | modifier = Modifier.padding(top = 16.dp), 82 | verticalArrangement = Arrangement.Center, 83 | horizontalAlignment = Alignment.CenterHorizontally 84 | ) { 85 | Text( 86 | text = "Hello, World!", 87 | fontSize = 16.sp, 88 | textAlign = TextAlign.Center 89 | ) 90 | } 91 | ``` 92 | 93 | ::: 94 | :::: 95 | 96 | Hikage 的基础部分**完全不需要借助外部及额外的编译插件**,它能**即插即用**并在**任何地方创建**一个可被设置到父布局以及 `Window` 上的 `View` 对象。 97 | 98 | Hikage **全面兼容**混合式布局,你可以在 Hikage 中嵌入 XML (使用 `R.layout` 方案装载布局)、ViewBinding 甚至是 Jetpack Compose。 99 | 100 | ## 语言要求 101 | 102 | 推荐使用 Kotlin 作为首选开发语言,本项目完全使用 Kotlin 编写,且不再有计划兼容 Java。 103 | 104 | 文档全部的 Demo 示例代码都将使用 Kotlin 进行描述,如果你完全不会使用 Kotlin,那么你将有可能无法正常使用本项目。 105 | 106 | ## 功能贡献 107 | 108 | 本项目的维护离不开各位开发者的支持和贡献,目前这个项目处于初期阶段,可能依然存在一些问题或者缺少你需要的功能, 109 | 如果可能,欢迎提交 PR 为此项目贡献你认为需要的功能或前往 [GitHub Issues](repo://issues) 向我们提出建议。 -------------------------------------------------------------------------------- /docs-source/src/zh-cn/guide/quick-start.md: -------------------------------------------------------------------------------- 1 | # 快速开始 2 | 3 | > 集成 `Hikage` 到你的项目中。 4 | 5 | ## 项目要求 6 | 7 | 项目需要使用 `Android Studio` 或 `IntelliJ IDEA` 创建且类型为 Android 或 Kotlin Multiplatform 项目并已集成 Kotlin 环境依赖。 8 | 9 | - Android Studio (建议 [从这里](https://developer.android.com/studio) 获取最新版本) 10 | 11 | - IntelliJ IDEA (建议 [从这里](https://www.jetbrains.com/idea) 获取最新版本) 12 | 13 | - Kotlin 1.9.0+、Gradle 8+、Java 17+、Android Gradle Plugin 8+ 14 | 15 | ### 配置存储库 16 | 17 | `Hikage` 的依赖发布在 **Maven Central** 和我们的公共存储库中,你可以使用如下方式配置存储库。 18 | 19 | 我们推荐使用 Kotlin DSL 作为 Gradle 构建脚本语言并推荐使用 [SweetDependency](https://github.com/HighCapable/SweetDependency) 来管理依赖。 20 | 21 | #### SweetDependency (推荐) 22 | 23 | 在你的项目 `SweetDependency` 配置文件中配置存储库。 24 | 25 | ```yaml 26 | repositories: 27 | google: 28 | maven-central: 29 | # (可选) 你可以添加此 URL 以使用我们的公共存储库 30 | # 当 Sonatype-OSS 发生故障无法发布依赖时,此存储库作为备选进行添加 31 | # 详情请前往:https://github.com/HighCapable/maven-repository 32 | highcapable-maven-releases: 33 | # 中国大陆用户请将下方的 "raw.githubusercontent.com" 修改为 "raw.gitmirror.com" 34 | url: https://raw.githubusercontent.com/HighCapable/maven-repository/main/repository/releases 35 | ``` 36 | 37 | #### 传统方式 38 | 39 | 在你的项目 `build.gradle.kts` 中配置存储库。 40 | 41 | ```kotlin 42 | repositories { 43 | google() 44 | mavenCentral() 45 | // (可选) 你可以添加此 URL 以使用我们的公共存储库 46 | // 当 Sonatype-OSS 发生故障无法发布依赖时,此存储库作为备选进行添加 47 | // 详情请前往:https://github.com/HighCapable/maven-repository 48 | // 中国大陆用户请将下方的 "raw.githubusercontent.com" 修改为 "raw.gitmirror.com" 49 | maven("https://raw.githubusercontent.com/HighCapable/maven-repository/main/repository/releases") 50 | } 51 | ``` 52 | 53 | ### 配置 Java 版本 54 | 55 | 在你的项目 `build.gradle.kts` 中修改 Kotlin 的 Java 版本为 17 及以上。 56 | 57 | ```kt 58 | android { 59 | compileOptions { 60 | sourceCompatibility = JavaVersion.VERSION_17 61 | targetCompatibility = JavaVersion.VERSION_17 62 | } 63 | kotlinOptions { 64 | jvmTarget = "17" 65 | } 66 | } 67 | ``` 68 | 69 | ## 功能一览 70 | 71 | 整个项目分为多个模块,你可以选择你希望引入的模块作为依赖应用到你的项目中,但一定要包含 **hikage-core** 模块。 72 | 73 | 你可以点击下方对应的模块前往查看详细的功能介绍。 74 | 75 | - [hikage-core](../library/hikage-core.md) 76 | - [hikage-compiler](../library/hikage-compiler.md) 77 | - [hikage-extension](../library/hikage-extension.md) 78 | - [hikage-extension-betterandroid](../library/hikage-extension-betterandroid.md) 79 | - [hikage-extension-compose](../library/hikage-extension-compose.md) 80 | - [hikage-widget-androidx](../library/hikage-widget-androidx.md) 81 | - [hikage-widget-material](../library/hikage-widget-material.md) 82 | 83 | ## Demo 84 | 85 | 你可以在 [这里](repo://tree/main/samples) 找到一些示例,查看对应的演示项目来更好地了解这些功能的运作方式,快速地挑选出你需要的功能。 -------------------------------------------------------------------------------- /docs-source/src/zh-cn/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | title: 首页 4 | heroImage: /images/logo.svg 5 | actions: 6 | - text: 快速上手 7 | link: /zh-cn/guide/home 8 | type: primary 9 | - text: 更新日志 10 | link: /zh-cn/about/changelog 11 | type: secondary 12 | features: 13 | - title: 原生可控 14 | details: 使用 View 作为基础,Kotlin 作为开发语言,100% 动态代码布局,无需任何额外配置,支持自定义 View。 15 | - title: 全面兼容 16 | details: 支持 XML、ViewBinding 以及 Jetpack Compose 嵌入混合使用,并对 Material 组件及 Jetpack 提供支持。 17 | - title: 快速上手 18 | details: 简单易用,不需要繁琐的配置,不需要十足的开发经验,搭建环境集成依赖即可立即开始使用。 19 | footer: Apache-2.0 License | Copyright (C) 2019 HighCapable 20 | --- 21 | 22 | ### 布局,就是这么灵活。 23 | 24 | :::: code-group 25 | ::: code-group-item Hikage (Kotlin DSL) 26 | 27 | ```kotlin 28 | LinearLayout( 29 | lparams = LayoutParams(matchParent = true), 30 | init = { 31 | orientation = LinearLayout.VERTICAL 32 | gravity = Gravity.CENTER 33 | } 34 | ) { 35 | TextView(id = "text_view") { 36 | text = "Hello, World!" 37 | textSize = 16f 38 | gravity = Gravity.CENTER 39 | } 40 | } 41 | ``` 42 | 43 | ::: 44 | ::: code-group-item XML 45 | 46 | ```xml 47 | 48 | 53 | 54 | 61 | 62 | ``` 63 | 64 | ::: 65 | :::: -------------------------------------------------------------------------------- /docs-source/src/zh-cn/library/hikage-extension-betterandroid.md: -------------------------------------------------------------------------------- 1 | # hikage-extension-betterandroid 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | 这是 Hikage 针对 [BetterAndroid](https://github.com/BetterAndroid/BetterAndroid) UI 组件相关功能的扩展依赖。 10 | 11 | ## 配置依赖 12 | 13 | 你可以使用如下方式将此模块添加到你的项目中。 14 | 15 | ### SweetDependency (推荐) 16 | 17 | 在你的项目 `SweetDependency` 配置文件中添加依赖。 18 | 19 | ```yaml 20 | libraries: 21 | com.highcapable.hikage: 22 | hikage-extension-betterandroid: 23 | version: + 24 | ``` 25 | 26 | 在你的项目 `build.gradle.kts` 中配置依赖。 27 | 28 | ```kotlin 29 | implementation(com.highcapable.hikage.hikage.extension.betterandroid) 30 | ``` 31 | 32 | ### 传统方式 33 | 34 | 在你的项目 `build.gradle.kts` 中配置依赖。 35 | 36 | ```kotlin 37 | implementation("com.highcapable.hikage:hikage-extension-betterandroid:") 38 | ``` 39 | 40 | 请将 `` 修改为此文档顶部显示的版本。 41 | 42 | ## 功能介绍 43 | 44 | 你可以 [点击这里](kdoc://hikage-extension-betterandroid) 查看 KDoc。 45 | 46 | ### 适配器 (Adapter) 扩展 47 | 48 | Hikage 为 BetterAndroid 提供的 [适配器](https://betterandroid.github.io/BetterAndroid/zh-cn/library/ui-component#%E9%80%82%E9%85%8D%E5%99%A8-adapter) 49 | 提供了布局扩展功能,你可以直接在适配器的原始扩展方法上使用 Hikage 布局。 50 | 51 | 它使用了 BetterAndroid 提供的 `ViewHolderDelegate` 来创建扩展方法。 52 | 53 | 下面提供了一个基于 `RecyclerView` 的简单示例。 54 | 55 | > 示例如下 56 | 57 | ```kotlin 58 | // 假设这就是你需要绑定的数据集 59 | val listData = ArrayList() 60 | // 创建并绑定到自定义的 RecyclerView.Adapter 61 | val adapter = recyclerView.bindAdapter { 62 | onBindData { listData } 63 | onBindItemView( 64 | Hikageable = { 65 | TextView(id = "text_view") { 66 | text = "Hello, World!" 67 | textSize = 16f 68 | } 69 | } 70 | ) { hikage, bean, position -> 71 | hikage.get("text_view").text = bean.name 72 | } 73 | } 74 | ``` -------------------------------------------------------------------------------- /docs-source/src/zh-cn/library/hikage-extension-compose.md: -------------------------------------------------------------------------------- 1 | # hikage-extension-compose 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | 这是 Hikage 针对 Jetpack Compose 组件相关功能的扩展依赖。 10 | 11 | ## 配置依赖 12 | 13 | 你可以使用如下方式将此模块添加到你的项目中。 14 | 15 | ::: warning 16 | 17 | 此模块依赖于 Jetpack Compose 编译插件,请确保你的项目中已经集成了 Jetpack Compose 相关依赖,详情请参考 [这里](https://developer.android.com/develop/ui/compose/compiler)。 18 | 19 | ::: 20 | 21 | ### SweetDependency (推荐) 22 | 23 | 在你的项目 `SweetDependency` 配置文件中添加依赖。 24 | 25 | ```yaml 26 | libraries: 27 | com.highcapable.hikage: 28 | hikage-extension-compose: 29 | version: + 30 | ``` 31 | 32 | 在你的项目 `build.gradle.kts` 中配置依赖。 33 | 34 | ```kotlin 35 | implementation(com.highcapable.hikage.hikage.extension.compose) 36 | ``` 37 | 38 | ### 传统方式 39 | 40 | 在你的项目 `build.gradle.kts` 中配置依赖。 41 | 42 | ```kotlin 43 | implementation("com.highcapable.hikage:hikage-extension-compose:") 44 | ``` 45 | 46 | 请将 `` 修改为此文档顶部显示的版本。 47 | 48 | ## 功能介绍 49 | 50 | 你可以 [点击这里](kdoc://hikage-extension-compose) 查看 KDoc。 51 | 52 | ### 在 Hikage 中使用 Jetpack Compose 53 | 54 | 你可以使用以下方式在一个 Hikage 布局中嵌入 Jetpack Compose 组件。 55 | 56 | > 示例如下 57 | 58 | ```kotlin 59 | Hikageable { 60 | ComposeView( 61 | lparams = LayoutParams(matchParent = true) 62 | ) { 63 | Text("Hello, World!") 64 | } 65 | } 66 | ``` 67 | 68 | ### 在 Jetpack Compose 中使用 Hikage 69 | 70 | 你可以使用以下方式在一个 Jetpack Compose 布局中嵌入 Hikage 组件。 71 | 72 | > 示例如下 73 | 74 | ```kotlin 75 | Column( 76 | modifier = Modifier.fillMaxSize() 77 | ) { 78 | HikageView { 79 | TextView( 80 | lparams = LayoutParams(matchParent = true) 81 | ) { 82 | text = "Hello, World!" 83 | textSize = 20f 84 | } 85 | } 86 | } 87 | ``` -------------------------------------------------------------------------------- /docs-source/src/zh-cn/library/hikage-widget-androidx.md: -------------------------------------------------------------------------------- 1 | # hikage-widget-androidx 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | 这是 Hikage 针对 Jetpack Compact 组件相关功能的扩展依赖。 10 | 11 | ## 配置依赖 12 | 13 | 你可以使用如下方式将此模块添加到你的项目中。 14 | 15 | ### SweetDependency (推荐) 16 | 17 | 在你的项目 `SweetDependency` 配置文件中添加依赖。 18 | 19 | ```yaml 20 | libraries: 21 | com.highcapable.hikage: 22 | hikage-widget-androidx: 23 | version: + 24 | ``` 25 | 26 | 在你的项目 `build.gradle.kts` 中配置依赖。 27 | 28 | ```kotlin 29 | implementation(com.highcapable.hikage.hikage.widget.androidx) 30 | ``` 31 | 32 | ### 传统方式 33 | 34 | 在你的项目 `build.gradle.kts` 中配置依赖。 35 | 36 | ```kotlin 37 | implementation("com.highcapable.hikage:hikage-widget-androidx:") 38 | ``` 39 | 40 | 请将 `` 修改为此文档顶部显示的版本。 41 | 42 | ## 功能介绍 43 | 44 | 这个依赖中继承了来自 Jetpack Compact 中的可用组件,你可以直接引用它们到 Hikage 中使用。 45 | 46 | > 示例如下 47 | 48 | ```kotlin 49 | LinearLayoutCompact( 50 | lparams = LayoutParams(matchParent = true) { 51 | topMargin = 16.dp 52 | }, 53 | init = { 54 | orientation = LinearLayoutCompat.VERTICAL 55 | gravity = Gravity.CENTER 56 | } 57 | ) { 58 | AppCompatTextView { 59 | text = "Hello, World!" 60 | textSize = 16f 61 | gravity = Gravity.CENTER 62 | } 63 | } 64 | ``` -------------------------------------------------------------------------------- /docs-source/src/zh-cn/library/hikage-widget-material.md: -------------------------------------------------------------------------------- 1 | # hikage-widget-material 2 | 3 |  4 | 5 |  6 | 7 |  8 | 9 | 这是 Hikage 针对 Google Material (MDC) 组件相关功能的扩展依赖。 10 | 11 | ## 配置依赖 12 | 13 | 你可以使用如下方式将此模块添加到你的项目中。 14 | 15 | ### SweetDependency (推荐) 16 | 17 | 在你的项目 `SweetDependency` 配置文件中添加依赖。 18 | 19 | ```yaml 20 | libraries: 21 | com.highcapable.hikage: 22 | hikage-widget-material: 23 | version: + 24 | ``` 25 | 26 | 在你的项目 `build.gradle.kts` 中配置依赖。 27 | 28 | ```kotlin 29 | implementation(com.highcapable.hikage.hikage.widget.material) 30 | ``` 31 | 32 | ### 传统方式 33 | 34 | 在你的项目 `build.gradle.kts` 中配置依赖。 35 | 36 | ```kotlin 37 | implementation("com.highcapable.hikage:hikage-widget-material:") 38 | ``` 39 | 40 | 请将 `` 修改为此文档顶部显示的版本。 41 | 42 | ## 功能介绍 43 | 44 | 这个依赖中继承了来自 Google Material (MDC) 中的可用组件,你可以直接引用它们到 Hikage 中使用。 45 | 46 | > 示例如下 47 | 48 | ```kotlin 49 | LinearLayout( 50 | lparams = LayoutParams(matchParent = true) { 51 | topMargin = 16.dp 52 | }, 53 | init = { 54 | orientation = LinearLayout.VERTICAL 55 | gravity = Gravity.CENTER 56 | } 57 | ) { 58 | MaterialTextView { 59 | text = "Hello, World!" 60 | textSize = 16f 61 | gravity = Gravity.CENTER 62 | } 63 | MaterialButton { 64 | text = "Hello, World!" 65 | textSize = 16f 66 | gravity = Gravity.CENTER 67 | } 68 | TextInputLayout( 69 | lparams = LayoutParams { 70 | topMargin = 16.dp 71 | }, 72 | init = { 73 | minWidth = 200.dp 74 | hint = "Enter your text" 75 | } 76 | ) { 77 | TextInputEditText() 78 | } 79 | } 80 | ``` -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Compiler Configuration 2 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 3 | android.useAndroidX=true 4 | android.nonTransitiveRClass=true 5 | kotlin.code.style=official 6 | kotlin.incremental.useClasspathSnapshot=true 7 | # Project Configuration 8 | project.name=Hikage 9 | project.url=https://github.com/BetterAndroid/Hikage 10 | project.groupName=com.highcapable.hikage 11 | project.android.compileSdk=35 12 | project.android.minSdk=21 13 | project.android.targetSdk=35 14 | project.samples-app.packageName=com.highcapable.hikage.demo 15 | project.samples-app.versionName=universal 16 | project.samples-app.versionCode=1 17 | project.hikage-core.namespace=${project.groupName}.core 18 | project.hikage-core.version="1.0.1" 19 | project.hikage-core-lint.namespace=${project.groupName}.core.lint 20 | project.hikage-core-lint.identifier=${project.groupName}:hikage-core:${project.hikage-core.version} 21 | project.hikage-core-lint.min-api=9 22 | project.hikage-core-lint.registry-v2-class="${project.hikage-core-lint.namespace}.HikageIssueRegistry" 23 | project.hikage-extension.namespace=${project.groupName}.extension 24 | project.hikage-extension.version="1.0.0" 25 | project.hikage-extension-betterandroid.namespace=${project.groupName}.extension.betterandroid 26 | project.hikage-extension-betterandroid.version="1.0.0" 27 | project.hikage-extension-compose.namespace=${project.groupName}.extension.androidx.compose 28 | project.hikage-extension-compose.version="1.0.0" 29 | project.hikage-compiler.namespace="${project.groupName}.compiler" 30 | project.hikage-compiler.version="1.0.0" 31 | project.hikage-widget-androidx.namespace=${project.groupName}.widget.androidx 32 | project.hikage-widget-androidx.version="1.0.0" 33 | project.hikage-widget-material.namespace=${project.groupName}.widget.google.material 34 | project.hikage-widget-material.version="1.0.0" 35 | # Maven Publish Configuration 36 | SONATYPE_HOST=CENTRAL_PORTAL 37 | RELEASE_SIGNING_ENABLED=true 38 | # Maven POM Configuration 39 | POM_NAME=Hikage 40 | POM_DESCRIPTION=An Android responsive UI building tool. 41 | POM_URL=https://github.com/BetterAndroid/Hikage 42 | POM_LICENSE_NAME=Apache License 2.0 43 | POM_LICENSE_URL=https://github.com/BetterAndroid/Hikage/blob/main/LICENSE 44 | POM_LICENSE_DIST=repo 45 | POM_SCM_URL=https://github.com/BetterAndroid/Hikage 46 | POM_SCM_CONNECTION=scm:git:git://github.com/BetterAndroid/Hikage.git 47 | POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/BetterAndroid/Hikage.git 48 | POM_DEVELOPER_ID=0 49 | POM_DEVELOPER_NAME=fankes 50 | POM_DEVELOPER_EMAIL=qzmmcn@163.com 51 | POM_DEVELOPER_URL=https://github.com/fankes -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /hikage-compiler/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.kotlin.jvm) 3 | autowire(libs.plugins.kotlin.ksp) 4 | autowire(libs.plugins.maven.publish) 5 | } 6 | 7 | group = property.project.groupName 8 | version = property.project.hikage.compiler.version 9 | 10 | java { 11 | sourceCompatibility = JavaVersion.VERSION_17 12 | targetCompatibility = JavaVersion.VERSION_17 13 | } 14 | 15 | kotlin { 16 | jvmToolchain(17) 17 | compilerOptions { 18 | freeCompilerArgs = listOf( 19 | "-Xno-param-assertions", 20 | "-Xno-call-assertions", 21 | "-Xno-receiver-assertions" 22 | ) 23 | } 24 | } 25 | 26 | dependencies { 27 | compileOnly(com.google.devtools.ksp.symbol.processing.api) 28 | ksp(dev.zacsweers.autoservice.auto.service.ksp) 29 | implementation(com.google.auto.service.auto.service.annotations) 30 | implementation(com.squareup.kotlinpoet) 31 | implementation(com.squareup.kotlinpoet.ksp) 32 | } -------------------------------------------------------------------------------- /hikage-compiler/src/main/java/com/highcapable/hikage/compiler/HikageProcessor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/23. 21 | */ 22 | @file:Suppress("unused") 23 | 24 | package com.highcapable.hikage.compiler 25 | 26 | import com.google.auto.service.AutoService 27 | import com.google.devtools.ksp.processing.Resolver 28 | import com.google.devtools.ksp.processing.SymbolProcessor 29 | import com.google.devtools.ksp.processing.SymbolProcessorEnvironment 30 | import com.google.devtools.ksp.processing.SymbolProcessorProvider 31 | import com.google.devtools.ksp.symbol.KSAnnotated 32 | import com.highcapable.hikage.compiler.subprocessor.HikageViewGenerator 33 | 34 | @AutoService(SymbolProcessorProvider::class) 35 | class HikageProcessor : SymbolProcessorProvider { 36 | 37 | override fun create(environment: SymbolProcessorEnvironment) = object : SymbolProcessor { 38 | 39 | private val subProcessor = listOf( 40 | HikageViewGenerator(environment) 41 | ) 42 | 43 | override fun process(resolver: Resolver) = emptyList().let { startProcess(resolver); it } 44 | 45 | private fun startProcess(resolver: Resolver) { 46 | subProcessor.forEach { 47 | it.startProcess(resolver) 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /hikage-compiler/src/main/java/com/highcapable/hikage/compiler/subprocessor/base/BaseSymbolProcessor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/23. 21 | */ 22 | package com.highcapable.hikage.compiler.subprocessor.base 23 | 24 | import com.google.devtools.ksp.processing.Resolver 25 | import com.google.devtools.ksp.processing.SymbolProcessorEnvironment 26 | 27 | abstract class BaseSymbolProcessor(protected open val environment: SymbolProcessorEnvironment) { 28 | 29 | protected val logger by lazy { environment.logger } 30 | protected val codeGenerator by lazy { environment.codeGenerator } 31 | 32 | abstract fun startProcess(resolver: Resolver) 33 | } -------------------------------------------------------------------------------- /hikage-core-lint/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget 2 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 3 | 4 | plugins { 5 | autowire(libs.plugins.kotlin.jvm) 6 | } 7 | 8 | group = property.project.groupName 9 | 10 | java { 11 | sourceCompatibility = JavaVersion.VERSION_17 12 | targetCompatibility = JavaVersion.VERSION_17 13 | } 14 | 15 | kotlin { 16 | jvmToolchain(17) 17 | compilerOptions { 18 | freeCompilerArgs = listOf( 19 | "-Xno-param-assertions", 20 | "-Xno-call-assertions", 21 | "-Xno-receiver-assertions" 22 | ) 23 | } 24 | } 25 | 26 | tasks.withType().configureEach { 27 | compilerOptions { 28 | jvmTarget.set(JvmTarget.JVM_17) 29 | } 30 | } 31 | 32 | tasks.named("jar") { 33 | manifest { 34 | attributes( 35 | "Lint-Registry-V2" to property.project.hikage.core.lint.registry.v2.clazz 36 | ) 37 | } 38 | } 39 | 40 | dependencies { 41 | compileOnly(org.jetbrains.kotlin.kotlin.stdlib) 42 | compileOnly(com.android.tools.lint.lint.api) 43 | compileOnly(com.android.tools.lint.lint.checks) 44 | testImplementation(com.android.tools.lint.lint) 45 | testImplementation(com.android.tools.lint.lint.tests) 46 | } -------------------------------------------------------------------------------- /hikage-core-lint/src/main/java/com/highcapable/hikage/core/lint/DeclaredSymbol.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/17. 21 | */ 22 | package com.highcapable.hikage.core.lint 23 | 24 | object DeclaredSymbol { 25 | 26 | const val HIKAGEABLE_ANNOTATION_CLASS = "com.highcapable.hikage.annotation.Hikageable" 27 | const val HIKAGE_CLASS = "com.highcapable.hikage.core.Hikage" 28 | const val HIKAGE_PERFORMER_CLASS = "com.highcapable.hikage.core.Hikage.Performer" 29 | 30 | val HIKAGE_VIEW_REGEX = "kotlin.jvm.functions.Function1<\\?\\s*super\\s+[^,]+,kotlin.Unit>".toRegex() 31 | } -------------------------------------------------------------------------------- /hikage-core-lint/src/main/java/com/highcapable/hikage/core/lint/HikageIssueRegistry.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/14. 21 | */ 22 | @file:Suppress("unused") 23 | 24 | package com.highcapable.hikage.core.lint 25 | 26 | import com.android.tools.lint.client.api.IssueRegistry 27 | import com.android.tools.lint.client.api.Vendor 28 | import com.android.tools.lint.detector.api.CURRENT_API 29 | import com.highcapable.hikage.core.lint.detector.HikageSafeTypeCastDetector 30 | import com.highcapable.hikage.core.lint.detector.HikageableBeyondScopeDetector 31 | import com.highcapable.hikage.core.lint.detector.HikageableFunctionsDetector 32 | import com.highcapable.hikage.core.lint.detector.WidgetsUsageDetector 33 | import com.highcapable.hikage.generated.HikageCoreLintProperties 34 | 35 | class HikageIssueRegistry : IssueRegistry() { 36 | 37 | override val issues get() = listOf( 38 | HikageableBeyondScopeDetector.ISSUE, 39 | HikageableFunctionsDetector.ISSUE, 40 | HikageSafeTypeCastDetector.ISSUE, 41 | WidgetsUsageDetector.ISSUE 42 | ) 43 | 44 | override val minApi = HikageCoreLintProperties.PROJECT_HIKAGE_CORE_LINT_MIN_API 45 | override val api = CURRENT_API 46 | override val vendor = Vendor( 47 | vendorName = HikageCoreLintProperties.PROJECT_NAME, 48 | identifier = HikageCoreLintProperties.PROJECT_HIKAGE_CORE_LINT_IDENTIFIER, 49 | feedbackUrl = "${HikageCoreLintProperties.PROJECT_URL}/issues", 50 | contact = HikageCoreLintProperties.PROJECT_URL 51 | ) 52 | } -------------------------------------------------------------------------------- /hikage-core-lint/src/main/java/com/highcapable/hikage/core/lint/detector/entity/ReportDetail.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/17. 21 | */ 22 | package com.highcapable.hikage.core.lint.detector.entity 23 | 24 | import org.jetbrains.uast.UCallExpression 25 | 26 | data class ReportDetail( 27 | val message: String, 28 | val callExpr: UCallExpression 29 | ) -------------------------------------------------------------------------------- /hikage-core-lint/src/main/java/com/highcapable/hikage/core/lint/detector/extension/Detector.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/30. 21 | */ 22 | package com.highcapable.hikage.core.lint.detector.extension 23 | 24 | import com.highcapable.hikage.core.lint.DeclaredSymbol 25 | import com.intellij.psi.PsiMethod 26 | 27 | fun PsiMethod.hasHikageable() = hasAnnotation(DeclaredSymbol.HIKAGEABLE_ANNOTATION_CLASS) -------------------------------------------------------------------------------- /hikage-core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.library) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.kotlin.dokka) 5 | autowire(libs.plugins.maven.publish) 6 | autowire(libs.plugins.kotlin.ksp) 7 | } 8 | 9 | group = property.project.groupName 10 | version = property.project.hikage.core.version 11 | 12 | android { 13 | namespace = property.project.hikage.core.namespace 14 | compileSdk = property.project.android.compileSdk 15 | 16 | defaultConfig { 17 | minSdk = property.project.android.minSdk 18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 19 | consumerProguardFiles("consumer-rules.pro") 20 | } 21 | buildTypes { 22 | release { 23 | isMinifyEnabled = false 24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 25 | } 26 | } 27 | compileOptions { 28 | sourceCompatibility = JavaVersion.VERSION_17 29 | targetCompatibility = JavaVersion.VERSION_17 30 | } 31 | kotlinOptions { 32 | jvmTarget = "17" 33 | freeCompilerArgs = listOf( 34 | "-opt-in=kotlin.ExperimentalStdlibApi", 35 | "-Xno-param-assertions", 36 | "-Xno-call-assertions", 37 | "-Xno-receiver-assertions" 38 | ) 39 | } 40 | } 41 | 42 | dependencies { 43 | lintPublish(projects.hikageCoreLint) 44 | ksp(projects.hikageCompiler) 45 | implementation(org.lsposed.hiddenapibypass.hiddenapibypass) 46 | implementation(com.highcapable.yukireflection.api) 47 | api(com.highcapable.betterandroid.ui.extension) 48 | implementation(com.highcapable.betterandroid.system.extension) 49 | implementation(androidx.core.core.ktx) 50 | implementation(androidx.appcompat.appcompat) 51 | testImplementation(junit.junit) 52 | androidTestImplementation(androidx.test.ext.junit) 53 | androidTestImplementation(androidx.test.espresso.espresso.core) 54 | } -------------------------------------------------------------------------------- /hikage-core/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/hikage-core/consumer-rules.pro -------------------------------------------------------------------------------- /hikage-core/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /hikage-core/src/androidTest/java/com/highcapable/hikage/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | 19 | @Test 20 | fun useAppContext() { 21 | // Context of the app under test. 22 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 23 | assertEquals("com.highcapable.hikage.test", appContext.packageName) 24 | } 25 | } -------------------------------------------------------------------------------- /hikage-core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/annotation/HikageView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/23. 21 | */ 22 | package com.highcapable.hikage.annotation 23 | 24 | import android.view.View 25 | import android.view.ViewGroup 26 | import com.highcapable.hikage.core.Hikage 27 | import kotlin.reflect.KClass 28 | 29 | /** 30 | * Declare annotations to generate the [Hikage.Performer] function for the specified [View] at compile time. 31 | * 32 | * Usage: 33 | * 34 | * ```kotlin 35 | * @HikageView(lparams = FrameLayout.LayoutParams::class, alias = "MyView") 36 | * class MyView(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) { 37 | * // ... 38 | * } 39 | * ``` 40 | * @param lparams the layout params class, only [ViewGroup] can be specified, 41 | * after specifying, the `performer` parameter will be generated for the function. 42 | * The parameters must be a class inherited from [ViewGroup.LayoutParams], 43 | * if the current [View] does not inherit from [ViewGroup], this parameter will be ignored and warned. 44 | * @param alias the view's class name alias will naming the function, default is the class name. 45 | * @param requireInit whether to force the `init` parameter to be called, default is false. 46 | * @param requirePerformer whether to force the `performer` parameter to be called, default is false, 47 | * this parameter will be ignored when no `performer` parameter is needed here. 48 | */ 49 | @Retention(AnnotationRetention.BINARY) 50 | @Target(AnnotationTarget.CLASS) 51 | @MustBeDocumented 52 | annotation class HikageView( 53 | val lparams: KClass<*> = Any::class, 54 | val alias: String = "", 55 | val requireInit: Boolean = false, 56 | val requirePerformer: Boolean = false 57 | ) -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/annotation/HikageViewDeclaration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/31. 21 | */ 22 | package com.highcapable.hikage.annotation 23 | 24 | import android.view.View 25 | import android.view.ViewGroup 26 | import com.highcapable.hikage.core.Hikage 27 | import kotlin.reflect.KClass 28 | 29 | /** 30 | * Declare annotations to generate the [Hikage.Performer] function for the specified [view] at compile time. 31 | * 32 | * You can declare a class for [View] that does not belong to your own [View] or third-party library. 33 | * 34 | * The class name you define can be as good as you like, and notice it must to use the `object` keyword to modify it. 35 | * 36 | * Usage: 37 | * 38 | * ```kotlin 39 | * @HikageViewDeclaration(ThirdPartyView::class, FrameLayout.LayoutParams::class, alias = "ThirdPartyView") 40 | * object ThirdPartyViewDeclaration 41 | * ``` 42 | * @param view the view class, only [View] can be specified. 43 | * @param lparams the layout params class, only [ViewGroup] can be specified, 44 | * after specifying, the `performer` parameter will be generated for the function. 45 | * The parameters must be a class inherited from [ViewGroup.LayoutParams], 46 | * if the current [View] does not inherit from [ViewGroup], this parameter will be ignored and warned. 47 | * @param alias the view's class name alias will naming the function, default is the [view] class name. 48 | * @param requireInit whether to force the `init` parameter to be called, default is false. 49 | * @param requirePerformer whether to force the `performer` parameter to be called, default is false, 50 | * this parameter will be ignored when no `performer` parameter is needed here. 51 | */ 52 | @Retention(AnnotationRetention.BINARY) 53 | @Target(AnnotationTarget.CLASS) 54 | @MustBeDocumented 55 | annotation class HikageViewDeclaration( 56 | val view: KClass<*>, 57 | val lparams: KClass<*> = Any::class, 58 | val alias: String = "", 59 | val requireInit: Boolean = false, 60 | val requirePerformer: Boolean = false 61 | ) -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/annotation/Hikageable.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/23. 21 | */ 22 | package com.highcapable.hikage.annotation 23 | 24 | import com.highcapable.hikage.core.Hikage 25 | 26 | /** 27 | * Declare an implementation of the [Hikage.Performer] function that 28 | * will be used for infectious creation of sub-layouts. 29 | * 30 | * Usage: 31 | * 32 | * ```kotlin 33 | * @Hikageable 34 | * inline fun Hikage.Performer.MyView( 35 | * lparams: Hikage.LayoutParams? = null, 36 | * id: String? = null, 37 | * init: HikageView = {} 38 | * ) = View(id, init, lparams) 39 | * ``` 40 | * @see Hikage.Performer 41 | */ 42 | @Retention(AnnotationRetention.BINARY) 43 | @Target(AnnotationTarget.FUNCTION) 44 | @MustBeDocumented 45 | annotation class Hikageable -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/bypass/HikageAttrsView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/28. 21 | */ 22 | package com.highcapable.hikage.bypass 23 | 24 | import android.content.Context 25 | import android.util.AttributeSet 26 | import android.view.View 27 | import androidx.annotation.Keep 28 | 29 | /** 30 | * Just a view for obtaining [AttributeSet]. 31 | * 32 | * **DONT USE THIS VIEW IN YOUR LAYOUT.** 33 | */ 34 | @Keep 35 | class HikageAttrsView internal constructor(context: Context, internal val attrs: AttributeSet?) : View(context, attrs) -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/core/base/Exceptions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:JvmName("ExceptionsUtils") 23 | 24 | package com.highcapable.hikage.core.base 25 | 26 | /** 27 | * The exception of performing view. 28 | * @param message the exception message. 29 | */ 30 | internal class PerformerException(message: String) : Exception(message) 31 | 32 | /** 33 | * The exception of providing view. 34 | * @param message the exception message. 35 | */ 36 | internal class ProvideException(message: String) : Exception(message) -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/core/extension/ResourcesScope.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/12. 21 | */ 22 | package com.highcapable.hikage.core.extension 23 | 24 | import android.content.res.ColorStateList 25 | import android.graphics.Bitmap 26 | import android.graphics.Typeface 27 | import android.graphics.drawable.Drawable 28 | import androidx.annotation.ColorRes 29 | import androidx.annotation.DimenRes 30 | import androidx.annotation.DrawableRes 31 | import androidx.annotation.FontRes 32 | import androidx.annotation.StringRes 33 | import com.highcapable.hikage.core.Hikage 34 | 35 | /** 36 | * An extension for [Hikage] view scope to provide resources. 37 | */ 38 | interface ResourcesScope { 39 | 40 | /** 41 | * Get the string from [resId]. 42 | * @param resId the resource id. 43 | * @param formatArgs the format arguments. 44 | * @return [String] 45 | */ 46 | fun stringResource(@StringRes resId: Int, vararg formatArgs: Any): String 47 | 48 | /** 49 | * Get the color from [resId]. 50 | * @param resId the resource id. 51 | * @return [Int] 52 | */ 53 | fun colorResource(@ColorRes resId: Int): Int 54 | 55 | /** 56 | * Get the [ColorStateList] from [resId]. 57 | * @param resId the resource id. 58 | * @return [Int] 59 | */ 60 | fun stateColorResource(@ColorRes resId: Int): ColorStateList 61 | 62 | /** 63 | * Get the [Drawable] from [resId]. 64 | * @param resId the resource id. 65 | * @return [Drawable] 66 | */ 67 | fun drawableResource(@DrawableRes resId: Int): Drawable 68 | 69 | /** 70 | * Get the [Bitmap] from [resId]. 71 | * @param resId the resource id. 72 | * @return [Bitmap] 73 | */ 74 | fun bitmapResource(@DrawableRes resId: Int): Bitmap 75 | 76 | /** 77 | * Get the dimension from [resId]. 78 | * @param resId the resource id. 79 | * @return [Float] 80 | */ 81 | fun dimenResource(@DimenRes resId: Int): Float 82 | 83 | /** 84 | * Get the font from [resId]. 85 | * @param resId the resource id. 86 | * @return [Typeface] or null. 87 | */ 88 | fun fontResource(@FontRes resId: Int): Typeface? 89 | } -------------------------------------------------------------------------------- /hikage-core/src/main/java/com/highcapable/hikage/core/preview/HikagePreview.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/27. 21 | */ 22 | @file:Suppress("unused", "FunctionName") 23 | 24 | package com.highcapable.hikage.core.preview 25 | 26 | import android.content.Context 27 | import android.util.AttributeSet 28 | import android.view.View 29 | import android.widget.FrameLayout 30 | import androidx.annotation.CallSuper 31 | import com.highcapable.hikage.core.Hikage 32 | import com.highcapable.hikage.core.builder.HikageBuilder 33 | 34 | /** 35 | * A preview layout for [Hikage]. 36 | * 37 | * - Note: This class should only be used in the layout preview mode by [View.isInEditMode]. 38 | */ 39 | abstract class HikagePreview(context: Context, attrs: AttributeSet? = null) : FrameLayout(context, attrs), HikageBuilder { 40 | 41 | init { 42 | require(isInEditMode) { 43 | "HikagePreview should only be used in the layout preview mode." 44 | } 45 | } 46 | 47 | @CallSuper 48 | override fun onAttachedToWindow() { 49 | super.onAttachedToWindow() 50 | removeAllViews() 51 | build().create(context, parent = this) 52 | } 53 | } -------------------------------------------------------------------------------- /hikage-core/src/main/res/layout/layout_hikage_attrs_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-core/src/test/java/com/highcapable/hikage/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | 14 | @Test 15 | fun addition_isCorrect() { 16 | assertEquals(4, 2 + 2) 17 | } 18 | } -------------------------------------------------------------------------------- /hikage-extension-betterandroid/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.library) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.kotlin.dokka) 5 | autowire(libs.plugins.maven.publish) 6 | } 7 | 8 | group = property.project.groupName 9 | version = property.project.hikage.extension.version 10 | 11 | android { 12 | namespace = property.project.hikage.extension.betterandroid.namespace 13 | compileSdk = property.project.android.compileSdk 14 | 15 | defaultConfig { 16 | minSdk = property.project.android.minSdk 17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | release { 22 | isMinifyEnabled = false 23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility = JavaVersion.VERSION_17 28 | targetCompatibility = JavaVersion.VERSION_17 29 | } 30 | kotlinOptions { 31 | jvmTarget = "17" 32 | freeCompilerArgs = listOf( 33 | "-Xno-param-assertions", 34 | "-Xno-call-assertions", 35 | "-Xno-receiver-assertions" 36 | ) 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation(projects.hikageCore) 42 | implementation(com.highcapable.yukireflection.api) 43 | implementation(com.highcapable.betterandroid.ui.component) 44 | implementation(com.highcapable.betterandroid.ui.extension) 45 | implementation(com.highcapable.betterandroid.system.extension) 46 | implementation(androidx.core.core.ktx) 47 | implementation(androidx.appcompat.appcompat) 48 | testImplementation(junit.junit) 49 | androidTestImplementation(androidx.test.ext.junit) 50 | androidTestImplementation(androidx.test.espresso.espresso.core) 51 | } -------------------------------------------------------------------------------- /hikage-extension-betterandroid/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/hikage-extension-betterandroid/consumer-rules.pro -------------------------------------------------------------------------------- /hikage-extension-betterandroid/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /hikage-extension-betterandroid/src/androidTest/java/com/highcapable/hikage/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | 19 | @Test 20 | fun useAppContext() { 21 | // Context of the app under test. 22 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 23 | assertEquals("com.highcapable.hikage.test", appContext.packageName) 24 | } 25 | } -------------------------------------------------------------------------------- /hikage-extension-betterandroid/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-extension-betterandroid/src/main/java/com/highcapable/hikage/extension/betterandroid/ui/component/adapter/CommonAdapterBuilder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/10. 21 | */ 22 | @file:Suppress("LocalVariableName") 23 | @file:JvmName("CommonAdapterBuilderUtils") 24 | 25 | package com.highcapable.hikage.extension.betterandroid.ui.component.adapter 26 | 27 | import android.view.ViewGroup 28 | import com.highcapable.betterandroid.ui.component.adapter.CommonAdapterBuilder 29 | import com.highcapable.hikage.core.Hikage 30 | import com.highcapable.hikage.core.base.HikagePerformer 31 | import com.highcapable.hikage.core.base.Hikageable 32 | import com.highcapable.hikage.extension.betterandroid.ui.component.adapter.viewholder.HikageHolderDelegate 33 | 34 | /** 35 | * Create and add view holder from [Hikage.Delegate]. 36 | * 37 | * Usage: 38 | * 39 | * ```kotlin 40 | * onBindItemView( 41 | * Hikageable = { 42 | * TextView( 43 | * id = "text", 44 | * lparams = LayoutParams(widthMatchParent = true) 45 | * ) { 46 | * text = "Item" 47 | * textSize = 20f 48 | * } 49 | * } 50 | * ) { hikage, entity, position -> 51 | * hikage.get("text").text = "Item ${entity.name} of ${position + 1}" 52 | * } 53 | * ``` 54 | * @see CommonAdapterBuilder.onBindItemView 55 | * @receiver [CommonAdapterBuilder]<[E]> 56 | * @param Hikageable the performer body. 57 | * @return [CommonAdapterBuilder]<[E]> 58 | */ 59 | @JvmOverloads 60 | fun CommonAdapterBuilder.onBindItemView( 61 | Hikageable: HikagePerformer, 62 | viewHolder: (hikage: Hikage, entity: E, position: Int) -> Unit = { _, _, _ -> } 63 | ) = onBindItemView(Hikageable(performer = Hikageable), viewHolder) 64 | 65 | /** 66 | * Create and add view holder from [Hikage.Delegate]. 67 | * @see CommonAdapterBuilder.onBindItemView 68 | * @receiver [CommonAdapterBuilder]<[E]> 69 | * @param delegate the delegate. 70 | * @return [CommonAdapterBuilder]<[E]> 71 | */ 72 | @JvmOverloads 73 | fun CommonAdapterBuilder.onBindItemView( 74 | delegate: Hikage.Delegate<*>, 75 | viewHolder: (hikage: Hikage, entity: E, position: Int) -> Unit = { _, _, _ -> } 76 | ) = onBindItemView(HikageHolderDelegate(delegate), viewHolder) -------------------------------------------------------------------------------- /hikage-extension-betterandroid/src/main/java/com/highcapable/hikage/extension/betterandroid/ui/component/adapter/viewholder/HikageHolderDelegate.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/10. 21 | */ 22 | package com.highcapable.hikage.extension.betterandroid.ui.component.adapter.viewholder 23 | 24 | import android.content.Context 25 | import android.view.ViewGroup 26 | import com.highcapable.betterandroid.ui.component.adapter.viewholder.delegate.base.ViewHolderDelegate 27 | import com.highcapable.hikage.core.Hikage 28 | 29 | /** 30 | * [Hikage.Delegate] type view holder delegate. 31 | * @param delegate the [Hikage.Delegate] instance. 32 | */ 33 | class HikageHolderDelegate internal constructor(private val delegate: Hikage.Delegate<*>) : ViewHolderDelegate() { 34 | 35 | override fun create(context: Context, parent: ViewGroup?) = delegate.create(context, parent, attachToParent = false) 36 | override fun getView(instance: Hikage) = instance.root 37 | } -------------------------------------------------------------------------------- /hikage-extension-betterandroid/src/test/java/com/highcapable/hikage/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | 14 | @Test 15 | fun addition_isCorrect() { 16 | assertEquals(4, 2 + 2) 17 | } 18 | } -------------------------------------------------------------------------------- /hikage-extension-compose/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.library) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.compose.compiler) 5 | autowire(libs.plugins.kotlin.dokka) 6 | autowire(libs.plugins.maven.publish) 7 | } 8 | 9 | group = property.project.groupName 10 | version = property.project.hikage.extension.compose.version 11 | 12 | android { 13 | namespace = property.project.hikage.extension.compose.namespace 14 | compileSdk = property.project.android.compileSdk 15 | 16 | defaultConfig { 17 | minSdk = property.project.android.minSdk 18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 19 | consumerProguardFiles("consumer-rules.pro") 20 | } 21 | buildTypes { 22 | release { 23 | isMinifyEnabled = false 24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 25 | } 26 | } 27 | compileOptions { 28 | sourceCompatibility = JavaVersion.VERSION_17 29 | targetCompatibility = JavaVersion.VERSION_17 30 | } 31 | kotlinOptions { 32 | jvmTarget = "17" 33 | freeCompilerArgs = listOf( 34 | "-Xno-param-assertions", 35 | "-Xno-call-assertions", 36 | "-Xno-receiver-assertions" 37 | ) 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation(projects.hikageCore) 43 | implementation(com.highcapable.yukireflection.api) 44 | implementation(com.highcapable.betterandroid.ui.extension) 45 | implementation(com.highcapable.betterandroid.system.extension) 46 | implementation(androidx.core.core.ktx) 47 | implementation(androidx.appcompat.appcompat) 48 | implementation(androidx.compose.ui.ui) 49 | testImplementation(junit.junit) 50 | androidTestImplementation(androidx.test.ext.junit) 51 | androidTestImplementation(androidx.test.espresso.espresso.core) 52 | } -------------------------------------------------------------------------------- /hikage-extension-compose/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/hikage-extension-compose/consumer-rules.pro -------------------------------------------------------------------------------- /hikage-extension-compose/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /hikage-extension-compose/src/androidTest/java/com/highcapable/hikage/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | 19 | @Test 20 | fun useAppContext() { 21 | // Context of the app under test. 22 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 23 | assertEquals("com.highcapable.hikage.test", appContext.packageName) 24 | } 25 | } -------------------------------------------------------------------------------- /hikage-extension-compose/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-extension-compose/src/main/java/com/highcapable/hikage/extension/androidx/compose/ComposeView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/28. 21 | */ 22 | @file:Suppress("unused", "FunctionName") 23 | @file:JvmName("ComposeViewPerformer") 24 | 25 | package com.highcapable.hikage.extension.androidx.compose 26 | 27 | import android.view.ViewGroup 28 | import androidx.compose.runtime.Composable 29 | import androidx.compose.ui.platform.ComposeView 30 | import com.highcapable.hikage.annotation.Hikageable 31 | import com.highcapable.hikage.core.Hikage 32 | import com.highcapable.hikage.core.base.HikageView 33 | 34 | /** 35 | * Composable in [Hikage]. 36 | * 37 | * Usage: 38 | * 39 | * ```kotlin 40 | * Hikageable { 41 | * ComposeView( 42 | * lparams = LayoutParams(matchParent = true) 43 | * ) { 44 | * Text("Hello, Compose in Hikage!") 45 | * } 46 | * } 47 | * ``` 48 | * @see ComposeView 49 | * @see Hikage.Performer.View 50 | */ 51 | @Hikageable 52 | inline fun Hikage.Performer.ComposeView( 53 | lparams: Hikage.LayoutParams? = null, 54 | id: String? = null, 55 | init: HikageView = {}, 56 | noinline content: (@Composable () -> Unit)? = null 57 | ) { 58 | View(lparams, id) { 59 | init(this) 60 | content?.let { setContent(it) } 61 | } 62 | } -------------------------------------------------------------------------------- /hikage-extension-compose/src/main/java/com/highcapable/hikage/extension/androidx/compose/HikageView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/12. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("HikageViewUtils") 24 | 25 | package com.highcapable.hikage.extension.androidx.compose 26 | 27 | import android.view.View 28 | import android.view.ViewGroup 29 | import androidx.compose.runtime.Composable 30 | import androidx.compose.ui.Modifier 31 | import androidx.compose.ui.UiComposable 32 | import androidx.compose.ui.viewinterop.AndroidView 33 | import com.highcapable.hikage.core.Hikage 34 | import com.highcapable.hikage.core.base.HikageFactoryBuilder 35 | import com.highcapable.hikage.core.base.HikagePerformer 36 | import com.highcapable.hikage.core.base.Hikageable 37 | 38 | /** 39 | * [Hikage] in composable. 40 | * 41 | * Usage: 42 | * 43 | * ```kotlin 44 | * Column( 45 | * modifier = Modifier.fillMaxSize() 46 | * ) { 47 | * HikageView { 48 | * TextView( 49 | * lparams = LayoutParams(matchParent = true) 50 | * ) { 51 | * text = "Hello, Hikage in Compose!" 52 | * textSize = 20f 53 | * } 54 | * } 55 | * } 56 | * ``` 57 | * @see AndroidView 58 | */ 59 | @Composable 60 | @UiComposable 61 | fun HikageView( 62 | modifier: Modifier = Modifier, 63 | update: (View) -> Unit = {}, 64 | factory: HikageFactoryBuilder.() -> Unit = {}, 65 | performer: HikagePerformer 66 | ) { 67 | AndroidView( 68 | factory = { context -> 69 | Hikageable( 70 | context = context, 71 | factory = factory, 72 | performer = performer 73 | ).root 74 | }, 75 | modifier = modifier, 76 | update = update 77 | ) 78 | } 79 | 80 | /** 81 | * [Hikage] in composable. 82 | * @see AndroidView 83 | * @param delegate the [Hikage.Delegate] instance. 84 | */ 85 | @Composable 86 | @UiComposable 87 | fun HikageView( 88 | delegate: Hikage.Delegate<*>, 89 | modifier: Modifier = Modifier, 90 | update: (View) -> Unit = {} 91 | ) { 92 | AndroidView( 93 | factory = { context -> 94 | delegate.create(context).root 95 | }, 96 | modifier = modifier, 97 | update = update 98 | ) 99 | } -------------------------------------------------------------------------------- /hikage-extension-compose/src/test/java/com/highcapable/hikage/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | 14 | @Test 15 | fun addition_isCorrect() { 16 | assertEquals(4, 2 + 2) 17 | } 18 | } -------------------------------------------------------------------------------- /hikage-extension/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.library) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.kotlin.dokka) 5 | autowire(libs.plugins.maven.publish) 6 | } 7 | 8 | group = property.project.groupName 9 | version = property.project.hikage.extension.version 10 | 11 | android { 12 | namespace = property.project.hikage.extension.namespace 13 | compileSdk = property.project.android.compileSdk 14 | 15 | defaultConfig { 16 | minSdk = property.project.android.minSdk 17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | release { 22 | isMinifyEnabled = false 23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility = JavaVersion.VERSION_17 28 | targetCompatibility = JavaVersion.VERSION_17 29 | } 30 | kotlinOptions { 31 | jvmTarget = "17" 32 | freeCompilerArgs = listOf( 33 | "-Xno-param-assertions", 34 | "-Xno-call-assertions", 35 | "-Xno-receiver-assertions" 36 | ) 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation(projects.hikageCore) 42 | implementation(com.highcapable.yukireflection.api) 43 | implementation(com.highcapable.betterandroid.ui.extension) 44 | implementation(com.highcapable.betterandroid.system.extension) 45 | implementation(androidx.core.core.ktx) 46 | implementation(androidx.appcompat.appcompat) 47 | implementation(androidx.constraintlayout.constraintlayout) 48 | testImplementation(junit.junit) 49 | androidTestImplementation(androidx.test.ext.junit) 50 | androidTestImplementation(androidx.test.espresso.espresso.core) 51 | } -------------------------------------------------------------------------------- /hikage-extension/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/hikage-extension/consumer-rules.pro -------------------------------------------------------------------------------- /hikage-extension/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /hikage-extension/src/androidTest/java/com/highcapable/hikage/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | 19 | @Test 20 | fun useAppContext() { 21 | // Context of the app under test. 22 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 23 | assertEquals("com.highcapable.hikage.test", appContext.packageName) 24 | } 25 | } -------------------------------------------------------------------------------- /hikage-extension/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-extension/src/main/java/com/highcapable/hikage/extension/Activity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/27. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ActivityUtils") 24 | 25 | package com.highcapable.hikage.extension 26 | 27 | import android.app.Activity 28 | import android.widget.FrameLayout 29 | import com.highcapable.hikage.core.Hikage 30 | import com.highcapable.hikage.core.base.HikageFactoryBuilder 31 | import com.highcapable.hikage.core.base.HikagePerformer 32 | import com.highcapable.hikage.core.base.Hikageable 33 | 34 | /** 35 | * @see Activity.setContentView 36 | * @see Hikageable 37 | * @return [Hikage] 38 | */ 39 | inline fun Activity.setContentView( 40 | factory: HikageFactoryBuilder.() -> Unit = {}, 41 | performer: HikagePerformer 42 | ) = Hikageable(context = this, factory = factory, performer = performer).apply { setContentView(root) } 43 | 44 | /** 45 | * @see Activity.setContentView 46 | * @see Hikage 47 | */ 48 | fun Activity.setContentView(hikage: Hikage) = setContentView(hikage.root) 49 | 50 | /** 51 | * @see Activity.setContentView 52 | * @see Hikage.Delegate 53 | * @return [Hikage] 54 | */ 55 | fun Activity.setContentView(delegate: Hikage.Delegate<*>) = 56 | delegate.create(context = this).apply { setContentView(root) } -------------------------------------------------------------------------------- /hikage-extension/src/main/java/com/highcapable/hikage/extension/PopupWindow.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/27. 21 | */ 22 | @file:Suppress("unused", "NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") 23 | @file:JvmName("PopupWindowUtils") 24 | 25 | package com.highcapable.hikage.extension 26 | 27 | import android.content.Context 28 | import android.widget.FrameLayout 29 | import android.widget.PopupWindow 30 | import com.highcapable.hikage.core.Hikage 31 | import com.highcapable.hikage.core.base.HikageFactoryBuilder 32 | import com.highcapable.hikage.core.base.HikagePerformer 33 | import com.highcapable.hikage.core.base.Hikageable 34 | import com.highcapable.yukireflection.factory.current 35 | 36 | /** 37 | * @see PopupWindow.setContentView 38 | * @see Hikageable 39 | * @return [Hikage] 40 | */ 41 | inline fun PopupWindow.setContentView( 42 | context: Context = requireContext(), 43 | factory: HikageFactoryBuilder.() -> Unit = {}, 44 | performer: HikagePerformer 45 | ) = Hikageable(context = context, factory = factory, performer = performer).apply { setContentView(root) } 46 | 47 | /** 48 | * @see PopupWindow.setContentView 49 | * @see Hikage 50 | */ 51 | fun PopupWindow.setContentView(hikage: Hikage) { 52 | contentView = hikage.root 53 | } 54 | 55 | /** 56 | * @see PopupWindow.setContentView 57 | * @see Hikage.Delegate 58 | * @return [Hikage] 59 | */ 60 | fun PopupWindow.setContentView( 61 | context: Context = requireContext(), 62 | delegate: Hikage.Delegate<*> 63 | ) = delegate.create(context).apply { setContentView(root) } 64 | 65 | /** 66 | * Require a context from [PopupWindow]. 67 | * @return [Context] 68 | */ 69 | private fun PopupWindow.requireContext() = 70 | current(ignored = true).field { name = "mContext" }.cast() 71 | ?: error("Hikage need a Context to create PopupWindow content view.") -------------------------------------------------------------------------------- /hikage-extension/src/main/java/com/highcapable/hikage/extension/ViewGroup.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/27. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ViewGroupUtils") 24 | 25 | package com.highcapable.hikage.extension 26 | 27 | import android.view.ViewGroup 28 | import com.highcapable.hikage.core.Hikage 29 | import com.highcapable.hikage.core.base.HikageFactoryBuilder 30 | import com.highcapable.hikage.core.base.HikagePerformer 31 | import com.highcapable.hikage.core.base.Hikageable 32 | 33 | /** 34 | * @see ViewGroup.addView 35 | * @see Hikageable 36 | * @return [Hikage] 37 | */ 38 | inline fun ViewGroup.addView( 39 | index: Int = -1, 40 | factory: HikageFactoryBuilder.() -> Unit = {}, 41 | performer: HikagePerformer 42 | ) = Hikageable(context = context, factory = factory, performer = performer).apply { addView(root, index) } 43 | 44 | /** 45 | * @see ViewGroup.addView 46 | * @see Hikage 47 | */ 48 | @JvmOverloads 49 | fun ViewGroup.addView(index: Int = -1, hikage: Hikage) = addView(hikage.root, index) 50 | 51 | /** 52 | * @see ViewGroup.addView 53 | * @see Hikage.Delegate 54 | * @return [Hikage] 55 | */ 56 | @JvmOverloads 57 | fun ViewGroup.addView(index: Int = -1, delegate: Hikage.Delegate<*>) = 58 | delegate.create(context).apply { addView(root, index) } -------------------------------------------------------------------------------- /hikage-extension/src/main/java/com/highcapable/hikage/extension/Window.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/27. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("WindowUtils") 24 | 25 | package com.highcapable.hikage.extension 26 | 27 | import android.view.Window 28 | import android.widget.FrameLayout 29 | import com.highcapable.hikage.core.Hikage 30 | import com.highcapable.hikage.core.base.HikageFactoryBuilder 31 | import com.highcapable.hikage.core.base.HikagePerformer 32 | import com.highcapable.hikage.core.base.Hikageable 33 | 34 | /** 35 | * @see Window.setContentView 36 | * @see Hikageable 37 | * @return [Hikage] 38 | */ 39 | inline fun Window.setContentView( 40 | factory: HikageFactoryBuilder.() -> Unit = {}, 41 | performer: HikagePerformer 42 | ) = Hikageable(context = context, factory = factory, performer = performer).apply { setContentView(root) } 43 | 44 | /** 45 | * @see Window.setContentView 46 | * @see Hikage 47 | */ 48 | fun Window.setContentView(hikage: Hikage) = setContentView(hikage.root) 49 | 50 | /** 51 | * @see Window.setContentView 52 | * @see Hikage.Delegate 53 | * @return [Hikage] 54 | */ 55 | fun Window.setContentView(delegate: Hikage.Delegate<*>) = 56 | delegate.create(context).apply { setContentView(root) } -------------------------------------------------------------------------------- /hikage-extension/src/main/java/com/highcapable/hikage/extension/widget/ConstraintLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/13. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ConstraintLayoutUtils") 24 | 25 | package com.highcapable.hikage.extension.widget 26 | 27 | import androidx.constraintlayout.widget.ConstraintLayout 28 | 29 | /** 30 | * @see ConstraintLayout.LayoutParams.leftToLeft 31 | */ 32 | fun ConstraintLayout.LayoutParams.leftToParent() { 33 | leftToLeft = ConstraintLayout.LayoutParams.PARENT_ID 34 | } 35 | 36 | /** 37 | * @see ConstraintLayout.LayoutParams.rightToRight 38 | */ 39 | fun ConstraintLayout.LayoutParams.rightToParent() { 40 | rightToRight = ConstraintLayout.LayoutParams.PARENT_ID 41 | } 42 | 43 | /** 44 | * @see ConstraintLayout.LayoutParams.startToStart 45 | */ 46 | fun ConstraintLayout.LayoutParams.startToParent() { 47 | startToStart = ConstraintLayout.LayoutParams.PARENT_ID 48 | } 49 | 50 | /** 51 | * @see ConstraintLayout.LayoutParams.endToEnd 52 | */ 53 | fun ConstraintLayout.LayoutParams.endToParent() { 54 | endToEnd = ConstraintLayout.LayoutParams.PARENT_ID 55 | } 56 | 57 | /** 58 | * @see ConstraintLayout.LayoutParams.topToTop 59 | */ 60 | fun ConstraintLayout.LayoutParams.topToParent() { 61 | topToTop = ConstraintLayout.LayoutParams.PARENT_ID 62 | } 63 | 64 | /** 65 | * @see ConstraintLayout.LayoutParams.bottomToBottom 66 | */ 67 | fun ConstraintLayout.LayoutParams.bottomToParent() { 68 | bottomToBottom = ConstraintLayout.LayoutParams.PARENT_ID 69 | } 70 | 71 | /** 72 | * @see ConstraintLayout.LayoutParams.startToParent 73 | * @see ConstraintLayout.LayoutParams.endToParent 74 | */ 75 | fun ConstraintLayout.LayoutParams.centerHorizontally() { 76 | startToParent() 77 | endToParent() 78 | } 79 | 80 | /** 81 | * @see ConstraintLayout.LayoutParams.topToParent 82 | * @see ConstraintLayout.LayoutParams.bottomToParent 83 | */ 84 | fun ConstraintLayout.LayoutParams.centerVertically() { 85 | topToParent() 86 | bottomToParent() 87 | } 88 | 89 | /** 90 | * @see ConstraintLayout.LayoutParams.centerHorizontally 91 | * @see ConstraintLayout.LayoutParams.centerVertically 92 | */ 93 | fun ConstraintLayout.LayoutParams.centerInParent() { 94 | centerHorizontally() 95 | centerVertically() 96 | } -------------------------------------------------------------------------------- /hikage-extension/src/test/java/com/highcapable/hikage/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | 14 | @Test 15 | fun addition_isCorrect() { 16 | assertEquals(4, 2 + 2) 17 | } 18 | } -------------------------------------------------------------------------------- /hikage-widget-androidx/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.library) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.maven.publish) 5 | autowire(libs.plugins.kotlin.ksp) 6 | } 7 | 8 | group = property.project.groupName 9 | version = property.project.hikage.widget.androidx.version 10 | 11 | android { 12 | namespace = property.project.hikage.widget.androidx.namespace 13 | compileSdk = property.project.android.compileSdk 14 | 15 | defaultConfig { 16 | minSdk = property.project.android.minSdk 17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | release { 22 | isMinifyEnabled = false 23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility = JavaVersion.VERSION_17 28 | targetCompatibility = JavaVersion.VERSION_17 29 | } 30 | kotlinOptions { 31 | jvmTarget = "17" 32 | freeCompilerArgs = listOf( 33 | "-Xno-param-assertions", 34 | "-Xno-call-assertions", 35 | "-Xno-receiver-assertions" 36 | ) 37 | } 38 | } 39 | 40 | dependencies { 41 | ksp(projects.hikageCompiler) 42 | implementation(projects.hikageCore) 43 | api(androidx.appcompat.appcompat) 44 | api(androidx.constraintlayout.constraintlayout) 45 | api(androidx.coordinatorlayout.coordinatorlayout) 46 | api(androidx.swiperefreshlayout.swiperefreshlayout) 47 | api(androidx.slidingpanelayout.slidingpanelayout) 48 | api(androidx.drawerlayout.drawerlayout) 49 | api(androidx.cardview.cardview) 50 | api(androidx.viewpager.viewpager) 51 | api(androidx.viewpager2.viewpager2) 52 | api(androidx.recyclerview.recyclerview) 53 | testImplementation(junit.junit) 54 | androidTestImplementation(androidx.test.ext.junit) 55 | androidTestImplementation(androidx.test.espresso.espresso.core) 56 | } -------------------------------------------------------------------------------- /hikage-widget-androidx/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/hikage-widget-androidx/consumer-rules.pro -------------------------------------------------------------------------------- /hikage-widget-androidx/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /hikage-widget-androidx/src/androidTest/java/com/highcapable/hikage/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | 19 | @Test 20 | fun useAppContext() { 21 | // Context of the app under test. 22 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 23 | assertEquals("com.highcapable.hikage.test", appContext.packageName) 24 | } 25 | } -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/cardview/CardView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("CardViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.cardview 26 | 27 | import android.widget.FrameLayout 28 | import androidx.cardview.widget.CardView 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(CardView::class, FrameLayout.LayoutParams::class) 32 | private object CardViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/constraintlayout/ConstraintLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ConstraintLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.constraintlayout 26 | 27 | import androidx.constraintlayout.widget.ConstraintLayout 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(ConstraintLayout::class, ConstraintLayout.LayoutParams::class) 31 | private object ConstraintLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/coordinatorlayout/CoordinatorLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("CoordinatorLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.coordinatorlayout 26 | 27 | import androidx.coordinatorlayout.widget.CoordinatorLayout 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(CoordinatorLayout::class, CoordinatorLayout.LayoutParams::class) 31 | private object CoordinatorLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/core/Widgets.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/27. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("WidgetsDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.core 26 | 27 | import android.widget.FrameLayout 28 | import androidx.core.widget.ContentLoadingProgressBar 29 | import androidx.core.widget.NestedScrollView 30 | import com.highcapable.hikage.annotation.HikageViewDeclaration 31 | 32 | @HikageViewDeclaration(NestedScrollView::class, FrameLayout.LayoutParams::class) 33 | private object NestedScrollViewDeclaration 34 | 35 | @HikageViewDeclaration(ContentLoadingProgressBar::class) 36 | private object ContentLoadingProgressBarDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/drawerlayout/DrawerLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("DrawerLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.drawerlayout 26 | 27 | import androidx.drawerlayout.widget.DrawerLayout 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(DrawerLayout::class, DrawerLayout.LayoutParams::class) 31 | private object DrawerLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/recyclerview/RecyclerView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("RecyclerViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.recyclerview 26 | 27 | import androidx.recyclerview.widget.RecyclerView 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(RecyclerView::class, RecyclerView.LayoutParams::class) 31 | private object RecyclerViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/slidingpanelayout/SlidingPaneLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("SlidingPaneLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.slidingpanelayout 26 | 27 | import androidx.slidingpanelayout.widget.SlidingPaneLayout 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(SlidingPaneLayout::class, SlidingPaneLayout.LayoutParams::class) 31 | private object SlidingPaneLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/swiperefreshlayout/SwipeRefreshLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("SwipeRefreshLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.swiperefreshlayout 26 | 27 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(SwipeRefreshLayout::class) 31 | private object SwipeRefreshLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/main/java/com/highcapable/hikage/widget/androidx/viewpager/ViewPager.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/2/26. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ViewPagerDeclaration") 24 | 25 | package com.highcapable.hikage.widget.androidx.viewpager 26 | 27 | import androidx.viewpager.widget.ViewPager 28 | import androidx.viewpager2.widget.ViewPager2 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(ViewPager::class, ViewPager.LayoutParams::class) 32 | private object ViewPagerDeclaration 33 | 34 | @HikageViewDeclaration(ViewPager2::class) 35 | private object ViewPager2Declaration -------------------------------------------------------------------------------- /hikage-widget-androidx/src/test/java/com/highcapable/hikage/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | 14 | @Test 15 | fun addition_isCorrect() { 16 | assertEquals(4, 2 + 2) 17 | } 18 | } -------------------------------------------------------------------------------- /hikage-widget-material/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.library) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.maven.publish) 5 | autowire(libs.plugins.kotlin.ksp) 6 | } 7 | 8 | group = property.project.groupName 9 | version = property.project.hikage.widget.material.version 10 | 11 | android { 12 | namespace = property.project.hikage.widget.material.namespace 13 | compileSdk = property.project.android.compileSdk 14 | 15 | defaultConfig { 16 | minSdk = property.project.android.minSdk 17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | release { 22 | isMinifyEnabled = false 23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility = JavaVersion.VERSION_17 28 | targetCompatibility = JavaVersion.VERSION_17 29 | } 30 | kotlinOptions { 31 | jvmTarget = "17" 32 | freeCompilerArgs = listOf( 33 | "-Xno-param-assertions", 34 | "-Xno-call-assertions", 35 | "-Xno-receiver-assertions" 36 | ) 37 | } 38 | } 39 | 40 | dependencies { 41 | ksp(projects.hikageCompiler) 42 | implementation(projects.hikageCore) 43 | api(com.google.android.material.material) 44 | testImplementation(junit.junit) 45 | androidTestImplementation(androidx.test.ext.junit) 46 | androidTestImplementation(androidx.test.espresso.espresso.core) 47 | } -------------------------------------------------------------------------------- /hikage-widget-material/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/hikage-widget-material/consumer-rules.pro -------------------------------------------------------------------------------- /hikage-widget-material/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /hikage-widget-material/src/androidTest/java/com/highcapable/hikage/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | 19 | @Test 20 | fun useAppContext() { 21 | // Context of the app under test. 22 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 23 | assertEquals("com.highcapable.hikage.test", appContext.packageName) 24 | } 25 | } -------------------------------------------------------------------------------- /hikage-widget-material/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/appbar/AppBarLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("AppBarLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.appbar 26 | 27 | import android.widget.Toolbar 28 | import com.google.android.material.appbar.AppBarLayout 29 | import com.google.android.material.appbar.CollapsingToolbarLayout 30 | import com.google.android.material.appbar.MaterialToolbar 31 | import com.highcapable.hikage.annotation.HikageViewDeclaration 32 | 33 | @HikageViewDeclaration(AppBarLayout::class, AppBarLayout.LayoutParams::class) 34 | private object AppBarLayoutDeclaration 35 | 36 | @HikageViewDeclaration(MaterialToolbar::class, Toolbar.LayoutParams::class) 37 | private object MaterialToolbarDeclaration 38 | 39 | @HikageViewDeclaration(CollapsingToolbarLayout::class, CollapsingToolbarLayout.LayoutParams::class) 40 | private object CollapsingToolbarLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/bottomappbar/BottomAppBar.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("BottomAppBarDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.bottomappbar 26 | 27 | import androidx.appcompat.widget.Toolbar 28 | import com.google.android.material.bottomappbar.BottomAppBar 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(BottomAppBar::class, Toolbar.LayoutParams::class) 32 | private object BottomAppBarDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/bottomnavigation/BottomNavigationView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("BottomNavigationViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.bottomnavigation 26 | 27 | import android.widget.FrameLayout 28 | import com.google.android.material.bottomnavigation.BottomNavigationView 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(BottomNavigationView::class, FrameLayout.LayoutParams::class) 32 | private object BottomNavigationViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/bottomsheet/BottomSheetDragHandleView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("BottomSheetDragHandleViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.bottomsheet 26 | 27 | import com.google.android.material.bottomsheet.BottomSheetDragHandleView 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(BottomSheetDragHandleView::class) 31 | private object BottomSheetDragHandleViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/button/MaterialButton.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialButtonDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.button 26 | 27 | import android.widget.LinearLayout 28 | import com.google.android.material.button.MaterialButton 29 | import com.google.android.material.button.MaterialButtonToggleGroup 30 | import com.highcapable.hikage.annotation.HikageViewDeclaration 31 | 32 | @HikageViewDeclaration(MaterialButton::class) 33 | private object MaterialButtonDeclaration 34 | 35 | @HikageViewDeclaration(MaterialButtonToggleGroup::class, LinearLayout.LayoutParams::class) 36 | private object MaterialButtonToggleGroupDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/card/MaterialCardView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialCardViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.card 26 | 27 | import android.widget.FrameLayout 28 | import com.google.android.material.card.MaterialCardView 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(MaterialCardView::class, FrameLayout.LayoutParams::class) 32 | private object MaterialCardViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/checkbox/MaterialCheckBox.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialCheckBoxDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.checkbox 26 | 27 | import com.google.android.material.checkbox.MaterialCheckBox 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(MaterialCheckBox::class) 31 | private object MaterialCheckBoxDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/chip/Chip.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ChipDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.chip 26 | 27 | import com.google.android.material.chip.Chip 28 | import com.google.android.material.chip.ChipGroup 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(Chip::class) 32 | private object ChipDeclaration 33 | 34 | @HikageViewDeclaration(ChipGroup::class, ChipGroup.LayoutParams::class) 35 | private object ChipGroupDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/circularreveal/CircularLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("CircularRevealLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.circularreveal 26 | 27 | import android.widget.FrameLayout 28 | import android.widget.GridLayout 29 | import android.widget.LinearLayout 30 | import android.widget.RelativeLayout 31 | import androidx.coordinatorlayout.widget.CoordinatorLayout 32 | import com.google.android.material.circularreveal.CircularRevealFrameLayout 33 | import com.google.android.material.circularreveal.CircularRevealGridLayout 34 | import com.google.android.material.circularreveal.CircularRevealLinearLayout 35 | import com.google.android.material.circularreveal.CircularRevealRelativeLayout 36 | import com.google.android.material.circularreveal.cardview.CircularRevealCardView 37 | import com.google.android.material.circularreveal.coordinatorlayout.CircularRevealCoordinatorLayout 38 | import com.highcapable.hikage.annotation.HikageViewDeclaration 39 | 40 | @HikageViewDeclaration(CircularRevealGridLayout::class, GridLayout.LayoutParams::class) 41 | private object CircularRevealGridLayoutDeclaration 42 | 43 | @HikageViewDeclaration(CircularRevealRelativeLayout::class, RelativeLayout.LayoutParams::class) 44 | private object CircularRevealRelativeLayoutDeclaration 45 | 46 | @HikageViewDeclaration(CircularRevealFrameLayout::class, FrameLayout.LayoutParams::class) 47 | private object CircularRevealFrameLayoutDeclaration 48 | 49 | @HikageViewDeclaration(CircularRevealLinearLayout::class, LinearLayout.LayoutParams::class) 50 | private object CircularRevealLinearLayoutDeclaration 51 | 52 | @HikageViewDeclaration(CircularRevealCoordinatorLayout::class, CoordinatorLayout.LayoutParams::class) 53 | private object CircularRevealCoordinatorLayoutDeclaration 54 | 55 | @HikageViewDeclaration(CircularRevealCardView::class, FrameLayout.LayoutParams::class) 56 | private object CircularRevealCardViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/divider/MaterialDivider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialDividerDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.divider 26 | 27 | import com.google.android.material.divider.MaterialDivider 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(MaterialDivider::class) 31 | private object MaterialDividerDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/floatingactionbutton/FloatingActionButton.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("FloatingActionButtonDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.floatingactionbutton 26 | 27 | import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton 28 | import com.google.android.material.floatingactionbutton.FloatingActionButton 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(FloatingActionButton::class) 32 | private object FloatingActionButtonDeclaration 33 | 34 | @HikageViewDeclaration(ExtendedFloatingActionButton::class) 35 | private object ExtendedFloatingActionButtonDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/imageview/ShapeableImageView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ShapeableImageViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.imageview 26 | 27 | import com.google.android.material.imageview.ShapeableImageView 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(ShapeableImageView::class) 31 | private object ShapeableImageViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/materialswitch/MaterialSwitch.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialSwitchDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.materialswitch 26 | 27 | import com.google.android.material.materialswitch.MaterialSwitch 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(MaterialSwitch::class) 31 | private object MaterialSwitchDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/navigation/NavigationView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("NavigationViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.navigation 26 | 27 | import android.widget.FrameLayout 28 | import com.google.android.material.navigation.NavigationView 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(NavigationView::class, FrameLayout.LayoutParams::class) 32 | private object NavigationViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/navigationrail/NavigationRailView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("NavigationRailViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.navigationrail 26 | 27 | import android.widget.FrameLayout 28 | import com.google.android.material.navigationrail.NavigationRailView 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(NavigationRailView::class, FrameLayout.LayoutParams::class) 32 | private object NavigationRailViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/progressindicator/ProgressIndicator.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("ProgressIndicatorDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.progressindicator 26 | 27 | import com.google.android.material.progressindicator.CircularProgressIndicator 28 | import com.google.android.material.progressindicator.LinearProgressIndicator 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(CircularProgressIndicator::class) 32 | private object ProgressIndicatorDeclaration 33 | 34 | @HikageViewDeclaration(LinearProgressIndicator::class) 35 | private object LinearProgressIndicatorDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/radiobutton/MaterialRadioButton.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialRadioButtonDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.radiobutton 26 | 27 | import com.google.android.material.radiobutton.MaterialRadioButton 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(MaterialRadioButton::class) 31 | private object MaterialRadioButtonDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/search/SearchBar.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("SearchBarDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.search 26 | 27 | import android.widget.FrameLayout 28 | import androidx.appcompat.widget.Toolbar 29 | import com.google.android.material.search.SearchBar 30 | import com.google.android.material.search.SearchView 31 | import com.highcapable.hikage.annotation.HikageViewDeclaration 32 | 33 | @HikageViewDeclaration(SearchBar::class, Toolbar.LayoutParams::class) 34 | private object SearchBarDeclaration 35 | 36 | @HikageViewDeclaration(SearchView::class, FrameLayout.LayoutParams::class) 37 | private object SearchViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/slider/Slider.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("SliderDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.slider 26 | 27 | import com.google.android.material.slider.RangeSlider 28 | import com.google.android.material.slider.Slider 29 | import com.highcapable.hikage.annotation.HikageViewDeclaration 30 | 31 | @HikageViewDeclaration(Slider::class) 32 | private object SliderDeclaration 33 | 34 | @HikageViewDeclaration(RangeSlider::class) 35 | private object RangeSliderDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/switchmaterial/SwitchMaterial.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("SwitchMaterialDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.switchmaterial 26 | 27 | import com.google.android.material.switchmaterial.SwitchMaterial 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(SwitchMaterial::class) 31 | private object SwitchMaterialDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/tabs/TabLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("TabLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.tabs 26 | 27 | import android.widget.FrameLayout 28 | import com.google.android.material.tabs.TabItem 29 | import com.google.android.material.tabs.TabLayout 30 | import com.highcapable.hikage.annotation.HikageViewDeclaration 31 | 32 | @HikageViewDeclaration(TabLayout::class, FrameLayout.LayoutParams::class) 33 | private object TabLayoutDeclaration 34 | 35 | @HikageViewDeclaration(TabItem::class) 36 | private object TabItemDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/textfield/TextInputLayout.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("TextInputLayoutDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.textfield 26 | 27 | import android.widget.LinearLayout 28 | import com.google.android.material.textfield.MaterialAutoCompleteTextView 29 | import com.google.android.material.textfield.TextInputEditText 30 | import com.google.android.material.textfield.TextInputLayout 31 | import com.highcapable.hikage.annotation.HikageViewDeclaration 32 | 33 | @HikageViewDeclaration(TextInputEditText::class) 34 | private object TextInputEditTextDeclaration 35 | 36 | @HikageViewDeclaration(MaterialAutoCompleteTextView::class) 37 | private object MaterialAutoCompleteTextViewDeclaration 38 | 39 | @HikageViewDeclaration(TextInputLayout::class, LinearLayout.LayoutParams::class) 40 | private object TextInputLayoutDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/main/java/com/highcapable/hikage/widget/google/material/textview/MaterialTextView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/3. 21 | */ 22 | @file:Suppress("unused") 23 | @file:JvmName("MaterialTextViewDeclaration") 24 | 25 | package com.highcapable.hikage.widget.google.material.textview 26 | 27 | import com.google.android.material.textview.MaterialTextView 28 | import com.highcapable.hikage.annotation.HikageViewDeclaration 29 | 30 | @HikageViewDeclaration(MaterialTextView::class) 31 | private object MaterialTextViewDeclaration -------------------------------------------------------------------------------- /hikage-widget-material/src/test/java/com/highcapable/hikage/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | 14 | @Test 15 | fun addition_isCorrect() { 16 | assertEquals(4, 2 + 2) 17 | } 18 | } -------------------------------------------------------------------------------- /img-src/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /img-src/nagasaki_soyo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/img-src/nagasaki_soyo.png -------------------------------------------------------------------------------- /samples/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | autowire(libs.plugins.android.application) 3 | autowire(libs.plugins.kotlin.android) 4 | autowire(libs.plugins.kotlin.ksp) 5 | } 6 | 7 | android { 8 | namespace = property.project.samples.app.packageName 9 | compileSdk = property.project.android.compileSdk 10 | 11 | defaultConfig { 12 | applicationId = property.project.samples.app.packageName 13 | minSdk = property.project.android.minSdk 14 | targetSdk = property.project.android.targetSdk 15 | versionName = property.project.samples.app.versionName 16 | versionCode = property.project.samples.app.versionCode 17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 18 | } 19 | buildTypes { 20 | release { 21 | isMinifyEnabled = true 22 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 23 | signingConfig = signingConfigs.getByName("debug") 24 | } 25 | } 26 | compileOptions { 27 | sourceCompatibility = JavaVersion.VERSION_17 28 | targetCompatibility = JavaVersion.VERSION_17 29 | } 30 | kotlinOptions { 31 | jvmTarget = "17" 32 | freeCompilerArgs = listOf( 33 | "-Xno-param-assertions", 34 | "-Xno-call-assertions", 35 | "-Xno-receiver-assertions" 36 | ) 37 | } 38 | buildFeatures { 39 | buildConfig = true 40 | viewBinding = true 41 | } 42 | } 43 | 44 | dependencies { 45 | ksp(projects.hikageCompiler) 46 | implementation(projects.hikageCore) 47 | implementation(projects.hikageExtension) 48 | implementation(projects.hikageExtensionBetterandroid) 49 | implementation(projects.hikageWidgetAndroidx) 50 | implementation(projects.hikageWidgetMaterial) 51 | implementation(com.highcapable.pangutext.pangutext.android) 52 | implementation(com.highcapable.betterandroid.ui.component) 53 | implementation(com.highcapable.betterandroid.ui.extension) 54 | implementation(com.highcapable.betterandroid.system.extension) 55 | implementation(androidx.core.core.ktx) 56 | implementation(androidx.appcompat.appcompat) 57 | testImplementation(junit.junit) 58 | androidTestImplementation(androidx.test.ext.junit) 59 | androidTestImplementation(androidx.test.espresso.espresso.core) 60 | } -------------------------------------------------------------------------------- /samples/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -ignorewarnings 24 | -optimizationpasses 10 25 | -dontusemixedcaseclassnames 26 | -dontoptimize 27 | -verbose 28 | -overloadaggressively 29 | -allowaccessmodification 30 | -adaptclassstrings 31 | -adaptresourcefilenames 32 | -adaptresourcefilecontents 33 | 34 | -renamesourcefileattribute P 35 | -keepattributes SourceFile,Signature,LineNumberTable 36 | 37 | -assumenosideeffects class kotlin.jvm.internal.Intrinsics { 38 | public static *** throwUninitializedProperty(...); 39 | public static *** throwUninitializedPropertyAccessException(...); 40 | } 41 | 42 | -keep class * extends android.app.Activity 43 | -keep class * implements androidx.viewbinding.ViewBinding { 44 | (); 45 | *** inflate(android.view.LayoutInflater); 46 | } -------------------------------------------------------------------------------- /samples/app/src/androidTest/java/com/highcapable/hikage/demo/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage.demo 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.highcapable.hikage.demo", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /samples/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /samples/app/src/main/java/com/highcapable/hikage/demo/DemoApp.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/4/20. 21 | */ 22 | package com.highcapable.hikage.demo 23 | 24 | import android.app.Application 25 | import com.google.android.material.color.DynamicColors 26 | 27 | class DemoApp : Application() { 28 | 29 | override fun onCreate() { 30 | super.onCreate() 31 | DynamicColors.applyToActivitiesIfAvailable(this) 32 | } 33 | } -------------------------------------------------------------------------------- /samples/app/src/main/java/com/highcapable/hikage/demo/ui/base/BaseActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/12. 21 | */ 22 | package com.highcapable.hikage.demo.ui.base 23 | 24 | import android.os.Bundle 25 | import androidx.annotation.CallSuper 26 | import com.highcapable.betterandroid.ui.component.activity.AppViewsActivity 27 | import com.highcapable.pangutext.android.factory.PanguTextFactory2 28 | 29 | abstract class BaseActivity : AppViewsActivity() { 30 | 31 | @CallSuper 32 | override fun onCreate(savedInstanceState: Bundle?) { 33 | super.onCreate(savedInstanceState) 34 | PanguTextFactory2.inject(this) 35 | } 36 | } -------------------------------------------------------------------------------- /samples/app/src/main/java/com/highcapable/hikage/demo/ui/preview/SamplePreview.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/3/12. 21 | */ 22 | @file:Suppress("SetTextI18n") 23 | 24 | package com.highcapable.hikage.demo.ui.preview 25 | 26 | import android.content.Context 27 | import android.util.AttributeSet 28 | import android.view.Gravity 29 | import android.widget.LinearLayout 30 | import com.highcapable.hikage.core.base.Hikageable 31 | import com.highcapable.hikage.core.preview.HikagePreview 32 | import com.highcapable.hikage.widget.android.widget.Button 33 | import com.highcapable.hikage.widget.android.widget.LinearLayout 34 | import com.highcapable.hikage.widget.android.widget.TextView 35 | 36 | class SamplePreview(context: Context, attrs: AttributeSet) : HikagePreview(context, attrs) { 37 | 38 | override fun build() = Hikageable { 39 | LinearLayout( 40 | lparams = LayoutParams(matchParent = true), 41 | init = { 42 | orientation = LinearLayout.VERTICAL 43 | gravity = Gravity.CENTER 44 | } 45 | ) { 46 | TextView { 47 | text = "Hello, World!" 48 | textSize = 20f 49 | } 50 | Button( 51 | lparams = LayoutParams { 52 | topMargin = 20.dp 53 | } 54 | ) { 55 | text = "Test Button" 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /samples/app/src/main/java/com/highcapable/hikage/demo/ui/widget/CheckableChip.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Hikage - An Android responsive UI building tool. 3 | * Copyright (C) 2019 HighCapable 4 | * https://github.com/BetterAndroid/Hikage 5 | * 6 | * Apache License Version 2.0 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * https://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | * This file is created by fankes on 2025/4/20. 21 | */ 22 | @file:Suppress("PrivateResource") 23 | 24 | package com.highcapable.hikage.demo.ui.widget 25 | 26 | import android.content.Context 27 | import android.util.AttributeSet 28 | import com.google.android.material.R 29 | import com.google.android.material.chip.Chip 30 | import com.highcapable.betterandroid.ui.extension.component.base.getDrawableCompat 31 | import com.highcapable.hikage.annotation.HikageView 32 | 33 | @HikageView 34 | class CheckableChip(context: Context, attrs: AttributeSet? = null) : Chip(context, attrs) { 35 | 36 | init { 37 | isCheckable = true 38 | isCheckedIconVisible = true 39 | checkedIcon = context.getDrawableCompat(R.drawable.ic_m3_chip_check) 40 | } 41 | } -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BetterAndroid/Hikage/4511ec329f484f2c6f7f56a886817198a9136d84/samples/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /samples/app/src/main/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hikage 演示 4 | 用户名 5 | 密码 6 | 男 7 | 女 8 | 启用通知 9 | 如你所见,所有布局都通过代码动态创建,你可以在任何地方对布局进行自定义。 10 | 提交 11 | 登录信息 12 | 用户名:%1$s\n密码:%2$s 13 | 请填写所有内容 14 | 欢迎使用 Hikage! 15 | -------------------------------------------------------------------------------- /samples/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #FFFFFFFF 5 | #FF639F70 6 | #FFF5F5F5 7 | #FF2D2D2D 8 | -------------------------------------------------------------------------------- /samples/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #4EA16B 4 | -------------------------------------------------------------------------------- /samples/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Hikage Demo 3 | Username 4 | Password 5 | Man 6 | Woman 7 | Enable Notification 8 | As you can see, all layouts are created dynamically through code, and you can customize the layout anywhere. 9 | Submit 10 | Login Info 11 | Username: %1$s\nPassword: %2$s 12 | Please fill in all fields 13 | Welcome to use Hikage! 14 | -------------------------------------------------------------------------------- /samples/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /samples/app/src/test/java/com/highcapable/hikage/demo/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.highcapable.hikage.demo 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 2 | pluginManagement { 3 | repositories { 4 | gradlePluginPortal() 5 | google() 6 | mavenCentral() 7 | } 8 | } 9 | plugins { 10 | id("com.highcapable.sweetdependency") version "1.0.4" 11 | id("com.highcapable.sweetproperty") version "1.0.5" 12 | } 13 | sweetProperty { 14 | rootProject { all { isEnable = false } } 15 | project( 16 | ":hikage-core", 17 | ":hikage-core-lint", 18 | ":hikage-extension", 19 | ":hikage-extension-compose", 20 | ":hikage-extension-betterandroid", 21 | ":hikage-compiler", 22 | ":hikage-widget-androidx", 23 | ":hikage-widget-material" 24 | ) { 25 | sourcesCode { 26 | isEnableRestrictedAccess = true 27 | } 28 | } 29 | } 30 | rootProject.name = "Hikage" 31 | include(":samples:app") 32 | include( 33 | ":hikage-core", 34 | ":hikage-core-lint", 35 | ":hikage-extension", 36 | ":hikage-extension-compose", 37 | ":hikage-extension-betterandroid", 38 | ":hikage-compiler", 39 | ":hikage-widget-androidx", 40 | ":hikage-widget-material" 41 | ) --------------------------------------------------------------------------------