api-impl: add misc stubs/impls

This commit is contained in:
Mis012
2024-06-22 14:22:37 +02:00
parent da90302946
commit df074bd2b4
6 changed files with 572 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ package android.content.res;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
// import android.text.TextUtils; // import android.text.TextUtils;
import android.os.LocaleList;
import android.view.View; import android.view.View;
import java.util.Locale; import java.util.Locale;
@@ -1446,6 +1447,34 @@ public final class Configuration implements Comparable<Configuration> {
return result; return result;
} }
/**
* Get the locale list. This is the preferred way for getting the locales (instead of using
* the direct accessor to {@link #locale}, which would only provide the primary locale).
*
* @return The locale list.
*/
public LocaleList getLocales() {
return new LocaleList();
/*fixUpLocaleList();
return mLocaleList;*/
}
/**
* Set the locale list. This is the preferred way for setting up the locales (instead of using
* the direct accessor or {@link #setLocale(Locale)}). This will also set the layout direction
* according to the first locale in the list.
*
* Note that the layout direction will always come from the first locale in the locale list,
* even if the locale is not supported by the resources (the resources may only support
* another locale further down the list which has a different direction).
*
* @param locales The locale list. If null, an empty LocaleList will be assigned.
*/
public void setLocales(LocaleList locales) {
/*mLocaleList = locales == null ? LocaleList.getEmptyLocaleList() : locales;
locale = mLocaleList.get(0);
setLayoutDirection(locale);*/
}
/** /**
* Set the locale. This is the preferred way for setting up the locale (instead of using the * Set the locale. This is the preferred way for setting up the locale (instead of using the
* direct accessor). This will also set the userLocale and layout direction according to * direct accessor). This will also set the userLocale and layout direction according to

View File

@@ -53,4 +53,13 @@ public class VectorDrawable extends Drawable {
this.paintable = bm.getTexture(); this.paintable = bm.getTexture();
} }
@Override
public int getIntrinsicWidth() {
return 24; // FIXME
}
@Override
public int getIntrinsicHeight() {
return 24; // FIXME
}
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1770,4 +1770,8 @@ public class View implements Drawable.Callback {
public String getTransitionName() {return null;} public String getTransitionName() {return null;}
public WindowId getWindowId() {return null;} public WindowId getWindowId() {return null;}
public boolean isInLayout() {
return false; // FIXME
}
} }

View File

@@ -278,4 +278,6 @@ public class TextView extends View {
} }
public int getMaxWidth() {return 1000;} public int getMaxWidth() {return 1000;}
public void nullLayouts() {}
} }

View File

@@ -279,6 +279,7 @@ hax_jar = jar('hax', [
'android/os/IBinder.java', 'android/os/IBinder.java',
'android/os/IInterface.java', 'android/os/IInterface.java',
'android/os/IMessenger.java', 'android/os/IMessenger.java',
'android/os/LocaleList.java',
'android/os/Looper.java', 'android/os/Looper.java',
'android/os/MemoryFile.java', 'android/os/MemoryFile.java',
'android/os/Message.java', 'android/os/Message.java',