All Projects → JessYanCoding → Androidautosize

JessYanCoding / Androidautosize

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

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidautosize

Retrofiturlmanager
🔮 Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime (以最简洁的 Api 让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl).
Stars: ✭ 1,961 (-83.74%)
Mutual labels:  mvparms, arms
Armscomponent
📦 A complete android componentization solution, powered by MVPArms (MVPArms 官方快速组件化方案).
Stars: ✭ 1,664 (-86.2%)
Mutual labels:  mvparms, arms
Progressmanager
⏳ Listen the progress of downloading and uploading in Okhttp, compatible Retrofit and Glide (一行代码即可监听 App 中所有网络链接的上传以及下载进度, 包括 Glide 的图片加载进度).
Stars: ✭ 2,463 (-79.58%)
Mutual labels:  mvparms, arms
Mvparms
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Stars: ✭ 10,146 (-15.86%)
Mutual labels:  mvparms, arms
Wanandroid
🐔🏀【停止维护,已使用Jetpack+Mvvm重构】根据鸿神提供的WanAndroid开放Api来制作的产品级玩安卓App,采用Kotlin语言,基于Material Design+AndroidX +MVP+RxJava+Retrofit等框架开发,注释超详细,方便大家练手
Stars: ✭ 674 (-94.41%)
Mutual labels:  mvparms
pyXSteam
Python library for calculating properties of Steam and Water
Stars: ✭ 32 (-99.73%)
Mutual labels:  density
Android-Alarm
This repository is an Alarm application, demonstrate how to use multiple pending intent to set alarm's time wake up. use popup menu, RecyclerView Adapter, use SQLite to store data
Stars: ✭ 25 (-99.79%)
Mutual labels:  adapterview
Li-MVPArms
这个项目会持续更新
Stars: ✭ 17 (-99.86%)
Mutual labels:  mvparms
Diycodeandroid
a Third-party Android App of DiyCode Community
Stars: ✭ 75 (-99.38%)
Mutual labels:  mvparms
Androidproject
Android 技术中台,但愿人长久,搬砖不再有
Stars: ✭ 4,398 (-63.53%)
Mutual labels:  mvparms
Armscomponent Template
🛠️ 一键搭建 ArmsComponent 快速组件化方案的整体组件架构, 让新手也可以一秒开始组件化项目, 开发神器, 让您一秒起飞, 体验纯傻瓜式的组件化开发, 避免组件化从入门到放弃!
Stars: ✭ 339 (-97.19%)
Mutual labels:  mvparms
DBSCANSD
Java implementation for DBSCANSD, a trajectory clustering algorithm.
Stars: ✭ 35 (-99.71%)
Mutual labels:  density
Mvparmstemplate
🛠️ A template for Android Studio to create MVPArms and MVPArt Page
Stars: ✭ 697 (-94.22%)
Mutual labels:  mvparms
MVPArmsTemplatePlugin
这是一个用于一键生成MVPArms相关代码的插件,和MVPArmsTemplate全家桶功能基本一致,兼容Android Studio4.1+
Stars: ✭ 22 (-99.82%)
Mutual labels:  mvparms
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (-99.17%)
Mutual labels:  mvparms
crowd density segmentation
The code for preparing the training data for crowd counting / segmentation algorithm.
Stars: ✭ 21 (-99.83%)
Mutual labels:  density
Basepro
使用MVPArms框架搭建的一个基类工程,便于日常项目开发。
Stars: ✭ 41 (-99.66%)
Mutual labels:  mvparms
Machine-Learning-for-Asset-Managers
Implementation of code snippets, exercises and application to live data from Machine Learning for Asset Managers (Elements in Quantitative Finance) written by Prof. Marcos López de Prado.
Stars: ✭ 168 (-98.61%)
Mutual labels:  density
Mvvmarms
Android MVVM Architecture Components based on MVPArms and Android Architecture Components.
Stars: ✭ 425 (-96.48%)
Mutual labels:  mvparms
Yangyannew
精简看美图
Stars: ✭ 141 (-98.83%)
Mutual labels:  mvparms

Logo Official

Latest Stable Version Build Status Min Sdk Version License Author QQ Group

中文说明

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

Overview

Pixel 2 XL | 1440 x 2880 | 560dpi:

Pixel XL | 1440 x 2560 | 560dpi:

Nexus 5X | 1080 x 1920 | 420dpi:

Nexus 4 | 768 x 1280 | 320dpi:

Nexus S | 480 x 800 | 240dpi:

Notice

Download

Jcenter ( ⚠️ DEPRECATION WARNING: the JCenter repository will keep serving packages until February 1st, 2022):

 implementation 'me.jessyan:autosize:1.2.1'

JitPack:

Step 1. Add the JitPack repository in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'
}

Usage

Step 1 (just one steps)

  • 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
<manifest>
    <application>            
        <meta-data
            android:name="design_width_in_dp"
            android:value="360"/>
        <meta-data
            android:name="design_height_in_dp"
            android:value="640"/>           
     </application>           
</manifest>

Preview

  • 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

  • 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 theme

  • Virtual device creation method create step

DP

  • 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))/dpi and create an virtual device (write screen size and resolution only) dp

PT

  • 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))/72 and create an virtual device (write screen size and resolution only) pt

IN

  • 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) in

MM

  • 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))/25.4 and create an virtual device (write screen size and resolution only) mm

Advance (see demo)

Activity

  • 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 {

}

Fragment

  • First enable the ability to support Fragment custom parameters
AutoSizeConfig.getInstance().setCustomFragment(true);
  • Customize the adaptation parameters of the Fragment:
public class CustomAdaptFragment extends Fragment implements CustomAdapt {

    @Override
    public boolean isBaseOnWidth() {
        return false;
    }

    @Override
    public float getSizeInDp() {
        return 667;
    }
}
  • Cancel the adaptation of the Fragment:
public class CancelAdaptFragment extends Fragment implements CancelAdapt {

}

Subunits (see demo-subunits)

  • 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
AutoSizeConfig.getInstance().getUnitsManager()
        .setSupportDP(false)
        .setSupportSP(false)
        .setSupportSubunits(Subunits.MM);

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].