mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-17 03:17:17 +01:00
36 lines
1.9 KiB
Java
36 lines
1.9 KiB
Java
package androidx.compose.foundation.text;
|
|
|
|
import androidx.compose.ui.text.TextRangeKt;
|
|
import com.amazon.alexa.apl.handler.event.LoadIndexListDataEventHandler;
|
|
import kotlin.Metadata;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u0016\n\u0000\n\u0002\u0010\b\n\u0002\u0010\r\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u0014\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0001H\u0000\u001a\u0014\u0010\u0004\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0001H\u0000\u001a\u0019\u0010\u0005\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u0007\u001a\u00020\u0001H\u0000¢\u0006\u0002\u0010\b¨\u0006\t"}, d2 = {"findParagraphEnd", "", "", LoadIndexListDataEventHandler.START_INDEX_KEY, "findParagraphStart", "getParagraphBoundary", "Landroidx/compose/ui/text/TextRange;", "index", "(Ljava/lang/CharSequence;I)J", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
public final class StringHelpersKt {
|
|
public static final int findParagraphEnd(@NotNull CharSequence charSequence, int i) {
|
|
int length = charSequence.length();
|
|
while (i < length) {
|
|
if (charSequence.charAt(i) == '\n') {
|
|
return i;
|
|
}
|
|
i++;
|
|
}
|
|
return charSequence.length();
|
|
}
|
|
|
|
public static final int findParagraphStart(@NotNull CharSequence charSequence, int i) {
|
|
while (i > 0) {
|
|
if (charSequence.charAt(i - 1) == '\n') {
|
|
return i;
|
|
}
|
|
i--;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public static final long getParagraphBoundary(@NotNull CharSequence charSequence, int i) {
|
|
return TextRangeKt.TextRange(findParagraphStart(charSequence, i), findParagraphEnd(charSequence, i));
|
|
}
|
|
}
|