Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a7c7dc8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Avoid Resources$NotFoundException"

parents f1308ceb 8a357e88
Loading
Loading
Loading
Loading

res/values-land/vals.xml

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->
<resources>
    <!-- The ratio of width:height for the contact's photo -->
    <item name="quickcontact_photo_ratio" type="vals" format="float">0.7</item>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
    <dimen name="quickcontact_maximum_title_size">36dp</dimen>
    <!-- When QC is uncollapsed, the title has this much margin on its left, right and bottom -->
    <dimen name="quickcontact_title_initial_margin">16dp</dimen>
    <!-- The ratio of width:height for the contact's photo in landscape -->
    <item name="quickcontact_landscape_photo_ratio" type="dimen" format="float">0.7</item>

    <!-- Top padding of the entire contact editor  -->
    <dimen name="editor_padding_top">0dip</dimen>
+8 −7
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ public class MultiShrinkScroller extends FrameLayout {
    private final int mMaximumTitleMargin;
    private final float mToolbarElevation;
    private final boolean mIsTwoPanel;
    private final float mLandscapePhotoRatio;
    private final int mActionBarSize;

    // Objects used to perform color filtering on the header. These are stored as fields for
@@ -251,6 +252,11 @@ public class MultiShrinkScroller extends FrameLayout {
        mMaximumTitleMargin = (int) getResources().getDimension(
                R.dimen.quickcontact_title_initial_margin);

        final TypedValue photoRatio = new TypedValue();
        getResources().getValue(R.dimen.quickcontact_landscape_photo_ratio, photoRatio,
                            /* resolveRefs = */ true);
        mLandscapePhotoRatio = photoRatio.getFloat();

        final TypedArray attributeArray = context.obtainStyledAttributes(
                new int[]{android.R.attr.actionBarSize});
        mActionBarSize = attributeArray.getDimensionPixelSize(0, 0);
@@ -317,9 +323,7 @@ public class MultiShrinkScroller extends FrameLayout {
                    mIntermediateHeaderHeight = (int) (mMaximumHeaderHeight
                            * INTERMEDIATE_HEADER_HEIGHT_RATIO);
                }
                final boolean isLandscape = getResources().getConfiguration().orientation
                        == Configuration.ORIENTATION_LANDSCAPE;
                mMaximumPortraitHeaderHeight = isLandscape ? getHeight()
                mMaximumPortraitHeaderHeight = mIsTwoPanel ? getHeight()
                        : mPhotoViewContainer.getWidth();
                setHeaderHeight(getMaximumScrollableHeaderHeight());
                mMaximumHeaderTextSize = mLargeTextView.getHeight();
@@ -329,13 +333,10 @@ public class MultiShrinkScroller extends FrameLayout {
                    mIntermediateHeaderHeight = mMaximumHeaderHeight;

                    // Permanently set photo width and height.
                    final TypedValue photoRatio = new TypedValue();
                    getResources().getValue(R.vals.quickcontact_photo_ratio, photoRatio,
                            /* resolveRefs = */ true);
                    final ViewGroup.LayoutParams photoLayoutParams
                            = mPhotoViewContainer.getLayoutParams();
                    photoLayoutParams.height = mMaximumHeaderHeight;
                    photoLayoutParams.width = (int) (mMaximumHeaderHeight * photoRatio.getFloat());
                    photoLayoutParams.width = (int) (mMaximumHeaderHeight * mLandscapePhotoRatio);
                    mPhotoViewContainer.setLayoutParams(photoLayoutParams);

                    // Permanently set title width and margin.