Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlinmigration #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
compileSdkVersion 28
buildToolsVersion "${androidBuildToolsVersion}"
defaultConfig {
applicationId "kaufland.com.demo"
minSdkVersion 17
targetSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -20,15 +20,15 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(path: ':swipelibrary')
compile "com.android.support:appcompat-v7:${androidSupportVersion}"
compile "com.android.support:design:${androidSupportVersion}"
compile "com.android.support:support-v4:${androidSupportVersion}"
compile "com.android.support:recyclerview-v7:${androidSupportVersion}"
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
testCompile "junit:junit:${jUnitVersion}"
implementation project(path: ':swipelibrary')
implementation "androidx.appcompat:appcompat:${androidSupportVersion}"
implementation "com.google.android.material:material:${androidSupportVersion}"
implementation "androidx.legacy:legacy-support-v4:${androidSupportVersion}"
implementation "androidx.recyclerview:recyclerview:${androidSupportVersion}"
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
testImplementation "junit:junit:${jUnitVersion}"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package kaufland.com.demo;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/kaufland/com/demo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package kaufland.com.demo;

import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.google.android.material.navigation.NavigationView;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/kaufland/com/demo/example/EasyExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -86,13 +86,13 @@ public void onClick(View view) {
view.findViewById(R.id.btn_open_left).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewById.openSwipe(SwipeLayout.LEFT_DRAG_VIEW);
mViewById.openSwipe(SwipeLayout.Companion.getLEFT_DRAG_VIEW());
}
});
view.findViewById(R.id.btn_open_right).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mViewById.openSwipe(SwipeLayout.RIGHT_DRAG_VIEW);
mViewById.openSwipe(SwipeLayout.Companion.getRIGHT_DRAG_VIEW());
}
});
view.findViewById(R.id.btn_disable_left_drag).setOnClickListener(new View.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package kaufland.com.demo.example;

import android.inputmethodservice.Keyboard;
import android.os.Looper;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import kaufland.com.demo.R;
Expand All @@ -19,7 +16,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Handler;

/**
* {@link RecyclerView.Adapter} that can display a {@link DummyItem} and makes a call to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import android.content.Context;
import android.os.Bundle;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -15,8 +14,6 @@
import kaufland.com.demo.example.dummy.DummyContent;
import kaufland.com.demo.example.dummy.DummyContent.DummyItem;

import java.util.List;

/**
* A fragment representing a list of Items.
* <p/>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand All @@ -14,7 +14,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<android.support.design.widget.NavigationView
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
Expand All @@ -23,4 +23,4 @@
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main2_drawer"/>

</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>
10 changes: 5 additions & 5 deletions app/src/main/res/layout/app_bar_main.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="kaufland.com.demo.MainActivity">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
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>

<FrameLayout
android:layout_width="match_parent"
android:paddingTop="?attr/actionBarSize"
android:id="@+id/content_main"
android:layout_height="match_parent"></FrameLayout>

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
28 changes: 14 additions & 14 deletions app/src/main/res/layout/easy_example_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
tools:context="kaufland.com.demo.MainActivity">


<kaufland.com.swipelibrary.SwipeLayout_
<kaufland.com.swipelibrary.SwipeLayout
android:layout_width="200dp"
android:id="@+id/example_1"
android:layout_height="wrap_content"
Expand All @@ -24,7 +24,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">

<kaufland.com.swipelibrary.DragView_
<kaufland.com.swipelibrary.DragView
android:layout_width="match_parent"
app:position="LEFT_DRAG_VIEW"
android:alpha="0.4"
Expand All @@ -35,9 +35,9 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Left Swipe"/>
</kaufland.com.swipelibrary.DragView_>
</kaufland.com.swipelibrary.DragView>

<kaufland.com.swipelibrary.SurfaceView_
<kaufland.com.swipelibrary.SurfaceView
android:layout_width="match_parent"
android:paddingTop="20dp"
android:paddingBottom="20dp"
Expand All @@ -49,9 +49,9 @@
android:layout_height="wrap_content"
android:text="Hello World!"/>

</kaufland.com.swipelibrary.SurfaceView_>
</kaufland.com.swipelibrary.SurfaceView>

<kaufland.com.swipelibrary.DragView_
<kaufland.com.swipelibrary.DragView
android:layout_width="match_parent"
app:position="RIGHT_DRAG_VIEW"
android:alpha="0.4"
Expand All @@ -62,11 +62,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Right Swipe"/>
</kaufland.com.swipelibrary.DragView_>
</kaufland.com.swipelibrary.SwipeLayout_>
</kaufland.com.swipelibrary.DragView>
</kaufland.com.swipelibrary.SwipeLayout>


<kaufland.com.swipelibrary.SwipeLayout_
<kaufland.com.swipelibrary.SwipeLayout
android:layout_width="match_parent"
android:id="@+id/example_optional"
android:layout_height="wrap_content"
Expand All @@ -76,7 +76,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">

<kaufland.com.swipelibrary.DragView_
<kaufland.com.swipelibrary.DragView
android:layout_width="wrap_content"
app:position="LEFT_DRAG_VIEW"
android:alpha="0.4"
Expand All @@ -101,9 +101,9 @@
android:layout_height="match_parent"
android:id="@+id/btn_add"
android:text="+"/>
</kaufland.com.swipelibrary.DragView_>
</kaufland.com.swipelibrary.DragView>

<kaufland.com.swipelibrary.SurfaceView_
<kaufland.com.swipelibrary.SurfaceView
android:layout_width="match_parent"
android:paddingTop="20dp"
android:paddingBottom="20dp"
Expand All @@ -115,8 +115,8 @@
android:layout_height="wrap_content"
android:text="Hello World!"/>

</kaufland.com.swipelibrary.SurfaceView_>
</kaufland.com.swipelibrary.SwipeLayout_>
</kaufland.com.swipelibrary.SurfaceView>
</kaufland.com.swipelibrary.SwipeLayout>



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/match_parent_example.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<kaufland.com.swipelibrary.SwipeLayout_
<kaufland.com.swipelibrary.SwipeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:weightSum="1"
Expand All @@ -10,7 +10,7 @@
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">

<kaufland.com.swipelibrary.DragView_
<kaufland.com.swipelibrary.DragView
android:layout_width="match_parent"
android:layout_weight="0.33"
app:bouncePossible="true"
Expand All @@ -32,9 +32,9 @@
android:layout_weight="1"
android:layout_height="match_parent"
android:text="Right Swipe"/>
</kaufland.com.swipelibrary.DragView_>
</kaufland.com.swipelibrary.DragView>

<kaufland.com.swipelibrary.SurfaceView_
<kaufland.com.swipelibrary.SurfaceView
android:layout_width="match_parent"
android:paddingTop="20dp"
android:layout_weight="0.33"
Expand All @@ -47,9 +47,9 @@
android:layout_height="wrap_content"
android:text="Hello World!"/>

</kaufland.com.swipelibrary.SurfaceView_>
</kaufland.com.swipelibrary.SurfaceView>

<kaufland.com.swipelibrary.DragView_
<kaufland.com.swipelibrary.DragView
android:layout_width="wrap_content"
android:layout_weight="0.33"
app:position="LEFT_DRAG_VIEW"
Expand All @@ -62,7 +62,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Left Swipe"/>
</kaufland.com.swipelibrary.DragView_>
</kaufland.com.swipelibrary.SwipeLayout_>
</kaufland.com.swipelibrary.DragView>
</kaufland.com.swipelibrary.SwipeLayout>

</merge>
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.31'
repositories {
jcenter()
google()
}
ext {
androidSupportVersion = '25.0.1'
androidBuildToolsVersion = '25.0.1'
androidSupportVersion = '1.0.0-beta01'
androidBuildToolsVersion = '28.0.3'
jUnitVersion = '4.12'
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -20,6 +23,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
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 Mar 29 10:26:33 CEST 2017
#Tue May 21 10:00:45 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
Loading