public abstract class

Guideline

extends Helper

 java.lang.Object

androidx.constraintlayout.core.dsl.Helper

↳androidx.constraintlayout.core.dsl.Guideline

Subclasses:

VGuideline

Gradle dependencies

compile group: 'androidx.constraintlayout', name: 'constraintlayout-core', version: '1.1.0-beta01'

  • groupId: androidx.constraintlayout
  • artifactId: constraintlayout-core
  • version: 1.1.0-beta01

Artifact androidx.constraintlayout:constraintlayout-core:1.1.0-beta01 it located at Google repository (https://maven.google.com/)

Summary

Fields
from Helperconfig, configMap, name, sideMap, type, typeMap
Methods
public intgetEnd()

Get the end position

public floatgetPercent()

Get the position in percent

public intgetStart()

Get the start position

public voidsetEnd(int end)

Set the end position

public voidsetPercent(float percent)

Set the position in percent

public voidsetStart(int start)

Set the start position

from Helperappend, convertConfigToMap, getConfig, getId, getType, main, toString
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods

public int getStart()

Get the start position

Returns:

start position

public void setStart(int start)

Set the start position

Parameters:

start: the start position

public int getEnd()

Get the end position

Returns:

end position

public void setEnd(int end)

Set the end position

Parameters:

end: the end position

public float getPercent()

Get the position in percent

Returns:

position in percent

public void setPercent(float percent)

Set the position in percent

Parameters:

percent: the position in percent

Source

/*
 * Copyright (C) 2022 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.
 */

package androidx.constraintlayout.core.dsl;

public abstract class Guideline extends Helper {
    private int mStart = Integer.MIN_VALUE;
    private int mEnd = Integer.MIN_VALUE;
    private float mPercent = Float.NaN;

    Guideline(String name) {
        super(name, new HelperType(""));
    }

    /**
     * Get the start position
     *
     * @return start position
     */
    public int getStart() {
        return mStart;
    }

    /**
     * Set the start position
     *
     * @param start the start position
     */
    public void setStart(int start) {
        mStart = start;
        configMap.put("start", String.valueOf(mStart));
    }

    /**
     * Get the end position
     *
     * @return end position
     */
    public int getEnd() {
        return mEnd;
    }

    /**
     * Set the end position
     *
     * @param end the end position
     */
    public void setEnd(int end) {
        mEnd = end;
        configMap.put("end", String.valueOf(mEnd));
    }

    /**
     * Get the position in percent
     *
     * @return position in percent
     */
    public float getPercent() {
        return mPercent;
    }

    /**
     * Set the position in percent
     *
     * @param percent the position in percent
     */
    public void setPercent(float percent) {
        mPercent = percent;
        configMap.put("percent", String.valueOf(mPercent));
    }
}