Skip to content

Commit 8bf53a8

Browse files
committed
Revert material update
1 parent 91433d2 commit 8bf53a8

File tree

7 files changed

+37
-28
lines changed

7 files changed

+37
-28
lines changed

aztec/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
implementation "org.jsoup:jsoup:$jSoupVersion"
5353

5454
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
55-
implementation 'com.google.android.material:material:1.8.0'
55+
implementation 'com.google.android.material:material:1.0.0'
5656

5757
implementation "org.wordpress:utils:$wordpressUtilsVersion"
5858

aztec/src/main/java/org/wordpress/aztec/Html.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
import org.wordpress.aztec.spans.AztecRelativeSizeSmallSpan;
4646
import org.wordpress.aztec.spans.AztecStyleBoldSpan;
4747
import org.wordpress.aztec.spans.AztecStyleCiteSpan;
48-
import org.wordpress.aztec.spans.AztecStyleEmphasisSpan;
4948
import org.wordpress.aztec.spans.AztecStyleItalicSpan;
49+
import org.wordpress.aztec.spans.AztecStyleEmphasisSpan;
5050
import org.wordpress.aztec.spans.AztecStyleStrongSpan;
5151
import org.wordpress.aztec.spans.AztecSubscriptSpan;
5252
import org.wordpress.aztec.spans.AztecSuperscriptSpan;
@@ -58,9 +58,9 @@
5858
import org.wordpress.aztec.spans.HighlightSpan;
5959
import org.wordpress.aztec.spans.IAztecInlineSpan;
6060
import org.wordpress.aztec.spans.IAztecParagraphStyle;
61-
import org.wordpress.aztec.spans.MarkSpan;
6261
import org.wordpress.aztec.spans.UnknownClickableSpan;
6362
import org.wordpress.aztec.spans.UnknownHtmlSpan;
63+
import org.wordpress.aztec.spans.MarkSpan;
6464
import org.wordpress.aztec.util.CleaningUtils;
6565
import org.xml.sax.Attributes;
6666
import org.xml.sax.InputSource;
@@ -76,6 +76,7 @@
7676
import java.util.regex.Pattern;
7777

7878
import kotlin.Unit;
79+
import kotlin.jvm.functions.Function1;
7980

8081
import static org.wordpress.aztec.util.ExtensionsKt.getLast;
8182

@@ -243,14 +244,14 @@ class HtmlToSpannedConverter implements org.xml.sax.ContentHandler, LexicalHandl
243244
private boolean insidePreTag = false;
244245
private boolean insideCodeTag = false;
245246

246-
private final String source;
247-
private final List<IAztecPlugin> plugins;
248-
private final XMLReader reader;
249-
private final SpannableStringBuilder spannableStringBuilder;
250-
private final Html.TagHandler tagHandler;
251-
private final Context context;
252-
private final List<String> ignoredTags;
253-
private final boolean shouldIgnoreWhitespace;
247+
private String source;
248+
private List<IAztecPlugin> plugins;
249+
private XMLReader reader;
250+
private SpannableStringBuilder spannableStringBuilder;
251+
private Html.TagHandler tagHandler;
252+
private Context context;
253+
private List<String> ignoredTags;
254+
private boolean shouldIgnoreWhitespace;
254255

