From 6e9821c66730477a29a1adca1d46b06043c8e9c3 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 3 Aug 2010 13:54:56 -0700 Subject: [PATCH] change fragment stack button from "next" to "new fragment" also move text in the dialog demo to the top to make dialogs easier to read Change-Id: I76c44f773098e64c79465060efb4bb6edab1fa3a --- samples/ApiDemos/res/layout/fragment_dialog.xml | 2 +- samples/ApiDemos/res/layout/fragment_stack.xml | 4 ++-- samples/ApiDemos/res/values/strings.xml | 2 +- .../src/com/example/android/apis/app/FragmentStack.java | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/ApiDemos/res/layout/fragment_dialog.xml b/samples/ApiDemos/res/layout/fragment_dialog.xml index 047ceae1e..e03f64f7d 100644 --- a/samples/ApiDemos/res/layout/fragment_dialog.xml +++ b/samples/ApiDemos/res/layout/fragment_dialog.xml @@ -27,7 +27,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="center_vertical|center_horizontal" - android:gravity="center_vertical|center_horizontal" /> + android:gravity="top|center_horizontal" /> diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml index 9b9d8464d..749a28fa0 100644 --- a/samples/ApiDemos/res/values/strings.xml +++ b/samples/ApiDemos/res/values/strings.xml @@ -115,7 +115,7 @@ App/Fragment/Receive Result App/Fragment/Stack - Next + New fragment App/Activity/Menu Open menu diff --git a/samples/ApiDemos/src/com/example/android/apis/app/FragmentStack.java b/samples/ApiDemos/src/com/example/android/apis/app/FragmentStack.java index c7754b6ce..51151e621 100644 --- a/samples/ApiDemos/src/com/example/android/apis/app/FragmentStack.java +++ b/samples/ApiDemos/src/com/example/android/apis/app/FragmentStack.java @@ -38,15 +38,15 @@ public class FragmentStack extends Activity { setContentView(R.layout.fragment_stack); // Watch for button clicks. - Button button = (Button)findViewById(R.id.next); + Button button = (Button)findViewById(R.id.new_fragment); button.setOnClickListener(new OnClickListener() { public void onClick(View v) { addFragmentToStack(); } }); - + if (savedInstanceState == null) { - // Do first time initialization -- add initial fragment. + // Do first time initialization -- add initial fragment. Fragment newFragment = new CountingFragment(mStackLevel); FragmentTransaction ft = openFragmentTransaction(); ft.add(R.id.simple_fragment, newFragment).commit();