Bug 1268647 - Add Switch to layout. r=sebastian
MozReview-Commit-ID: 1CCXAzqVVvO
--- a/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/firstrun/FirstrunPanel.java
@@ -24,17 +24,17 @@ import org.mozilla.gecko.TelemetryContra
*/
public class FirstrunPanel extends Fragment {
public static final int TITLE_RES = -1;
protected boolean showBrowserHint = true;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
- final ViewGroup root = (ViewGroup) inflater.inflate(R.layout.firstrun_basepanel_fragment, container, false);
+ final ViewGroup root = (ViewGroup) inflater.inflate(R.layout.firstrun_basepanel_checkable_fragment, container, false);
Bundle args = getArguments();
if (args != null) {
final int imageRes = args.getInt(FirstrunPagerConfig.KEY_IMAGE);
final int textRes = args.getInt(FirstrunPagerConfig.KEY_TEXT);
final int subtextRes = args.getInt(FirstrunPagerConfig.KEY_SUBTEXT);
((ImageView) root.findViewById(R.id.firstrun_image)).setImageResource(imageRes);
((TextView) root.findViewById(R.id.firstrun_text)).setText(textRes);
rename from mobile/android/base/resources/layout/firstrun_basepanel_fragment.xml
rename to mobile/android/base/resources/layout/firstrun_basepanel_checkable_fragment.xml
--- a/mobile/android/base/resources/layout/firstrun_basepanel_fragment.xml
+++ b/mobile/android/base/resources/layout/firstrun_basepanel_checkable_fragment.xml
@@ -35,19 +35,22 @@
<TextView android:id="@+id/firstrun_subtext"
android:layout_width="@dimen/firstrun_content_width"
android:layout_height="wrap_content"
android:paddingTop="20dp"
android:paddingBottom="30dp"
android:gravity="center"
android:textAppearance="@style/TextAppearance.FirstrunRegular.Body"/>
- <View android:layout_weight="1"
- android:layout_height="0dp"
- android:layout_width="match_parent"/>
+ <android.support.v7.widget.SwitchCompat
+ android:id="@+id/firstrun_switch"
+ android:layout_width="wrap_content"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:visibility="invisible"/>
<TextView android:id="@+id/firstrun_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="30dp"
android:gravity="center"
android:textAppearance="@style/TextAppearance.FirstrunRegular.Link"
android:text="@string/firstrun_button_next"/>