スタート画面のViewPagerを廃止
@@ -22,23 +22,17 @@ | ||
22 | 22 | import roboguice.inject.InjectView; |
23 | 23 | import android.app.Activity; |
24 | 24 | import android.app.AlertDialog; |
25 | -import android.content.Context; | |
26 | 25 | import android.content.Intent; |
27 | 26 | import android.os.Bundle; |
28 | -import android.support.v4.view.PagerAdapter; | |
29 | -import android.support.v4.view.ViewPager; | |
30 | -import android.view.LayoutInflater; | |
31 | 27 | import android.view.Menu; |
32 | 28 | import android.view.MenuInflater; |
33 | 29 | import android.view.MenuItem; |
34 | 30 | import android.view.View; |
35 | 31 | import android.view.View.OnClickListener; |
36 | -import android.view.ViewGroup; | |
37 | 32 | import android.widget.AdapterView; |
38 | 33 | import android.widget.AdapterView.OnItemClickListener; |
39 | 34 | import android.widget.Button; |
40 | 35 | import android.widget.ListView; |
41 | -import android.widget.TextView; | |
42 | 36 | |
43 | 37 | /** |
44 | 38 | * アプリを起動すると最初に表示される画面<br> |
@@ -54,8 +48,8 @@ | ||
54 | 48 | private Button runLectureSearchActivityButton; |
55 | 49 | @InjectView(R.id.runReviewActivityButton) |
56 | 50 | private Button runReviewActivityButton; |
57 | - @InjectView(R.id.startviewpager) | |
58 | - ViewPager mViewPager; | |
51 | + @InjectView(R.id.nextLectureView) | |
52 | + private ListView lectureListView; | |
59 | 53 | |
60 | 54 | // 1から7の番号をjava.util.Calendar.XXXに変換する配列 |
61 | 55 | // dayOfWeekSelectedを変換するのが目的 |
@@ -64,7 +58,6 @@ | ||
64 | 58 | java.util.Calendar.FRIDAY, java.util.Calendar.SATURDAY, java.util.Calendar.SUNDAY }; |
65 | 59 | |
66 | 60 | NextLectureListAdapter listAdapter; |
67 | - private ListView lectureListView; | |
68 | 61 | private List<Course> lectures = new ArrayList<Course>(); |
69 | 62 | |
70 | 63 | //今日は何曜日? |
@@ -92,22 +85,6 @@ | ||
92 | 85 | } |
93 | 86 | }); |
94 | 87 | |
95 | - /* | |
96 | - * //ReviewActivityをまだ作っていない | |
97 | - * runReviewActivityButton.setOnClickListener(new View.OnClickListener() | |
98 | - * { | |
99 | - * | |
100 | - * @Override public void onClick(View v) { //startActivity(new | |
101 | - * Intent(ObservoiceNetworkingSampleActivity.this, | |
102 | - * ReviewActivity.class)); | |
103 | - * | |
104 | - * } }); | |
105 | - */ | |
106 | - | |
107 | - MyPagerAdapter mPagerAdapter = new MyPagerAdapter(); | |
108 | - mViewPager.setAdapter(mPagerAdapter); | |
109 | - lectureListView = mPagerAdapter.getNextLectureListView(); | |
110 | - | |
111 | 88 | //検索用データの設定 |
112 | 89 | String freeWord = ""; |
113 | 90 | int periodToSearch = 0; |
@@ -292,60 +269,6 @@ | ||
292 | 269 | |
293 | 270 | } |
294 | 271 | |
295 | - // フリップで切り替え可能なサブビュー用のアダプタ | |
296 | - private class MyPagerAdapter extends PagerAdapter { | |
297 | - private ListView mNextLecture; // フリックページ1 | |
298 | - private ListView mCommentListView; // フリックページ2 | |
299 | - private TextView mLectureAbstractView; | |
300 | - | |
301 | - public MyPagerAdapter() { | |
302 | - LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
303 | - mNextLecture = (ListView) inflater.inflate(R.layout.next_lecture, null); | |
304 | - mCommentListView = (ListView) inflater.inflate(R.layout.comment_list_fragment, null); | |
305 | - mLectureAbstractView = (TextView) inflater.inflate(R.layout.lecture_abstract, null); | |
306 | - } | |
307 | - | |
308 | - @Override | |
309 | - public Object instantiateItem(ViewGroup container, int position) { | |
310 | - int[] pages = { R.layout.next_lecture, R.layout.comment_list_fragment, | |
311 | - R.layout.lecture_abstract }; | |
312 | - int page = pages[position]; | |
313 | - View view = null; | |
314 | - switch (page) { | |
315 | - case R.layout.next_lecture: | |
316 | - view = mNextLecture; | |
317 | - break; | |
318 | - case R.layout.comment_list_fragment: | |
319 | - view = mCommentListView; | |
320 | - break; | |
321 | - case R.layout.lecture_abstract: | |
322 | - view = mLectureAbstractView; | |
323 | - break; | |
324 | - } | |
325 | - container.addView(view); | |
326 | - return view; | |
327 | - } | |
328 | - | |
329 | - @Override | |
330 | - public void destroyItem(ViewGroup container, int position, Object object) { | |
331 | - ((ViewPager) container).removeView((View) object); | |
332 | - } | |
333 | - | |
334 | - @Override | |
335 | - public int getCount() { | |
336 | - return 3; | |
337 | - } | |
338 | - | |
339 | - @Override | |
340 | - public boolean isViewFromObject(View view, Object object) { | |
341 | - return view.equals(object); | |
342 | - } | |
343 | - | |
344 | - public ListView getNextLectureListView() { | |
345 | - return mNextLecture; | |
346 | - } | |
347 | - } | |
348 | - | |
349 | 272 | @Override |
350 | 273 | public boolean onCreateOptionsMenu(Menu menu) { |
351 | 274 | MenuInflater inflater = getMenuInflater(); |
@@ -2,7 +2,8 @@ | ||
2 | 2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | 3 | android:id="@+id/menu" |
4 | 4 | android:layout_width="fill_parent" |
5 | - android:layout_height="fill_parent" > | |
5 | + android:layout_height="fill_parent" | |
6 | + android:baselineAligned="false" > | |
6 | 7 | |
7 | 8 | <RelativeLayout |
8 | 9 | android:layout_width="0dp" |
@@ -9,22 +10,20 @@ | ||
9 | 10 | android:layout_height="fill_parent" |
10 | 11 | android:layout_weight="0.7" > |
11 | 12 | |
12 | - <android.support.v4.view.ViewPager | |
13 | + <ListView | |
13 | 14 | xmlns:android="http://schemas.android.com/apk/res/android" |
14 | - android:id="@+id/startviewpager" | |
15 | + android:id="@+id/nextLectureView" | |
15 | 16 | android:layout_width="fill_parent" |
16 | 17 | android:layout_height="fill_parent" |
17 | - android:layout_above="@+id/tori_button" | |
18 | - android:layout_weight="0.5" /> | |
18 | + android:layout_above="@+id/tori_button" /> | |
19 | 19 | |
20 | - <Button | |
20 | + <Button | |
21 | 21 | android:id="@+id/tori_button" |
22 | 22 | style="@style/ObsvToriButton" |
23 | 23 | android:layout_width="128dp" |
24 | 24 | android:layout_height="128dp" |
25 | 25 | android:layout_alignParentBottom="true" |
26 | - android:layout_alignParentRight="true"> | |
27 | - | |
26 | + android:layout_alignParentRight="true" > | |
28 | 27 | </Button> |
29 | 28 | </RelativeLayout> |
30 | 29 |