diff options
author | Dominik <dominik@dominikschuermann.de> | 2012-11-19 18:01:05 +0100 |
---|---|---|
committer | Dominik <dominik@dominikschuermann.de> | 2012-11-19 18:01:05 +0100 |
commit | 882610627c4687094e7b00934c27c03f67a7bb3f (patch) | |
tree | a7abd7eeef1561774a8d2300e28c9b6b5201d4f0 /com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java | |
parent | be569984b893e8cb412b9cc2b3826c92fd4c9d81 (diff) | |
download | open-keychain-882610627c4687094e7b00934c27c03f67a7bb3f.tar.gz open-keychain-882610627c4687094e7b00934c27c03f67a7bb3f.tar.bz2 open-keychain-882610627c4687094e7b00934c27c03f67a7bb3f.zip |
changed location of ActionBarSherlock lib
Diffstat (limited to 'com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java')
-rw-r--r-- | com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java b/com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java deleted file mode 100644 index ad1b4f0a8..000000000 --- a/com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.actionbarsherlock.internal.widget; - -import static android.view.View.MeasureSpec.EXACTLY; -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.DisplayMetrics; -import android.util.TypedValue; -import android.widget.LinearLayout; -import com.actionbarsherlock.R; - -public class FakeDialogPhoneWindow extends LinearLayout { - final TypedValue mMinWidthMajor = new TypedValue(); - final TypedValue mMinWidthMinor = new TypedValue(); - - public FakeDialogPhoneWindow(Context context, AttributeSet attrs) { - super(context, attrs); - - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SherlockTheme); - - a.getValue(R.styleable.SherlockTheme_windowMinWidthMajor, mMinWidthMajor); - a.getValue(R.styleable.SherlockTheme_windowMinWidthMinor, mMinWidthMinor); - - a.recycle(); - } - - /* Stolen from PhoneWindow */ - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); - final boolean isPortrait = metrics.widthPixels < metrics.heightPixels; - - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - int width = getMeasuredWidth(); - boolean measure = false; - - widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, EXACTLY); - - final TypedValue tv = isPortrait ? mMinWidthMinor : mMinWidthMajor; - - if (tv.type != TypedValue.TYPE_NULL) { - final int min; - if (tv.type == TypedValue.TYPE_DIMENSION) { - min = (int)tv.getDimension(metrics); - } else if (tv.type == TypedValue.TYPE_FRACTION) { - min = (int)tv.getFraction(metrics.widthPixels, metrics.widthPixels); - } else { - min = 0; - } - - if (width < min) { - widthMeasureSpec = MeasureSpec.makeMeasureSpec(min, EXACTLY); - measure = true; - } - } - - // TODO: Support height? - - if (measure) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - } - } -} |