Search in sources :

Example 1 with Guideline

use of androidx.constraintlayout.widget.Guideline in project Signal-Android by WhisperSystems.

the class InsetAwareConstraintLayout method applyInsets.

private void applyInsets(@NonNull Rect insets) {
    Guideline statusBarGuideline = findViewById(R.id.status_bar_guideline);
    Guideline navigationBarGuideline = findViewById(R.id.navigation_bar_guideline);
    Guideline parentStartGuideline = findViewById(R.id.parent_start_guideline);
    Guideline parentEndGuideline = findViewById(R.id.parent_end_guideline);
    if (statusBarGuideline != null) {
        statusBarGuideline.setGuidelineBegin(insets.top);
    }
    if (navigationBarGuideline != null) {
        navigationBarGuideline.setGuidelineEnd(insets.bottom);
    }
    if (parentStartGuideline != null) {
        if (ViewUtil.isLtr(this)) {
            parentStartGuideline.setGuidelineBegin(insets.left);
        } else {
            parentStartGuideline.setGuidelineBegin(insets.right);
        }
    }
    if (parentEndGuideline != null) {
        if (ViewUtil.isLtr(this)) {
            parentEndGuideline.setGuidelineEnd(insets.right);
        } else {
            parentEndGuideline.setGuidelineEnd(insets.left);
        }
    }
}
Also used : Guideline(androidx.constraintlayout.widget.Guideline)

Example 2 with Guideline

use of androidx.constraintlayout.widget.Guideline in project Signal-Android by WhisperSystems.

the class WebRtcCallView method fitSystemWindows.

@Override
protected boolean fitSystemWindows(Rect insets) {
    Guideline navigationBarGuideline = findViewById(R.id.call_screen_navigation_bar_guideline);
    statusBarGuideline.setGuidelineBegin(insets.top);
    navigationBarGuideline.setGuidelineEnd(insets.bottom);
    return true;
}
Also used : Guideline(androidx.constraintlayout.widget.Guideline)

Example 3 with Guideline

use of androidx.constraintlayout.widget.Guideline in project Signal-Android by signalapp.

the class WebRtcCallView method fitSystemWindows.

@Override
protected boolean fitSystemWindows(Rect insets) {
    Guideline navigationBarGuideline = findViewById(R.id.call_screen_navigation_bar_guideline);
    statusBarGuideline.setGuidelineBegin(insets.top);
    navigationBarGuideline.setGuidelineEnd(insets.bottom);
    return true;
}
Also used : Guideline(androidx.constraintlayout.widget.Guideline)

Example 4 with Guideline

use of androidx.constraintlayout.widget.Guideline in project Signal-Android by signalapp.

the class InsetAwareConstraintLayout method applyInsets.

private void applyInsets(@NonNull Rect insets) {
    Guideline statusBarGuideline = findViewById(R.id.status_bar_guideline);
    Guideline navigationBarGuideline = findViewById(R.id.navigation_bar_guideline);
    Guideline parentStartGuideline = findViewById(R.id.parent_start_guideline);
    Guideline parentEndGuideline = findViewById(R.id.parent_end_guideline);
    if (statusBarGuideline != null) {
        statusBarGuideline.setGuidelineBegin(insets.top);
    }
    if (navigationBarGuideline != null) {
        navigationBarGuideline.setGuidelineEnd(insets.bottom);
    }
    if (parentStartGuideline != null) {
        if (ViewUtil.isLtr(this)) {
            parentStartGuideline.setGuidelineBegin(insets.left);
        } else {
            parentStartGuideline.setGuidelineBegin(insets.right);
        }
    }
    if (parentEndGuideline != null) {
        if (ViewUtil.isLtr(this)) {
            parentEndGuideline.setGuidelineEnd(insets.right);
        } else {
            parentEndGuideline.setGuidelineEnd(insets.left);
        }
    }
}
Also used : Guideline(androidx.constraintlayout.widget.Guideline)

Aggregations

Guideline (androidx.constraintlayout.widget.Guideline)4