android字节跳动屏幕适配,GitHub - chen3441251/AndroidAutoSize: A low-cost Android screen adaptation solution ...

90475b86340a8c86d9aa7f413b296d0d.png

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a63656e7465722d76302e372e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265

68747470733a2f2f7472617669732d63692e6f72672f4a65737359616e436f64696e672f416e64726f69644175746f53697a652e7376673f6272616e63683d6d6173746572

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4150492d31342532422d626c75652e7376673f7374796c653d666c61742d737175617265

687474703a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c75652e7376673f7374796c653d666c61742d737175617265

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f417574686f722d4a65737359616e2d6f72616e67652e7376673f7374796c653d666c61742d737175617265

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5151e7bea42d3330313733333237382d6f72616e67652e7376673f7374796c653d666c61742d737175617265

A low-cost Android screen adaptation solution (今日头条屏幕适配方案终极版,一个极低成本的 Android 屏幕适配方案).

Overview

Pixel 2 XL | 1440 x 2880 | 560dpi:

8c8b7be3b35d74620df7fdea08047198.png

f41cc7b6fa37fbfc81fb6faf5fa699f9.png

143abf0f2edbf304f6d72348e077cf3b.png

Pixel XL | 1440 x 2560 | 560dpi:

1440x2560_width.png

d21c3577e78ee5d09171e5797cf72768.png

6efc872541868451e7c3ef9e2e811801.png

Nexus 5X | 1080 x 1920 | 420dpi:

362d2400f5a9e94b08acbd70a1fc6b31.png

1080x1920_height.png

5361a5da004729497c93df48ce8101d2.png

Nexus 4 | 768 x 1280 | 320dpi:

0f597939fe5fb0d8b90c84fac0b3dde7.png

768x1280_height.png

0dd0f1cf37127c0f9d5fdabfc3fc5dc5.png

Nexus S | 480 x 800 | 240dpi:

480x800_width.png

480x800_height.png

480x800_external.png

Notice

Download

implementation 'me.jessyan:autosize:0.7.0'

Usage (just one steps)

Step 1

Initialize in AndroidManifest:

android:name="design_width_in_dp"

android:value="360"/>

android:name="design_height_in_dp"

android:value="640"/>

Advance (see demo)

Customize the adaptation parameters of the Activity:

public class CustomAdaptActivity extends AppCompatActivity implements CustomAdapt {

@Override

public boolean isBaseOnWidth() {

return false;

}

@Override

public float getSizeInDp() {

return 667;

}

}

Cancel the adaptation of the Activity:

public class CancelAdaptActivity extends AppCompatActivity implements CancelAdapt {

}

ProGuard

-keep class me.jessyan.autosize.** { *; }

-keep interface me.jessyan.autosize.** { *; }

Donate

pay_alipay.jpgpay_wxpay.jpg

About Me

License

Copyright 2018, jessyan

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值