blob: d797e38baaf162bcfabbed5f344eb049a92a8421 [file] [log] [blame]
Daniel Sandlera30b70352013-09-16 10:16:49 -04001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.systemui;
18
Daniel Sandler8475a742013-09-26 00:24:57 -040019import android.animation.ObjectAnimator;
Daniel Sandlera30b70352013-09-16 10:16:49 -040020import android.app.Activity;
21import android.content.ComponentName;
22import android.content.pm.PackageManager;
Daniel Sandler8475a742013-09-26 00:24:57 -040023import android.os.Handler;
Daniel Sandlera30b70352013-09-16 10:16:49 -040024import android.util.Slog;
Daniel Sandler8475a742013-09-26 00:24:57 -040025import android.view.animation.DecelerateInterpolator;
Daniel Sandlera30b70352013-09-16 10:16:49 -040026
27public class DessertCase extends Activity {
Daniel Sandler8475a742013-09-26 00:24:57 -040028 DessertCaseView mView;
Daniel Sandlera30b70352013-09-16 10:16:49 -040029
30 @Override
31 public void onStart() {
32 super.onStart();
33
Daniel Sandlera30b70352013-09-16 10:16:49 -040034 PackageManager pm = getPackageManager();
Daniel Sandler8475a742013-09-26 00:24:57 -040035 final ComponentName cn = new ComponentName(this, DessertCaseDream.class);
36 if (pm.getComponentEnabledSetting(cn) != PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
37 Slog.v("DessertCase", "ACHIEVEMENT UNLOCKED");
38 pm.setComponentEnabledSetting(cn,
Daniel Sandler5c6a7812013-11-12 21:50:18 -050039 PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
40 PackageManager.DONT_KILL_APP);
Daniel Sandler8475a742013-09-26 00:24:57 -040041 }
Daniel Sandlera30b70352013-09-16 10:16:49 -040042
Daniel Sandler8475a742013-09-26 00:24:57 -040043 mView = new DessertCaseView(this);
44
45 DessertCaseView.RescalingContainer container = new DessertCaseView.RescalingContainer(this);
46
47 container.setView(mView);
48
49 setContentView(container);
50 }
51
52 @Override
53 public void onResume() {
54 super.onResume();
55 mView.postDelayed(new Runnable() {
56 public void run() {
57 mView.start();
58 }
59 }, 1000);
60 }
61
62 @Override
63 public void onPause() {
64 super.onPause();
65 mView.stop();
Daniel Sandlera30b70352013-09-16 10:16:49 -040066 }
67}