1b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan/*
2b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * Copyright (C) 2013 The Android Open Source Project
3b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan *
4b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * Licensed under the Apache License, Version 2.0 (the "License");
5b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * you may not use this file except in compliance with the License.
6b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * You may obtain a copy of the License at
7b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan *
8b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan *      http://www.apache.org/licenses/LICENSE-2.0
9b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan *
10b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * Unless required by applicable law or agreed to in writing, software
11b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * distributed under the License is distributed on an "AS IS" BASIS,
12b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * See the License for the specific language governing permissions and
14b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan * limitations under the License.
15b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan */
16b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
17b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chanpackage com.android.calendar.recurrencepicker;
18b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
19b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chanimport android.content.Context;
20b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chanimport android.util.AttributeSet;
21b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chanimport android.view.View;
22b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chanimport android.widget.LinearLayout;
23b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
24b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chanpublic class LinearLayoutWithMaxWidth extends LinearLayout {
25b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
26b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    public LinearLayoutWithMaxWidth(Context context) {
27b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan        super(context);
28b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    }
29b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
30b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    public LinearLayoutWithMaxWidth(Context context, AttributeSet attrs) {
31b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan        super(context, attrs);
32b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    }
33b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
34b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    public LinearLayoutWithMaxWidth(Context context, AttributeSet attrs, int defStyle) {
35b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan        super(context, attrs, defStyle);
36b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    }
37b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan
38b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    @Override
39b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
40b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan        WeekButton.setSuggestedWidth((View.MeasureSpec.getSize(widthMeasureSpec)) / 7);
41b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
42b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan    }
43b21c638ca11d9be3a3d9e7d28223bb4a3dab5f15Michael Chan}
44