Skip to content

Commit

Permalink
FixedCompilingIssues+more
Browse files Browse the repository at this point in the history
Fixed issue gabrielemariotti#566 opened 16 days ago by @gipsyblues
+Upgraded to the latest available sdks & library as per the requirement of Android Studio Version. 3.0.3
+Refactored code, especially redundant Casting
  • Loading branch information
oplarshad committed Mar 10, 2018
1 parent d803848 commit ef39a99
Show file tree
Hide file tree
Showing 40 changed files with 165 additions and 197 deletions.
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
buildscript {
repositories {
mavenCentral()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.2.0'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

ext {
compileSdkVersion = 22
buildToolsVersion = "22.0.1"
compileSdkVersion = 27
buildToolsVersion = "27.0.2"
}

def isReleaseBuild() {
Expand All @@ -24,6 +25,7 @@ allprojects {

repositories {
mavenCentral()
google()
}
}

Expand Down
19 changes: 10 additions & 9 deletions demo/extras/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
Expand Down Expand Up @@ -49,22 +49,22 @@ dependencies {
compile project(':extra:extra-dragdrop')

// Support Libraries
compile 'com.android.support:support-v4:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'

//OkHttp
//temporary patch for android-L for Okio packaging problem (see https://gist.github.com/JakeWharton/017738659d4f38adedc2)
//compile fileTree(dir: 'libs', include: 'repackaged-*.jar')
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.7.2'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
//Picasso
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.picasso:picasso:2.5.2'

//Ion
//compile 'com.koushikdutta.ion:ion:1.3.1'

//universal-image-loader
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

//Actionbar pull to refresh
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.9.9'
Expand All @@ -83,7 +83,8 @@ dependencies {
compile ('se.emilsjolander:stickylistheaders:2.5.0')

//Weather Lib
compile 'com.survivingwithandroid:weatherlib:1.3.2'
// compile 'com.survivingwithandroid:weatherlib:1.3.2'
compile 'com.survivingwithandroid:weatherlib:1.6.0'

// Fading ActionBar
//compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar:3.0.0'
Expand All @@ -94,7 +95,7 @@ dependencies {
compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.1'

//FAB
compile 'com.melnykov:floatingactionbutton:1.0.6'
compile 'com.melnykov:floatingactionbutton:1.3.0'
}


Expand Down
8 changes: 4 additions & 4 deletions demo/stock/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)

Expand Down Expand Up @@ -46,8 +46,8 @@ dependencies {
compile project(':library-cards')
compile project(':library-recyclerview')
// Support Libraries
compile 'com.android.support:support-v4:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'

//androidTestCompile 'com.jakewharton.espresso:espresso:1.1-r2'
}
Expand Down
6 changes: 3 additions & 3 deletions extra/extra-dragdrop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
Expand All @@ -31,4 +31,4 @@ dependencies {
}

// Used to update in Maven
//apply from: '../../maven_push.gradle'
apply from: '../../maven_push.gradle'
6 changes: 3 additions & 3 deletions extra/extra-staggeredgrid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
Expand All @@ -30,4 +30,4 @@ dependencies {
}

// Used to update in Maven
//apply from: '../../maven_push.gradle'
apply from: '../../maven_push.gradle'
6 changes: 3 additions & 3 deletions extra/extra-twoway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
Expand All @@ -35,4 +35,4 @@ dependencies {
}

// Used to update in Maven
//apply from: '../maven_push.gradle'
apply from: '../../maven_push.gradle'
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 14 23:06:53 CET 2015
#Wed Mar 07 18:47:06 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
8 changes: 4 additions & 4 deletions library-cards/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
Expand All @@ -26,8 +26,8 @@ dependencies {
compile project(':library-core')

//Annotation
compile 'com.android.support:support-annotations:22.1.1'
compile 'com.android.support:support-annotations:27.1.0'
}

// Used to update in Maven
//apply from: '../maven_push.gradle'
apply from: '../maven_push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public BaseMaterialCard(Context context, int innerLayout) {
protected View buildSupplementalActions() {

if (getLayout_supplemental_actions_id() != INVALID_SUPPLEMENTAL_ACTIONS_LAYOUT) {
ViewStub stub = (ViewStub) ((View) getCardView()).findViewById(R.id.card_supplemental_actions_vs);
ViewStub stub = ((View) getCardView()).findViewById(R.id.card_supplemental_actions_vs);
if (stub != null) {
stub.setLayoutResource(getLayout_supplemental_actions_id());
return stub.inflate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class MaterialLargeImageCard extends BaseMaterialCard {
*/
protected CharSequence mSubTitle;

public static interface DrawableExternal{
public interface DrawableExternal{
void setupInnerViewElements(ViewGroup parent, View viewImage);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ public void setupInnerViewElements(ViewGroup parent, View view) {

//Add a simple subtitle
if (view != null) {
TextView mTitleView = (TextView) view.findViewById(R.id.card_main_inner_simple_subtitle);
TextView mTitleView = view.findViewById(R.id.card_main_inner_simple_subtitle);
if (mTitleView != null)
mTitleView.setText(mSubTitle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void setupInnerViewElements(ViewGroup parent, View imageView) {
}

//Title over the image
mTitleOverImageView = (TextView) parent.findViewById(default_text_id);
mTitleOverImageView = parent.findViewById(default_text_id);
buildTextOverImage();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ public void setupInnerViewElements(ViewGroup parent, View view) {
ViewHolder holder = (ViewHolder) view.getTag();
if (holder == null) {
holder = new ViewHolder();
holder.mLinearLayoutContainer = (LinearLayout) view.findViewById(R.id.card_main_inner_topcolored_layout);
holder.mTitleView = (TextView) view.findViewById(R.id.card_main_inner_topcolored_title);
holder.mSubTitleView = (TextView) view.findViewById(R.id.card_main_inner_topcolored_subtitle);
holder.mLinearLayoutContainer = view.findViewById(R.id.card_main_inner_topcolored_layout);
holder.mTitleView = view.findViewById(R.id.card_main_inner_topcolored_title);
holder.mSubTitleView = view.findViewById(R.id.card_main_inner_topcolored_subtitle);
View viewStub = ((View)getCardView()).findViewById(R.id.card_halfcolored_secondhalf);
if (viewStub != null) {
((ViewStub)viewStub).setLayoutResource(mSecondHalfViewStubLayoutId);
Expand Down Expand Up @@ -250,7 +250,7 @@ protected void setupInnerViewElementsSecondHalf(View secondHalfView){
if (mOnSetupInnerElements != null)
mOnSetupInnerElements.setupInnerViewElementsSecondHalf(secondHalfView);

};
}


/**
Expand Down
17 changes: 11 additions & 6 deletions library-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
targetSdkVersion 22
minSdkVersion 16
targetSdkVersion 27
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
Expand All @@ -19,18 +19,23 @@ android {
lintOptions {
abortOnError false
}
buildToolsVersion '26.0.3'
}

dependencies {
//CardView
compile 'com.android.support:cardview-v7:22.1.1'
//noinspection GradleCompatible
compile 'com.android.support:cardview-v7:27.1.0'

//Support lib
compile 'com.android.support:support-v4:22.1.1'
compile 'com.android.support:support-v4:27.1.0'

//Annotation
compile 'com.android.support:support-annotations:22.1.1'
compile 'com.android.support:support-annotations:27.1.0'
compile 'com.survivingwithandroid:weatherlib:1.6.0'
compile 'com.survivingwithandroid:weatherlib_volleyclient:1.6.0'
compile 'com.mcxiaoke.volley:library:1.0.6@aar'
}

// Used to update in Maven
//apply from: '../maven_push.gradle'
apply from: '../maven_push.gradle'
3 changes: 2 additions & 1 deletion library-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="it.gmariotti.cardslib.library">

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="27"/>

<application>

Expand Down

0 comments on commit ef39a99

Please sign in to comment.