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
multiple additions and fixes for the Java APIs
Stuff needed for WhatsApp support
This commit is contained in:
@@ -241,7 +241,12 @@ public class LayoutInflater {
|
||||
} else {
|
||||
final View view = createViewFromTag(parent, name, attrs);
|
||||
final ViewGroup viewGroup = (ViewGroup)parent;
|
||||
final ViewGroup.LayoutParams params = viewGroup.generateLayoutParams(attrs);
|
||||
ViewGroup.LayoutParams params = null;
|
||||
try {
|
||||
params = viewGroup.generateLayoutParams(attrs);
|
||||
} catch (RuntimeException e) {
|
||||
params = viewGroup.generateDefaultLayoutParams();
|
||||
}
|
||||
params.resolveLayoutDirection(viewGroup.getLayoutDirection());
|
||||
rInflate(parser, view, attrs, true);
|
||||
viewGroup.addView(view, params);
|
||||
|
||||
@@ -50,4 +50,6 @@ public interface MenuItem {
|
||||
|
||||
public MenuItem setOnActionExpandListener(OnActionExpandListener listener);
|
||||
|
||||
public MenuItem setIcon(Drawable icon);
|
||||
|
||||
}
|
||||
@@ -1776,4 +1776,16 @@ public class View implements Drawable.Callback {
|
||||
public boolean isInLayout() {
|
||||
return false; // FIXME
|
||||
}
|
||||
|
||||
public void setTextDirection(int textDirection) {}
|
||||
|
||||
public Drawable getForeground() {return null;}
|
||||
|
||||
public void setScrollbarFadingEnabled(boolean fadeEnabled) {}
|
||||
|
||||
public void setScrollBarStyle(int style) {}
|
||||
|
||||
public void setVerticalScrollbarPosition(int position) {}
|
||||
|
||||
public void setNestedScrollingEnabled(boolean enabled) {}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,8 @@ public class ViewConfiguration {
|
||||
public static float getScrollFriction() {
|
||||
return 0.015f;
|
||||
}
|
||||
|
||||
public int getScaledWindowTouchSlop() {
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,4 +111,8 @@ public class Window {
|
||||
public int getNavigationBarColor() {
|
||||
return 0xFF888888; // gray
|
||||
}
|
||||
|
||||
public void setBackgroundDrawableResource(int resId) {}
|
||||
|
||||
public int getStatusBarColor() { return 0xFFFF0000; }
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.List;
|
||||
|
||||
public class AccessibilityManager {
|
||||
|
||||
public interface AccessibilityStateChangeListener {}
|
||||
|
||||
public boolean isTouchExplorationEnabled() {return false;}
|
||||
|
||||
public boolean isEnabled() {return false;}
|
||||
@@ -13,4 +15,8 @@ public class AccessibilityManager {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean addAccessibilityStateChangeListener(AccessibilityStateChangeListener listener) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,4 +22,6 @@ public class Animation {
|
||||
public void setAnimationListener(AnimationListener l) {
|
||||
l.onAnimationEnd(this); // FIXME
|
||||
}
|
||||
|
||||
public void setRepeatCount(int count) {}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,8 @@ public class InputMethodManager {
|
||||
|
||||
public boolean showSoftInput(View view, int flags) {return false;}
|
||||
|
||||
public boolean isFullscreenMode() {return false;}
|
||||
|
||||
public boolean isActive(View view) {return false;}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user