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-impl: misc fixes and additions to make Telegram launch
This commit is contained in:
@@ -123,7 +123,7 @@ public class TextView extends View {
|
||||
public void setTextColor(ColorStateList colors) {
|
||||
if (colors != null) {
|
||||
this.colors = colors;
|
||||
setTextColor(colors.getDefaultColor()); // TODO: do this properly
|
||||
native_setTextColor(colors.getDefaultColor()); // TODO: do this properly
|
||||
}
|
||||
}
|
||||
public void setTypeface(Typeface tf, int style) {
|
||||
|
||||
45
src/api-impl/android/widget/ViewSwitcher.java
Normal file
45
src/api-impl/android/widget/ViewSwitcher.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package android.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
public class ViewSwitcher extends ViewAnimator {
|
||||
|
||||
public interface ViewFactory {
|
||||
public View makeView();
|
||||
}
|
||||
|
||||
private ViewFactory factory;
|
||||
|
||||
public ViewSwitcher(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public ViewSwitcher(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public void setFactory(ViewFactory factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getCurrentView() {
|
||||
View view = super.getCurrentView();
|
||||
if (view == null) {
|
||||
view = factory.makeView();
|
||||
addView(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
public View getNextView() {
|
||||
View view = getChildAt(mWhichChild+1);
|
||||
if (view == null) {
|
||||
view = factory.makeView();
|
||||
addView(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user