Add some stubs needed by android material library

This commit is contained in:
Julian Winkler
2023-08-22 14:41:01 +02:00
parent ca975a0e7c
commit 960930a348
42 changed files with 428 additions and 19 deletions

View File

@@ -0,0 +1,12 @@
package android.text;
public class Layout {
public enum Alignment {
ALIGN_NORMAL,
ALIGN_OPPOSITE,
ALIGN_CENTER,
ALIGN_LEFT,
ALIGN_RIGHT,
}
}

View 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;
}
}

View File

@@ -0,0 +1,4 @@
package android.text;
public class TextDirectionHeuristic {
}

View 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();
}

View File

@@ -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;
}
}