1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package androidx.constraintlayout.widget; 17 18 /** 19 * <b>Added in 2.0</b> 20 * <p> 21 * Callbacks on state change 22 * </p> 23 */ 24 public abstract class ConstraintsChangedListener { 25 26 /** 27 * called before layout happens 28 * @param stateId -1 if state unknown, otherwise the state we will transition to 29 * @param constraintId the constraintSet id that we will transition to 30 */ preLayoutChange(int stateId, int constraintId)31 public void preLayoutChange(int stateId, int constraintId){ 32 // nothing 33 } 34 35 /** 36 * called after layout happens 37 * @param stateId -1 if state unknown, otherwise the current state 38 * @param constraintId the current constraintSet id we transitioned to 39 */ postLayoutChange(int stateId, int constraintId)40 public void postLayoutChange(int stateId, int constraintId) { 41 // nothing 42 } 43 } 44