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
This commit is contained in:
Scott Main
2010-08-03 13:54:56 -07:00
parent 721a184e0a
commit 6e9821c667
4 changed files with 7 additions and 7 deletions

View File

@@ -27,7 +27,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_gravity="center_vertical|center_horizontal" android:layout_gravity="center_vertical|center_horizontal"
android:gravity="center_vertical|center_horizontal" /> android:gravity="top|center_horizontal" />
<Button android:id="@+id/show" <Button android:id="@+id/show"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content"

View File

@@ -27,10 +27,10 @@
android:layout_height="0px" android:layout_height="0px"
android:layout_weight="1" /> android:layout_weight="1" />
<Button android:id="@+id/next" <Button android:id="@+id/new_fragment"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:text="@string/next"> android:text="@string/new_fragment">
<requestFocus /> <requestFocus />
</Button> </Button>

View File

@@ -115,7 +115,7 @@
<string name="fragment_receive_result">App/Fragment/Receive Result</string> <string name="fragment_receive_result">App/Fragment/Receive Result</string>
<string name="fragment_stack">App/Fragment/Stack</string> <string name="fragment_stack">App/Fragment/Stack</string>
<string name="next">Next</string> <string name="new_fragment">New fragment</string>
<string name="activity_menu">App/Activity/Menu</string> <string name="activity_menu">App/Activity/Menu</string>
<string name="open_menu">Open menu</string> <string name="open_menu">Open menu</string>

View File

@@ -38,15 +38,15 @@ public class FragmentStack extends Activity {
setContentView(R.layout.fragment_stack); setContentView(R.layout.fragment_stack);
// Watch for button clicks. // Watch for button clicks.
Button button = (Button)findViewById(R.id.next); Button button = (Button)findViewById(R.id.new_fragment);
button.setOnClickListener(new OnClickListener() { button.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
addFragmentToStack(); addFragmentToStack();
} }
}); });
if (savedInstanceState == null) { if (savedInstanceState == null) {
// Do first time initialization -- add initial fragment. // Do first time initialization -- add initial fragment.
Fragment newFragment = new CountingFragment(mStackLevel); Fragment newFragment = new CountingFragment(mStackLevel);
FragmentTransaction ft = openFragmentTransaction(); FragmentTransaction ft = openFragmentTransaction();
ft.add(R.id.simple_fragment, newFragment).commit(); ft.add(R.id.simple_fragment, newFragment).commit();