[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4029":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},4029,"AndroidAutoSize","JessYanCoding\u002FAndroidAutoSize","JessYanCoding","🔥 A low-cost Android screen adaptation solution (今日头条屏幕适配方案终极版，一个极低成本的 Android 屏幕适配方案).","",null,"Java",13731,2007,196,125,0,1,4,44.91,"Apache License 2.0",false,"master",true,[25,26,27,28,29,30],"adapterview","android","arms","density","mvparms","screenadapter","2026-06-12 02:00:57","![Logo](art\u002Fautosize_banner.jpg)\n![Official](https:\u002F\u002Fraw.githubusercontent.com\u002FJessYanCoding\u002FMVPArms\u002Fmaster\u002Fimage\u002Fofficial.jpeg)\n\n\u003Cp align=\"center\">\n   \u003Ca href=\"https:\u002F\u002Fbintray.com\u002Fjessyancoding\u002Fmaven\u002Fautosize\u002F_latestVersion\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FJcenter-v1.2.1-brightgreen.svg?style=flat-square\" alt=\"Latest Stable Version\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Ftravis-ci.org\u002FJessYanCoding\u002FAndroidAutoSize\">\n    \u003Cimg src=\"https:\u002F\u002Ftravis-ci.org\u002FJessYanCoding\u002FAndroidAutoSize.svg?branch=master\" alt=\"Build Status\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdeveloper.android.com\u002Fabout\u002Fversions\u002Fandroid-4.0.html\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAPI-14%2B-blue.svg?style=flat-square\" alt=\"Min Sdk Version\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\">\n    \u003Cimg src=\"http:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache%202.0-blue.svg?style=flat-square\" alt=\"License\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.jianshu.com\u002Fu\u002F1d0c0bc634db\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAuthor-JessYan-orange.svg?style=flat-square\" alt=\"Author\" \u002F>\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fshang.qq.com\u002Fwpa\u002Fqunwpa?idkey=7e59e59145e6c7c68932ace10f52790636451f01d1ecadb6a652b1df234df753\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQQ%E7%BE%A4-455850365%20%7C%20301733278-orange.svg?style=flat-square\" alt=\"QQ Group\" \u002F>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"README-zh.md\">\n    \u003Cb>中文说明\u003C\u002Fb>\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\n## A low-cost Android screen adaptation solution (今日头条屏幕适配方案终极版，一个极低成本的 Android 屏幕适配方案).\n\n## Overview\n### Pixel 2 XL | 1440 x 2880 | 560dpi:\n\u003Cp>\n   \u003Cimg src=\"art\u002F1440x2880_width.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F1440x2880_height.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F1440x2880_external.png\" width=\"30%\" height=\"30%\">\n\u003C\u002Fp>\n\n### Pixel XL | 1440 x 2560 | 560dpi:\n\u003Cp>\n   \u003Cimg src=\"art\u002F1440x2560_width.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F1440x2560_height.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F1440x2560_external.png\" width=\"30%\" height=\"30%\">\n\u003C\u002Fp>\n\n### Nexus 5X | 1080 x 1920 | 420dpi:\n\u003Cp>\n   \u003Cimg src=\"art\u002F1080x1920_width.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F1080x1920_height.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F1080x1920_external.png\" width=\"30%\" height=\"30%\">\n\u003C\u002Fp>\n\n### Nexus 4 | 768 x 1280 | 320dpi:\n\u003Cp>\n   \u003Cimg src=\"art\u002F768x1280_width.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F768x1280_height.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F768x1280_external.png\" width=\"30%\" height=\"30%\">\n\u003C\u002Fp>\n\n### Nexus S | 480 x 800 | 240dpi:\n\u003Cp>\n   \u003Cimg src=\"art\u002F480x800_width.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F480x800_height.png\" width=\"30%\" height=\"30%\">\n   \u003Cimg src=\"art\u002F480x800_external.png\" width=\"30%\" height=\"30%\">\n\u003C\u002Fp>\n\n## Notice\n* [Devices Info](https:\u002F\u002Fmaterial.io\u002Ftools\u002Fdevices\u002F)\n\n* [Introduction Of Function](https:\u002F\u002Fjuejin.im\u002Fpost\u002F5bce688e6fb9a05cf715d1c2)\n\n* [Framework Analysis](https:\u002F\u002Fjuejin.im\u002Fpost\u002F5b7a29736fb9a019d53e7ee2)\n\n* [Common Issues](https:\u002F\u002Fgithub.com\u002FJessYanCoding\u002FAndroidAutoSize\u002Fissues\u002F13)\n\n* [AndroidAutoLayout Migration Guide](https:\u002F\u002Fgithub.com\u002FJessYanCoding\u002FAndroidAutoSize\u002Fissues\u002F90)\n\n* [Android Advanced Framework](https:\u002F\u002Fgithub.com\u002FJessYanCoding\u002FMVPArms)\n\n## Download\n### Jcenter ([ ⚠️ DEPRECATION WARNING: the JCenter repository will keep serving packages until February 1st, 2022](https:\u002F\u002Fjfrog.com\u002Fblog\u002Finto-the-sunset-bintray-jcenter-gocenter-and-chartcenter)):\n``` gradle\n implementation 'me.jessyan:autosize:1.2.1'\n```\n\n### JitPack:\nStep 1. Add the JitPack repository in your root [build.gradle](https:\u002F\u002Fgithub.com\u002FJessYanCoding\u002FAndroidAutoSize\u002Fblob\u002Fmaster\u002Fbuild.gradle#L20) at the end of repositories:\n\n```gradle\nallprojects {\n    repositories {\n        ...\n        maven { url \"https:\u002F\u002Fjitpack.io\" }\n    }\n}\n```\n\nStep 2. Add the dependency\n\n```gradle\ndependencies {\n    implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'\n}\n```\n\n## Usage\n### Step 1 (just one steps) \n* **Initialize in AndroidManifest, if you use a subunits, you can write the pixel size, no need to convert the pixel to dp, please see [demo-subunits](https:\u002F\u002Fgithub.com\u002FJessYanCoding\u002FAndroidAutoSize\u002Ftree\u002Fmaster\u002Fdemo-subunits)**\n```xml\n\u003Cmanifest>\n    \u003Capplication>            \n        \u003Cmeta-data\n            android:name=\"design_width_in_dp\"\n            android:value=\"360\"\u002F>\n        \u003Cmeta-data\n            android:name=\"design_height_in_dp\"\n            android:value=\"640\"\u002F>           \n     \u003C\u002Fapplication>           \n\u003C\u002Fmanifest>\n```\n\n\u003Ca name=\"preview\">\u003C\u002Fa>\n## Preview\n* Real-time preview during layout is an important part of the development phase, in many cases, the default preview device provided by **Android Studio** does not fully display our design, so we need to create the virtual device ourselves, under the **dp, pt, in, mm** four units of virtual device creation method\n\n* If you don't want the status bar and navigation bar to appear in **Preview** during preview, you can select the **panel** theme according to the following image, after using this theme, the vertical resolution just fills the entire preview page\n![theme](art\u002Ftheme_panel.png)\n\n* Virtual device creation method\n![create step](art\u002Fcreate_step.png)\n\n### DP\n* If you use **dp** as a unit in the **layout** file for layout (**AndroidAutoSize** supports **dp, sp** for layout by default), you can find the screen size according to the formula **(sqrt(vertical resolution^2 + horizontal resolution^2))\u002Fdpi** and create an virtual device (**write screen size and resolution only**)\n![dp](art\u002Funit_dp.png)\n\n### PT\n* If you use **pt** as a unit in the **layout** file for layout (requires **AutoSizeConfig.getInstance().getUnitsManager().setSupportSubunits(Subunits.PT);** to open **pt** support), you can find the screen size according to the formula **(sqrt(vertical resolution^2 + horizontal resolution^2))\u002F72** and create an virtual device (**write screen size and resolution only**)\n![pt](art\u002Funit_pt.png)\n\n### IN\n* If you use **in** as a unit in the **layout** file for layout (requires **AutoSizeConfig.getInstance().getUnitsManager().setSupportSubunits(Subunits.IN);** to open **in** support), you can find the screen size according to the formula **sqrt(vertical resolution^2 + horizontal resolution^2)** and create an virtual device (**write screen size and resolution only**)\n![in](art\u002Funit_in.png)\n\n### MM\n* If you use **mm** as a unit in the **layout** file for layout (requires **AutoSizeConfig.getInstance().getUnitsManager().setSupportSubunits(Subunits.MM);** to open **mm** support), you can find the screen size according to the formula **(sqrt(vertical resolution^2 + horizontal resolution^2))\u002F25.4** and create an virtual device (**write screen size and resolution only**)\n![mm](art\u002Funit_mm.png)\n\n## Advance (see demo)\n\n### Activity\n* **Customize the adaptation parameters of the Activity:**\n```java\npublic class CustomAdaptActivity extends AppCompatActivity implements CustomAdapt {\n\n    @Override\n    public boolean isBaseOnWidth() {\n        return false;\n    }\n\n    @Override\n    public float getSizeInDp() {\n        return 667;\n    }\n}\n```\n\n* **Cancel the adaptation of the Activity:**\n```java\npublic class CancelAdaptActivity extends AppCompatActivity implements CancelAdapt {\n\n}\n```\n\n### Fragment\n* **First enable the ability to support Fragment custom parameters**\n```java\nAutoSizeConfig.getInstance().setCustomFragment(true);\n```\n\n* **Customize the adaptation parameters of the Fragment:**\n```java\npublic class CustomAdaptFragment extends Fragment implements CustomAdapt {\n\n    @Override\n    public boolean isBaseOnWidth() {\n        return false;\n    }\n\n    @Override\n    public float getSizeInDp() {\n        return 667;\n    }\n}\n```\n\n* **Cancel the adaptation of the Fragment:**\n```java\npublic class CancelAdaptFragment extends Fragment implements CancelAdapt {\n\n}\n```\n\n### Subunits (see demo-subunits)\n* You can choose one of the three unpopular units of **pt, in, mm** as the subunits, the subunits is used to avoid the adverse effects caused by modifying **DisplayMetrics#density**, after using the subunits, you can write the pixel size on the design, you don't need to convert it to **dp**\n\n\n```java\nAutoSizeConfig.getInstance().getUnitsManager()\n        .setSupportDP(false)\n        .setSupportSP(false)\n        .setSupportSubunits(Subunits.MM);\n```\n\n## About Me\n* **Email**: \u003Cjess.yan.effort@gmail.com>\n* **Home**: \u003Chttp:\u002F\u002Fjessyan.me>\n* **掘金**: \u003Chttps:\u002F\u002Fjuejin.im\u002Fuser\u002F57a9dbd9165abd0061714613>\n* **简书**: \u003Chttps:\u002F\u002Fwww.jianshu.com\u002Fu\u002F1d0c0bc634db>\n\n## License\n```\n Copyright 2018, jessyan\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n```\n","AndroidAutoSize 是一个极低成本的 Android 屏幕适配方案，旨在简化不同设备上的屏幕适配工作。该项目通过自定义单位和动态调整布局参数来实现屏幕适配，支持多种尺寸和分辨率的设备，且无需为每种屏幕尺寸单独创建资源文件。其核心功能包括自动计算设计稿与实际设备之间的缩放比例，并根据此比例调整 UI 元素大小，从而确保应用在各种设备上都能保持良好的显示效果。适用于需要快速、高效地完成多屏幕适配工作的 Android 开发场景，尤其适合那些希望减少适配成本同时保证用户体验一致性的开发者。",2,"2026-06-11 02:58:00","top_language"]