├── Sample ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── activity_demo_list.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── item_demo_list.xml │ │ │ │ └── activity_demo.xml │ │ ├── java │ │ │ └── cn │ │ │ │ └── gavinliu │ │ │ │ └── android_scalelayout │ │ │ │ ├── DemoActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── DemoListActivity.java │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── cn │ │ └── gavinliu │ │ └── android_scalelayout │ │ └── ApplicationTest.java ├── build.gradle └── proguard-rules.pro ├── ScaleLayout ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── cn │ │ │ └── gavinliu │ │ │ └── android │ │ │ └── lib │ │ │ └── scale │ │ │ ├── config │ │ │ └── ScaleConfig.java │ │ │ ├── ScaleFrameLayout.java │ │ │ ├── ScaleRelativeLayout.java │ │ │ ├── ScaleLinearLayout.java │ │ │ └── helper │ │ │ └── ScaleLayoutHelper.java │ └── androidTest │ │ └── java │ │ └── cn │ │ └── gavinliu │ │ └── android │ │ └── lib │ │ └── scale │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── screenhot.png ├── .gitignore ├── README_zh.md └── README.md /Sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /ScaleLayout/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':Sample', ':ScaleLayout' 2 | -------------------------------------------------------------------------------- /Sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /screenhot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavinliu/Android-ScaleLayout/HEAD/screenhot.png -------------------------------------------------------------------------------- /ScaleLayout/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ScaleLayout 3 | 4 | -------------------------------------------------------------------------------- /Sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavinliu/Android-ScaleLayout/HEAD/Sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavinliu/Android-ScaleLayout/HEAD/Sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavinliu/Android-ScaleLayout/HEAD/Sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gavinliu/Android-ScaleLayout/HEAD/Sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Android-ScaleLayout 3 | 4 | Hello world! 5 | Settings 6 | 7 | -------------------------------------------------------------------------------- /Sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ScaleLayout/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sample/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /Sample/src/main/res/layout/activity_demo_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /Sample/src/androidTest/java/cn/gavinliu/android_scalelayout/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package cn.gavinliu.android_scalelayout; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /ScaleLayout/src/androidTest/java/cn/gavinliu/android/lib/scale/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package cn.gavinliu.android.lib.scale; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /Sample/src/main/java/cn/gavinliu/android_scalelayout/DemoActivity.java: -------------------------------------------------------------------------------- 1 | package cn.gavinliu.android_scalelayout; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | /** 8 | * Created by Gavin on 2016/11/20. 9 | */ 10 | 11 | public class DemoActivity extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(@Nullable Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_demo); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.1" 6 | 7 | defaultConfig { 8 | applicationId "cn.gavinliu.android_scalelayout" 9 | minSdkVersion 9 10 | targetSdkVersion 24 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | // compile project(':ScaleLayout') 24 | compile 'cn.gavinliu.android.lib:ScaleLayout:1.0.4' 25 | 26 | compile 'com.android.support:appcompat-v7:24.2.0' 27 | } 28 | -------------------------------------------------------------------------------- /Sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/gavin/Develop/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /ScaleLayout/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/gavin/Develop/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /Sample/src/main/java/cn/gavinliu/android_scalelayout/MainApplication.java: -------------------------------------------------------------------------------- 1 | package cn.gavinliu.android_scalelayout; 2 | 3 | import android.app.Application; 4 | 5 | import cn.gavinliu.android.lib.scale.config.ScaleConfig; 6 | 7 | /** 8 | * Created by Gavin on 16-11-10. 9 | */ 10 | 11 | public class MainApplication extends Application { 12 | 13 | @Override 14 | public void onCreate() { 15 | super.onCreate(); 16 | ScaleConfig.create(this, 17 | 1080, // Design Width 18 | 1920, // Design Height 19 | 3, // Design Density 20 | 3, // Design FontScale 21 | ScaleConfig.DIMENS_UNIT_DP); 22 | ScaleConfig.getInstance().setDebug(true); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Sample/src/main/java/cn/gavinliu/android_scalelayout/MainActivity.java: -------------------------------------------------------------------------------- 1 | package cn.gavinliu.android_scalelayout; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.view.View; 7 | 8 | public class MainActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_main); 14 | } 15 | 16 | public void demo(View view) { 17 | Intent intent = new Intent(this, DemoActivity.class); 18 | startActivity(intent); 19 | } 20 | 21 | public void demoList(View view) { 22 | Intent intent = new Intent(this, DemoListActivity.class); 23 | startActivity(intent); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /Sample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 |