diff options
Diffstat (limited to 'library/main')
-rw-r--r-- | library/main/res/layout/suw_glif_header.xml | 3 | ||||
-rw-r--r-- | library/main/res/values-bn/strings.xml | 2 | ||||
-rw-r--r-- | library/main/res/values-en-rCA/strings.xml | 23 | ||||
-rw-r--r-- | library/main/res/values-en-rXC/strings.xml | 23 | ||||
-rw-r--r-- | library/main/res/values-hi/strings.xml | 2 | ||||
-rw-r--r-- | library/main/res/values-mr/strings.xml | 2 | ||||
-rw-r--r-- | library/main/res/values-te/strings.xml | 2 | ||||
-rw-r--r-- | library/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | library/main/src/com/android/setupwizardlib/GlifLayout.java | 11 | ||||
-rw-r--r-- | library/main/src/com/android/setupwizardlib/template/IconMixin.java | 2 | ||||
-rw-r--r-- | library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java | 31 |
11 files changed, 87 insertions, 15 deletions
diff --git a/library/main/res/layout/suw_glif_header.xml b/library/main/res/layout/suw_glif_header.xml index b090f79..cfabcb1 100644 --- a/library/main/res/layout/suw_glif_header.xml +++ b/library/main/res/layout/suw_glif_header.xml @@ -26,7 +26,8 @@ style="@style/SuwGlifIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:contentDescription="@null" /> + android:contentDescription="@null" + android:visibility="gone" /> <TextView android:id="@+id/suw_layout_title" diff --git a/library/main/res/values-bn/strings.xml b/library/main/res/values-bn/strings.xml index d807c08..88865ee 100644 --- a/library/main/res/values-bn/strings.xml +++ b/library/main/res/values-bn/strings.xml @@ -19,5 +19,5 @@ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="suw_next_button_label" msgid="7269625133873553978">"পরবর্তী"</string> <string name="suw_back_button_label" msgid="1460929053642711025">"ফিরুন"</string> - <string name="suw_more_button_label" msgid="7769076059705546563">"আরো"</string> + <string name="suw_more_button_label" msgid="7769076059705546563">"আরও"</string> </resources> diff --git a/library/main/res/values-en-rCA/strings.xml b/library/main/res/values-en-rCA/strings.xml new file mode 100644 index 0000000..5260500 --- /dev/null +++ b/library/main/res/values-en-rCA/strings.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="suw_next_button_label" msgid="7269625133873553978">"Next"</string> + <string name="suw_back_button_label" msgid="1460929053642711025">"Back"</string> + <string name="suw_more_button_label" msgid="7769076059705546563">"More"</string> +</resources> diff --git a/library/main/res/values-en-rXC/strings.xml b/library/main/res/values-en-rXC/strings.xml new file mode 100644 index 0000000..693af6b --- /dev/null +++ b/library/main/res/values-en-rXC/strings.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="suw_next_button_label" msgid="7269625133873553978">"Next"</string> + <string name="suw_back_button_label" msgid="1460929053642711025">"Back"</string> + <string name="suw_more_button_label" msgid="7769076059705546563">"More"</string> +</resources> diff --git a/library/main/res/values-hi/strings.xml b/library/main/res/values-hi/strings.xml index d30fbb4..3fb41d3 100644 --- a/library/main/res/values-hi/strings.xml +++ b/library/main/res/values-hi/strings.xml @@ -17,7 +17,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="suw_next_button_label" msgid="7269625133873553978">"आगे"</string> + <string name="suw_next_button_label" msgid="7269625133873553978">"आगे बढ़ें"</string> <string name="suw_back_button_label" msgid="1460929053642711025">"पीछे"</string> <string name="suw_more_button_label" msgid="7769076059705546563">"अधिक"</string> </resources> diff --git a/library/main/res/values-mr/strings.xml b/library/main/res/values-mr/strings.xml index bb9980e..a529655 100644 --- a/library/main/res/values-mr/strings.xml +++ b/library/main/res/values-mr/strings.xml @@ -18,6 +18,6 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="suw_next_button_label" msgid="7269625133873553978">"पुढील"</string> - <string name="suw_back_button_label" msgid="1460929053642711025">"परत"</string> + <string name="suw_back_button_label" msgid="1460929053642711025">"मागे"</string> <string name="suw_more_button_label" msgid="7769076059705546563">"अधिक"</string> </resources> diff --git a/library/main/res/values-te/strings.xml b/library/main/res/values-te/strings.xml index 4209a3c..b120ee8 100644 --- a/library/main/res/values-te/strings.xml +++ b/library/main/res/values-te/strings.xml @@ -17,7 +17,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="suw_next_button_label" msgid="7269625133873553978">"తదుపరి"</string> + <string name="suw_next_button_label" msgid="7269625133873553978">"తర్వాత"</string> <string name="suw_back_button_label" msgid="1460929053642711025">"వెనుకకు"</string> <string name="suw_more_button_label" msgid="7769076059705546563">"మరింత"</string> </resources> diff --git a/library/main/res/values/attrs.xml b/library/main/res/values/attrs.xml index 36d5fb7..d378bb0 100644 --- a/library/main/res/values/attrs.xml +++ b/library/main/res/values/attrs.xml @@ -102,6 +102,7 @@ <attr name="suwBackgroundBaseColor" format="color" /> <attr name="suwColorPrimary" /> <attr name="suwFooter" format="reference" /> + <attr name="suwLayoutFullscreen" format="boolean" /> </declare-styleable> <declare-styleable name="SuwStatusBarBackgroundLayout"> diff --git a/library/main/src/com/android/setupwizardlib/GlifLayout.java b/library/main/src/com/android/setupwizardlib/GlifLayout.java index f4d52a5..dd0963b 100644 --- a/library/main/src/com/android/setupwizardlib/GlifLayout.java +++ b/library/main/src/com/android/setupwizardlib/GlifLayout.java @@ -77,6 +77,8 @@ public class GlifLayout extends TemplateLayout { @Nullable private ColorStateList mBackgroundBaseColor; + private boolean mLayoutFullscreen = true; + public GlifLayout(Context context) { this(context, 0, 0); } @@ -139,7 +141,13 @@ public class GlifLayout extends TemplateLayout { inflateFooter(footer); } + mLayoutFullscreen = a.getBoolean(R.styleable.SuwGlifLayout_suwLayoutFullscreen, true); + a.recycle(); + + if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP && mLayoutFullscreen) { + setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + } } @Override @@ -280,9 +288,6 @@ public class GlifLayout extends TemplateLayout { patternBg.setBackgroundDrawable(background); } } - if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { - setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); - } } public boolean isProgressBarShown() { diff --git a/library/main/src/com/android/setupwizardlib/template/IconMixin.java b/library/main/src/com/android/setupwizardlib/template/IconMixin.java index 46c23f0..c42299b 100644 --- a/library/main/src/com/android/setupwizardlib/template/IconMixin.java +++ b/library/main/src/com/android/setupwizardlib/template/IconMixin.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.view.View; import android.widget.ImageView; import com.android.setupwizardlib.R; @@ -61,6 +62,7 @@ public class IconMixin implements Mixin { final ImageView iconView = getView(); if (iconView != null) { iconView.setImageDrawable(icon); + iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); } } diff --git a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java index a93694c..32929aa 100644 --- a/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java +++ b/library/main/src/com/android/setupwizardlib/util/WizardManagerHelper.java @@ -27,6 +27,8 @@ import android.support.annotation.VisibleForTesting; import com.android.setupwizardlib.R; +import java.util.Arrays; + public class WizardManagerHelper { private static final String ACTION_NEXT = "com.android.wizard.NEXT"; @@ -45,6 +47,8 @@ public class WizardManagerHelper { static final String EXTRA_IS_FIRST_RUN = "firstRun"; @VisibleForTesting static final String EXTRA_IS_DEFERRED_SETUP = "deferredSetup"; + @VisibleForTesting + static final String EXTRA_IS_PRE_DEFERRED_SETUP = "preDeferredSetup"; public static final String EXTRA_THEME = "theme"; public static final String EXTRA_USE_IMMERSIVE_MODE = "useImmersiveMode"; @@ -140,13 +144,14 @@ public class WizardManagerHelper { */ public static void copyWizardManagerExtras(Intent srcIntent, Intent dstIntent) { dstIntent.putExtra(EXTRA_WIZARD_BUNDLE, srcIntent.getBundleExtra(EXTRA_WIZARD_BUNDLE)); - dstIntent.putExtra(EXTRA_THEME, srcIntent.getStringExtra(EXTRA_THEME)); - dstIntent.putExtra(EXTRA_IS_FIRST_RUN, - srcIntent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false)); - dstIntent.putExtra(EXTRA_IS_DEFERRED_SETUP, - srcIntent.getBooleanExtra(EXTRA_IS_DEFERRED_SETUP, false)); - dstIntent.putExtra(EXTRA_SCRIPT_URI, srcIntent.getStringExtra(EXTRA_SCRIPT_URI)); - dstIntent.putExtra(EXTRA_ACTION_ID, srcIntent.getStringExtra(EXTRA_ACTION_ID)); + for (String key : Arrays.asList( + EXTRA_IS_FIRST_RUN, EXTRA_IS_DEFERRED_SETUP, EXTRA_IS_PRE_DEFERRED_SETUP)) { + dstIntent.putExtra(key, srcIntent.getBooleanExtra(key, false)); + } + + for (String key : Arrays.asList(EXTRA_THEME, EXTRA_SCRIPT_URI, EXTRA_ACTION_ID)) { + dstIntent.putExtra(key, srcIntent.getStringExtra(key)); + } } /** @@ -213,6 +218,18 @@ public class WizardManagerHelper { } /** + * Checks whether an intent is running in "pre-deferred" setup wizard flow. + * + * @param originalIntent The original intent that was used to start the step, usually via + * {@link android.app.Activity#getIntent()}. + * @return true if the intent passed in was running in "pre-deferred" setup wizard. + */ + public static boolean isPreDeferredSetupWizard(Intent originalIntent) { + return originalIntent != null + && originalIntent.getBooleanExtra(EXTRA_IS_PRE_DEFERRED_SETUP, false); + } + + /** * Checks the intent whether the extra indicates that the light theme should be used or not. If * the theme is not specified in the intent, or the theme specified is unknown, the value def * will be returned. |