Skip to content

Commit

Permalink
Merge pull request #461 from google/update_build_gradle_version_3.2
Browse files Browse the repository at this point in the history
Merge the androidx to master
  • Loading branch information
thagikura authored Sep 25, 2018
2 parents 80cd42e + c3a569f commit 9db6bb1
Show file tree
Hide file tree
Showing 59 changed files with 596 additions and 503 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-27-alpha
- image: circleci/android:api-28-alpha
environment:
JVM_OPTS: -Xmx3200m
MAX_RETRY: 4
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Add the following dependency to your `build.gradle` file:

```
dependencies {
implementation 'com.google.android:flexbox:1.0.0'
implementation 'com.google.android:flexbox:1.1.0'
}
```

# Usage
There are two ways of using Flexbox in your layout.
There are two ways of using Flexbox in your layout.

## FlexboxLayout
## FlexboxLayout
The first one is `FlexboxLayout` that extends the `ViewGroup` like `LinearLayout` and `RelativeLayout`.
You can specify the attributes from a layout XML like:
```xml
Expand Down
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@
buildscript {
ext {
minSdkVersion = 14
targetSdkVersion = 27
compileSdkVersion = 27
androidGradlePluginVersion = "3.1.3"
targetSdkVersion = 28
compileSdkVersion = 28

androidGradlePluginVersion = "3.2.0"
androidMavenGradlePluginVersion = "1.5"
gradleBintrayPluginVersion = "1.6"
kotlinVersion = "1.2.30"
supportLibVersion = "27.1.0"
espressoVersion = "3.0.0"
testRunnerVersion = "1.0.0"
androidxCoreVersion = "1.0.0"
androidxEspressoVersion = "3.1.0-alpha4"
androidxTestVersion = "1.1.0-alpha4"
junitVersion = "4.12"
gradleBintrayPluginVersion = "1.6"
kotlinVersion = "1.2.70"
materialVersion = "1.0.0"
}

repositories {
Expand Down
10 changes: 5 additions & 5 deletions demo-cat-gallery/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -40,8 +40,8 @@ android {

dependencies {
implementation project(path: ":flexbox")
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
implementation "androidx.appcompat:appcompat:${rootProject.androidxCoreVersion}"
implementation "androidx.recyclerview:recyclerview:${rootProject.androidxCoreVersion}"
implementation "com.google.android.material:material:${rootProject.materialVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.kotlinVersion}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.google.android.flexbox.apps.catgallery

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView

/**
* Adapter class that handles the data set with the {@link RecyclerView.LayoutManager}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.google.android.flexbox.apps.catgallery

import android.support.annotation.DrawableRes
import android.support.v7.widget.RecyclerView
import android.view.View
import android.widget.ImageView
import androidx.annotation.DrawableRes
import androidx.recyclerview.widget.RecyclerView
import com.google.android.flexbox.FlexboxLayoutManager

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package com.google.android.flexbox.apps.catgallery

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.Toolbar
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.recyclerview.widget.RecyclerView
import com.google.android.flexbox.AlignItems
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexWrap
Expand Down
14 changes: 7 additions & 7 deletions demo-cat-gallery/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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"
Expand All @@ -23,31 +23,31 @@ limitations under the License.
android:fitsSystemWindows="true"
tools:context="com.google.android.flexbox.apps.catgallery.MainActivity">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.design.widget.CollapsingToolbarLayout
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

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

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

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

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion demo-cat-gallery/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
Expand Down
19 changes: 10 additions & 9 deletions demo-playground/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -40,16 +40,17 @@ android {

dependencies {
implementation project(":flexbox")
implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:preference-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:preference-v14:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
implementation "androidx.legacy:legacy-support-v4:${rootProject.androidxCoreVersion}"
implementation "androidx.appcompat:appcompat:${rootProject.androidxCoreVersion}"
implementation "androidx.preference:preference:${rootProject.androidxCoreVersion}"
implementation "androidx.legacy:legacy-preference-v14:${rootProject.androidxCoreVersion}"
implementation "com.google.android.material:material:${rootProject.materialVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

testImplementation "junit:junit:${rootProject.ext.junitVersion}"

androidTestImplementation "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
androidTestImplementation "com.android.support.test:runner:${rootProject.ext.testRunnerVersion}"
androidTestImplementation "com.android.support.test.espresso:espresso-core:${rootProject.ext.espressoVersion}"
androidTestImplementation "androidx.annotation:annotation:${rootProject.androidxCoreVersion}"
androidTestImplementation "androidx.test:runner:${rootProject.androidxTestVersion}"
androidTestImplementation "androidx.test:rules:${rootProject.androidxTestVersion}"
androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.androidxEspressoVersion}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@
package com.google.android.apps.flexbox.test

import android.content.pm.ActivityInfo
import android.support.design.widget.NavigationView
import android.support.test.InstrumentationRegistry
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.action.ViewActions.*
import android.support.test.espresso.matcher.ViewMatchers.withId
import android.support.test.filters.FlakyTest
import android.support.test.filters.MediumTest
import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import android.view.View
import android.widget.ArrayAdapter
import android.widget.RadioGroup
import android.widget.Spinner
import android.widget.TextView
import androidx.test.InstrumentationRegistry
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.filters.FlakyTest
import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import com.google.android.apps.flexbox.R
import com.google.android.flexbox.*
import junit.framework.Assert.*
import com.google.android.material.navigation.NavigationView
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.core.Is.`is`
import org.junit.Assert.*
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@

package com.google.android.flexbox

import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import com.google.android.apps.flexbox.R

/**
* [RecyclerView.Adapter] implementation for [FlexItemViewHolder].
*/
internal class FlexItemAdapter(private val activity: AppCompatActivity, private val flexContainer: FlexContainer) : RecyclerView.Adapter<FlexItemViewHolder>() {
internal class FlexItemAdapter(private val activity: AppCompatActivity,
private val flexContainer: FlexContainer)
: RecyclerView.Adapter<FlexItemViewHolder>() {

private val layoutParams = mutableListOf<FlexboxLayoutManager.LayoutParams>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.google.android.flexbox

import android.support.v7.widget.RecyclerView
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView

/**
* Implementation for the [FlexItemChangedListener].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.google.android.flexbox

import android.support.v7.app.AppCompatActivity
import android.view.View
import androidx.appcompat.app.AppCompatActivity

/**
* Implementation of the [android.view.View.OnClickListener] when a flex item is clicked in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ package com.google.android.flexbox
import android.content.Context
import android.os.Build
import android.os.Bundle
import android.support.design.widget.TextInputLayout
import android.support.v4.app.DialogFragment
import android.text.Editable
import android.text.TextWatcher
import android.view.KeyEvent
Expand All @@ -30,8 +28,10 @@ import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.*
import androidx.fragment.app.DialogFragment
import com.google.android.apps.flexbox.R
import com.google.android.flexbox.validators.*
import com.google.android.material.textfield.TextInputLayout

/**
* DialogFragment that changes the properties for a flex item.
Expand Down Expand Up @@ -333,7 +333,7 @@ internal class FlexItemEditFragment : DialogFragment() {
copyFlexItemValues(item, newItem)
return newItem
}
throw IllegalArgumentException("Unknown FlexItem: " + item)
throw IllegalArgumentException("Unknown FlexItem: $item")
}

private fun copyFlexItemValues(from: FlexItem, to: FlexItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.google.android.flexbox

import android.support.v7.widget.RecyclerView
import android.view.Gravity
import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.google.android.apps.flexbox.R

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ package com.google.android.flexbox

import android.content.Context
import android.os.Bundle
import android.support.design.widget.FloatingActionButton
import android.support.v4.app.Fragment
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.google.android.apps.flexbox.R
import com.google.android.material.floatingactionbutton.FloatingActionButton
import java.util.*

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
package com.google.android.flexbox

import android.content.SharedPreferences
import android.support.design.widget.NavigationView
import android.support.v7.preference.PreferenceManager
import android.view.Menu
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Spinner
import android.widget.Toast
import androidx.preference.PreferenceManager
import com.google.android.apps.flexbox.R
import com.google.android.material.navigation.NavigationView

/**
* Helper class that has the common logic for initializing the Fragment for the play ground demo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ package com.google.android.flexbox

import android.content.Intent
import android.os.Bundle
import android.support.design.widget.NavigationView
import android.support.v4.app.FragmentManager
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.RadioGroup
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.drawerlayout.widget.DrawerLayout
import androidx.fragment.app.FragmentManager
import com.google.android.apps.flexbox.R
import com.google.android.material.navigation.NavigationView

class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
package com.google.android.flexbox

import android.os.Bundle
import android.support.design.widget.FloatingActionButton
import android.support.v4.app.Fragment
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.RecyclerView
import com.google.android.apps.flexbox.R
import com.google.android.material.floatingactionbutton.FloatingActionButton

/**
* Fragment that contains the [RecyclerView] and the [FlexboxLayoutManager] as its
Expand Down
Loading

0 comments on commit 9db6bb1

Please sign in to comment.