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

Convert the project to androidx. #436

Merged
merged 2 commits into from Jun 11, 2018

Conversation

Projects
None yet
4 participants
@thagikura
Member

thagikura commented Jun 8, 2018

Here are the steps I did for the conversion.

Used Android Studio 3.2 canary 17

Auto conversion to androdx

  1. Changed the targetSdkVersion and compileSdkVersion to 28
  2. From Android Studio, navigated to "Refactor -> Refactor to AndroidX"

Manual changes

  1. Trimmed the leading package name (e.g. androidx.recyclerview.widget.RecyclerView -> RecyclerView in files where it's already imported)
  2. Added "androidx.test:rules:1.1.0-alpha3" for a dependency
    (com.android.support.test:runner was there before the conversion, but some classes are now provided by a different dependency like "ActivityTestRule")
  3. In build.gradle files, defined duplicate versions through variables.
    (e.g. 1.0.0-alpha3 for the androidxCoreVersion)
  4. Handled API changes
  • LayoutManager.getChildAt is now nullable

These issues need be addressed by the conversion tool. I'll file these
as issues.

  1. double quotations were replaced by single quotations in the dependencies in build.gradle. It's going to be an issue if the versions are defined through variables.
  2. Unneeded leading package names.
    e.g.
    val navigationView: com.google.android.material.navigation.NavigationView = findViewById(R.id.nav_view)
    Should be
    val navigationView: NavigationView = findViewById(R.id.nav_view)
  3. Add a missing dependency automatically? Like androidx.test.rules.
Convert the project to androidx.
Here are the steps I did for the conversion.

Used Android Studio 3.2 canary 17

Auto conversion to androdx
1. Changed the targetSdkVersion and compileSdkVersion to 28
2. From Android Studio, navigated to "Refactor -> Refactor to AndroidX"

Manual changes
1. Trimmed the leading package name (e.g. androidx.recyclerview.widget.RecyclerView -> RecyclerView in files where it's already imported)
2. Added "androidx.test:rules:1.1.0-alpha3" for a dependency
   (com.android.support.test:runner was there before the conversion, but some classes are now provided by a different dependency like "ActivityTestRule")
3. In build.gradle files, defined duplicate versions through variables.
   (e.g. 1.0.0-alpha3 for the androidxCoreVersion)
4. Handled API changes
  - LayoutManager.getChildAt is now nullable

These issues need be addressed by the conversion tool. I'll file these
as issues.
1. double quotations were replaced by single quotations in the dependencies in build.gradle. It's going to be an issue if the versions are defined through variables.
2. Unneeded leading package names.
    e.g.
val navigationView: com.google.android.material.navigation.NavigationView = findViewById(R.id.nav_view)
  Should be
val navigationView: NavigationView = findViewById(R.id.nav_view)
3. Add a missing dependency automatically? Like androidx.test.rules.

@thagikura thagikura force-pushed the jetpack branch from f5e7320 to b931a12 Jun 8, 2018

@thagikura thagikura requested a review from yaraki Jun 8, 2018

@TWiStErRob

This comment has been minimized.

@thagikura just poking around, noticed: unnecessary qualification

This comment has been minimized.

Member

thagikura replied Jun 10, 2018

Oh thanks! Fixed in a follow up commit.

@TWiStErRob

This comment has been minimized.

Member

thagikura replied Jun 10, 2018

Done. Thanks.

@yaraki

yaraki approved these changes Jun 11, 2018

@thagikura thagikura merged commit a208337 into master Jun 11, 2018

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed

@thagikura thagikura added this to the 1.1 milestone Jun 11, 2018

@thagikura thagikura referenced this pull request Jun 11, 2018

Closed

FlexboxLayoutManager for AndroidX #433

1 of 1 task complete

@thagikura thagikura modified the milestones: 1.1, 1.1-alpha Jun 11, 2018

@ebraminio

This comment has been minimized.

ebraminio commented Jul 14, 2018

Hey guys, can you make a beta release with AndroidX? We like to use FlexBox with AndroidX but our bot doesn't like it https://travis-ci.org/ebraminio/DroidPersianCalendar/builds/403957063#L1754 apparently.

@thagikura thagikura deleted the jetpack branch Jul 19, 2018

thagikura added a commit that referenced this pull request Sep 25, 2018

Convert the project to androidx. (#436)
* Convert the project to androidx.

Here are the steps I did for the conversion.

Used Android Studio 3.2 canary 17

Auto conversion to androdx
1. Changed the targetSdkVersion and compileSdkVersion to 28
2. From Android Studio, navigated to "Refactor -> Refactor to AndroidX"

Manual changes
1. Trimmed the leading package name (e.g. androidx.recyclerview.widget.RecyclerView -> RecyclerView in files where it's already imported)
2. Added "androidx.test:rules:1.1.0-alpha3" for a dependency
   (com.android.support.test:runner was there before the conversion, but some classes are now provided by a different dependency like "ActivityTestRule")
3. In build.gradle files, defined duplicate versions through variables.
   (e.g. 1.0.0-alpha3 for the androidxCoreVersion)
4. Handled API changes
  - LayoutManager.getChildAt is now nullable
5. Optimized import order

These issues need be addressed by the conversion tool. I'll file these
as issues.
1. double quotations were replaced by single quotations in the dependencies in build.gradle. It's going to be an issue if the versions are defined through variables.
2. Unneeded leading package names.
    e.g.
val navigationView: com.google.android.material.navigation.NavigationView = findViewById(R.id.nav_view)
  Should be
val navigationView: NavigationView = findViewById(R.id.nav_view)
3. Add a missing dependency automatically? Like androidx.test.rules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment