未验证 提交 1865c6a0 编写于 作者: T Takeshi Hagikura 提交者: GitHub

Bump up some library versions. (#383)

Also fixes:

- Some Kotlin errors in the demo app.
- Replace the deprecated compile dependency syntax to api or implementation in the build.gradle files.
上级 1874afa7
......@@ -35,7 +35,7 @@ jobs:
counter=0 ;
result=1 ;
while [ $result != 0 -a $counter -lt $MAX_RETRY ]; do
gcloud firebase test android run --type instrumentation --app demo-playground/build/outputs/apk/demo-playground-debug.apk --test flexbox/build/outputs/apk/flexbox-debug-androidTest.apk --device-ids hammerhead,sailfish --os-version-ids 19,21,23,24,25,26 --locales en --orientations portrait,landscape --results-bucket ${GCLOUD_TEST_BUCKET_LIBRARY} --timeout 180s ;
gcloud firebase test android run --type instrumentation --app demo-playground/build/outputs/apk/debug/demo-playground-debug.apk --test flexbox/build/outputs/apk/androidTest/debug/flexbox-debug-androidTest.apk --device-ids hammerhead,sailfish --os-version-ids 19,21,23,24,25,26 --locales en --orientations portrait,landscape --results-bucket ${GCLOUD_TEST_BUCKET_LIBRARY} --timeout 180s ;
result=$? ;
let counter=counter+1 ;
done
......
......@@ -19,14 +19,14 @@
buildscript {
ext {
minSdkVersion = 14
targetSdkVersion = 26
compileSdkVersion = 26
buildToolsVersion = "26.0.0"
androidGradlePluginVersion = "2.3.3"
targetSdkVersion = 27
compileSdkVersion = 27
buildToolsVersion = "27.0.1"
androidGradlePluginVersion = "3.0.1"
androidMavenGradlePluginVersion = "1.5"
gradleBintrayPluginVersion = "1.6"
kotlinVersion = "1.1.3"
supportLibVersion = "26.0.0"
kotlinVersion = "1.1.61"
supportLibVersion = "27.0.1"
espressoVersion = "3.0.0"
testRunnerVersion = "1.0.0"
junitVersion = "4.12"
......@@ -34,9 +34,7 @@ buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$androidGradlePluginVersion"
......@@ -51,9 +49,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
google()
}
}
......
......@@ -40,9 +40,9 @@ android {
}
dependencies {
compile project(path: ":flexbox")
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
compile "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
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}"
}
......@@ -40,17 +40,17 @@ android {
}
dependencies {
compile project(":flexbox")
compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:preference-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:preference-v14:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
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 "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testCompile "junit:junit:${rootProject.ext.junitVersion}"
testImplementation "junit:junit:${rootProject.ext.junitVersion}"
androidTestCompile "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
androidTestCompile "com.android.support.test:runner:${rootProject.ext.testRunnerVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-core:${rootProject.ext.espressoVersion}"
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}"
}
......@@ -38,17 +38,17 @@ import com.google.android.flexbox.validators.*
*/
internal class FlexItemEditFragment : DialogFragment() {
private lateinit var ALIGN_SELF_AUTO: String
private lateinit var alignSelfAuto: String
private lateinit var ALIGN_SELF_FLEX_START: String
private lateinit var alignSelfFlexStart: String
private lateinit var ALIGN_SELF_FLEX_END: String
private lateinit var alignSelfFlexEnd: String
private lateinit var ALIGN_SELF_CENTER: String
private lateinit var alignSelfCenter: String
private lateinit var ALIGN_SELF_BASELINE: String
private lateinit var alignSelfBaseline: String
private lateinit var ALIGN_SELF_STRETCH: String
private lateinit var alignSelfStretch: String
private var viewIndex: Int = 0
......@@ -70,19 +70,19 @@ internal class FlexItemEditFragment : DialogFragment() {
} else {
setStyle(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Dialog)
}
arguments.let {
arguments?.let {
flexItem = it.getParcelable(FLEX_ITEM_KEY)
viewIndex = it.getInt(VIEW_INDEX_KEY)
}
flexItemInEdit = createNewFlexItem(flexItem)
activity.let {
ALIGN_SELF_AUTO = it.getString(R.string.auto)
ALIGN_SELF_FLEX_START = it.getString(R.string.flex_start)
ALIGN_SELF_FLEX_END = it.getString(R.string.flex_end)
ALIGN_SELF_CENTER = it.getString(R.string.center)
ALIGN_SELF_BASELINE = it.getString(R.string.baseline)
ALIGN_SELF_STRETCH = it.getString(R.string.stretch)
activity?.let {
alignSelfAuto = it.getString(R.string.auto)
alignSelfFlexStart = it.getString(R.string.flex_start)
alignSelfFlexEnd = it.getString(R.string.flex_end)
alignSelfCenter = it.getString(R.string.center)
alignSelfBaseline = it.getString(R.string.baseline)
alignSelfStretch = it.getString(R.string.stretch)
}
}
......@@ -91,12 +91,12 @@ internal class FlexItemEditFragment : DialogFragment() {
val view = inflater.inflate(R.layout.fragment_flex_item_edit, container, false)
dialog.setTitle((viewIndex + 1).toString())
val activity = activity
val context = activity ?: return view
val orderTextInput: TextInputLayout = view.findViewById(R.id.input_layout_order)
val orderEdit: EditText = view.findViewById(R.id.edit_text_order)
orderEdit.setText(flexItem.order.toString())
orderEdit.addTextChangedListener(
FlexEditTextWatcher(activity, orderTextInput, IntegerInputValidator(),
FlexEditTextWatcher(context, orderTextInput, IntegerInputValidator(),
R.string.must_be_integer))
if (flexItem is FlexboxLayoutManager.LayoutParams) {
// Order is not enabled in FlexboxLayoutManager
......@@ -107,14 +107,14 @@ internal class FlexItemEditFragment : DialogFragment() {
val flexGrowEdit: EditText = view.findViewById(R.id.edit_text_flex_grow)
flexGrowEdit.setText(flexItem.flexGrow.toString())
flexGrowEdit.addTextChangedListener(
FlexEditTextWatcher(activity, flexGrowInput, NonNegativeDecimalInputValidator(),
FlexEditTextWatcher(context, flexGrowInput, NonNegativeDecimalInputValidator(),
R.string.must_be_non_negative_float))
val flexShrinkInput: TextInputLayout = view.findViewById(R.id.input_layout_flex_shrink)
val flexShrinkEdit: EditText = view.findViewById(R.id.edit_text_flex_shrink)
flexShrinkEdit.setText(flexItem.flexShrink.toString())
flexShrinkEdit.addTextChangedListener(
FlexEditTextWatcher(activity, flexShrinkInput, NonNegativeDecimalInputValidator(),
FlexEditTextWatcher(context, flexShrinkInput, NonNegativeDecimalInputValidator(),
R.string.must_be_non_negative_float))
val flexBasisPercentInput: TextInputLayout =
......@@ -127,49 +127,49 @@ internal class FlexItemEditFragment : DialogFragment() {
flexBasisPercentEdit.setText(flexItem.flexBasisPercent.toInt().toString())
}
flexBasisPercentEdit.addTextChangedListener(
FlexEditTextWatcher(activity, flexBasisPercentInput, FlexBasisPercentInputValidator(),
FlexEditTextWatcher(context, flexBasisPercentInput, FlexBasisPercentInputValidator(),
R.string.must_be_minus_one_or_non_negative_integer))
val widthInput: TextInputLayout = view.findViewById(R.id.input_layout_width)
val widthEdit: EditText = view.findViewById(R.id.edit_text_width)
widthEdit.setText(activity.pixelToDp(flexItem.width).toString())
widthEdit.setText(context.pixelToDp(flexItem.width).toString())
widthEdit.addTextChangedListener(
FlexEditTextWatcher(activity, widthInput, DimensionInputValidator(),
FlexEditTextWatcher(context, widthInput, DimensionInputValidator(),
R.string.must_be_minus_one_or_minus_two_or_non_negative_integer))
val heightInput: TextInputLayout = view.findViewById(R.id.input_layout_height)
val heightEdit: EditText= view.findViewById(R.id.edit_text_height)
heightEdit.setText(activity.pixelToDp(flexItem.height).toString())
heightEdit.setText(context.pixelToDp(flexItem.height).toString())
heightEdit.addTextChangedListener(
FlexEditTextWatcher(activity, heightInput, DimensionInputValidator(),
FlexEditTextWatcher(context, heightInput, DimensionInputValidator(),
R.string.must_be_minus_one_or_minus_two_or_non_negative_integer))
val minWidthInput: TextInputLayout = view.findViewById(R.id.input_layout_min_width)
val minWidthEdit: EditText = view.findViewById(R.id.edit_text_min_width)
minWidthEdit.setText(activity.pixelToDp(flexItem.minWidth).toString())
minWidthEdit.setText(context.pixelToDp(flexItem.minWidth).toString())
minWidthEdit.addTextChangedListener(
FlexEditTextWatcher(activity, minWidthInput, FixedDimensionInputValidator(),
FlexEditTextWatcher(context, minWidthInput, FixedDimensionInputValidator(),
R.string.must_be_non_negative_integer))
val minHeightInput: TextInputLayout = view.findViewById(R.id.input_layout_min_height)
val minHeightEdit: EditText = view.findViewById(R.id.edit_text_min_height)
minHeightEdit.setText(activity.pixelToDp(flexItem.minHeight).toString())
minHeightEdit.setText(context.pixelToDp(flexItem.minHeight).toString())
minHeightEdit.addTextChangedListener(
FlexEditTextWatcher(activity, minHeightInput, FixedDimensionInputValidator(),
FlexEditTextWatcher(context, minHeightInput, FixedDimensionInputValidator(),
R.string.must_be_non_negative_integer))
val maxWidthInput: TextInputLayout = view.findViewById(R.id.input_layout_max_width)
val maxWidthEdit: EditText = view.findViewById(R.id.edit_text_max_width)
maxWidthEdit.setText(activity.pixelToDp(flexItem.maxWidth).toString())
maxWidthEdit.setText(context.pixelToDp(flexItem.maxWidth).toString())
maxWidthEdit.addTextChangedListener(
FlexEditTextWatcher(activity, maxWidthInput, FixedDimensionInputValidator(),
FlexEditTextWatcher(context, maxWidthInput, FixedDimensionInputValidator(),
R.string.must_be_non_negative_integer))
val maxHeightInput: TextInputLayout = view.findViewById(R.id.input_layout_max_height)
val maxHeightEdit: EditText = view.findViewById(R.id.edit_text_max_height)
maxHeightEdit.setText(activity.pixelToDp(flexItem.maxHeight).toString())
maxHeightEdit.setText(context.pixelToDp(flexItem.maxHeight).toString())
maxHeightEdit.addTextChangedListener(
FlexEditTextWatcher(activity, maxHeightInput, FixedDimensionInputValidator(),
FlexEditTextWatcher(context, maxHeightInput, FixedDimensionInputValidator(),
R.string.must_be_non_negative_integer))
setNextFocusesOnEnterDown(orderEdit, flexGrowEdit, flexShrinkEdit, flexBasisPercentEdit,
......@@ -182,12 +182,12 @@ internal class FlexItemEditFragment : DialogFragment() {
alignSelfSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>, ignored: View, position: Int, id: Long) {
flexItemInEdit.alignSelf = when (parent.getItemAtPosition(position).toString()) {
ALIGN_SELF_AUTO -> AlignSelf.AUTO
ALIGN_SELF_FLEX_START -> AlignItems.FLEX_START
ALIGN_SELF_FLEX_END -> AlignItems.FLEX_END
ALIGN_SELF_CENTER -> AlignItems.CENTER
ALIGN_SELF_BASELINE -> AlignItems.BASELINE
ALIGN_SELF_STRETCH -> AlignItems.STRETCH
alignSelfAuto -> AlignSelf.AUTO
alignSelfFlexStart -> AlignItems.FLEX_START
alignSelfFlexEnd -> AlignItems.FLEX_END
alignSelfCenter -> AlignItems.CENTER
alignSelfBaseline -> AlignItems.BASELINE
alignSelfStretch -> AlignItems.STRETCH
else -> return
}
}
......@@ -248,9 +248,9 @@ internal class FlexItemEditFragment : DialogFragment() {
if (i + 1 < textViews.size) {
textViews[i + 1].requestFocus()
} else if (i == textViews.size - 1) {
val inputMethodManager = activity
.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
inputMethodManager.hideSoftInputFromWindow(v.windowToken, 0)
val inputMethodManager = activity?.getSystemService(
Context.INPUT_METHOD_SERVICE) as InputMethodManager?
inputMethodManager?.hideSoftInputFromWindow(v.windowToken, 0)
}
}
true
......@@ -264,13 +264,13 @@ internal class FlexItemEditFragment : DialogFragment() {
private fun alignSelfAsString(alignSelf: Int): String {
return when (alignSelf) {
AlignSelf.AUTO -> ALIGN_SELF_AUTO
AlignItems.FLEX_START -> ALIGN_SELF_FLEX_START
AlignItems.FLEX_END -> ALIGN_SELF_FLEX_END
AlignItems.CENTER -> ALIGN_SELF_CENTER
AlignItems.BASELINE -> ALIGN_SELF_BASELINE
AlignItems.STRETCH -> ALIGN_SELF_STRETCH
else -> ALIGN_SELF_AUTO
AlignSelf.AUTO -> alignSelfAuto
AlignItems.FLEX_START -> alignSelfFlexStart
AlignItems.FLEX_END -> alignSelfFlexEnd
AlignItems.CENTER -> alignSelfCenter
AlignItems.BASELINE -> alignSelfBaseline
AlignItems.STRETCH -> alignSelfStretch
else -> alignSelfAuto
}
}
......@@ -289,7 +289,7 @@ internal class FlexItemEditFragment : DialogFragment() {
textInputLayout.error = ""
} else {
textInputLayout.isErrorEnabled = true
textInputLayout.error = activity.resources.getString(errorMessageId)
textInputLayout.error = activity?.resources?.getString(errorMessageId)
}
}
......
......@@ -41,13 +41,13 @@ android {
}
dependencies {
compile "com.android.support:support-compat:${rootProject.ext.supportLibVersion}"
compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
api "com.android.support:support-compat:${rootProject.ext.supportLibVersion}"
api "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
testCompile "junit:junit:${rootProject.ext.junitVersion}"
testImplementation "junit:junit:${rootProject.ext.junitVersion}"
androidTestCompile "com.android.support:support-annotations:${rootProject.ext.supportLibVersion}"
androidTestCompile "com.android.support.test:runner:${rootProject.ext.testRunnerVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-core:${rootProject.ext.espressoVersion}"
androidTestCompile "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
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 "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
}
......@@ -17,7 +17,7 @@
package com.google.android.flexbox;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.view.View;
/**
* An interface that has the common behavior as a flex item contained in a flex container.
......@@ -39,7 +39,7 @@ interface FlexItem extends Parcelable {
float FLEX_BASIS_PERCENT_DEFAULT = -1f;
/** The maximum size of the max width and max height attributes */
int MAX_SIZE = Integer.MAX_VALUE & ViewCompat.MEASURED_SIZE_MASK;
int MAX_SIZE = Integer.MAX_VALUE & View.MEASURED_SIZE_MASK;
/**
* @return the width attribute of the flex item.
......
#Tue Jun 13 19:10:11 JST 2017
#Mon Nov 27 14:52:10 JST 2017
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.3.1-all.zip
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册