2017-02-09 20:54:41 +01:00
|
|
|
package info.nightscout.androidaps.interaction;
|
2016-11-17 15:17:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
2017-02-15 16:27:46 +01:00
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
2016-11-17 15:17:02 +01:00
|
|
|
|
|
|
|
import info.nightscout.androidaps.R;
|
2016-11-28 18:40:50 +01:00
|
|
|
import preference.WearPreferenceActivity;
|
2016-11-17 15:17:02 +01:00
|
|
|
|
2017-02-09 21:40:00 +01:00
|
|
|
public class AAPSPreferences extends WearPreferenceActivity {
|
2016-11-17 15:17:02 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
addPreferencesFromResource(R.xml.preferences);
|
2017-02-15 16:27:46 +01:00
|
|
|
ViewGroup view = (ViewGroup)getWindow().getDecorView();
|
|
|
|
removeBackgroundRecursively(view);
|
|
|
|
view.setBackground(getResources().getDrawable(R.drawable.settings_background));
|
2016-11-17 15:17:02 +01:00
|
|
|
}
|
|
|
|
|
2017-02-09 21:40:00 +01:00
|
|
|
@Override
|
|
|
|
protected void onPause(){
|
|
|
|
super.onPause();
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
|
2017-02-15 16:27:46 +01:00
|
|
|
void removeBackgroundRecursively(View parent) {
|
|
|
|
if (parent instanceof ViewGroup) {
|
|
|
|
ViewGroup group = (ViewGroup)parent;
|
|
|
|
for (int i = 0; i < group.getChildCount(); i++) {
|
|
|
|
removeBackgroundRecursively(group.getChildAt(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parent.setBackground(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-11-17 15:17:02 +01:00
|
|
|
}
|