2015-08-08 16:47:22 +02:00
|
|
|
package juloo.keyboard2;
|
|
|
|
|
2022-11-05 10:13:35 +01:00
|
|
|
import android.content.res.Configuration;
|
|
|
|
import android.os.Build;
|
2015-08-08 16:47:22 +02:00
|
|
|
import android.os.Bundle;
|
|
|
|
import android.preference.PreferenceActivity;
|
|
|
|
|
|
|
|
public class SettingsActivity extends PreferenceActivity
|
|
|
|
{
|
2021-12-19 19:44:27 +01:00
|
|
|
@Override
|
|
|
|
public void onCreate(Bundle savedInstanceState)
|
|
|
|
{
|
2022-11-05 10:13:35 +01:00
|
|
|
detectSystemTheme();
|
2021-12-19 19:44:27 +01:00
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
addPreferencesFromResource(R.xml.settings);
|
|
|
|
}
|
2022-11-05 10:13:35 +01:00
|
|
|
|
|
|
|
/** The default theme is [Theme.DeviceDefault], which is dark. Detect if the
|
|
|
|
system is using light theme. */
|
|
|
|
void detectSystemTheme()
|
|
|
|
{
|
|
|
|
if (Build.VERSION.SDK_INT >= 14)
|
|
|
|
{
|
|
|
|
int ui_mode = getResources().getConfiguration().uiMode;
|
|
|
|
if ((ui_mode & Configuration.UI_MODE_NIGHT_NO) != 0)
|
|
|
|
setTheme(android.R.style.Theme_DeviceDefault_Light);
|
|
|
|
}
|
|
|
|
}
|
2015-08-08 16:47:22 +02:00
|
|
|
}
|