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
Dialog: apply window background from theme
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
package android.app;
|
package android.app;
|
||||||
|
|
||||||
|
import android.R;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
@@ -31,6 +34,12 @@ public class Dialog implements Window.Callback, DialogInterface {
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
nativePtr = nativeInit();
|
nativePtr = nativeInit();
|
||||||
window = new Window(context, this);
|
window = new Window(context, this);
|
||||||
|
TypedArray ta = context.obtainStyledAttributes(new int[] {R.attr.windowBackground});
|
||||||
|
Drawable background = ta.getDrawable(0);
|
||||||
|
if (background != null)
|
||||||
|
window.setBackgroundDrawable(background);
|
||||||
|
ta.recycle();
|
||||||
|
|
||||||
window.native_window = nativePtr;
|
window.native_window = nativePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user