255256
public HtmlToSpannedConverter(
256257
String source, Html.TagHandler tagHandler,
@@ -643,7 +644,7 @@ private static void endFont(SpannableStringBuilder text) {
643644
String name = color.substring(1);
644645
int colorRes = res.getIdentifier(name, "color", "android");
645646
if (colorRes != 0) {
646-
ColorStateList colors = res.getColorStateList(colorRes, res.newTheme());
647+
ColorStateList colors = res.getColorStateList(colorRes);
647648
text.setSpan(new TextAppearanceSpan(null, 0, 0, colors, null),
648649
where, len,
649650
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
@@ -866,10 +867,13 @@ private boolean processCommentHandlerPlugins(String comment) {
866867
for (IAztecPlugin plugin : plugins) {
867868
if (plugin instanceof IHtmlCommentHandler) {
868869
wasCommentHandled = ((IHtmlCommentHandler) plugin).handleComment(comment, spannableStringBuilder,
869-
nestingLevel, newNesting -> {
870-
nestingLevel = newNesting;
871-
return Unit.INSTANCE;
872-
});
870+
nestingLevel, new Function1<Integer, Unit>() {
871+
@Override
872+
public Unit invoke(Integer newNesting) {
873+
nestingLevel = newNesting;
874+
return Unit.INSTANCE;
875+
}
876+
});
873877
if (wasCommentHandled) {
874878
break;
875879
}

aztec/src/main/kotlin/org/wordpress/aztec/util/Extensions.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ fun ClipData.Item.coerceToHtmlText(parser: AztecParser): String {
7474
*/
7575
fun ToggleButton.convertToButtonAccessibilityProperties() {
7676
ViewCompat.setAccessibilityDelegate(this, object : AccessibilityDelegateCompat() {
77-
override fun onInitializeAccessibilityNodeInfo(host: View, info: AccessibilityNodeInfoCompat) {
77+
override fun onInitializeAccessibilityNodeInfo(host: View?, info: AccessibilityNodeInfoCompat?) {
7878
super.onInitializeAccessibilityNodeInfo(host, info)
79-
info.className = Button::class.java.name
80-
info.isCheckable = false
81-
info.addAction(AccessibilityNodeInfoCompat.AccessibilityActionCompat(ACTION_CLICK, context.getString(R.string.accessibility_action_click_label)))
79+
info?.className = Button::class.java.name
80+
info?.isCheckable = false
81+
info?.addAction(AccessibilityNodeInfoCompat.AccessibilityActionCompat(ACTION_CLICK, context.getString(R.string.accessibility_action_click_label)))
8282
}
8383
})
8484
}

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/ImageWithCaptionAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import android.view.Gravity
55
import android.view.View
66
import android.view.animation.Animation
77
import android.view.animation.Transformation
8+
import android.widget.FrameLayout
89
import android.widget.ImageView
910
import android.widget.LinearLayout
1011
import android.widget.TextView
11-
import androidx.core.view.updateLayoutParams
1212
import com.bumptech.glide.Glide
1313
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
1414
import kotlinx.coroutines.CoroutineScope
@@ -97,7 +97,7 @@ class ImageWithCaptionAdapter(
9797
private val startHeight: Int = view.height
9898

9999
override fun applyTransformation(interpolatedTime: Float, t: Transformation) {
100-
view.updateLayoutParams {
100+
(view.layoutParams as FrameLayout.LayoutParams).apply {
101101
width = startWidth + ((newWidth - startWidth) * interpolatedTime).toInt()
102102
height = startHeight + ((newHeight - startHeight) * interpolatedTime).toInt()
103103
}

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/PlaceholderManager.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import android.view.View
1212
import android.view.ViewTreeObserver
1313
import android.widget.FrameLayout
1414
import androidx.core.content.ContextCompat
15-
import androidx.core.view.updateLayoutParams
1615
import kotlinx.coroutines.CoroutineScope
1716
import kotlinx.coroutines.Dispatchers
1817
import kotlinx.coroutines.Job
@@ -377,9 +376,9 @@ class PlaceholderManager(
377376
paramsFlow.emit(Placeholder.ViewParams(newWidth, newHeight, attrs, initial = false))
378377
}
379378

380-
box.updateLayoutParams<FrameLayout.LayoutParams> {
379+
(box.layoutParams as FrameLayout.LayoutParams).apply {
381380
leftMargin = newLeftPadding
382-
topMargin = newTopPadding
381+
topMargin = newLeftPadding
383382
}
384383

385384
positionToIdMutex.withLock {
@@ -456,7 +455,13 @@ class PlaceholderManager(
456455
/**
457456
* This method handled a `placeholder` tag found in the HTML. It creates a placeholder and inserts a view over it.
458457
*/
459-
override fun handleTag(opening: Boolean, tag: String, output: Editable, attributes: Attributes, nestingLevel: Int): Boolean {
458+
override fun handleTag(
459+
opening: Boolean,
460+
tag: String,
461+
output: Editable,
462+
attributes: Attributes,
463+
nestingLevel: Int
464+
): Boolean {
460465
if (opening) {
461466
val type = attributes.getValue(TYPE_ATTRIBUTE)
462467
attributes.getValue(UUID_ATTRIBUTE)?.also { uuid ->

picasso-loader/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626
implementation aztecProjectDependency
2727

2828
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
29-
implementation 'com.google.android.material:material:1.8.0'
29+
implementation 'com.google.android.material:material:1.0.0'
3030

3131
implementation "com.squareup.picasso:picasso:$picassoVersion"
3232
}

wordpress-comments/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
implementation aztecProjectDependency
3939

4040
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
41-
implementation 'com.google.android.material:material:1.8.0'
41+
implementation 'com.google.android.material:material:1.0.0'
4242
implementation "org.wordpress:utils:$wordpressUtilsVersion"
4343

4444
testImplementation "junit:junit:$jUnitVersion"

0 commit comments

Comments
 (0)