mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-29 17:23:23 +01:00
276 lines
16 KiB
Java
276 lines
16 KiB
Java
package androidx.compose.foundation.text.selection;
|
|
|
|
import androidx.compose.foundation.text.StringHelpersKt;
|
|
import androidx.compose.foundation.text.selection.Selection;
|
|
import androidx.compose.foundation.text.selection.SelectionAdjustment;
|
|
import kotlin.Metadata;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bà\u0080\u0001\u0018\u0000 \u00062\u00020\u0001:\u0001\u0006J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H&ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0007À\u0006\u0001"}, d2 = {"Landroidx/compose/foundation/text/selection/SelectionAdjustment;", "", "adjust", "Landroidx/compose/foundation/text/selection/Selection;", "layout", "Landroidx/compose/foundation/text/selection/SelectionLayout;", "Companion", "foundation_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
public interface SelectionAdjustment {
|
|
|
|
/* renamed from: Companion, reason: from kotlin metadata */
|
|
@NotNull
|
|
public static final Companion INSTANCE = Companion.$$INSTANCE;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0011\u0010\u0003\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006R\u0011\u0010\u0007\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0006R\u0011\u0010\t\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u0006R\u0011\u0010\u000b\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\u0006R\u0011\u0010\r\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u0006¨\u0006\u000f"}, d2 = {"Landroidx/compose/foundation/text/selection/SelectionAdjustment$Companion;", "", "()V", "Character", "Landroidx/compose/foundation/text/selection/SelectionAdjustment;", "getCharacter", "()Landroidx/compose/foundation/text/selection/SelectionAdjustment;", "CharacterWithWordAccelerate", "getCharacterWithWordAccelerate", "None", "getNone", "Paragraph", "getParagraph", "Word", "getWord", "foundation_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
public static final class Companion {
|
|
static final /* synthetic */ Companion $$INSTANCE = new Companion();
|
|
|
|
@NotNull
|
|
private static final SelectionAdjustment Character;
|
|
|
|
@NotNull
|
|
private static final SelectionAdjustment CharacterWithWordAccelerate;
|
|
|
|
@NotNull
|
|
private static final SelectionAdjustment None;
|
|
|
|
@NotNull
|
|
private static final SelectionAdjustment Paragraph;
|
|
|
|
@NotNull
|
|
private static final SelectionAdjustment Word;
|
|
|
|
static {
|
|
final int i = 0;
|
|
None = new SelectionAdjustment() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$$ExternalSyntheticLambda0
|
|
@Override // androidx.compose.foundation.text.selection.SelectionAdjustment
|
|
public final Selection adjust(SelectionLayout selectionLayout) {
|
|
Selection None$lambda$0;
|
|
Selection Character$lambda$1;
|
|
Selection Word$lambda$2;
|
|
Selection Paragraph$lambda$3;
|
|
Selection CharacterWithWordAccelerate$lambda$4;
|
|
switch (i) {
|
|
case 0:
|
|
None$lambda$0 = SelectionAdjustment.Companion.None$lambda$0(selectionLayout);
|
|
return None$lambda$0;
|
|
case 1:
|
|
Character$lambda$1 = SelectionAdjustment.Companion.Character$lambda$1(selectionLayout);
|
|
return Character$lambda$1;
|
|
case 2:
|
|
Word$lambda$2 = SelectionAdjustment.Companion.Word$lambda$2(selectionLayout);
|
|
return Word$lambda$2;
|
|
case 3:
|
|
Paragraph$lambda$3 = SelectionAdjustment.Companion.Paragraph$lambda$3(selectionLayout);
|
|
return Paragraph$lambda$3;
|
|
default:
|
|
CharacterWithWordAccelerate$lambda$4 = SelectionAdjustment.Companion.CharacterWithWordAccelerate$lambda$4(selectionLayout);
|
|
return CharacterWithWordAccelerate$lambda$4;
|
|
}
|
|
}
|
|
};
|
|
final int i2 = 1;
|
|
Character = new SelectionAdjustment() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$$ExternalSyntheticLambda0
|
|
@Override // androidx.compose.foundation.text.selection.SelectionAdjustment
|
|
public final Selection adjust(SelectionLayout selectionLayout) {
|
|
Selection None$lambda$0;
|
|
Selection Character$lambda$1;
|
|
Selection Word$lambda$2;
|
|
Selection Paragraph$lambda$3;
|
|
Selection CharacterWithWordAccelerate$lambda$4;
|
|
switch (i2) {
|
|
case 0:
|
|
None$lambda$0 = SelectionAdjustment.Companion.None$lambda$0(selectionLayout);
|
|
return None$lambda$0;
|
|
case 1:
|
|
Character$lambda$1 = SelectionAdjustment.Companion.Character$lambda$1(selectionLayout);
|
|
return Character$lambda$1;
|
|
case 2:
|
|
Word$lambda$2 = SelectionAdjustment.Companion.Word$lambda$2(selectionLayout);
|
|
return Word$lambda$2;
|
|
case 3:
|
|
Paragraph$lambda$3 = SelectionAdjustment.Companion.Paragraph$lambda$3(selectionLayout);
|
|
return Paragraph$lambda$3;
|
|
default:
|
|
CharacterWithWordAccelerate$lambda$4 = SelectionAdjustment.Companion.CharacterWithWordAccelerate$lambda$4(selectionLayout);
|
|
return CharacterWithWordAccelerate$lambda$4;
|
|
}
|
|
}
|
|
};
|
|
final int i3 = 2;
|
|
Word = new SelectionAdjustment() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$$ExternalSyntheticLambda0
|
|
@Override // androidx.compose.foundation.text.selection.SelectionAdjustment
|
|
public final Selection adjust(SelectionLayout selectionLayout) {
|
|
Selection None$lambda$0;
|
|
Selection Character$lambda$1;
|
|
Selection Word$lambda$2;
|
|
Selection Paragraph$lambda$3;
|
|
Selection CharacterWithWordAccelerate$lambda$4;
|
|
switch (i3) {
|
|
case 0:
|
|
None$lambda$0 = SelectionAdjustment.Companion.None$lambda$0(selectionLayout);
|
|
return None$lambda$0;
|
|
case 1:
|
|
Character$lambda$1 = SelectionAdjustment.Companion.Character$lambda$1(selectionLayout);
|
|
return Character$lambda$1;
|
|
case 2:
|
|
Word$lambda$2 = SelectionAdjustment.Companion.Word$lambda$2(selectionLayout);
|
|
return Word$lambda$2;
|
|
case 3:
|
|
Paragraph$lambda$3 = SelectionAdjustment.Companion.Paragraph$lambda$3(selectionLayout);
|
|
return Paragraph$lambda$3;
|
|
default:
|
|
CharacterWithWordAccelerate$lambda$4 = SelectionAdjustment.Companion.CharacterWithWordAccelerate$lambda$4(selectionLayout);
|
|
return CharacterWithWordAccelerate$lambda$4;
|
|
}
|
|
}
|
|
};
|
|
final int i4 = 3;
|
|
Paragraph = new SelectionAdjustment() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$$ExternalSyntheticLambda0
|
|
@Override // androidx.compose.foundation.text.selection.SelectionAdjustment
|
|
public final Selection adjust(SelectionLayout selectionLayout) {
|
|
Selection None$lambda$0;
|
|
Selection Character$lambda$1;
|
|
Selection Word$lambda$2;
|
|
Selection Paragraph$lambda$3;
|
|
Selection CharacterWithWordAccelerate$lambda$4;
|
|
switch (i4) {
|
|
case 0:
|
|
None$lambda$0 = SelectionAdjustment.Companion.None$lambda$0(selectionLayout);
|
|
return None$lambda$0;
|
|
case 1:
|
|
Character$lambda$1 = SelectionAdjustment.Companion.Character$lambda$1(selectionLayout);
|
|
return Character$lambda$1;
|
|
case 2:
|
|
Word$lambda$2 = SelectionAdjustment.Companion.Word$lambda$2(selectionLayout);
|
|
return Word$lambda$2;
|
|
case 3:
|
|
Paragraph$lambda$3 = SelectionAdjustment.Companion.Paragraph$lambda$3(selectionLayout);
|
|
return Paragraph$lambda$3;
|
|
default:
|
|
CharacterWithWordAccelerate$lambda$4 = SelectionAdjustment.Companion.CharacterWithWordAccelerate$lambda$4(selectionLayout);
|
|
return CharacterWithWordAccelerate$lambda$4;
|
|
}
|
|
}
|
|
};
|
|
final int i5 = 4;
|
|
CharacterWithWordAccelerate = new SelectionAdjustment() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$$ExternalSyntheticLambda0
|
|
@Override // androidx.compose.foundation.text.selection.SelectionAdjustment
|
|
public final Selection adjust(SelectionLayout selectionLayout) {
|
|
Selection None$lambda$0;
|
|
Selection Character$lambda$1;
|
|
Selection Word$lambda$2;
|
|
Selection Paragraph$lambda$3;
|
|
Selection CharacterWithWordAccelerate$lambda$4;
|
|
switch (i5) {
|
|
case 0:
|
|
None$lambda$0 = SelectionAdjustment.Companion.None$lambda$0(selectionLayout);
|
|
return None$lambda$0;
|
|
case 1:
|
|
Character$lambda$1 = SelectionAdjustment.Companion.Character$lambda$1(selectionLayout);
|
|
return Character$lambda$1;
|
|
case 2:
|
|
Word$lambda$2 = SelectionAdjustment.Companion.Word$lambda$2(selectionLayout);
|
|
return Word$lambda$2;
|
|
case 3:
|
|
Paragraph$lambda$3 = SelectionAdjustment.Companion.Paragraph$lambda$3(selectionLayout);
|
|
return Paragraph$lambda$3;
|
|
default:
|
|
CharacterWithWordAccelerate$lambda$4 = SelectionAdjustment.Companion.CharacterWithWordAccelerate$lambda$4(selectionLayout);
|
|
return CharacterWithWordAccelerate$lambda$4;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Selection Character$lambda$1(SelectionLayout selectionLayout) {
|
|
return SelectionAdjustmentKt.ensureAtLeastOneChar(None.adjust(selectionLayout), selectionLayout);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Selection CharacterWithWordAccelerate$lambda$4(SelectionLayout selectionLayout) {
|
|
Selection.AnchorInfo end;
|
|
Selection.AnchorInfo updateSelectionBoundary;
|
|
Selection.AnchorInfo start;
|
|
Selection.AnchorInfo anchorInfo;
|
|
Selection previousSelection = selectionLayout.getPreviousSelection();
|
|
if (previousSelection == null) {
|
|
return Word.adjust(selectionLayout);
|
|
}
|
|
if (selectionLayout.isStartHandle()) {
|
|
end = previousSelection.getStart();
|
|
updateSelectionBoundary = SelectionAdjustmentKt.updateSelectionBoundary(selectionLayout, selectionLayout.getStartInfo(), end);
|
|
anchorInfo = previousSelection.getEnd();
|
|
start = updateSelectionBoundary;
|
|
} else {
|
|
end = previousSelection.getEnd();
|
|
updateSelectionBoundary = SelectionAdjustmentKt.updateSelectionBoundary(selectionLayout, selectionLayout.getEndInfo(), end);
|
|
start = previousSelection.getStart();
|
|
anchorInfo = updateSelectionBoundary;
|
|
}
|
|
if (Intrinsics.areEqual(updateSelectionBoundary, end)) {
|
|
return previousSelection;
|
|
}
|
|
return SelectionAdjustmentKt.ensureAtLeastOneChar(new Selection(start, anchorInfo, selectionLayout.getCrossStatus() == CrossStatus.CROSSED || (selectionLayout.getCrossStatus() == CrossStatus.COLLAPSED && start.getOffset() > anchorInfo.getOffset())), selectionLayout);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Selection None$lambda$0(SelectionLayout selectionLayout) {
|
|
return new Selection(selectionLayout.getStartInfo().anchorForOffset(selectionLayout.getStartInfo().getRawStartHandleOffset()), selectionLayout.getEndInfo().anchorForOffset(selectionLayout.getEndInfo().getRawEndHandleOffset()), selectionLayout.getCrossStatus() == CrossStatus.CROSSED);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Selection Paragraph$lambda$3(SelectionLayout selectionLayout) {
|
|
Selection adjustToBoundaries;
|
|
adjustToBoundaries = SelectionAdjustmentKt.adjustToBoundaries(selectionLayout, new BoundaryFunction() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$Paragraph$1$1
|
|
@Override // androidx.compose.foundation.text.selection.BoundaryFunction
|
|
/* renamed from: getBoundary-fzxv0v0 */
|
|
public final long mo1511getBoundaryfzxv0v0(@NotNull SelectableInfo selectableInfo, int i) {
|
|
return StringHelpersKt.getParagraphBoundary(selectableInfo.getInputText(), i);
|
|
}
|
|
});
|
|
return adjustToBoundaries;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Selection Word$lambda$2(SelectionLayout selectionLayout) {
|
|
Selection adjustToBoundaries;
|
|
adjustToBoundaries = SelectionAdjustmentKt.adjustToBoundaries(selectionLayout, new BoundaryFunction() { // from class: androidx.compose.foundation.text.selection.SelectionAdjustment$Companion$Word$1$1
|
|
@Override // androidx.compose.foundation.text.selection.BoundaryFunction
|
|
/* renamed from: getBoundary-fzxv0v0 */
|
|
public final long mo1511getBoundaryfzxv0v0(@NotNull SelectableInfo selectableInfo, int i) {
|
|
return selectableInfo.getTextLayoutResult().m6802getWordBoundaryjx7JFs(i);
|
|
}
|
|
});
|
|
return adjustToBoundaries;
|
|
}
|
|
|
|
@NotNull
|
|
public final SelectionAdjustment getCharacter() {
|
|
return Character;
|
|
}
|
|
|
|
@NotNull
|
|
public final SelectionAdjustment getCharacterWithWordAccelerate() {
|
|
return CharacterWithWordAccelerate;
|
|
}
|
|
|
|
@NotNull
|
|
public final SelectionAdjustment getNone() {
|
|
return None;
|
|
}
|
|
|
|
@NotNull
|
|
public final SelectionAdjustment getParagraph() {
|
|
return Paragraph;
|
|
}
|
|
|
|
@NotNull
|
|
public final SelectionAdjustment getWord() {
|
|
return Word;
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
Selection adjust(@NotNull SelectionLayout layout);
|
|
}
|