1d8732610ff48dc57063559d55ea3c84775e30e41John Reck/*
2d8732610ff48dc57063559d55ea3c84775e30e41John Reck * Copyright (C) 2013 The Android Open Source Project
3d8732610ff48dc57063559d55ea3c84775e30e41John Reck *
4d8732610ff48dc57063559d55ea3c84775e30e41John Reck * Licensed under the Apache License, Version 2.0 (the "License");
5d8732610ff48dc57063559d55ea3c84775e30e41John Reck * you may not use this file except in compliance with the License.
6d8732610ff48dc57063559d55ea3c84775e30e41John Reck * You may obtain a copy of the License at
7d8732610ff48dc57063559d55ea3c84775e30e41John Reck *
8d8732610ff48dc57063559d55ea3c84775e30e41John Reck *      http://www.apache.org/licenses/LICENSE-2.0
9d8732610ff48dc57063559d55ea3c84775e30e41John Reck *
10d8732610ff48dc57063559d55ea3c84775e30e41John Reck * Unless required by applicable law or agreed to in writing, software
11d8732610ff48dc57063559d55ea3c84775e30e41John Reck * distributed under the License is distributed on an "AS IS" BASIS,
12d8732610ff48dc57063559d55ea3c84775e30e41John Reck * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13d8732610ff48dc57063559d55ea3c84775e30e41John Reck * See the License for the specific language governing permissions and
14d8732610ff48dc57063559d55ea3c84775e30e41John Reck * limitations under the License.
15d8732610ff48dc57063559d55ea3c84775e30e41John Reck */
16d8732610ff48dc57063559d55ea3c84775e30e41John Reck
17d8732610ff48dc57063559d55ea3c84775e30e41John Reckpackage com.android.photos;
18d8732610ff48dc57063559d55ea3c84775e30e41John Reck
19d8732610ff48dc57063559d55ea3c84775e30e41John Reckimport android.app.Activity;
20d8732610ff48dc57063559d55ea3c84775e30e41John Reckimport android.os.Bundle;
21d8732610ff48dc57063559d55ea3c84775e30e41John Reckimport com.android.photos.views.TiledImageView;
22d8732610ff48dc57063559d55ea3c84775e30e41John Reck
23d8732610ff48dc57063559d55ea3c84775e30e41John Reck
24d8732610ff48dc57063559d55ea3c84775e30e41John Reckpublic class FullscreenViewer extends Activity {
25d8732610ff48dc57063559d55ea3c84775e30e41John Reck
26d8732610ff48dc57063559d55ea3c84775e30e41John Reck    private TiledImageView mTextureView;
27d8732610ff48dc57063559d55ea3c84775e30e41John Reck
28d8732610ff48dc57063559d55ea3c84775e30e41John Reck    @Override
29d8732610ff48dc57063559d55ea3c84775e30e41John Reck    protected void onCreate(Bundle savedInstanceState) {
30d8732610ff48dc57063559d55ea3c84775e30e41John Reck        super.onCreate(savedInstanceState);
31d8732610ff48dc57063559d55ea3c84775e30e41John Reck
32d8732610ff48dc57063559d55ea3c84775e30e41John Reck        String path = getIntent().getData().toString();
33d8732610ff48dc57063559d55ea3c84775e30e41John Reck        mTextureView = new TiledImageView(this);
34f5ef4801465a48ce3e33e1a75568060b2cf61185John Reck        mTextureView.setTileSource(new BitmapRegionTileSource(this, path, 0, 0), null);
35d8732610ff48dc57063559d55ea3c84775e30e41John Reck        setContentView(mTextureView);
36d8732610ff48dc57063559d55ea3c84775e30e41John Reck    }
37d8732610ff48dc57063559d55ea3c84775e30e41John Reck
38d8732610ff48dc57063559d55ea3c84775e30e41John Reck    @Override
39d8732610ff48dc57063559d55ea3c84775e30e41John Reck    protected void onDestroy() {
40d8732610ff48dc57063559d55ea3c84775e30e41John Reck        super.onDestroy();
41d8732610ff48dc57063559d55ea3c84775e30e41John Reck        mTextureView.destroy();
42d8732610ff48dc57063559d55ea3c84775e30e41John Reck    }
43d8732610ff48dc57063559d55ea3c84775e30e41John Reck
44d8732610ff48dc57063559d55ea3c84775e30e41John Reck}
45