diff options
| author | Michael Kolb <kolby@google.com> | 2011-03-07 15:26:33 -0800 |
|---|---|---|
| committer | Michael Kolb <kolby@google.com> | 2011-03-08 13:10:08 -0800 |
| commit | 0860d99a463f7645bcc9aaa246fd8852e90dbb5d (patch) | |
| tree | ed62e02e453f1a633aacb1053c5de48d27e48cfc /src/com/android/browser/view/PieItem.java | |
| parent | 448461d9b7e8824a68a2994f490bb142c9f9b77a (diff) | |
| download | packages_apps_Browser-0860d99a463f7645bcc9aaa246fd8852e90dbb5d.tar.gz packages_apps_Browser-0860d99a463f7645bcc9aaa246fd8852e90dbb5d.tar.bz2 packages_apps_Browser-0860d99a463f7645bcc9aaa246fd8852e90dbb5d.zip | |
qc refactor part1
Bug: 4052266
change QuickControl rendering (removes all path calculations)
change pie to allow several levels of items
Change-Id: I52254745eadf956da83d963e23c1ba07946f53a7
Diffstat (limited to 'src/com/android/browser/view/PieItem.java')
| -rw-r--r-- | src/com/android/browser/view/PieItem.java | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/com/android/browser/view/PieItem.java b/src/com/android/browser/view/PieItem.java new file mode 100644 index 000000000..c09dba2e7 --- /dev/null +++ b/src/com/android/browser/view/PieItem.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.android.browser.view; + +import android.view.View; + +/** + * Pie menu item + */ +public class PieItem { + + private View mView; + private int level; + private float start; + private float sweep; + private int inner; + private int outer; + private boolean mSelected; + + public PieItem(View view, int level) { + mView = view; + this.level = level; + } + + public void setSelected(boolean s) { + mSelected = s; + if (mView != null) { + mView.setSelected(s); + } + } + + public boolean isSelected() { + return mSelected; + } + + public int getLevel() { + return level; + } + + public void setGeometry(float st, float sw, int inside, int outside) { + start = st; + sweep = sw; + inner = inside; + outer = outside; + } + + public float getStartAngle() { + return start; + } + + public float getSweep() { + return sweep; + } + + public int getInnerRadius() { + return inner; + } + + public int getOuterRadius() { + return outer; + } + + public View getView() { + return mView; + } + +} |
