Dont use R.id.content to host GuidedStepFragment am: caaf7b076e

am: e354e923dc

* commit 'e354e923dc008aee939861cc1c32f9596cf494f3':
  Dont use R.id.content to host GuidedStepFragment
This commit is contained in:
Dake Gu
2015-10-30 00:04:09 +00:00
committed by android-build-merger
7 changed files with 48 additions and 12 deletions

View File

@@ -32,4 +32,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- container for hosting GuidedStepFragment -->
<FrameLayout android:id="@+id/lb_guidedstep_host"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

View File

@@ -34,4 +34,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- container for hosting GuidedStepFragment -->
<FrameLayout android:id="@+id/lb_guidedstep_host"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 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.
-->
<!-- container for hosting GuidedStepFragment -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/lb_guidedstep_host"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -136,7 +136,7 @@ public class BrowseFragment extends android.support.v17.leanback.app.BrowseFragm
if (((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_6) {
GuidedStepFragment.add(getFragmentManager(),
new GuidedStepActivity.FirstStepFragment(),
android.R.id.content);
R.id.lb_guidedstep_host);
return;
} else if ( ((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_8) {
intent = new Intent(getActivity(), BrowseActivity.class);

View File

@@ -138,7 +138,7 @@ public class BrowseSupportFragment extends android.support.v17.leanback.app.Brow
if (((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_6) {
GuidedStepSupportFragment.add(getFragmentManager(),
new GuidedStepSupportActivity.FirstStepFragment(),
android.R.id.content);
R.id.lb_guidedstep_host);
return;
} else if ( ((PhotoItem) item).getImageResourceId() == R.drawable.gallery_photo_8) {
intent = new Intent(getActivity(), BrowseSupportActivity.class);

View File

@@ -61,7 +61,8 @@ public class GuidedStepActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
Log.v(TAG, "onCreate");
super.onCreate(savedInstanceState);
GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
setContentView(R.layout.guided_step_activity);
GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
}
@Override
@@ -174,7 +175,7 @@ public class GuidedStepActivity extends Activity {
public void onGuidedActionClicked(GuidedAction action) {
FragmentManager fm = getFragmentManager();
if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
GuidedStepFragment.add(fm, new SecondStepFragment(), android.R.id.content);
GuidedStepFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
} else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
finishGuidedStepFragments();
}
@@ -215,7 +216,7 @@ public class GuidedStepActivity extends Activity {
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
FragmentManager fm = getFragmentManager();
GuidedStepFragment.add(fm, new ThirdStepFragment());
GuidedStepFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
}
}
@@ -301,7 +302,8 @@ public class GuidedStepActivity extends Activity {
.description(desc)
.multilineDescription(true)
.infoOnly(true)
.enabled(false)
.enabled(true)
.focusable(false)
.build());
for (int i = 0; i < OPTION_NAMES.length; i++) {
addCheckedAction(actions, OPTION_DRAWABLES[i], getActivity(), OPTION_NAMES[i],
@@ -322,7 +324,7 @@ public class GuidedStepActivity extends Activity {
Bundle arguments = new Bundle();
arguments.putInt(FourthStepFragment.EXTRA_OPTION, mSelectedOption);
f.setArguments(arguments);
GuidedStepFragment.add(fm, f, android.R.id.content);
GuidedStepFragment.add(fm, f, R.id.lb_guidedstep_host);
} else {
mSelectedOption = getSelectedActionPosition()-1;
}

View File

@@ -63,7 +63,8 @@ public class GuidedStepSupportActivity extends FragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
Log.v(TAG, "onCreate");
super.onCreate(savedInstanceState);
GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);
setContentView(R.layout.guided_step_activity);
GuidedStepSupportFragment.addAsRoot(this, new FirstStepFragment(), R.id.lb_guidedstep_host);
}
@Override
@@ -176,7 +177,7 @@ public class GuidedStepSupportActivity extends FragmentActivity {
public void onGuidedActionClicked(GuidedAction action) {
FragmentManager fm = getFragmentManager();
if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
GuidedStepSupportFragment.add(fm, new SecondStepFragment(), android.R.id.content);
GuidedStepSupportFragment.add(fm, new SecondStepFragment(), R.id.lb_guidedstep_host);
} else if (action.getId() == GuidedAction.ACTION_ID_CANCEL){
finishGuidedStepSupportFragments();
}
@@ -217,7 +218,7 @@ public class GuidedStepSupportActivity extends FragmentActivity {
public void onGuidedActionClicked(GuidedAction action) {
if (action.getId() == GuidedAction.ACTION_ID_CONTINUE) {
FragmentManager fm = getFragmentManager();
GuidedStepSupportFragment.add(fm, new ThirdStepFragment());
GuidedStepSupportFragment.add(fm, new ThirdStepFragment(), R.id.lb_guidedstep_host);
}
}
@@ -303,7 +304,8 @@ public class GuidedStepSupportActivity extends FragmentActivity {
.description(desc)
.multilineDescription(true)
.infoOnly(true)
.enabled(false)
.enabled(true)
.focusable(false)
.build());
for (int i = 0; i < OPTION_NAMES.length; i++) {
addCheckedAction(actions, OPTION_DRAWABLES[i], getActivity(), OPTION_NAMES[i],
@@ -324,7 +326,7 @@ public class GuidedStepSupportActivity extends FragmentActivity {
Bundle arguments = new Bundle();
arguments.putInt(FourthStepFragment.EXTRA_OPTION, mSelectedOption);
f.setArguments(arguments);
GuidedStepSupportFragment.add(fm, f, android.R.id.content);
GuidedStepSupportFragment.add(fm, f, R.id.lb_guidedstep_host);
} else {
mSelectedOption = getSelectedActionPosition()-1;
}