Skip to content

Commit

Permalink
Migrate to AndroidX
Browse files Browse the repository at this point in the history
  • Loading branch information
k-kagurazaka committed Oct 18, 2018
1 parent 04ed452 commit 2bdf658
Show file tree
Hide file tree
Showing 129 changed files with 254 additions and 251 deletions.
2 changes: 1 addition & 1 deletion annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8

dependencies {
compileOnly "com.android.support:support-annotations:${SUPPORT_LIBRARY_VERSION}"
compileOnly "androidx.annotation:annotation:${ANDROIDX_ANNOTATION_VERSION}"
}

archivesBaseName = 'orma-annotations'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.github.gfx.android.orma.annotation;

import android.support.annotation.LongDef;
import androidx.annotation.LongDef;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.github.gfx.android.orma.annotation;

import android.support.annotation.RestrictTo;
import androidx.annotation.RestrictTo;

/**
* Indicates the feature is in experimental state: its existence, signature or behavior
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.github.gfx.android.orma.annotation;

import android.support.annotation.IntDef;
import androidx.annotation.IntDef;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ ext {
MIN_SDK_VERSION = 15
SDK_VERSION = 28
BUILD_TOOLS_VERSION = '28.0.3'
SUPPORT_LIBRARY_VERSION = '28.0.0'
ANDROIDX_CORE_VERSION = '1.0.0'
ANDROIDX_ANNOTATION_VERSION = '1.0.0'
ANDROIDX_RECYCLERVIEW_VERSION = '1.0.0'
ANDROID_JAR = fileTree(dir: "${ANDROID_SDK_PATH}/platforms/android-${SDK_VERSION}/", include: 'android.jar')
metadata.version = versionName
}
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}
buildTypes {
Expand All @@ -44,7 +44,7 @@ android {
}

dependencies {
api "com.android.support:support-annotations:${SUPPORT_LIBRARY_VERSION}"
api "androidx.annotation:annotation:${ANDROIDX_ANNOTATION_VERSION}"
}

archivesBaseName = 'orma-core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.github.gfx.android.orma.core;

import android.content.Context;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

public interface DatabaseProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.os.Build;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

public class DefaultDatabase implements Database {

Expand Down
4 changes: 2 additions & 2 deletions encryption/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
targetSdkVersion SDK_VERSION
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

consumerProguardFiles 'proguard-rules.pro'
}
Expand Down Expand Up @@ -40,7 +40,7 @@ android {
dependencies {
api project(':core')

api "com.android.support:support-annotations:${SUPPORT_LIBRARY_VERSION}"
api "androidx.annotation:annotation:${ANDROIDX_ANNOTATION_VERSION}"

// https://github.com/sqlcipher/android-database-sqlcipher
implementation 'net.zetetic:android-database-sqlcipher:3.5.9'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.text.TextUtils;

import java.io.File;
Expand Down
8 changes: 4 additions & 4 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ dependencies {
implementation project(':core')
implementation project(':library')
implementation project(':encryption')
implementation "com.android.support:appcompat-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:cardview-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:design:${SUPPORT_LIBRARY_VERSION}"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.jakewharton.threetenabp:threetenabp:1.0.5'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
Expand Down
5 changes: 2 additions & 3 deletions example/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
-dontwarn java.lang.instrument.**
-dontwarn java.lang.invoke.**

# Android Support Library
-keep class android.support.** { *; }
-keep class android.databinding.** { *; }
# AndroidX
-keep class androidx.** { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,30 @@
*/
package com.github.gfx.android.orma.example.activity;

import com.google.android.material.navigation.NavigationView;

import com.github.gfx.android.orma.example.R;
import com.github.gfx.android.orma.example.databinding.ActivityMainBinding;
import com.github.gfx.android.orma.example.fragment.BenchmarkFragment;
import com.github.gfx.android.orma.example.fragment.ListViewFragment;
import com.github.gfx.android.orma.example.fragment.MainFragment;
import com.github.gfx.android.orma.example.fragment.RecyclerViewFragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
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 android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GravityCompat;
import androidx.databinding.DataBindingUtil;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;

public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
import org.threeten.bp.ZonedDateTime;

import android.content.Context;
import android.databinding.DataBindingUtil;
import androidx.databinding.DataBindingUtil;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@

import org.threeten.bp.ZonedDateTime;

import android.databinding.DataBindingUtil;
import androidx.databinding.DataBindingUtil;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import org.threeten.bp.ZonedDateTime;

import android.content.Context;
import android.databinding.DataBindingUtil;
import androidx.databinding.DataBindingUtil;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.github.gfx.android.orma.annotation.Setter;
import com.github.gfx.android.orma.annotation.Table;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;


@Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.github.gfx.android.orma.annotation.Setter;
import com.github.gfx.android.orma.annotation.Table;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;

@Table
public class Item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZonedDateTime;

import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

/**
* To demonstrate multiple associations to the same model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import com.github.gfx.android.orma.annotation.PrimaryKey;
import com.github.gfx.android.orma.annotation.Table;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.Date;

Expand Down
16 changes: 8 additions & 8 deletions example/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,46 @@
tools:showIn="@layout/activity_main"
>

<android.support.v4.widget.DrawerLayout
<androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
>

<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.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:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

<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 @@ -55,5 +55,5 @@
app:menu="@menu/activity_main_drawer"
/>

</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>
</layout>
4 changes: 2 additions & 2 deletions example/src/main/res/layout/card_todo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:card_view="http://schemas.android.com/tools"
>

<android.support.v7.widget.CardView
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
Expand Down Expand Up @@ -39,5 +39,5 @@


</LinearLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
</layout>
2 changes: 1 addition & 1 deletion example/src/main/res/layout/fragment_list_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:paddingTop="@dimen/activity_vertical_margin"
/>

<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"
Expand Down
6 changes: 3 additions & 3 deletions example/src/main/res/layout/fragment_recycler_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_height="match_parent"
>

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -19,10 +19,10 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
/>

<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"
Expand Down
Loading

0 comments on commit 2bdf658

Please sign in to comment.