mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-19 04:13:18 +01:00
79 lines
4.8 KiB
Java
79 lines
4.8 KiB
Java
package androidx.compose.ui.text.input;
|
|
|
|
import androidx.biometric.ErrorUtils$$ExternalSyntheticOutline0;
|
|
import androidx.compose.runtime.internal.StabilityInferred;
|
|
import androidx.compose.ui.text.internal.InlineClassHelperKt;
|
|
import com.amazon.alexa.redesign.view.container.CardStudioAgentSpaceMetrics;
|
|
import kotlin.Metadata;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@StabilityInferred(parameters = 1)
|
|
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0007\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003¢\u0006\u0004\b\u0005\u0010\u0006J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0016J\u0013\u0010\u000e\u001a\u00020\u000f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u0011H\u0096\u0002J\b\u0010\u0012\u001a\u00020\u0003H\u0016J\b\u0010\u0013\u001a\u00020\u0014H\u0016R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u0011\u0010\u0004\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\b¨\u0006\u0015"}, d2 = {"Landroidx/compose/ui/text/input/DeleteSurroundingTextCommand;", "Landroidx/compose/ui/text/input/EditCommand;", "lengthBeforeCursor", "", "lengthAfterCursor", "<init>", "(II)V", "getLengthBeforeCursor", "()I", "getLengthAfterCursor", "applyTo", "", "buffer", "Landroidx/compose/ui/text/input/EditingBuffer;", "equals", "", CardStudioAgentSpaceMetrics.DimensionValue.SCHEME_OTHER, "", "hashCode", "toString", "", "ui-text"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nEditCommand.kt\nKotlin\n*S Kotlin\n*F\n+ 1 EditCommand.kt\nandroidx/compose/ui/text/input/DeleteSurroundingTextCommand\n+ 2 InlineClassHelper.kt\nandroidx/compose/ui/text/internal/InlineClassHelperKt\n+ 3 MathUtils.kt\nandroidx/compose/ui/text/input/MathUtilsKt\n*L\n1#1,558:1\n118#2,4:559\n28#3,3:563\n38#3,4:566\n*S KotlinDebug\n*F\n+ 1 EditCommand.kt\nandroidx/compose/ui/text/input/DeleteSurroundingTextCommand\n*L\n250#1:559,4\n259#1:563,3\n264#1:566,4\n*E\n"})
|
|
/* loaded from: classes13.dex */
|
|
public final class DeleteSurroundingTextCommand implements EditCommand {
|
|
public static final int $stable = 0;
|
|
private final int lengthAfterCursor;
|
|
private final int lengthBeforeCursor;
|
|
|
|
public DeleteSurroundingTextCommand(int i, int i2) {
|
|
this.lengthBeforeCursor = i;
|
|
this.lengthAfterCursor = i2;
|
|
if (i >= 0 && i2 >= 0) {
|
|
return;
|
|
}
|
|
InlineClassHelperKt.throwIllegalArgumentException("Expected lengthBeforeCursor and lengthAfterCursor to be non-negative, were " + i + " and " + i2 + " respectively.");
|
|
}
|
|
|
|
@Override // androidx.compose.ui.text.input.EditCommand
|
|
public void applyTo(@NotNull EditingBuffer buffer) {
|
|
int selectionEnd = buffer.getSelectionEnd();
|
|
int i = this.lengthAfterCursor;
|
|
int i2 = selectionEnd + i;
|
|
if (((selectionEnd ^ i2) & (i ^ i2)) < 0) {
|
|
i2 = buffer.getLength$ui_text();
|
|
}
|
|
buffer.delete$ui_text(buffer.getSelectionEnd(), Math.min(i2, buffer.getLength$ui_text()));
|
|
int selectionStart = buffer.getSelectionStart();
|
|
int i3 = this.lengthBeforeCursor;
|
|
int i4 = selectionStart - i3;
|
|
if (((i3 ^ selectionStart) & (selectionStart ^ i4)) < 0) {
|
|
i4 = 0;
|
|
}
|
|
buffer.delete$ui_text(Math.max(0, i4), buffer.getSelectionStart());
|
|
}
|
|
|
|
public boolean equals(@Nullable Object other) {
|
|
if (this == other) {
|
|
return true;
|
|
}
|
|
if (!(other instanceof DeleteSurroundingTextCommand)) {
|
|
return false;
|
|
}
|
|
DeleteSurroundingTextCommand deleteSurroundingTextCommand = (DeleteSurroundingTextCommand) other;
|
|
return this.lengthBeforeCursor == deleteSurroundingTextCommand.lengthBeforeCursor && this.lengthAfterCursor == deleteSurroundingTextCommand.lengthAfterCursor;
|
|
}
|
|
|
|
public final int getLengthAfterCursor() {
|
|
return this.lengthAfterCursor;
|
|
}
|
|
|
|
public final int getLengthBeforeCursor() {
|
|
return this.lengthBeforeCursor;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return (this.lengthBeforeCursor * 31) + this.lengthAfterCursor;
|
|
}
|
|
|
|
@NotNull
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder("DeleteSurroundingTextCommand(lengthBeforeCursor=");
|
|
sb.append(this.lengthBeforeCursor);
|
|
sb.append(", lengthAfterCursor=");
|
|
return ErrorUtils$$ExternalSyntheticOutline0.m(sb, this.lengthAfterCursor, ')');
|
|
}
|
|
}
|