1a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell/*
2a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * Copyright (C) 2013 The Android Open Source Project
3a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell *
4a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * Licensed under the Apache License, Version 2.0 (the "License");
5a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * you may not use this file except in compliance with the License.
6a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * You may obtain a copy of the License at
7a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell *
8a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell *      http://www.apache.org/licenses/LICENSE-2.0
9a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell *
10a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * Unless required by applicable law or agreed to in writing, software
11a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * distributed under the License is distributed on an "AS IS" BASIS,
12a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * See the License for the specific language governing permissions and
14a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell * limitations under the License.
15a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell */
16a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
17a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
18a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powellpackage android.support.v4.view;
19a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
20a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powellimport android.view.ViewGroup;
21a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
22a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powellclass MarginLayoutParamsCompatJellybeanMr1 {
23a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static int getMarginStart(ViewGroup.MarginLayoutParams lp) {
24a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        return lp.getMarginStart();
25a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
26a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
27a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static int getMarginEnd(ViewGroup.MarginLayoutParams lp) {
28a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        return lp.getMarginEnd();
29a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
30a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
31a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static void setMarginStart(ViewGroup.MarginLayoutParams lp, int marginStart) {
32a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        lp.setMarginStart(marginStart);
33a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
34a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
35a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static void setMarginEnd(ViewGroup.MarginLayoutParams lp, int marginEnd) {
36a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        lp.setMarginEnd(marginEnd);
37a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
38a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
39a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static boolean isMarginRelative(ViewGroup.MarginLayoutParams lp) {
40a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        return lp.isMarginRelative();
41a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
42a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
43a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static int getLayoutDirection(ViewGroup.MarginLayoutParams lp) {
44a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        return lp.getLayoutDirection();
45a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
46a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
47a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static void setLayoutDirection(ViewGroup.MarginLayoutParams lp, int layoutDirection) {
48a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        lp.setLayoutDirection(layoutDirection);
49a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
50a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell
51a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    public static void resolveLayoutDirection(ViewGroup.MarginLayoutParams lp,
52a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell            int layoutDirection) {
53a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell        lp.resolveLayoutDirection(layoutDirection);
54a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell    }
55a4ce8ce5dacb7902373edfe35d5b2075968d1125Adam Powell}
56