summaryrefslogtreecommitdiffstats
path: root/src/com/android/calendar/AllInOneActivity.java
diff options
context:
space:
mode:
authorIsaac Katzenelson <isaack@android.com>2012-04-12 16:00:53 -0700
committerIsaac Katzenelson <isaack@android.com>2012-04-20 14:31:44 -0700
commite0b4b2744a1c0de48f76d9af6989bfa5106bc5f4 (patch)
treed8122d6c732edc98e825a486c79d9696a762e666 /src/com/android/calendar/AllInOneActivity.java
parent81e28b00ea86551a1a0c60bcdbf9ff4ba4fa61a0 (diff)
downloadandroid_packages_apps_Calendar-e0b4b2744a1c0de48f76d9af6989bfa5106bc5f4.tar.gz
android_packages_apps_Calendar-e0b4b2744a1c0de48f76d9af6989bfa5106bc5f4.tar.bz2
android_packages_apps_Calendar-e0b4b2744a1c0de48f76d9af6989bfa5106bc5f4.zip
Fix mini-calendar size of 7 inch
Bug: 6331538 Mini calendar is too small on 7 inch portrait. Change-Id: Ic79a5a4dfca61357a116a6148afd46a2ed783a6f
Diffstat (limited to 'src/com/android/calendar/AllInOneActivity.java')
-rw-r--r--src/com/android/calendar/AllInOneActivity.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/calendar/AllInOneActivity.java b/src/com/android/calendar/AllInOneActivity.java
index 0a898da7..9cbc0c6f 100644
--- a/src/com/android/calendar/AllInOneActivity.java
+++ b/src/com/android/calendar/AllInOneActivity.java
@@ -369,14 +369,20 @@ public class AllInOneActivity extends Activity implements EventHandler,
mShowString = res.getString(R.string.show_controls);
mOrientation = res.getConfiguration().orientation;
if (mOrientation == Configuration.ORIENTATION_LANDSCAPE) {
+ mControlsAnimateWidth = (int)res.getDimension(R.dimen.calendar_controls_width);
if (mControlsParams == null) {
mControlsParams = new LayoutParams(mControlsAnimateWidth, 0);
}
mControlsParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+ } else {
+ // Make sure width is in between allowed min and max width values
+ mControlsAnimateWidth = Math.max(res.getDisplayMetrics().widthPixels * 45 / 100,
+ (int)res.getDimension(R.dimen.min_portrait_calendar_controls_width));
+ mControlsAnimateWidth = Math.min(mControlsAnimateWidth,
+ (int)res.getDimension(R.dimen.max_portrait_calendar_controls_width));
}
mControlsAnimateHeight = (int)res.getDimension(R.dimen.calendar_controls_height);
- mControlsAnimateWidth = (int)res.getDimension(R.dimen.calendar_controls_width);
mIsMultipane = Utils.getConfigBool(this, R.bool.multiple_pane_config);
mIsTabletConfig = Utils.getConfigBool(this, R.bool.tablet_config);
@@ -408,6 +414,10 @@ public class AllInOneActivity extends Activity implements EventHandler,
mHomeTime = (TextView) findViewById(R.id.home_time);
mMiniMonth = findViewById(R.id.mini_month);
+ if (mOrientation == Configuration.ORIENTATION_PORTRAIT) {
+ mMiniMonth.setLayoutParams(new LinearLayout.LayoutParams(mControlsAnimateWidth,
+ mControlsAnimateHeight));
+ }
mCalendarsList = findViewById(R.id.calendar_list);
mMiniMonthContainer = findViewById(R.id.mini_month_container);
mSecondaryPane = findViewById(R.id.secondary_pane);