From 4be03a5a32b79dd1e218b6a3111f8848d67dd9c5 Mon Sep 17 00:00:00 2001 From: Dasser Basyouni Date: Fri, 13 Jul 2018 00:33:33 +0200 Subject: [PATCH] Small Updates + updated: - gradle (dependency and wrapper) - some libraries + added "LoadHeaderImageFromNetworkActivity" to Manifest + removed some of redundant cast --- build.gradle | 3 +- coordinatortablayout/build.gradle | 24 ++++--- coordinatortablayout/coordinatortablayout.iml | 68 +++++++++++-------- .../CoordinatorTabLayout.java | 8 +-- gradle/wrapper/gradle-wrapper.properties | 4 +- sample/build.gradle | 28 +++++--- sample/src/main/AndroidManifest.xml | 1 + .../LoadHeaderImageFromNetworkActivity.java | 2 +- .../MainActivity.java | 6 +- 9 files changed, 82 insertions(+), 62 deletions(-) diff --git a/build.gradle b/build.gradle index 41b563e..abda072 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6' classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.0.0" classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' } @@ -15,6 +15,7 @@ buildscript { allprojects { repositories { jcenter() + google() } } diff --git a/coordinatortablayout/build.gradle b/coordinatortablayout/build.gradle index 756895d..35bef25 100644 --- a/coordinatortablayout/build.gradle +++ b/coordinatortablayout/build.gradle @@ -5,12 +5,12 @@ apply plugin: 'com.jfrog.bintray' version = "1.2.2" android { - compileSdkVersion 25 - buildToolsVersion '26.0.2' + compileSdkVersion 27 + buildToolsVersion '27.0.3' defaultConfig { minSdkVersion 15 - targetSdkVersion 25 + targetSdkVersion 27 versionCode 10 versionName "1.2.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -25,13 +25,17 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - compile 'com.android.support:appcompat-v7:25.3.1' - compile 'com.android.support:design:25.3.1' - testCompile 'junit:junit:4.12' + implementation fileTree(dir: 'libs', include: ['*.jar']) + def supportLibraries_version = '27.1.1' + + // support libraries + implementation "com.android.support:appcompat-v7:$supportLibraries_version" + implementation "com.android.support:design:$supportLibraries_version" + + // testing libraries + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' }) + testImplementation 'junit:junit:4.12' } def siteUrl = 'https://github.com/hugeterry/CoordinatorTabLayout' diff --git a/coordinatortablayout/coordinatortablayout.iml b/coordinatortablayout/coordinatortablayout.iml index b624dfa..ad5fe45 100644 --- a/coordinatortablayout/coordinatortablayout.iml +++ b/coordinatortablayout/coordinatortablayout.iml @@ -86,8 +86,6 @@ - - @@ -96,42 +94,52 @@ + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/coordinatortablayout/src/main/java/cn/hugeterry/coordinatortablayout/CoordinatorTabLayout.java b/coordinatortablayout/src/main/java/cn/hugeterry/coordinatortablayout/CoordinatorTabLayout.java index fc9892a..3f3043b 100644 --- a/coordinatortablayout/src/main/java/cn/hugeterry/coordinatortablayout/CoordinatorTabLayout.java +++ b/coordinatortablayout/src/main/java/cn/hugeterry/coordinatortablayout/CoordinatorTabLayout.java @@ -70,9 +70,9 @@ public CoordinatorTabLayout(Context context, AttributeSet attrs, int defStyleAtt private void initView(Context context) { LayoutInflater.from(context).inflate(R.layout.view_coordinatortablayout, this, true); initToolbar(); - mCollapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsingtoolbarlayout); - mTabLayout = (TabLayout) findViewById(R.id.tabLayout); - mImageView = (ImageView) findViewById(R.id.imageview); + mCollapsingToolbarLayout = findViewById(R.id.collapsingtoolbarlayout); + mTabLayout = findViewById(R.id.tabLayout); + mImageView = findViewById(R.id.imageview); } private void initWidget(Context context, AttributeSet attrs) { @@ -94,7 +94,7 @@ private void initWidget(Context context, AttributeSet attrs) { } private void initToolbar() { - mToolbar = (Toolbar) findViewById(R.id.toolbar); + mToolbar = findViewById(R.id.toolbar); ((AppCompatActivity) mContext).setSupportActionBar(mToolbar); mActionbar = ((AppCompatActivity) mContext).getSupportActionBar(); } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dc8b061..06831ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Dec 31 16:08:46 CST 2017 +#Tue Jul 10 15:12:21 EET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/sample/build.gradle b/sample/build.gradle index 00f447d..57acf41 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion '26.0.2' + compileSdkVersion 27 + buildToolsVersion '27.0.3' defaultConfig { applicationId "cn.hugeterry.coordinatortablayout" minSdkVersion 15 - targetSdkVersion 25 + targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -20,13 +20,19 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - compile 'com.android.support:appcompat-v7:25.3.1' - testCompile 'junit:junit:4.12' + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation project(':coordinatortablayout') + def supportLibraries_version = '27.1.1' - compile project(':coordinatortablayout') - compile 'com.github.bumptech.glide:glide:3.7.0' + // support + implementation "com.android.support:appcompat-v7:$supportLibraries_version" + implementation "com.android.support:design:$supportLibraries_version" + + // glide + implementation 'com.github.bumptech.glide:glide:3.7.0' + + // testing libraries + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' }) + testImplementation 'junit:junit:4.12' } diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 1b58ae0..a51f351 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -17,6 +17,7 @@ + \ No newline at end of file diff --git a/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/LoadHeaderImageFromNetworkActivity.java b/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/LoadHeaderImageFromNetworkActivity.java index 9c8a6fc..7ff03e7 100644 --- a/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/LoadHeaderImageFromNetworkActivity.java +++ b/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/LoadHeaderImageFromNetworkActivity.java @@ -43,7 +43,7 @@ protected void onCreate(Bundle savedInstanceState) { android.R.color.holo_orange_light, android.R.color.holo_green_light}; - mCoordinatorTabLayout = (CoordinatorTabLayout) findViewById(R.id.coordinatortablayout); + mCoordinatorTabLayout = findViewById(R.id.coordinatortablayout); mCoordinatorTabLayout.setTranslucentStatusBar(this) .setTitle("Demo") .setBackEnable(true) diff --git a/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/MainActivity.java b/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/MainActivity.java index 2b2cb4e..95e9fab 100644 --- a/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/MainActivity.java +++ b/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/MainActivity.java @@ -1,9 +1,9 @@ package cn.hugeterry.coordinatortablayoutdemo; +import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; @@ -38,7 +38,7 @@ protected void onCreate(Bundle savedInstanceState) { android.R.color.holo_orange_light, android.R.color.holo_green_light}; - mCoordinatorTabLayout = (CoordinatorTabLayout) findViewById(R.id.coordinatortablayout); + mCoordinatorTabLayout = findViewById(R.id.coordinatortablayout); mCoordinatorTabLayout.setTranslucentStatusBar(this) .setTitle("Demo") .setBackEnable(true) @@ -54,7 +54,7 @@ private void initFragments() { } private void initViewPager() { - mViewPager = (ViewPager) findViewById(R.id.vp); + mViewPager = findViewById(R.id.vp); mViewPager.setOffscreenPageLimit(4); mViewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(), mFragments, mTitles)); }