Skip to content

Commit 88b9e3b

Browse files
authored
Merge pull request #9215 from wordpress-mobile/feature/update-support-lib-28
Update support library to 28
2 parents 230b94b + 5aeafa2 commit 88b9e3b

38 files changed

+101
-106
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
android_config: &android_config
22
docker:
3-
- image: circleci/android:api-27-alpha
3+
- image: circleci/android:api-28-alpha
44
environment:
55
# kotlin.incremental=false and kotlin.compiler.execution.strategy=in-process are required due to an issue with the Kotlin compiler in
66
# memory constrained environments: https://youtrack.jetbrains.com/issue/KT-15562

WordPress/build.gradle

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,18 @@ android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompi
2929

3030
android {
3131
useLibrary 'org.apache.http.legacy'
32+
useLibrary 'android.test.runner'
33+
34+
useLibrary 'android.test.base'
35+
useLibrary 'android.test.mock'
3236

3337
dexOptions {
3438
jumboMode = true
3539
javaMaxHeapSize = project.properties.getOrDefault("javaMaxHeapSize", "6g")
3640
dexInProcess = true
3741
}
3842

39-
compileSdkVersion 27
43+
compileSdkVersion 28
4044
buildToolsVersion '28.0.3'
4145

4246
defaultConfig {
@@ -105,6 +109,11 @@ android {
105109
lintConfig file('lint.xml')
106110
baseline file("lint-baseline.xml")
107111
}
112+
113+
packagingOptions {
114+
// MPAndroidChart uses androidX - remove this line when we migrate everything to androidX
115+
exclude 'META-INF/proguard/androidx-annotations.pro'
116+
}
108117
}
109118

110119
// allows us to use cool things like @Parcelize annotations
@@ -125,17 +134,20 @@ dependencies {
125134
implementation 'com.google.code.gson:gson:2.6.2'
126135
implementation 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
127136

128-
implementation 'com.android.support:support-compat:27.1.1'
129-
implementation 'com.android.support:support-core-ui:27.1.1'
130-
implementation 'com.android.support:support-fragment:27.1.1'
137+
implementation 'com.android.support:support-compat:28.0.0'
138+
implementation 'com.android.support:support-core-ui:28.0.0'
139+
implementation 'com.android.support:support-fragment:28.0.0'
131140

132141
implementation 'com.android.support:multidex:1.0.2'
133-
implementation 'com.android.support:appcompat-v7:27.1.1'
134-
implementation 'com.android.support:cardview-v7:27.1.1'
135-
implementation 'com.android.support:recyclerview-v7:27.1.1'
136-
implementation 'com.android.support:design:27.1.1'
137-
implementation 'com.android.support:percent:27.1.1'
138-
implementation 'com.android.support:preference-v7:27.1.1'
142+
implementation 'com.android.support:support-v4:28.0.0'
143+
implementation 'com.android.support:exifinterface:28.0.0'
144+
implementation'com.android.support:support-media-compat:28.0.0'
145+
implementation 'com.android.support:appcompat-v7:28.0.0'
146+
implementation 'com.android.support:cardview-v7:28.0.0'
147+
implementation 'com.android.support:recyclerview-v7:28.0.0'
148+
implementation 'com.android.support:design:28.0.0'
149+
implementation 'com.android.support:percent:28.0.0'
150+
implementation 'com.android.support:preference-v7:28.0.0'
139151

140152
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
141153

WordPress/src/androidTest/java/org/wordpress/android/ui/screenshots/WPScreenshotTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import android.support.test.rule.ActivityTestRule;
44
import android.support.test.runner.AndroidJUnit4;
55
import android.support.v7.widget.CardView;
6-
import android.test.suitebuilder.annotation.LargeTest;
6+
import android.support.test.filters.LargeTest;
77

88
import org.junit.ClassRule;
99
import org.junit.Rule;

WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class ActivityLogListFragment : Fragment() {
6565

6666
log_list_view.setEmptyView(actionable_empty_view)
6767
log_list_view.addOnScrollListener(object : RecyclerView.OnScrollListener() {
68-
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
69-
if (!recyclerView!!.canScrollVertically(1) && dy != 0) {
68+
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
69+
if (!recyclerView.canScrollVertically(1) && dy != 0) {
7070
viewModel.onScrolledToBottom()
7171
}
7272
}

WordPress/src/main/java/org/wordpress/android/ui/main/WPMainNavigationView.kt

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.wordpress.android.ui.main
22

3-
import android.annotation.SuppressLint
43
import android.content.Context
54
import android.support.annotation.DrawableRes
65
import android.support.annotation.IdRes
76
import android.support.annotation.StringRes
7+
import android.support.design.bottomnavigation.LabelVisibilityMode
88
import android.support.design.internal.BottomNavigationItemView
99
import android.support.design.internal.BottomNavigationMenuView
1010
import android.support.design.widget.BottomNavigationView
@@ -27,8 +27,6 @@ import org.wordpress.android.ui.prefs.AppPrefs
2727
import org.wordpress.android.ui.reader.ReaderPostListFragment
2828
import org.wordpress.android.util.AniUtils
2929
import org.wordpress.android.util.AniUtils.Duration
30-
import org.wordpress.android.util.AppLog
31-
import org.wordpress.android.util.AppLog.T
3230

3331
/*
3432
* Bottom navigation view and related adapter used by the main activity for the
@@ -95,30 +93,8 @@ class WPMainNavigationView @JvmOverloads constructor(
9593
currentPosition = AppPrefs.getMainPageIndex()
9694
}
9795

98-
/*
99-
* uses reflection to disable "shift mode" so the item are equal width
100-
*/
101-
@SuppressLint("RestrictedApi")
10296
private fun disableShiftMode() {
103-
val menuView = getChildAt(0) as BottomNavigationMenuView
104-
try {
105-
menuView.javaClass.getDeclaredField("mShiftingMode").apply {
106-
isAccessible = true
107-
setBoolean(menuView, false)
108-
isAccessible = false
109-
}
110-
for (i in 0 until menuView.childCount) {
111-
(menuView.getChildAt(i) as BottomNavigationItemView).apply {
112-
setShiftingMode(false)
113-
// force the view to update
114-
setChecked(itemData.isChecked)
115-
}
116-
}
117-
} catch (e: NoSuchFieldException) {
118-
AppLog.e(T.MAIN, "Unable to disable shift mode", e)
119-
} catch (e: IllegalAccessException) {
120-
AppLog.e(T.MAIN, "Unable to disable shift mode", e)
121-
}
97+
labelVisibilityMode = LabelVisibilityMode.LABEL_VISIBILITY_LABELED
12298
}
12399

124100
private fun assignNavigationListeners(assign: Boolean) {

WordPress/src/main/java/org/wordpress/android/ui/sitecreation/NewSiteCreationActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class NewSiteCreationActivity : AppCompatActivity(),
179179
}
180180
}
181181

182-
private fun slideInFragment(fragment: Fragment?, tag: String) {
182+
private fun slideInFragment(fragment: Fragment, tag: String) {
183183
val fragmentTransaction = supportFragmentManager.beginTransaction()
184184
fragmentTransaction.replace(R.id.fragment_container, fragment, tag)
185185
if (supportFragmentManager.findFragmentById(R.id.fragment_container) != null) {

WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsListItemDecoration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import android.view.View
66

77
data class StatsListItemDecoration(val horizontalSpacing: Int, val verticalSpacing: Int, val columnCount: Int) :
88
RecyclerView.ItemDecoration() {
9-
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State?) {
9+
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
1010
super.getItemOffsets(outRect, view, parent, state)
1111
val isFirst = parent.getChildAdapterPosition(view) == 0
12-
val isLast = parent.getChildAdapterPosition(view) == parent.adapter.itemCount - 1
12+
val isLast = parent.adapter?.let { parent.getChildAdapterPosition(view) == it.itemCount - 1 } ?: false
1313
outRect.set(
1414
if (columnCount == 1) 2 * horizontalSpacing else horizontalSpacing,
1515
if (isFirst) 2 * verticalSpacing else verticalSpacing,

WordPress/src/main/java/org/wordpress/android/ui/themes/ThemeBrowserAdapter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,10 @@ private void configureCardView(ThemeViewHolder themeViewHolder, boolean isCurren
162162
themeViewHolder.mActiveView.setVisibility(View.VISIBLE);
163163
themeViewHolder.mCardView.setCardBackgroundColor(resources.getColor(R.color.blue_wordpress));
164164
} else {
165-
themeViewHolder.mDetailsView.setBackgroundColor(resources.getColor(
166-
android.support.v7.cardview.R.color.cardview_light_background));
165+
themeViewHolder.mDetailsView.setBackgroundColor(resources.getColor(R.color.white));
167166
themeViewHolder.mNameView.setTextColor(resources.getColor(R.color.black));
168167
themeViewHolder.mActiveView.setVisibility(View.GONE);
169-
themeViewHolder.mCardView.setCardBackgroundColor(resources.getColor(
170-
android.support.v7.cardview.R.color.cardview_light_background));
168+
themeViewHolder.mCardView.setCardBackgroundColor(resources.getColor(R.color.white));
171169
}
172170
}
173171

WordPress/src/main/res/layout-sw600dp/theme_grid_cardview_header.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
android:layout_width="match_parent"
99
android:layout_height="match_parent"
1010
android:layout_marginTop="@dimen/theme_browser_cardview_margin_large"
11-
android:layout_marginBottom="@dimen/cardview_default_radius"
12-
card_view:cardCornerRadius="@dimen/cardview_default_radius"
11+
android:layout_marginBottom="@dimen/default_cardview_radius"
12+
card_view:cardCornerRadius="@dimen/default_cardview_radius"
1313
card_view:cardElevation="@dimen/card_elevation"
1414
android:layout_marginStart="@dimen/theme_browser_cardview_margin_large"
1515
android:layout_marginEnd="@dimen/theme_browser_cardview_margin_large">

WordPress/src/main/res/layout/edit_post_settings_fragment.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<android.support.v7.widget.CardView
1818
style="@style/PostSettingsCardView"
1919
card_view:cardBackgroundColor="@color/white"
20-
card_view:cardCornerRadius="@dimen/cardview_default_radius">
20+
card_view:cardCornerRadius="@dimen/default_cardview_radius">
2121

2222
<LinearLayout
2323
style="@style/PostSettingsCardViewInnerLayout">
@@ -75,7 +75,7 @@
7575
style="@style/PostSettingsCardView"
7676
android:id="@+id/post_categories_and_tags_card"
7777
card_view:cardBackgroundColor="@color/white"
78-
card_view:cardCornerRadius="@dimen/cardview_default_radius">
78+
card_view:cardCornerRadius="@dimen/default_cardview_radius">
7979

8080
<LinearLayout
8181
style="@style/PostSettingsCardViewInnerLayout">
@@ -122,7 +122,7 @@
122122
android:id="@+id/post_featured_image_card_view"
123123
style="@style/PostSettingsCardView"
124124
card_view:cardBackgroundColor="@color/white"
125-
card_view:cardCornerRadius="@dimen/cardview_default_radius">
125+
card_view:cardCornerRadius="@dimen/default_cardview_radius">
126126

127127
<LinearLayout
128128
style="@style/PostSettingsCardViewInnerLayout">
@@ -159,7 +159,7 @@
159159
<android.support.v7.widget.CardView
160160
style="@style/PostSettingsCardView"
161161
card_view:cardBackgroundColor="@color/white"
162-
card_view:cardCornerRadius="@dimen/cardview_default_radius">
162+
card_view:cardCornerRadius="@dimen/default_cardview_radius">
163163

164164
<LinearLayout
165165
style="@style/PostSettingsCardViewInnerLayout">

0 commit comments

Comments
 (0)