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
Activity: set windowBackground on start
This overwrites the GTK window backgrounds and therefore makes theming more consistent when GTK theme and Android theme doesn't match.
This commit is contained in:
@@ -8,6 +8,8 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageParser;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -170,6 +172,12 @@ public class Activity extends ContextThemeWrapper implements Window.Callback {
|
||||
fragment.onStart();
|
||||
}
|
||||
|
||||
TypedArray ta = obtainStyledAttributes(new int[] {R.attr.windowBackground});
|
||||
Drawable background = ta.getDrawable(0);
|
||||
if (background != null)
|
||||
window.setBackgroundDrawable(background);
|
||||
ta.recycle();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user