Merge branch 'tubular' into 'master'

support tubular and probably other NewPipe forks

See merge request android_translation_layer/android_translation_layer!153
This commit is contained in:
julianwi 2025-04-09 10:44:25 +00:00
commit 4ae6b9cc20
3 changed files with 15 additions and 3 deletions

View file

@ -78,13 +78,17 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
int length = layers.length;
ChildDrawable[] r = new ChildDrawable[length];
int j = 0;
for (int i = 0; i < length; i++) {
r[i] = new ChildDrawable();
r[i].mDrawable = layers[i];
if (layers[i] == null)
continue;
r[j] = new ChildDrawable();
r[j].mDrawable = layers[i];
layers[i].setCallback(this);
mLayerState.mChildrenChangingConfigurations |= layers[i].getChangingConfigurations();
j++;
}
mLayerState.mNum = length;
mLayerState.mNum = j;
mLayerState.mChildren = r;
ensurePadding();

View file

@ -2192,4 +2192,8 @@ public class View implements Drawable.Callback {
public void restoreHierarchyState(SparseArray<Parcelable> container) {}
public boolean isHovered() { return false; }
public void scrollBy(int x, int y) {
scrollTo(scrollX + x, scrollY + y);
}
}

View file

@ -11,6 +11,10 @@ public class CookieManager {
if (Context.this_application.getPackageName().equals("org.schabi.newpipe")) {
throw new RuntimeException("CookieManager not yet fully implemented");
}
try { // also handle NewPipe forks which can have a different packagename
Class.forName("org.schabi.newpipe.util.potoken.PoTokenWebView");
throw new RuntimeException("CookieManager not yet fully implemented");
} catch (ClassNotFoundException e) {}
return new CookieManager();
}