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
Add some stubs needed by android material library
This commit is contained in:
12
src/api-impl/android/text/Layout.java
Normal file
12
src/api-impl/android/text/Layout.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package android.text;
|
||||
|
||||
public class Layout {
|
||||
|
||||
public enum Alignment {
|
||||
ALIGN_NORMAL,
|
||||
ALIGN_OPPOSITE,
|
||||
ALIGN_CENTER,
|
||||
ALIGN_LEFT,
|
||||
ALIGN_RIGHT,
|
||||
}
|
||||
}
|
||||
21
src/api-impl/android/text/StaticLayout.java
Normal file
21
src/api-impl/android/text/StaticLayout.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package android.text;
|
||||
|
||||
import android.text.Layout.Alignment;
|
||||
|
||||
public class StaticLayout {
|
||||
|
||||
private CharSequence text;
|
||||
|
||||
public StaticLayout(CharSequence source, int bufstart, int bufend,
|
||||
TextPaint paint, int outerwidth,
|
||||
Alignment align, TextDirectionHeuristic textDir,
|
||||
float spacingmult, float spacingadd,
|
||||
boolean includepad,
|
||||
TextUtils.TruncateAt ellipsize, int ellipsizedWidth, int maxLines) {
|
||||
this.text = source;
|
||||
}
|
||||
|
||||
public CharSequence getText() {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
4
src/api-impl/android/text/TextDirectionHeuristic.java
Normal file
4
src/api-impl/android/text/TextDirectionHeuristic.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package android.text;
|
||||
|
||||
public class TextDirectionHeuristic {
|
||||
}
|
||||
8
src/api-impl/android/text/TextDirectionHeuristics.java
Normal file
8
src/api-impl/android/text/TextDirectionHeuristics.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package android.text;
|
||||
|
||||
public class TextDirectionHeuristics {
|
||||
|
||||
public static final TextDirectionHeuristic LTR = new TextDirectionHeuristic();
|
||||
|
||||
public static final TextDirectionHeuristic RTL = new TextDirectionHeuristic();
|
||||
}
|
||||
@@ -96,4 +96,16 @@ public class TextUtils {
|
||||
MARQUEE,
|
||||
END_SMALL
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the original text if it fits in the specified width
|
||||
* given the properties of the specified Paint,
|
||||
* or, if it does not fit, a truncated
|
||||
* copy with ellipsis character added at the specified edge or center.
|
||||
*/
|
||||
public static CharSequence ellipsize(CharSequence text,
|
||||
TextPaint p,
|
||||
float avail, TruncateAt where) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user