Skip to content

Commit 196800e

Browse files
committed
Set app primary/accent color in TestDPC
Create TestDPC own app theme. For fragment/activities used for provisioning, keep using setupwizard theme. Change-Id: Ibd5916162cb50f86202b5c912af69ec2bf3ed4c0
1 parent 8d505fb commit 196800e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

app/src/main/java/com/afwsamples/testdpc/SetupManagementFragment.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
import android.app.Fragment;
2222
import android.content.ClipData;
2323
import android.content.ContentResolver;
24+
import android.content.Context;
2425
import android.content.Intent;
2526
import android.content.res.ColorStateList;
2627
import android.net.Uri;
2728
import android.os.Build;
2829
import android.os.Bundle;
2930
import android.os.PersistableBundle;
31+
import android.view.ContextThemeWrapper;
3032
import android.view.LayoutInflater;
3133
import android.view.View;
3234
import android.view.ViewGroup;
@@ -93,7 +95,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
9395
mCurrentColor = getResources().getColor(R.color.teal);
9496
}
9597

96-
View view = inflater.inflate(R.layout.setup_management_fragment, container, false);
98+
// Use setupwizard theme
99+
final Context contextThemeWrapper =
100+
new ContextThemeWrapper(getActivity(), R.style.SetupTheme);
101+
LayoutInflater themeInflater = inflater.cloneInContext(contextThemeWrapper);
102+
View view = themeInflater.inflate(R.layout.setup_management_fragment, container, false);
97103
SetupWizardLayout layout = (SetupWizardLayout) view.findViewById(R.id.setup_wizard_layout);
98104
NavigationBar navigationBar = layout.getNavigationBar();
99105
navigationBar.setNavigationBarListener(this);

app/src/main/res/values/colors.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
limitations under the License.
1616
-->
1717
<resources>
18-
<color name="teal">#009587</color>
18+
<color name="teal">#009688</color>
1919
<color name="text_black">#333333</color>
2020
<color name="red">#ff0000</color>
2121
<color name="green">#00ff00</color>
2222
<color name="blue">#0000ff</color>
23+
<color name="dark_teal">#00796B</color>
24+
<color name="pink">#FF4081</color>
2325
</resources>

app/src/main/res/values/styles.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717

1818
<resources>
1919
<style name="SetupTheme" parent="SuwThemeMaterial.Light">
20-
<item name="android:colorAccent">@color/teal</item>
20+
<item name="android:colorAccent">@color/pink</item>
2121
<item name="suwLayoutTheme">@style/SetupIllustrationTheme</item>
2222
</style>
2323

24-
<style name="AppTheme" parent="SetupTheme">
24+
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
2525
<item name="android:windowActionBar">true</item>
2626
<item name="android:windowNoTitle">false</item>
27-
<item name="android:colorPrimaryDark">@android:color/black</item>
27+
<item name="android:colorPrimary">@color/teal</item>
28+
<item name="android:colorPrimaryDark">@color/dark_teal</item>
29+
<item name="android:colorAccent">@color/pink</item>
2830
</style>
2931

3032
<style name="SetupIllustrationTheme">

0 commit comments

Comments
 (0)