系統(tǒng)小組件

Android Widget 小部件(四---完結(jié)) 使用ListView遂蛀、GridView谭跨、StackView、ViewFlipper展示W(wǎng)idget

分類: Android

2014-08-10 23:13

2596人閱讀

評(píng)論(1)

收藏

舉報(bào)

android widget

官方有話這樣說:

A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:

  • FrameLayout
  • LinearLayout
  • RelativeLayout
  • And the following widget classes:

  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ImageView
  • ProgressBar
  • TextView
  • ViewFlipper
  • ListView
  • GridView
  • StackView
  • AdapterViewFlipper
  • Descendants of these classes are not supported.不支持這些類的后代

    接下來的示例說明怎么樣實(shí)現(xiàn) 使用ListView李滴、GridView螃宙、StackView、ViewFlipper創(chuàng)建AppWidget

    menifest

    1. <receiver?android:name="com.stone.receiver.WidgetSetProvider">??
    2. ?????????????<intent-filter>??
    3. ?????????????????<action?android:name="android.appwidget.action.APPWIDGET_UPDATE"/>??
    4. ?????????????????<action?android:name="com.stone.action.clickset"/>??
    5. ?????????????????<action?android:name="com.stone.action.clickset.item"/>??
    6. ?????????????</intent-filter>??
    7. ?????????????<meta-data?android:name="android.appwidget.provider"??
    8. ?????????????????android:resource="@xml/set_widget_provider"/>??
    9. </receiver>??

    1. <receiver?android:name="com.stone.receiver.WidgetSetProvider">??
    2. ?????????????<intent-filter>??
    3. ?????????????????<action?android:name="android.appwidget.action.APPWIDGET_UPDATE"/>??
    4. ?????????????????<action?android:name="com.stone.action.clickset"/>??
    5. ?????????????????<action?android:name="com.stone.action.clickset.item"/>??
    6. ?????????????</intent-filter>??
    7. ?????????????<meta-data?android:name="android.appwidget.provider"??
    8. ?????????????????android:resource="@xml/set_widget_provider"/>??
    9. </receiver>??


    res/xml/set_widget_provider.xml

    1. <?xml?version="1.0"?encoding="utf-8"?>??
    2. <appwidget-provider?xmlns:android="http://schemas.android.com/apk/res/android"??
    3. ????android:minWidth="250dp"??
    4. ????android:minHeight="180dp"??
    5. ????android:updatePeriodMillis="5000"??
    6. ????android:previewImage="@drawable/ic_launcher"??
    7. ????android:initialLayout="@layout/collections_view_widget"??
    8. ????android:resizeMode="horizontal|vertical"??
    9. ????android:autoAdvanceViewId="@id/viewflipper"??>??
    10. ????<!--???
    11. ????????計(jì)算size的公式:?(70*n)?-30??n為部件所需的大小(占幾格)???當(dāng)前的就是??4x4??
    12. ????????minResizeWidth??
    13. ????????minResizeHeight???能被調(diào)整的最小寬高悬嗓,若大于minWidth?minHeight?則忽略??
    14. ????????label???選擇部件時(shí)看到標(biāo)簽??
    15. ????????icon????選擇部件時(shí)看到圖標(biāo)??
    16. ????????updatePeriodMillis??更新時(shí)間間隔??
    17. ????????previewImage????選擇部件時(shí)?展示的圖像??3.0以上使用??
    18. ????????initialLayout???布局文件??
    19. ????????resizeMode??????調(diào)整size模式??
    20. ????????configure???????如果需要在啟動(dòng)前先啟動(dòng)一個(gè)Activity進(jìn)行設(shè)置污呼,在這里給出Activity的完整類名??
    21. ????????autoAdvanceViewId=@id/xx????與集合部件一起使用,指定該集合item自動(dòng)推進(jìn)?暫只發(fā)現(xiàn)對(duì)stackview有效包竹,會(huì)自動(dòng)一段時(shí)間推進(jìn)到下一個(gè)??
    22. ??????????
    23. ????????集合部件:3.0后才有燕酷。set?view:ListView、GridView周瞎、StackView苗缩、AdapterViewFlipper??
    24. ????????ViewFlipper?為非集合部件??
    25. ?????-->??
    26. </appwidget-provider>??

    1. <?xml?version="1.0"?encoding="utf-8"?>??
    2. <appwidget-provider?xmlns:android="http://schemas.android.com/apk/res/android"??
    3. ????android:minWidth="250dp"??
    4. ????android:minHeight="180dp"??
    5. ????android:updatePeriodMillis="5000"??
    6. ????android:previewImage="@drawable/ic_launcher"??
    7. ????android:initialLayout="@layout/collections_view_widget"??
    8. ????android:resizeMode="horizontal|vertical"??
    9. ????android:autoAdvanceViewId="@id/viewflipper"??>??
    10. ????<!--???
    11. ????????計(jì)算size的公式:?(70*n)?-30??n為部件所需的大小(占幾格)???當(dāng)前的就是??4x4??
    12. ????????minResizeWidth??
    13. ????????minResizeHeight???能被調(diào)整的最小寬高,若大于minWidth?minHeight?則忽略??
    14. ????????label???選擇部件時(shí)看到標(biāo)簽??
    15. ????????icon????選擇部件時(shí)看到圖標(biāo)??
    16. ????????updatePeriodMillis??更新時(shí)間間隔??
    17. ????????previewImage????選擇部件時(shí)?展示的圖像??3.0以上使用??
    18. ????????initialLayout???布局文件??
    19. ????????resizeMode??????調(diào)整size模式??
    20. ????????configure???????如果需要在啟動(dòng)前先啟動(dòng)一個(gè)Activity進(jìn)行設(shè)置声诸,在這里給出Activity的完整類名??
    21. ????????autoAdvanceViewId=@id/xx????與集合部件一起使用酱讶,指定該集合item自動(dòng)推進(jìn)?暫只發(fā)現(xiàn)對(duì)stackview有效,會(huì)自動(dòng)一段時(shí)間推進(jìn)到下一個(gè)??
    22. ??????????
    23. ????????集合部件:3.0后才有彼乌。set?view:ListView泻肯、GridView渊迁、StackView、AdapterViewFlipper??
    24. ????????ViewFlipper?為非集合部件??
    25. ?????-->??
    26. </appwidget-provider>??


    layout/collections_view_widget.xml

    1. <?xml?version="1.0"?encoding="utf-8"?>??
    2. <LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"??
    3. ????android:layout_width="match_parent"??
    4. ????android:layout_height="match_parent"??
    5. ????android:orientation="vertical"?>??
    6. ??
    7. ????<LinearLayout??
    8. ????????android:layout_width="fill_parent"??
    9. ????????android:layout_height="wrap_content"?>??
    10. ??
    11. ????????<Button??
    12. ????????????android:id="@+id/btn_listview"??
    13. ????????????android:layout_width="0dp"??
    14. ????????????android:layout_height="wrap_content"??
    15. ????????????android:layout_weight="1"??
    16. ????????????android:text="listview"?/>??
    17. ??
    18. ????????<Button??
    19. ????????????android:id="@+id/btn_gridview"??
    20. ????????????android:layout_width="0dp"??
    21. ????????????android:layout_height="wrap_content"??
    22. ????????????android:layout_weight="1"??
    23. ????????????android:text="gridview"?/>??
    24. ??
    25. ????????<Button??
    26. ????????????android:id="@+id/btn_stackview"??
    27. ????????????android:layout_width="0dp"??
    28. ????????????android:layout_height="wrap_content"??
    29. ????????????android:layout_weight="1"??
    30. ????????????android:text="stackview"?/>??
    31. ??
    32. ????????<Button??
    33. ????????????android:id="@+id/btn_viewflipper"??
    34. ????????????android:layout_width="0dp"??
    35. ????????????android:layout_height="wrap_content"??
    36. ????????????android:layout_weight="1"??
    37. ????????????android:text="viewflipper"?/>??
    38. ????</LinearLayout>??
    39. ??
    40. ????<FrameLayout??
    41. ????????xmlns:android="http://schemas.android.com/apk/res/android"??
    42. ????????android:layout_width="match_parent"??
    43. ????????android:layout_height="match_parent"??
    44. ????????android:background="#80000000"?>??
    45. ????????/>??
    46. ??
    47. ????????<ListView??
    48. ????????????android:id="@+id/listview"??
    49. ????????????android:layout_width="fill_parent"??
    50. ????????????android:layout_height="fill_parent"?/>??
    51. ??
    52. ????????<GridView??
    53. ????????????android:id="@+id/gridview"??
    54. ????????????android:layout_width="fill_parent"??
    55. ????????????android:layout_height="fill_parent"??
    56. ????????????android:numColumns="2"??
    57. ????????????android:visibility="gone"?/>??
    58. ??
    59. ????????<StackView??
    60. ????????????android:id="@+id/stackview"??
    61. ????????????android:layout_width="fill_parent"??
    62. ????????????android:layout_height="fill_parent"??
    63. ????????????android:visibility="gone"?/>??
    64. ??
    65. ????????<ViewFlipper??
    66. ????????????android:id="@+id/viewflipper"??
    67. ????????????android:layout_width="fill_parent"??
    68. ????????????android:layout_height="fill_parent"??
    69. ????????????android:autoStart="true"??
    70. ????????????android:flipInterval="2000"??
    71. ????????????android:visibility="gone"?>??
    72. <!--???
    73. autoStart=true??<==>??startFlipping()??
    74. flipInterval=2000?<==>?How?long?to?wait?before?flipping?to?the?next?view??
    75. ?-->??
    76. ????????????<ImageView??
    77. ????????????????android:id="@+id/iv1"??
    78. ????????????????android:layout_width="fill_parent"??
    79. ????????????????android:layout_height="fill_parent"??
    80. ????????????????android:background="@drawable/a11"/>??
    81. ????????????<ImageView??
    82. ????????????????android:id="@+id/iv2"??
    83. ????????????????android:layout_width="fill_parent"??
    84. ????????????????android:layout_height="fill_parent"??
    85. ????????????????android:background="@drawable/a2"/>??
    86. ????????????<ImageView??
    87. ????????????????android:id="@+id/iv3"??
    88. ????????????????android:layout_width="fill_parent"??
    89. ????????????????android:layout_height="fill_parent"??
    90. ????????????????android:background="@drawable/a3"?/>??
    91. ????????????<ImageView??
    92. ????????????????android:id="@+id/iv4"??
    93. ????????????????android:layout_width="fill_parent"??
    94. ????????????????android:layout_height="fill_parent"??
    95. ????????????????android:background="@drawable/a4"?/>??
    96. ????????</ViewFlipper>??
    97. ??
    98. ????????<TextView??
    99. ????????????android:id="@+id/tv_empty"??
    100. ????????????android:layout_width="fill_parent"??
    101. ????????????android:layout_height="fill_parent"??
    102. ????????????android:gravity="center"??
    103. ????????????android:text="Empty?List"??
    104. ????????????android:visibility="gone"?/>??
    105. ????</FrameLayout>??
    106. ??
    107. </LinearLayout>??

    1. <?xml?version="1.0"?encoding="utf-8"?>??
    2. <LinearLayout?xmlns:android="http://schemas.android.com/apk/res/android"??
    3. ????android:layout_width="match_parent"??
    4. ????android:layout_height="match_parent"??
    5. ????android:orientation="vertical"?>??
    6. ??
    7. ????<LinearLayout??
    8. ????????android:layout_width="fill_parent"??
    9. ????????android:layout_height="wrap_content"?>??
    10. ??
    11. ????????<Button??
    12. ????????????android:id="@+id/btn_listview"??
    13. ????????????android:layout_width="0dp"??
    14. ????????????android:layout_height="wrap_content"??
    15. ????????????android:layout_weight="1"??
    16. ????????????android:text="listview"?/>??
    17. ??
    18. ????????<Button??
    19. ????????????android:id="@+id/btn_gridview"??
    20. ????????????android:layout_width="0dp"??
    21. ????????????android:layout_height="wrap_content"??
    22. ????????????android:layout_weight="1"??
    23. ????????????android:text="gridview"?/>??
    24. ??
    25. ????????<Button??
    26. ????????????android:id="@+id/btn_stackview"??
    27. ????????????android:layout_width="0dp"??
    28. ????????????android:layout_height="wrap_content"??
    29. ????????????android:layout_weight="1"??
    30. ????????????android:text="stackview"?/>??
    31. ??
    32. ????????<Button??
    33. ????????????android:id="@+id/btn_viewflipper"??
    34. ????????????android:layout_width="0dp"??
    35. ????????????android:layout_height="wrap_content"??
    36. ????????????android:layout_weight="1"??
    37. ????????????android:text="viewflipper"?/>??
    38. ????</LinearLayout>??
    39. ??
    40. ????<FrameLayout??
    41. ????????xmlns:android="http://schemas.android.com/apk/res/android"??
    42. ????????android:layout_width="match_parent"??
    43. ????????android:layout_height="match_parent"??
    44. ????????android:background="#80000000"?>??
    45. ????????/>??
    46. ??
    47. ????????<ListView??
    48. ????????????android:id="@+id/listview"??
    49. ????????????android:layout_width="fill_parent"??
    50. ????????????android:layout_height="fill_parent"?/>??
    51. ??
    52. ????????<GridView??
    53. ????????????android:id="@+id/gridview"??
    54. ????????????android:layout_width="fill_parent"??
    55. ????????????android:layout_height="fill_parent"??
    56. ????????????android:numColumns="2"??
    57. ????????????android:visibility="gone"?/>??
    58. ??
    59. ????????<StackView??
    60. ????????????android:id="@+id/stackview"??
    61. ????????????android:layout_width="fill_parent"??
    62. ????????????android:layout_height="fill_parent"??
    63. ????????????android:visibility="gone"?/>??
    64. ??
    65. ????????<ViewFlipper??
    66. ????????????android:id="@+id/viewflipper"??
    67. ????????????android:layout_width="fill_parent"??
    68. ????????????android:layout_height="fill_parent"??
    69. ????????????android:autoStart="true"??
    70. ????????????android:flipInterval="2000"??
    71. ????????????android:visibility="gone"?>??
    72. <!--???
    73. autoStart=true??<==>??startFlipping()??
    74. flipInterval=2000?<==>?How?long?to?wait?before?flipping?to?the?next?view??
    75. ?-->??
    76. ????????????<ImageView??
    77. ????????????????android:id="@+id/iv1"??
    78. ????????????????android:layout_width="fill_parent"??
    79. ????????????????android:layout_height="fill_parent"??
    80. ????????????????android:background="@drawable/a11"/>??
    81. ????????????<ImageView??
    82. ????????????????android:id="@+id/iv2"??
    83. ????????????????android:layout_width="fill_parent"??
    84. ????????????????android:layout_height="fill_parent"??
    85. ????????????????android:background="@drawable/a2"/>??
    86. ????????????<ImageView??
    87. ????????????????android:id="@+id/iv3"??
    88. ????????????????android:layout_width="fill_parent"??
    89. ????????????????android:layout_height="fill_parent"??
    90. ????????????????android:background="@drawable/a3"?/>??
    91. ????????????<ImageView??
    92. ????????????????android:id="@+id/iv4"??
    93. ????????????????android:layout_width="fill_parent"??
    94. ????????????????android:layout_height="fill_parent"??
    95. ????????????????android:background="@drawable/a4"?/>??
    96. ????????</ViewFlipper>??
    97. ??
    98. ????????<TextView??
    99. ????????????android:id="@+id/tv_empty"??
    100. ????????????android:layout_width="fill_parent"??
    101. ????????????android:layout_height="fill_parent"??
    102. ????????????android:gravity="center"??
    103. ????????????android:text="Empty?List"??
    104. ????????????android:visibility="gone"?/>??
    105. ????</FrameLayout>??
    106. ??
    107. </LinearLayout>??


    集合的數(shù)據(jù)源 需要 繼承?RemoteViewsService

    1. package?com.stone.service;??
    2. ??
    3. import?java.util.ArrayList;??
    4. import?java.util.List;??
    5. ??
    6. import?android.app.PendingIntent;??
    7. import?android.content.Context;??
    8. import?android.content.Intent;??
    9. import?android.os.Bundle;??
    10. import?android.widget.RemoteViews;??
    11. import?android.widget.RemoteViewsService;??
    12. ??
    13. import?com.stone.R;??
    14. import?com.stone.receiver.WidgetSetProvider;??
    15. ??
    16. /**?
    17. ?*?繼承自RemoteViewsService?必須重寫onGetViewFactory?
    18. ?*?該服務(wù)只是用來?創(chuàng)建?集合widget使用的數(shù)據(jù)源?
    19. ?*?@author?stone?
    20. ?*/??
    21. public?class?WidgetSetService?extends?RemoteViewsService?{??
    22. ??????
    23. ????public?WidgetSetService()?{??
    24. ??????????
    25. ????}??
    26. ??????
    27. ????@Override??
    28. ????public?RemoteViewsFactory?onGetViewFactory(Intent?intent)?{??
    29. ????????return?new?WidgetFactory(this.getApplicationContext(),?intent);??
    30. ????}??
    31. ??????
    32. ??????
    33. ????public?class?WidgetFactory?implements?RemoteViewsService.RemoteViewsFactory?{??
    34. ????????private?static?final?int?mCount?=?10;??
    35. ????????private?Context?mContext;??
    36. ????????private?List<String>?mWidgetItems?=?new?ArrayList<String>();??
    37. ??????????
    38. ??????????
    39. ????????public?WidgetFactory(Context?context,?Intent?intent)?{??
    40. ????????????mContext?=?context;??
    41. //??????????mAppWidgetId?=?intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,??
    42. //??????????????????AppWidgetManager.INVALID_APPWIDGET_ID);??
    43. ????????}??
    44. ??????????
    45. ????????@Override??
    46. ????????public?void?onCreate()?{??
    47. ????????????for?(int?i?=?0;?i?<?mCount;?i++)?{??
    48. ????????????????mWidgetItems.add("item:"?+?i?+?"!");??
    49. ????????????}??
    50. ????????}??
    51. ??
    52. ????????@Override??
    53. ????????public?void?onDataSetChanged()?{??
    54. ????????????/*?
    55. ?????????????*?appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds,?R.id.listview);?
    56. ?????????????*?使用該通知更新數(shù)據(jù)源灶挟,會(huì)調(diào)用onDataSetChanged?
    57. ?????????????*/??
    58. ????????????System.out.println("----onDataSetChanged----");??
    59. ????????}??
    60. ??
    61. ????????@Override??
    62. ????????public?void?onDestroy()?{??
    63. ????????????mWidgetItems.clear();??
    64. ????????}??
    65. ??
    66. ????????@Override??
    67. ????????public?int?getCount()?{??
    68. ????????????return??mCount;??
    69. ????????}??
    70. ??
    71. ????????@Override??
    72. ????????public?RemoteViews?getViewAt(int?position)?{??
    73. ????????????RemoteViews?views?=?new?RemoteViews(mContext.getPackageName(),?android.R.layout.simple_list_item_1);??
    74. ????????????views.setTextViewText(android.R.id.text1,?"item:"?+?position);??
    75. ????????????System.out.println("RemoteViewsService----getViewAt"?+?position);??
    76. ??????????????
    77. ??????????????
    78. ????????????Bundle?extras?=?new?Bundle();??
    79. ????????????extras.putInt(WidgetSetProvider.EXTRA_ITEM,?position);??
    80. ????????????Intent?fillInIntent?=?new?Intent();??
    81. ????????????fillInIntent.putExtras(extras);??
    82. ????????????/*?
    83. ?????????????*?android.R.layout.simple_list_item_1?---?id?---?text1?
    84. ?????????????*?listview的item?click:將fillInIntent發(fā)送琉朽,?
    85. ?????????????*?fillInIntent它默認(rèn)的就有action?是provider中使用?setPendingIntentTemplate?設(shè)置的action?
    86. ?????????????*/??
    87. ????????????views.setOnClickFillInIntent(android.R.id.text1,?fillInIntent);??
    88. ??????????????
    89. ????????????return?views;??
    90. ????????}??
    91. ??
    92. ????????@Override??
    93. ????????public?RemoteViews?getLoadingView()?{??
    94. ????????????/*?在更新界面的時(shí)候如果耗時(shí)就會(huì)顯示?正在加載...?的默認(rèn)字樣,但是你可以更改這個(gè)界面?
    95. ?????????????*?如果返回null?顯示默認(rèn)界面?
    96. ?????????????*?否則?加載自定義的稚铣,返回RemoteViews?
    97. ?????????????*/??
    98. ????????????return?null;??
    99. ????????}??
    100. ??
    101. ????????@Override??
    102. ????????public?int?getViewTypeCount()?{??
    103. ????????????return?1;??
    104. ????????}??
    105. ??
    106. ????????@Override??
    107. ????????public?long?getItemId(int?position)?{??
    108. ????????????return?position;??
    109. ????????}??
    110. ??
    111. ????????@Override??
    112. ????????public?boolean?hasStableIds()?{??
    113. ????????????return?false;??
    114. ????????}??
    115. ??????????
    116. ????}??
    117. ??
    118. }??
    1. package?com.stone.service;??
    2. ??
    3. import?java.util.ArrayList;??
    4. import?java.util.List;??
    5. ??
    6. import?android.app.PendingIntent;??
    7. import?android.content.Context;??
    8. import?android.content.Intent;??
    9. import?android.os.Bundle;??
    10. import?android.widget.RemoteViews;??
    11. import?android.widget.RemoteViewsService;??
    12. ??
    13. import?com.stone.R;??
    14. import?com.stone.receiver.WidgetSetProvider;??
    15. ??
    16. /**?
    17. ?*?繼承自RemoteViewsService?必須重寫onGetViewFactory?
    18. ?*?該服務(wù)只是用來?創(chuàng)建?集合widget使用的數(shù)據(jù)源?
    19. ?*?@author?stone?
    20. ?*/??
    21. public?class?WidgetSetService?extends?RemoteViewsService?{??
    22. ??????
    23. ????public?WidgetSetService()?{??
    24. ??????????
    25. ????}??
    26. ??????
    27. ????@Override??
    28. ????public?RemoteViewsFactory?onGetViewFactory(Intent?intent)?{??
    29. ????????return?new?WidgetFactory(this.getApplicationContext(),?intent);??
    30. ????}??
    31. ??????
    32. ??????
    33. ????public?class?WidgetFactory?implements?RemoteViewsService.RemoteViewsFactory?{??
    34. ????????private?static?final?int?mCount?=?10;??
    35. ????????private?Context?mContext;??
    36. ????????private?List<String>?mWidgetItems?=?new?ArrayList<String>();??
    37. ??????????
    38. ??????????
    39. ????????public?WidgetFactory(Context?context,?Intent?intent)?{??
    40. ????????????mContext?=?context;??
    41. //??????????mAppWidgetId?=?intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,??
    42. //??????????????????AppWidgetManager.INVALID_APPWIDGET_ID);??
    43. ????????}??
    44. ??????????
    45. ????????@Override??
    46. ????????public?void?onCreate()?{??
    47. ????????????for?(int?i?=?0;?i?<?mCount;?i++)?{??
    48. ????????????????mWidgetItems.add("item:"?+?i?+?"!");??
    49. ????????????}??
    50. ????????}??
    51. ??
    52. ????????@Override??
    53. ????????public?void?onDataSetChanged()?{??
    54. ????????????/*?
    55. ?????????????*?appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds,?R.id.listview);?
    56. ?????????????*?使用該通知更新數(shù)據(jù)源箱叁,會(huì)調(diào)用onDataSetChanged?
    57. ?????????????*/??
    58. ????????????System.out.println("----onDataSetChanged----");??
    59. ????????}??
    60. ??
    61. ????????@Override??
    62. ????????public?void?onDestroy()?{??
    63. ????????????mWidgetItems.clear();??
    64. ????????}??
    65. ??
    66. ????????@Override??
    67. ????????public?int?getCount()?{??
    68. ????????????return??mCount;??
    69. ????????}??
    70. ??
    71. ????????@Override??
    72. ????????public?RemoteViews?getViewAt(int?position)?{??
    73. ????????????RemoteViews?views?=?new?RemoteViews(mContext.getPackageName(),?android.R.layout.simple_list_item_1);??
    74. ????????????views.setTextViewText(android.R.id.text1,?"item:"?+?position);??
    75. ????????????System.out.println("RemoteViewsService----getViewAt"?+?position);??
    76. ??????????????
    77. ??????????????
    78. ????????????Bundle?extras?=?new?Bundle();??
    79. ????????????extras.putInt(WidgetSetProvider.EXTRA_ITEM,?position);??
    80. ????????????Intent?fillInIntent?=?new?Intent();??
    81. ????????????fillInIntent.putExtras(extras);??
    82. ????????????/*?
    83. ?????????????*?android.R.layout.simple_list_item_1?---?id?---?text1?
    84. ?????????????*?listview的item?click:將fillInIntent發(fā)送,?
    85. ?????????????*?fillInIntent它默認(rèn)的就有action?是provider中使用?setPendingIntentTemplate?設(shè)置的action?
    86. ?????????????*/??
    87. ????????????views.setOnClickFillInIntent(android.R.id.text1,?fillInIntent);??
    88. ??????????????
    89. ????????????return?views;??
    90. ????????}??
    91. ??
    92. ????????@Override??
    93. ????????public?RemoteViews?getLoadingView()?{??
    94. ????????????/*?在更新界面的時(shí)候如果耗時(shí)就會(huì)顯示?正在加載...?的默認(rèn)字樣惕医,但是你可以更改這個(gè)界面?
    95. ?????????????*?如果返回null?顯示默認(rèn)界面?
    96. ?????????????*?否則?加載自定義的耕漱,返回RemoteViews?
    97. ?????????????*/??
    98. ????????????return?null;??
    99. ????????}??
    100. ??
    101. ????????@Override??
    102. ????????public?int?getViewTypeCount()?{??
    103. ????????????return?1;??
    104. ????????}??
    105. ??
    106. ????????@Override??
    107. ????????public?long?getItemId(int?position)?{??
    108. ????????????return?position;??
    109. ????????}??
    110. ??
    111. ????????@Override??
    112. ????????public?boolean?hasStableIds()?{??
    113. ????????????return?false;??
    114. ????????}??
    115. ??????????
    116. ????}??
    117. ??
    118. }??

    widgetprovider

    1. package?com.stone.receiver;??
    2. ??
    3. import?com.stone.R;??
    4. import?com.stone.service.WidgetSetService;??
    5. ??
    6. import?android.app.PendingIntent;??
    7. import?android.appwidget.AppWidgetManager;??
    8. import?android.appwidget.AppWidgetProvider;??
    9. import?android.content.ComponentName;??
    10. import?android.content.Context;??
    11. import?android.content.Intent;??
    12. import?android.os.Bundle;??
    13. import?android.text.TextUtils;??
    14. import?android.text.format.DateUtils;??
    15. import?android.view.View;??
    16. import?android.widget.RemoteViews;??
    17. import?android.widget.Toast;??
    18. import?android.widget.ViewFlipper;??
    19. ??
    20. /**?
    21. ?*?使用了集合展示AppWidget?
    22. ?*?ListView、GridView抬伺、StackView?設(shè)置adapter螟够,處理item點(diǎn)擊?
    23. ?*?ViewFlipper?在RemoteViews中缺少支持,暫只能在它的布局文件中設(shè)置?輪換效果?
    24. ?*??????????????對(duì)于切換到哪一個(gè)子view的item事件不好處理沛简,只能設(shè)置一個(gè)整體setPendingIntent?
    25. ?*?@author?stone?
    26. ?*/??
    27. public?class?WidgetSetProvider?extends?AppWidgetProvider?{??
    28. ????public?final?static?String?CLICK_ACTION?=?"com.stone.action.clickset";??
    29. ????public?final?static?String?CLICK_ITEM_ACTION?=?"com.stone.action.clickset.item";??
    30. ????public?final?static?String?EXTRA_ITEM?=?"extra_item";??
    31. ??????
    32. ????@Override??
    33. ????public?void?onReceive(Context?context,?Intent?intent)?{??
    34. ????????super.onReceive(context,?intent);??
    35. ????????System.out.println(intent.getAction());??
    36. ????????if?(TextUtils.equals(CLICK_ACTION,?intent.getAction()))?{??
    37. ????????????int?extraType?=?intent.getIntExtra("view_tag",?0);??
    38. ????????????if?(extraType?>?0)?{??
    39. ????????????????System.out.println("extra:::"?+?extraType);??
    40. ??????????????????
    41. ????????????????switch?(extraType)?{??
    42. ????????????????case?1:??
    43. ????????????????????updateWidget(context,?R.id.listview,?R.id.gridview,?R.id.stackview,?R.id.viewflipper);??
    44. ????????????????????break;??
    45. ????????????????case?2:??
    46. ????????????????????updateWidget(context,?R.id.gridview,?R.id.listview,?R.id.stackview,?R.id.viewflipper);??
    47. ????????????????????break;??
    48. ????????????????case?3:??
    49. ????????????????????updateWidget(context,?R.id.stackview,?R.id.gridview,?R.id.listview,?R.id.viewflipper);??
    50. ????????????????????break;??
    51. ????????????????case?4:??
    52. ????????????????????updateWidget(context,?R.id.viewflipper,?R.id.gridview,?R.id.stackview,?R.id.listview);??
    53. ????????????????????break;??
    54. ??????
    55. ????????????????default:??
    56. ????????????????????break;??
    57. ????????????????}??
    58. ????????????}???
    59. ????????}?else?if?(TextUtils.equals(CLICK_ITEM_ACTION,?intent.getAction()))?{??
    60. ????????????Bundle?extras?=?intent.getExtras();??
    61. ????????????int?position?=?extras.getInt(WidgetSetProvider.EXTRA_ITEM,?-1);??
    62. ????????????if?(position?!=?-1)?{??
    63. ????????????????System.out.println("--點(diǎn)擊了item---"?+?position);??
    64. ????????????????System.out.println("");??
    65. //??????????????Toast.makeText(context,?"click?item:"?+?position,?0).show();??
    66. ????????????}??
    67. ????????}??
    68. ????}??
    69. ??
    70. ????@Override??
    71. ????public?void?onUpdate(Context?context,?AppWidgetManager?appWidgetManager,?int[]?appWidgetIds)?{??
    72. ????????RemoteViews?views?=?new?RemoteViews(context.getPackageName(),?R.layout.collections_view_widget);??
    73. ??????????
    74. ????????Intent?intent1?=?new?Intent(CLICK_ACTION);??
    75. ????????intent1.putExtra("view_tag",?1);??
    76. ????????PendingIntent?pendingIntent1?=?PendingIntent.getBroadcast(context,?101,?intent1,?0);??
    77. ????????views.setOnClickPendingIntent(R.id.btn_listview,?pendingIntent1);??
    78. ??????????
    79. ????????Intent?intent2?=?new?Intent(CLICK_ACTION);??
    80. ????????intent2.putExtra("view_tag",?2);??
    81. ????????PendingIntent?pendingIntent2?=?PendingIntent.getBroadcast(context,?102,?intent2,?0);??
    82. ????????views.setOnClickPendingIntent(R.id.btn_gridview,?pendingIntent2);??
    83. ??????????
    84. ????????Intent?intent3?=?new?Intent(CLICK_ACTION);??
    85. ????????intent3.putExtra("view_tag",?3);??
    86. ????????PendingIntent?pendingIntent3?=?PendingIntent.getBroadcast(context,?103,?intent3,?0);??
    87. ????????views.setOnClickPendingIntent(R.id.btn_stackview,?pendingIntent3);??
    88. ??????????
    89. ????????Intent?intent4?=?new?Intent(CLICK_ACTION);??
    90. ????????intent4.putExtra("view_tag",?4);??
    91. ????????PendingIntent?pendingIntent4?=?PendingIntent.getBroadcast(context,?104,?intent4,?0);??
    92. ????????views.setOnClickPendingIntent(R.id.btn_viewflipper,?pendingIntent4);??
    93. ??????????
    94. ????????appWidgetManager.updateAppWidget(appWidgetIds,?views);??
    95. ??????????
    96. ????????System.out.println("setwidget?update");??
    97. ????????super.onUpdate(context,?appWidgetManager,?appWidgetIds);??
    98. ????}??
    99. ??
    100. ????@Override??
    101. ????public?void?onAppWidgetOptionsChanged(Context?context,???
    102. ????????????AppWidgetManager?appWidgetManager,?int?appWidgetId,??
    103. ????????????Bundle?newOptions)?{??
    104. ????????super.onAppWidgetOptionsChanged(context,?appWidgetManager,?appWidgetId,??
    105. ????????????????newOptions);??
    106. ????}??
    107. ??
    108. ????@Override??
    109. ????public?void?onDeleted(Context?context,?int[]?appWidgetIds)?{??
    110. ????????super.onDeleted(context,?appWidgetIds);??
    111. ????}??
    112. ??
    113. ????@Override??
    114. ????public?void?onEnabled(Context?context)?{??
    115. ????????super.onEnabled(context);??
    116. ????}??
    117. ??
    118. ????@Override??
    119. ????public?void?onDisabled(Context?context)?{??
    120. ????????super.onDisabled(context);??
    121. ????}??
    122. ??????
    123. ????private?void?updateWidget(Context?context,?int?visible,?int?gone1,?int?gone2,?int?gone3)?{??
    124. ????????//RemoteViews處理異進(jìn)程中的View??
    125. ????????RemoteViews?views?=?new?RemoteViews(context.getPackageName(),?R.layout.collections_view_widget);??
    126. ??????????
    127. ????????views.setViewVisibility(visible,?View.VISIBLE);??
    128. ????????views.setViewVisibility(gone1,?View.GONE);??
    129. ????????views.setViewVisibility(gone2,?View.GONE);??
    130. ????????views.setViewVisibility(gone3,?View.GONE);??
    131. ??????????
    132. ????????if?(visible?!=?R.id.viewflipper)?{//viewflipper?不是?繼承自AbsListView??or??AdapterViewAnimator??的view??
    133. ????????????Intent?intent?=?new?Intent(context,?WidgetSetService.class);??
    134. ????????????views.setRemoteAdapter(visible,?intent);//設(shè)置集合的adapter為intent指定的service??
    135. ????????????views.setEmptyView(visible,?R.id.tv_empty);//指定集合view為空時(shí)顯示的view??
    136. ??????????????
    137. ????????????Intent?toIntent?=?new?Intent(CLICK_ITEM_ACTION);??
    138. ????????????PendingIntent?pendingIntent?=?PendingIntent.getBroadcast(context,?200,?toIntent,?PendingIntent.FLAG_UPDATE_CURRENT);??
    139. ????????????/*?
    140. ?????????????*?setPendingIntentTemplate?設(shè)置pendingIntent?模板?
    141. ?????????????*?setOnClickFillInIntent???可以將fillInIntent?添加到pendingIntent中?
    142. ?????????????*/??
    143. ????????????views.setPendingIntentTemplate(visible,?pendingIntent);??
    144. ??????????????
    145. ????????}?else?if?(visible?==?R.id.viewflipper)?{??
    146. //??????????views.setPendingIntentTemplate(R.id.viewflipper,?pendingIntentTemplate);??
    147. ????????}??
    148. ??????????
    149. ????????AppWidgetManager?am?=?AppWidgetManager.getInstance(context);??
    150. ????????int[]?appWidgetIds?=?am.getAppWidgetIds(new?ComponentName(context,?WidgetSetProvider.class));??
    151. ????????for?(int?i?=?0;?i?<?appWidgetIds.length;?i++)?{??
    152. ????????????am.updateAppWidget(appWidgetIds[i],?views);?//更新?實(shí)例??
    153. ????????}??
    154. ??????????
    155. ????}??
    156. ??????
    157. }??
    1. package?com.stone.receiver;??
    2. ??
    3. import?com.stone.R;??
    4. import?com.stone.service.WidgetSetService;??
    5. ??
    6. import?android.app.PendingIntent;??
    7. import?android.appwidget.AppWidgetManager;??
    8. import?android.appwidget.AppWidgetProvider;??
    9. import?android.content.ComponentName;??
    10. import?android.content.Context;??
    11. import?android.content.Intent;??
    12. import?android.os.Bundle;??
    13. import?android.text.TextUtils;??
    14. import?android.text.format.DateUtils;??
    15. import?android.view.View;??
    16. import?android.widget.RemoteViews;??
    17. import?android.widget.Toast;??
    18. import?android.widget.ViewFlipper;??
    19. ??
    20. /**?
    21. ?*?使用了集合展示AppWidget?
    22. ?*?ListView齐鲤、GridView、StackView?設(shè)置adapter椒楣,處理item點(diǎn)擊?
    23. ?*?ViewFlipper?在RemoteViews中缺少支持给郊,暫只能在它的布局文件中設(shè)置?輪換效果?
    24. ?*??????????????對(duì)于切換到哪一個(gè)子view的item事件不好處理,只能設(shè)置一個(gè)整體setPendingIntent?
    25. ?*?@author?stone?
    26. ?*/??
    27. public?class?WidgetSetProvider?extends?AppWidgetProvider?{??
    28. ????public?final?static?String?CLICK_ACTION?=?"com.stone.action.clickset";??
    29. ????public?final?static?String?CLICK_ITEM_ACTION?=?"com.stone.action.clickset.item";??
    30. ????public?final?static?String?EXTRA_ITEM?=?"extra_item";??
    31. ??????
    32. ????@Override??
    33. ????public?void?onReceive(Context?context,?Intent?intent)?{??
    34. ????????super.onReceive(context,?intent);??
    35. ????????System.out.println(intent.getAction());??
    36. ????????if?(TextUtils.equals(CLICK_ACTION,?intent.getAction()))?{??
    37. ????????????int?extraType?=?intent.getIntExtra("view_tag",?0);??
    38. ????????????if?(extraType?>?0)?{??
    39. ????????????????System.out.println("extra:::"?+?extraType);??
    40. ??????????????????
    41. ????????????????switch?(extraType)?{??
    42. ????????????????case?1:??
    43. ????????????????????updateWidget(context,?R.id.listview,?R.id.gridview,?R.id.stackview,?R.id.viewflipper);??
    44. ????????????????????break;??
    45. ????????????????case?2:??
    46. ????????????????????updateWidget(context,?R.id.gridview,?R.id.listview,?R.id.stackview,?R.id.viewflipper);??
    47. ????????????????????break;??
    48. ????????????????case?3:??
    49. ????????????????????updateWidget(context,?R.id.stackview,?R.id.gridview,?R.id.listview,?R.id.viewflipper);??
    50. ????????????????????break;??
    51. ????????????????case?4:??
    52. ????????????????????updateWidget(context,?R.id.viewflipper,?R.id.gridview,?R.id.stackview,?R.id.listview);??
    53. ????????????????????break;??
    54. ??????
    55. ????????????????default:??
    56. ????????????????????break;??
    57. ????????????????}??
    58. ????????????}???
    59. ????????}?else?if?(TextUtils.equals(CLICK_ITEM_ACTION,?intent.getAction()))?{??
    60. ????????????Bundle?extras?=?intent.getExtras();??
    61. ????????????int?position?=?extras.getInt(WidgetSetProvider.EXTRA_ITEM,?-1);??
    62. ????????????if?(position?!=?-1)?{??
    63. ????????????????System.out.println("--點(diǎn)擊了item---"?+?position);??
    64. ????????????????System.out.println("");??
    65. //??????????????Toast.makeText(context,?"click?item:"?+?position,?0).show();??
    66. ????????????}??
    67. ????????}??
    68. ????}??
    69. ??
    70. ????@Override??
    71. ????public?void?onUpdate(Context?context,?AppWidgetManager?appWidgetManager,?int[]?appWidgetIds)?{??
    72. ????????RemoteViews?views?=?new?RemoteViews(context.getPackageName(),?R.layout.collections_view_widget);??
    73. ??????????
    74. ????????Intent?intent1?=?new?Intent(CLICK_ACTION);??
    75. ????????intent1.putExtra("view_tag",?1);??
    76. ????????PendingIntent?pendingIntent1?=?PendingIntent.getBroadcast(context,?101,?intent1,?0);??
    77. ????????views.setOnClickPendingIntent(R.id.btn_listview,?pendingIntent1);??
    78. ??????????
    79. ????????Intent?intent2?=?new?Intent(CLICK_ACTION);??
    80. ????????intent2.putExtra("view_tag",?2);??
    81. ????????PendingIntent?pendingIntent2?=?PendingIntent.getBroadcast(context,?102,?intent2,?0);??
    82. ????????views.setOnClickPendingIntent(R.id.btn_gridview,?pendingIntent2);??
    83. ??????????
    84. ????????Intent?intent3?=?new?Intent(CLICK_ACTION);??
    85. ????????intent3.putExtra("view_tag",?3);??
    86. ????????PendingIntent?pendingIntent3?=?PendingIntent.getBroadcast(context,?103,?intent3,?0);??
    87. ????????views.setOnClickPendingIntent(R.id.btn_stackview,?pendingIntent3);??
    88. ??????????
    89. ????????Intent?intent4?=?new?Intent(CLICK_ACTION);??
    90. ????????intent4.putExtra("view_tag",?4);??
    91. ????????PendingIntent?pendingIntent4?=?PendingIntent.getBroadcast(context,?104,?intent4,?0);??
    92. ????????views.setOnClickPendingIntent(R.id.btn_viewflipper,?pendingIntent4);??
    93. ??????????
    94. ????????appWidgetManager.updateAppWidget(appWidgetIds,?views);??
    95. ??????????
    96. ????????System.out.println("setwidget?update");??
    97. ????????super.onUpdate(context,?appWidgetManager,?appWidgetIds);??
    98. ????}??
    99. ??
    100. ????@Override??
    101. ????public?void?onAppWidgetOptionsChanged(Context?context,???
    102. ????????????AppWidgetManager?appWidgetManager,?int?appWidgetId,??
    103. ????????????Bundle?newOptions)?{??
    104. ????????super.onAppWidgetOptionsChanged(context,?appWidgetManager,?appWidgetId,??
    105. ????????????????newOptions);??
    106. ????}??
    107. ??
    108. ????@Override??
    109. ????public?void?onDeleted(Context?context,?int[]?appWidgetIds)?{??
    110. ????????super.onDeleted(context,?appWidgetIds);??
    111. ????}??
    112. ??
    113. ????@Override??
    114. ????public?void?onEnabled(Context?context)?{??
    115. ????????super.onEnabled(context);??
    116. ????}??
    117. ??
    118. ????@Override??
    119. ????public?void?onDisabled(Context?context)?{??
    120. ????????super.onDisabled(context);??
    121. ????}??
    122. ??????
    123. ????private?void?updateWidget(Context?context,?int?visible,?int?gone1,?int?gone2,?int?gone3)?{??
    124. ????????//RemoteViews處理異進(jìn)程中的View??
    125. ????????RemoteViews?views?=?new?RemoteViews(context.getPackageName(),?R.layout.collections_view_widget);??
    126. ??????????
    127. ????????views.setViewVisibility(visible,?View.VISIBLE);??
    128. ????????views.setViewVisibility(gone1,?View.GONE);??
    129. ????????views.setViewVisibility(gone2,?View.GONE);??
    130. ????????views.setViewVisibility(gone3,?View.GONE);??
    131. ??????????
    132. ????????if?(visible?!=?R.id.viewflipper)?{//viewflipper?不是?繼承自AbsListView??or??AdapterViewAnimator??的view??
    133. ????????????Intent?intent?=?new?Intent(context,?WidgetSetService.class);??
    134. ????????????views.setRemoteAdapter(visible,?intent);//設(shè)置集合的adapter為intent指定的service??
    135. ????????????views.setEmptyView(visible,?R.id.tv_empty);//指定集合view為空時(shí)顯示的view??
    136. ??????????????
    137. ????????????Intent?toIntent?=?new?Intent(CLICK_ITEM_ACTION);??
    138. ????????????PendingIntent?pendingIntent?=?PendingIntent.getBroadcast(context,?200,?toIntent,?PendingIntent.FLAG_UPDATE_CURRENT);??
    139. ????????????/*?
    140. ?????????????*?setPendingIntentTemplate?設(shè)置pendingIntent?模板?
    141. ?????????????*?setOnClickFillInIntent???可以將fillInIntent?添加到pendingIntent中?
    142. ?????????????*/??
    143. ????????????views.setPendingIntentTemplate(visible,?pendingIntent);??
    144. ??????????????
    145. ????????}?else?if?(visible?==?R.id.viewflipper)?{??
    146. //??????????views.setPendingIntentTemplate(R.id.viewflipper,?pendingIntentTemplate);??
    147. ????????}??
    148. ??????????
    149. ????????AppWidgetManager?am?=?AppWidgetManager.getInstance(context);??
    150. ????????int[]?appWidgetIds?=?am.getAppWidgetIds(new?ComponentName(context,?WidgetSetProvider.class));??
    151. ????????for?(int?i?=?0;?i?<?appWidgetIds.length;?i++)?{??
    152. ????????????am.updateAppWidget(appWidgetIds[i],?views);?//更新?實(shí)例??
    153. ????????}??
    154. ??????????
    155. ????}??
    156. ??????
    157. }??

    運(yùn)行的周期函數(shù)

    點(diǎn)擊stackview的效果圖


    最后編輯于
    ?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
    • 序言:七十年代末捧灰,一起剝皮案震驚了整個(gè)濱河市淆九,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌毛俏,老刑警劉巖炭庙,帶你破解...
      沈念sama閱讀 217,406評(píng)論 6 503
    • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異煌寇,居然都是意外死亡焕蹄,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
      沈念sama閱讀 92,732評(píng)論 3 393
    • 文/潘曉璐 我一進(jìn)店門阀溶,熙熙樓的掌柜王于貴愁眉苦臉地迎上來腻脏,“玉大人,你說我怎么就攤上這事银锻∮榔罚” “怎么了?”我有些...
      開封第一講書人閱讀 163,711評(píng)論 0 353
    • 文/不壞的土叔 我叫張陵击纬,是天一觀的道長(zhǎng)鼎姐。 經(jīng)常有香客問我,道長(zhǎng),這世上最難降的妖魔是什么炕桨? 我笑而不...
      開封第一講書人閱讀 58,380評(píng)論 1 293
    • 正文 為了忘掉前任饭尝,我火速辦了婚禮,結(jié)果婚禮上谋作,老公的妹妹穿的比我還像新娘芋肠。我一直安慰自己乎芳,他們只是感情好遵蚜,可當(dāng)我...
      茶點(diǎn)故事閱讀 67,432評(píng)論 6 392
    • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著奈惑,像睡著了一般吭净。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上肴甸,一...
      開封第一講書人閱讀 51,301評(píng)論 1 301
    • 那天寂殉,我揣著相機(jī)與錄音,去河邊找鬼原在。 笑死友扰,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的庶柿。 我是一名探鬼主播村怪,決...
      沈念sama閱讀 40,145評(píng)論 3 418
    • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼浮庐!你這毒婦竟也來了甚负?” 一聲冷哼從身側(cè)響起,我...
      開封第一講書人閱讀 39,008評(píng)論 0 276
    • 序言:老撾萬榮一對(duì)情侶失蹤审残,失蹤者是張志新(化名)和其女友劉穎梭域,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體搅轿,經(jīng)...
      沈念sama閱讀 45,443評(píng)論 1 314
    • 正文 獨(dú)居荒郊野嶺守林人離奇死亡病涨,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
      茶點(diǎn)故事閱讀 37,649評(píng)論 3 334
    • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了璧坟。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片既穆。...
      茶點(diǎn)故事閱讀 39,795評(píng)論 1 347
    • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖沸柔,靈堂內(nèi)的尸體忽然破棺而出循衰,到底是詐尸還是另有隱情,我是刑警寧澤褐澎,帶...
      沈念sama閱讀 35,501評(píng)論 5 345
    • 正文 年R本政府宣布会钝,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏迁酸。R本人自食惡果不足惜先鱼,卻給世界環(huán)境...
      茶點(diǎn)故事閱讀 41,119評(píng)論 3 328
    • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望奸鬓。 院中可真熱鬧焙畔,春花似錦、人聲如沸串远。這莊子的主人今日做“春日...
      開封第一講書人閱讀 31,731評(píng)論 0 22
    • 文/蒼蘭香墨 我抬頭看了看天上的太陽澡罚。三九已至伸但,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間留搔,已是汗流浹背更胖。 一陣腳步聲響...
      開封第一講書人閱讀 32,865評(píng)論 1 269
    • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留隔显,地道東北人却妨。 一個(gè)月前我還...
      沈念sama閱讀 47,899評(píng)論 2 370
    • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像括眠,于是被迫代替她去往敵國和親彪标。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
      茶點(diǎn)故事閱讀 44,724評(píng)論 2 354

    推薦閱讀更多精彩內(nèi)容