Commit e3146e92 authored by Jessica Hummel's avatar Jessica Hummel Committed by Sander Alewijnse
Browse files

Adapt provisioning UI to mocks.

Change-Id: I329e6768fea2ac49a3bb0fe166d8f2a0b4a88252
parent 59ea1f94
......@@ -52,7 +52,8 @@
<application
android:allowClearUserData="false"
android:hardwareAccelerated="true"
android:label="@string/app_name" >
android:label="@string/app_name"
android:theme="@style/SetupWorkSpaceTheme" >
<!--
Note: Setup activities are android:immersive to prevent full-screen notifications (USB
......
......@@ -20,56 +20,47 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
style="@style/UserConsentBackground">
android:orientation="vertical">
<LinearLayout
style="@style/SetupWorkSpaceHeader">
</LinearLayout>
<TextView
android:id="@+id/title"
android:layout_width="fill_parent"
android:text="@string/encrypt_device_title"
style="@style/UserConsentTitle"/>
style="@style/SetupWorkSpaceTitle"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:fillViewport="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
style="@style/SetupWorkSpaceTextContainer">
<TextView
android:layout_width="fill_parent"
android:text="@string/encrypt_device_text"
style="@style/UserConsentMainText"/>
style="@style/SetupWorkSpaceMainText"/>
<TextView
android:id="@+id/warning_low_charge"
android:layout_width="fill_parent"
android:text="@string/encrypt_device_low_charge_text"
android:textStyle="bold"
android:visibility="gone"
style="@style/UserConsentMainText"/>
style="@style/SetupWorkSpaceMainText"/>
<TextView
android:id="@+id/warning_unplugged"
android:layout_width="fill_parent"
android:text="@string/encrypt_device_unplugged_text"
android:textStyle="bold"
android:visibility="gone"
style="@style/UserConsentMainText"/>
style="@style/SetupWorkSpaceMainText"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="bottom"
android:layout_weight="1">
<Button
android:id="@+id/accept_button"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="@string/encrypt_device_confirm"
style="@style/SetupButton"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<!-- Button bar -->
<LinearLayout
android:layout_width="fill_parent"
android:orientation="horizontal"
style="@style/UserConsentButtonBar">
<Button
android:id="@+id/accept_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/encrypt_device_confirm"
style="@style/UserConsentButton"/>
</LinearLayout>
</LinearLayout>
......@@ -22,7 +22,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
style="@style/UserConsentBackground">
style="@style/ProvisioningProgress">
<TextView
android:layout_width="match_parent"
......@@ -46,4 +46,4 @@
android:gravity="center"
android:textSize="30sp" />
</LinearLayout>
\ No newline at end of file
</LinearLayout>
......@@ -22,7 +22,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
style="@style/UserConsentBackground">
style="@style/ProvisioningProgress">
<TextView
android:id="@+id/provisioning_profile"
......
......@@ -20,43 +20,38 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
style="@style/UserConsentBackground">
<TextView
android:id="@+id/title"
android:layout_width="fill_parent"
android:hint="@string/what_is_corporate_profile"
style="@style/UserConsentTitle"/>
android:orientation="vertical">
<LinearLayout
style="@style/SetupWorkSpaceHeader">
</LinearLayout>
<TextView
android:layout_width="fill_parent"
android:hint="@string/placeholder"
style="@style/UserConsentMainText"/>
<!-- Padding -->
<View
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<!-- Button bar -->
style="@style/SetupWorkSpaceTitle"/>
<LinearLayout
android:layout_width="fill_parent"
android:orientation="horizontal"
style="@style/UserConsentButtonBar">
<Button
android:id="@+id/negative_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/no_thanks"
style="@style/UserConsentButton"/>
<Button
android:id="@+id/positive_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/lets_start"
style="@style/UserConsentButton"/>
</LinearLayout>
style="@style/SetupWorkSpaceTextContainer">
<TextView
android:text="@string/separate_work_spaces"
style="@style/SetupWorkSpaceMainText"/>
<TextView
android:text="@string/company_controls_workspace"
style="@style/SetupWorkSpaceMainText"/>
</LinearLayout>
\ No newline at end of file
<!-- Button bar -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/positive_button"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="@string/set_up"
style="@style/SetupButton"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
......@@ -17,10 +17,10 @@
*/
-->
<resources>
<color name="title_color">#33B5E5</color>
<color name="dark_grey_user_consent">#454545</color>
<color name="medium_grey_user_consent">#E6E6E6</color>
<color name="light_grey_user_consent">#F8F8F8</color>
<color name="title_color">#45316f</color>
<color name="black">#000000</color>
<color name="white">#ffffff</color>
<color name="light_turquoise">#b2dfdb</color>
<color name="dark_turquoise">#4db6ac</color>
<color name="blue">#4285f4</color>
</resources>
......@@ -26,24 +26,25 @@
<!-- Title of the main activity for profile owner provisioning. CHAR LIMIT=NONE] -->
<string name="provisioning_title">Provisioning...</string>
<!-- Managed profile provisioning flow UI. -->
<!-- Title of the dialog that asks for user consent to create a profile. CHAR LIMIT=NONE] -->
<string name="what_is_corporate_profile">What is corporate profile?</string>
<!-- String for negative button on user consent dialog for creating a profile CHAR LIMIT=NONE] -->
<string name="no_thanks">No, thanks</string>
<!-- String for positive button on user consent dialog for creating a profile CHAR LIMIT=NONE] -->
<string name="lets_start">Let\'s start</string>
<!-- Placeholder for text that expains what a corporate profile is CHAR LIMIT=NONE] -->
<string name="placeholder">A managed profile is:.... By consenting here you are allowing
the creation of a managed profile that will be owned by the application "name". "Name" will
have full control over the new profile and any data created on that profile. </string>
<!-- User consent -->
<!-- Title of all managed profile setup screens. CHAR LIMIT=NONE] -->
<string name="setup_work_space">Setup work space</string>
<!-- Part 1 of the text that asks for user consent to create a corporate profile CHAR LIMIT=NONE] -->
<string name="separate_work_spaces">Setup a separate work space from your personal space</string>
<!-- Part 2 of the text that asks for user consent to create a corporate profile CHAR LIMIT=NONE] -->
<string name="company_controls_workspace">Your company controls your work space on this device and keeps
it secure. You control your personal space. Your company can\'t access it.</string>
<!-- String for positive button on user consent dialog for creating a profile CHAR LIMIT=NONE] -->
<string name="set_up">Set up</string>
<!-- string shown when there already is a managed profile for this user. CHAR LIMIT=NONE] -->
<string name="managed_profile_already_present"> You already have a managed profile.
You cannot create a second one. </string>
<!-- Strings shown on prompt for user to encrypt and reboot the device -->
<string name="encrypt_device_title">Encrypt device</string>
<string name="encrypt_device_text">To continue, restart your device so it can be encrypted. This may take some time.</string>
<string name="encrypt_device_confirm">Restart</string>
<string name="encrypt_device_launch_settings">Encrypt Device</string>
......@@ -58,8 +59,7 @@
<string name="managed_provisioning_error_title">Oops!</string>
<!-- Explains the failure and what to do to next. CHAR LIMIT=NONE] -->
<string name="managed_provisioning_error_text">
Device provisioning failed. Please try again later!</string>
<string name="managed_provisioning_error_text"> Device provisioning failed. Please try again later!</string>
<!-- Error string displayed if this device doesn't support managed profiles. -->
<string name="managed_provisioning_not_supported">Sorry, managed profiles are not supported on this device.</string>
......
......@@ -27,35 +27,61 @@
<style name="WelcomeTheme" parent="@android:Theme.Holo.NoActionBar">
</style>
<style name="UserConsentBackground">
<item name="android:background">@color/light_grey_user_consent</item>
<item name="android:textColor">@color/dark_grey_user_consent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:padding">20dp</item>
<style name="SetupWorkSpaceTheme" parent="@android:Theme.NoTitleBar">
<item name="android:background">@color/white</item>
</style>
<style name="UserConsentTitle">
<item name="android:textSize">30sp</item>
<item name="android:textColor">@color/dark_grey_user_consent</item>
<item name="android:layout_height">wrap_content</item>
<style name="SetupWorkSpaceHeader">
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">151dp</item>
<item name="android:background">@color/light_turquoise</item>
</style>
<style name="UserConsentMainText">
<item name="android:textSize">20sp</item>
<item name="android:layout_marginTop">20dp</item>
<item name="android:background">@color/medium_grey_user_consent</item>
<item name="android:padding">30dp</item>
<item name="android:layout_height">wrap_content</item>
<style name="SetupWorkSpaceTitle" parent ="@style/SetupWorkSpaceLeftRightPadding">
<item name="android:text">@string/setup_work_space</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">72dp</item>
<item name="android:textSize">24sp</item>
<item name="android:background">@color/dark_turquoise</item>
<item name="android:textColor">@color/white</item>
<item name="android:gravity">center_vertical</item>
</style>
<style name="UserConsentButtonBar">
<item name="android:paddingTop">10dp</item>
<style name="SetupWorkSpaceMainText">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/black</item>
<item name="android:paddingTop">16dp</item>
</style>
<style name="SetupButton">
<item name="android:layout_width">100dp</item>
<item name="android:layout_height">35dp</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/white</item>
<item name="android:background">@color/blue</item>
</style>
<style name="UserConsentButton">
<item name="android:layout_height">40dp</item>
<item name ="android:layout_weight">1</item>
<style name="SetupWorkSpaceTextContainer" parent ="@style/SetupWorkSpaceLeftRightPadding">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:orientation">vertical</item>
<item name="android:paddingBottom">24dp</item>
</style>
<style name="SetupWorkSpaceLeftRightPadding">
<item name="android:paddingLeft">16dp</item>
<item name="android:paddingRight">16dp</item>
</style>
<style name="ProvisioningProgress">
<item name="android:layout_height">match_parent</item>
<item name="android:background">@color/dark_turquoise</item>
<item name="android:textColor">@color/white</item>
<item name="android:padding">20dp</item>
</style>
</resources>
\ No newline at end of file
</resources>
......@@ -23,15 +23,14 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.os.BatteryManager;
import android.os.Bundle;
import android.os.ServiceManager;
import android.os.storage.IMountService;
import android.os.storage.StorageManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.view.View;
import android.widget.Button;
/**
* Activity to ask for permission to activate full-filesystem encryption.
......
......@@ -41,20 +41,7 @@ public class UserConsentActivity extends Activity {
final View contentView = inflater.inflate(R.layout.user_consent, null);
setContentView(contentView);
TextView titleView = (TextView) contentView.findViewById(R.id.title);
String title = getResources().getString(R.string.what_is_corporate_profile);
titleView.setText(title.toUpperCase());
Button negativeButton = (Button) contentView.findViewById(R.id.negative_button);
Button positiveButton = (Button) contentView.findViewById(R.id.positive_button);
negativeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
returnUserConsentResult(false);
}
});
positiveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment