• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

development


Commit MetaInfo

修订版a6cadd6244b4c0045ccb571881af982267b4ee9c (tree)
时间2011-06-04 05:17:32
作者Dianne Hackborn <hackbod@goog...>
CommiterAndroid Git Automerger

Log Message

am 47f569e4: Lost and found.

* commit '47f569e460adaef04b75174706b7c95471567ca8':

Lost and found.

更改概述

差异

--- a/samples/Support13Demos/res/layout/fragment_pager.xml
+++ b/samples/Support13Demos/res/layout/fragment_pager.xml
@@ -28,10 +28,17 @@
2828 android:layout_weight="1">
2929 </android.support.v13.view.ViewPager>
3030
31- <Button android:id="@+id/new_fragment"
32- android:layout_width="wrap_content" android:layout_height="wrap_content"
33- android:layout_weight="0"
34- android:text="@string/new_fragment">
35- <requestFocus />
36- </Button>
31+ <LinearLayout android:orientation="horizontal"
32+ android:gravity="center" android:measureWithLargestChild="true"
33+ android:layout_width="match_parent" android:layout_height="wrap_content"
34+ android:layout_weight="0">
35+ <Button android:id="@+id/goto_first"
36+ android:layout_width="wrap_content" android:layout_height="wrap_content"
37+ android:text="@string/first">
38+ </Button>
39+ <Button android:id="@+id/goto_last"
40+ android:layout_width="wrap_content" android:layout_height="wrap_content"
41+ android:text="@string/last">
42+ </Button>
43+ </LinearLayout>
3744 </LinearLayout>
--- a/samples/Support13Demos/res/values/strings.xml
+++ b/samples/Support13Demos/res/values/strings.xml
@@ -23,9 +23,9 @@
2323 siwuf cakso dodtos anr koop.
2424 </string>
2525
26- <string name="new_fragment">New fragment</string>
27-
2826 <string name="fragment_pager_support">Fragment/Pager</string>
27+ <string name="first">First</string>
28+ <string name="last">Last</string>
2929
3030 <string name="fragment_state_pager_support">Fragment/State Pager</string>
3131
--- a/samples/Support13Demos/src/com/example/android/supportv13/app/FragmentPagerSupport.java
+++ b/samples/Support13Demos/src/com/example/android/supportv13/app/FragmentPagerSupport.java
@@ -43,7 +43,6 @@ public class FragmentPagerSupport extends Activity {
4343 MyAdapter mAdapter;
4444
4545 ViewPager mPager;
46- int mCurPos;
4746
4847 @Override
4948 protected void onCreate(Bundle savedInstanceState) {
@@ -56,15 +55,16 @@ public class FragmentPagerSupport extends Activity {
5655 mPager.setAdapter(mAdapter);
5756
5857 // Watch for button clicks.
59- Button button = (Button)findViewById(R.id.new_fragment);
58+ Button button = (Button)findViewById(R.id.goto_first);
6059 button.setOnClickListener(new OnClickListener() {
6160 public void onClick(View v) {
62- mCurPos++;
63- if (mCurPos < NUM_ITEMS) {
64- mPager.setCurrentItem(mCurPos);
65- } else {
66- mCurPos--;
67- }
61+ mPager.setCurrentItem(0);
62+ }
63+ });
64+ button = (Button)findViewById(R.id.goto_last);
65+ button.setOnClickListener(new OnClickListener() {
66+ public void onClick(View v) {
67+ mPager.setCurrentItem(NUM_ITEMS-1);
6868 }
6969 });
7070 }
--- a/samples/Support13Demos/src/com/example/android/supportv13/app/FragmentStatePagerSupport.java
+++ b/samples/Support13Demos/src/com/example/android/supportv13/app/FragmentStatePagerSupport.java
@@ -43,7 +43,6 @@ public class FragmentStatePagerSupport extends Activity {
4343 MyAdapter mAdapter;
4444
4545 ViewPager mPager;
46- int mCurPos;
4746
4847 @Override
4948 protected void onCreate(Bundle savedInstanceState) {
@@ -56,15 +55,16 @@ public class FragmentStatePagerSupport extends Activity {
5655 mPager.setAdapter(mAdapter);
5756
5857 // Watch for button clicks.
59- Button button = (Button)findViewById(R.id.new_fragment);
58+ Button button = (Button)findViewById(R.id.goto_first);
6059 button.setOnClickListener(new OnClickListener() {
6160 public void onClick(View v) {
62- mCurPos++;
63- if (mCurPos < NUM_ITEMS) {
64- mPager.setCurrentItem(mCurPos);
65- } else {
66- mCurPos--;
67- }
61+ mPager.setCurrentItem(0);
62+ }
63+ });
64+ button = (Button)findViewById(R.id.goto_last);
65+ button.setOnClickListener(new OnClickListener() {
66+ public void onClick(View v) {
67+ mPager.setCurrentItem(NUM_ITEMS-1);
6868 }
6969 });
7070 }
--- a/samples/Support4Demos/res/layout/fragment_pager.xml
+++ b/samples/Support4Demos/res/layout/fragment_pager.xml
@@ -28,10 +28,17 @@
2828 android:layout_weight="1">
2929 </android.support.v4.app.FragmentPager>
3030
31- <Button android:id="@+id/new_fragment"
32- android:layout_width="wrap_content" android:layout_height="wrap_content"
33- android:layout_weight="0"
34- android:text="@string/new_fragment">
35- <requestFocus />
36- </Button>
31+ <LinearLayout android:orientation="horizontal"
32+ android:gravity="center" android:measureWithLargestChild="true"
33+ android:layout_width="match_parent" android:layout_height="wrap_content"
34+ android:layout_weight="0">
35+ <Button android:id="@+id/goto_first"
36+ android:layout_width="wrap_content" android:layout_height="wrap_content"
37+ android:text="@string/first">
38+ </Button>
39+ <Button android:id="@+id/goto_last"
40+ android:layout_width="wrap_content" android:layout_height="wrap_content"
41+ android:text="@string/last">
42+ </Button>
43+ </LinearLayout>
3744 </LinearLayout>
--- a/samples/Support4Demos/res/values/strings.xml
+++ b/samples/Support4Demos/res/values/strings.xml
@@ -78,6 +78,8 @@
7878 <string name="new_fragment">New fragment</string>
7979
8080 <string name="fragment_pager_support">Fragment/Pager</string>
81+ <string name="first">First</string>
82+ <string name="last">Last</string>
8183
8284 <string name="loader_cursor_support">Loader/Cursor</string>
8385
--- a/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentPagerSupport.java
+++ b/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentPagerSupport.java
@@ -39,7 +39,6 @@ public class FragmentPagerSupport extends FragmentActivity
3939 static final int NUM_ITEMS = 10;
4040
4141 FragmentPager mPager;
42- int mCurPos;
4342
4443 @Override
4544 protected void onCreate(Bundle savedInstanceState) {
@@ -50,15 +49,16 @@ public class FragmentPagerSupport extends FragmentActivity
5049 mPager.setAdapter(this);
5150
5251 // Watch for button clicks.
53- Button button = (Button)findViewById(R.id.new_fragment);
52+ Button button = (Button)findViewById(R.id.goto_first);
5453 button.setOnClickListener(new OnClickListener() {
5554 public void onClick(View v) {
56- mCurPos++;
57- if (mCurPos < NUM_ITEMS) {
58- mPager.setCurrentItem(mCurPos);
59- } else {
60- mCurPos--;
61- }
55+ mPager.setCurrentItem(0);
56+ }
57+ });
58+ button = (Button)findViewById(R.id.goto_last);
59+ button.setOnClickListener(new OnClickListener() {
60+ public void onClick(View v) {
61+ mPager.setCurrentItem(NUM_ITEMS-1);
6262 }
6363 });
6464 }