ScheduleProvider (3)
若い方々に中を掘ってもらおうと思ってたりして。
それは良いとして、この ContentProvider の実装は素晴しいですな。SelectionBuilder というクラスを使って (insert 以外は) 見事に処理を抽象化しておられます。
Uri
ちょい整理しておきます。
- content://com.google.android.apps.iosched/blocks/between/*/*
- type は vnd.android.cursor.dir/vnd.iosched.block
- content://com.google.android.apps.iosched/blocks/*/sessioins
- type は vnd.android.cursor.dir/vnd.iosched.block
- content://com.google.android.apps.iosched/tracks/*/sessions
- type は vnd.android.cursor.dir/vnd.iosched.track
- content://com.google.android.apps.iosched/tracks/*/vendors
- type は vnd.android.cursor.dir/vnd.iosched.track
- content://com.google.android.apps.iosched/rooms/*/sessions
- type は vnd.android.cursor.dir/vnd.iosched.room
- content://com.google.android.apps.iosched/sessions
- type は vnd.android.cursor.dir/vnd.iosched.session
- content://com.google.android.apps.iosched/sessions/starred
- type は vnd.android.cursor.dir/vnd.iosched.session
- content://com.google.android.apps.iosched/sessions/search/*
- type は vnd.android.cursor.dir/vnd.iosched.session
- content://com.google.android.apps.iosched/sessions/at/*
- type は vnd.android.cursor.dir/vnd.iosched.session
- content://com.google.android.apps.iosched/sessions/*
- type は vnd.android.cursor.item/vnd.iosched.session
- content://com.google.android.apps.iosched/sessions/*/speakers
- type は vnd.android.cursor.dir/vnd.iosched.session
- content://com.google.android.apps.iosched/sessions/*/tracks
- type は vnd.android.cursor.dir/vnd.iosched.session
- content://com.google.android.apps.iosched/speakers
- type は vnd.android.cursor.dir/vnd.iosched.speaker
- content://com.google.android.apps.iosched/speakers/*
- type は vnd.android.cursor.item/vnd.iosched.speaker
- content://com.google.android.apps.iosched/speakers/*/sessions
- type は vnd.android.cursor.dir/vnd.iosched.speaker
- content://com.google.android.apps.iosched/vendors/starred
- type は vnd.android.cursor.dir/vnd.iosched.vendor
- content://com.google.android.apps.iosched/vendors/search/*
- type は vnd.android.cursor.dir/vnd.iosched.vendor
- content://com.google.android.apps.iosched/vendor/*
- type は vnd.android.cursor.item/vnd.iosched.vendor
こうやって見てみるに見事なまでに一覧と詳細だな。徹底してるね、って感心するべきなのかどうかがナニ。ちなみに AndroidManifest で intent-filter がかかってるのは以下な type なのか。
- vnd.android.cursor.dir/vnd.iosched.track
- ui.phone.TracksActivity
- vnd.android.cursor.dir/vnd.iosched.session
- ui.phone.SessionsActivity
- vnd.android.cursor.item/vnd.iosched.session
- ui.phone.SessioDetailActivity
- vnd.android.cursor.dir/vnd.iosched.vendor
- ui.phone.VendorsActivity
- vnd.android.cursor.item/vnd.iosched.vendor
- ui.phone.VendorDetailActivity
ACTION_VIEW な Intent を云々してる箇所を抜き出してみました。
$ (cd src/com/google/android/apps/iosched/; find |xargs grep Intent|grep new|grep ACTION_VIEW; ) ./ui/SessionsFragment.java: final Intent intent = new Intent(Intent.ACTION_VIEW, sessionUri); ./ui/WhatsOnFragment.java: Intent intent = new Intent(Intent.ACTION_VIEW); ./ui/VendorsFragment.java: ((BaseActivity) getActivity()).openActivityOrFragment(new Intent(Intent.ACTION_VIEW, ./ui/TracksFragment.java: final Intent intent = new Intent(Intent.ACTION_VIEW); ./ui/StarredActivity.java: final Intent intent = new Intent(Intent.ACTION_VIEW, Sessions.CONTENT_STARRED_URI); ./ui/StarredActivity.java: final Intent intent = new Intent(Intent.ACTION_VIEW, Vendors.CONTENT_STARRED_URI); ./ui/ScheduleFragment.java: final Intent intent = new Intent(Intent.ACTION_VIEW, sessionsUri); ./ui/DashboardFragment.java: final Intent intent = new Intent(Intent.ACTION_VIEW, ./ui/DashboardFragment.java: final Intent intent = new Intent(Intent.ACTION_VIEW, ./ui/SessionDetailFragment.java: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); ./ui/MapFragment.java: intent = new Intent(Intent.ACTION_VIEW, trackVendorsUri); ./ui/MapFragment.java: intent = new Intent(Intent.ACTION_VIEW, roomUri); ./ui/SearchActivity.java: new Intent(Intent.ACTION_VIEW, Sessions.buildSearchUri(mQuery))); ./ui/SearchActivity.java: new Intent(Intent.ACTION_VIEW, Vendors.buildSearchUri(mQuery))); ./ui/tablet/TracksDropdownFragment.java: final Intent intent = new Intent(Intent.ACTION_VIEW); ./ui/TagStreamFragment.java: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); ./ui/BulletinFragment.java: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); ./util/CatchNotesHelper.java: Intent intent = new Intent(Intent.ACTION_VIEW, uri); $
上記、へろへろながら一つづつ確認してみます。
- ./ui/SessionsFragment.java
- SessionDetailActivity へ
- ./ui/WhatsOnFragment.java
- 明示的 intent でした
- ./ui/VendorsFragment.java
- VenderDetailActivity へ
- ./ui/TracksFragment.java
- Sessions または SessionDetail または Vendors または VendorDetail
- ./ui/StarredActivity.java
- SessionFragment を Fragment にはりつけてました
- VendorFragment を Fragment にはりつけてました
- ./ui/ScheduleFragment.java
- SessionsDetailActivity へ
- ./ui/DashboardFragment.java
- TracksActivity へ
- ./ui/SessionDetailFragment.java
- 詳細不明
- ./ui/MapFragment.java
- VendorsActivity
- SessionsActivity
- ./ui/SearchActivity.java
- SessionsActivity
- VendorsActivity
- ./ui/tablet/TracksDropdownFragment.java
- Sessions または Vendord に見えます
- ./ui/TagStreamFragment.java
- 引数マター、なので別途調べます
- ./ui/BulletinFragment.java
- こいつも引数マター
- ./util/CatchNotesHelper.java
- これもスルーで良いはず
ちょっとへろへろなので今日は休みます。