Skip to content

Commit

Permalink
Merge pull request #141 from flipkart-incubator/migrate-to-android-x
Browse files Browse the repository at this point in the history
Migrate to androidx
  • Loading branch information
adityasharat authored Mar 14, 2019
2 parents 7b7cf2d + e690ed0 commit a332d8c
Show file tree
Hide file tree
Showing 122 changed files with 347 additions and 273 deletions.
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
Expand All @@ -40,11 +40,13 @@ allprojects {

ext {
groupName = 'com.github.flipkart-incubator.proteus'
versionName = '5.0.0-snapshot'
versionCode = 500014
versionName = '5.0.0-rc15'
versionCode = 500015
compileSdkVersion = 28
minSdkVersion = 19
targetSdkVersion = 28
buildToolsVersion = '28.0.3'
supportLibraryVersion = '28.0.0'
supportLibraryVersion = '1.0.2'
}

apply plugin: 'maven-publish'
4 changes: 2 additions & 2 deletions cardview-v7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:cardview-v7:${rootProject.ext.supportLibraryVersion}"
api "com.android.support:appcompat-v7:${rootProject.ext.supportLibraryVersion}"
implementation "androidx.cardview:cardview:1.0.0"
api "androidx.appcompat:appcompat:${rootProject.ext.supportLibraryVersion}"
api project(path: ':proteus-core')

androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package com.flipkart.android.proteus.support.v7.widget;

import android.content.res.ColorStateList;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.CardView;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -31,6 +28,10 @@
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.cardview.widget.CardView;

/**
* CardViewParser
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

package com.flipkart.android.proteus.support.v7.widget;

import android.support.annotation.NonNull;
import android.support.v7.widget.CardView;
import android.view.View;

import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.ProteusView;

import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;

/**
* ProteusCardView
*
Expand Down
4 changes: 2 additions & 2 deletions data/layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
},
{
"type": "ImageView",
"src": "https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png",
"src": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png",
"layout_height": "70dp",
"layout_width": "120dp",
"padding": "4dp",
"background": "@color/colorPrimary",
"background": "#000000",
"scaleType": "fitCenter",
"layout_alignParentTop": true,
"layout_alignParentRight": true
Expand Down
17 changes: 7 additions & 10 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,13 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibraryVersion}"
implementation "com.android.support:design:${rootProject.ext.supportLibraryVersion}"
implementation 'com.github.tony19:logback-android-core:1.1.1-3'
implementation 'com.github.tony19:logback-android-classic:1.1.1-3'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation('com.github.bumptech.glide:glide:4.7.1') {
exclude group: "com.android.support"
}
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation "androidx.appcompat:appcompat:${rootProject.ext.supportLibraryVersion}"
implementation "com.google.android.material:material:1.0.0"
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor "androidx.annotation:annotation:${rootProject.ext.supportLibraryVersion}"
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

implementation project(':proteus-core')
implementation project(':gson-adapter')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.flipkart.android.proteus.demo;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -28,6 +26,9 @@
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* CircleViewParser
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -45,9 +39,16 @@
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Value;
import com.google.android.material.floatingactionbutton.FloatingActionButton;

import java.util.Map;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

public class ProteusActivity extends AppCompatActivity implements ProteusManager.Listener {

private ProteusManager proteusManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package com.flipkart.android.proteus.demo.api;

import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;

import com.flipkart.android.proteus.Proteus;
Expand All @@ -37,6 +35,8 @@
import java.util.Map;
import java.util.Set;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import retrofit2.Retrofit;

public class ProteusManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Build;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;

import com.flipkart.android.proteus.ProteusView;

import androidx.annotation.NonNull;

/**
* CircleView
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
package com.flipkart.android.proteus.demo.utils;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.flipkart.android.proteus.value.DrawableValue;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public class ImageLoaderTarget extends SimpleTarget<Drawable> {

@NonNull
Expand Down
12 changes: 6 additions & 6 deletions demo/src/main/res/layout/activity_proteus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@
~ limitations under the License.
-->

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>

<include layout="@layout/content_main" />

<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:srcCompat="@android:drawable/ic_dialog_info" />

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
4 changes: 2 additions & 2 deletions design/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "com.android.support:design:${rootProject.ext.supportLibraryVersion}"
api "com.android.support:appcompat-v7:${rootProject.ext.supportLibraryVersion}"
implementation "com.google.android.material:material:1.0.0"
api "androidx.appcompat:appcompat:${rootProject.ext.supportLibraryVersion}"
api project(path: ':proteus-core')

androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

package com.flipkart.android.proteus.support.design;


import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -33,11 +29,15 @@
import com.flipkart.android.proteus.processor.GravityAttributeProcessor;
import com.flipkart.android.proteus.processor.StringAttributeProcessor;
import com.flipkart.android.proteus.toolbox.Attributes;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import androidx.coordinatorlayout.widget.CoordinatorLayout;


/**
* DesignModuleAttributeHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -36,6 +33,10 @@
import com.flipkart.android.proteus.value.Resource;
import com.flipkart.android.proteus.value.StyleResource;
import com.flipkart.android.proteus.value.Value;
import com.google.android.material.appbar.AppBarLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* AppBarLayoutParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomNavigationView;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -34,6 +31,10 @@
import com.flipkart.android.proteus.value.Resource;
import com.flipkart.android.proteus.value.StyleResource;
import com.flipkart.android.proteus.value.Value;
import com.google.android.material.bottomnavigation.BottomNavigationView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* BottomNavigationViewParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package com.flipkart.android.proteus.support.design.widget;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.CollapsingToolbarLayout;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -33,6 +30,10 @@
import com.flipkart.android.proteus.processor.StringAttributeProcessor;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.google.android.material.appbar.CollapsingToolbarLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* CollapsingToolbarLayoutParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package com.flipkart.android.proteus.support.design.widget;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.CoordinatorLayout;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -30,6 +27,10 @@
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.coordinatorlayout.widget.CoordinatorLayout;

/**
* CoordinatorLayoutParser
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

import android.content.Context;
import android.content.res.ColorStateList;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.view.ViewGroup;

import com.flipkart.android.proteus.ProteusContext;
Expand All @@ -34,6 +31,10 @@
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Primitive;
import com.flipkart.android.proteus.value.Value;
import com.google.android.material.floatingactionbutton.FloatingActionButton;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* FloatingActionButtonParser
Expand Down
Loading

0 comments on commit a332d8c

Please sign in to comment.