You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
API stubs and fixes for composeUI
This commit is contained in:
10
src/api-impl/android/text/BoringLayout.java
Normal file
10
src/api-impl/android/text/BoringLayout.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package android.text;
|
||||
|
||||
public class BoringLayout extends Layout {
|
||||
|
||||
public static class Metrics {};
|
||||
|
||||
public static Metrics isBoring(CharSequence source, TextPaint paint, Metrics metrics) {
|
||||
return metrics;
|
||||
}
|
||||
}
|
||||
@@ -29,4 +29,34 @@ public class Layout {
|
||||
public void draw(Canvas canvas) {}
|
||||
|
||||
public int getParagraphDirection(int line) {return 0;}
|
||||
|
||||
public static float getDesiredWidth(CharSequence source, int start, int end, TextPaint paint) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public int getLineEnd(int line) {return 100;}
|
||||
|
||||
public int getLineStart(int line) {return 0;}
|
||||
|
||||
public int getLineAscent(int line) {return 0;}
|
||||
|
||||
public int getLineDescent(int line) {return 0;}
|
||||
|
||||
public int getTopPadding() {return 0;}
|
||||
|
||||
public int getBottomPadding() {return 0;}
|
||||
|
||||
public float getLineLeft(int line) {return 0;}
|
||||
|
||||
public int getLineBottom(int line) {return 0;}
|
||||
|
||||
public int getLineBaseline(int line) {return 0;}
|
||||
|
||||
public boolean isRtlCharAt(int offset) {return false;}
|
||||
|
||||
public float getSecondaryHorizontal(int line) {return 0;}
|
||||
|
||||
public int getLineForVertical(int y) {return 0;}
|
||||
|
||||
public int getOffsetForHorizontal(int line, float x) {return 0;}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
package android.text;
|
||||
|
||||
public class TextDirectionHeuristic {
|
||||
public interface TextDirectionHeuristic {
|
||||
|
||||
public boolean isRtl(CharSequence text, int start, int end);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,17 @@ package android.text;
|
||||
|
||||
public class TextDirectionHeuristics {
|
||||
|
||||
public static final TextDirectionHeuristic LTR = new TextDirectionHeuristic();
|
||||
public static final TextDirectionHeuristic LTR = new TextDirectionHeuristic() {
|
||||
@Override
|
||||
public boolean isRtl(CharSequence text, int start, int end) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public static final TextDirectionHeuristic RTL = new TextDirectionHeuristic();
|
||||
public static final TextDirectionHeuristic RTL = new TextDirectionHeuristic() {
|
||||
@Override
|
||||
public boolean isRtl(CharSequence text, int start, int end) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,4 +79,8 @@ public class TextPaint extends Paint {
|
||||
underlineColor = color;
|
||||
underlineThickness = thickness;
|
||||
}
|
||||
|
||||
public float getLetterSpacing() {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user