Merge pull request #182 from AdrianLxM/wear-bolus5
Background for wear settings
This commit is contained in:
commit
11e57e4043
|
@ -2,7 +2,8 @@ package info.nightscout.androidaps.interaction;
|
||||||
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceActivity;
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import preference.WearPreferenceActivity;
|
import preference.WearPreferenceActivity;
|
||||||
|
@ -13,6 +14,9 @@ public class AAPSPreferences extends WearPreferenceActivity {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
addPreferencesFromResource(R.xml.preferences);
|
addPreferencesFromResource(R.xml.preferences);
|
||||||
|
ViewGroup view = (ViewGroup)getWindow().getDecorView();
|
||||||
|
removeBackgroundRecursively(view);
|
||||||
|
view.setBackground(getResources().getDrawable(R.drawable.settings_background));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,4 +25,15 @@ public class AAPSPreferences extends WearPreferenceActivity {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
12
wear/src/main/res/drawable/settings_background.xml
Normal file
12
wear/src/main/res/drawable/settings_background.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<solid android:color="@color/black"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:drawable="@drawable/nslogo_background" />
|
||||||
|
|
||||||
|
|
||||||
|
</layer-list>
|
Loading…
Reference in a new issue