Search in sources :

Example 11 with Projection

use of org.thoughtcrime.securesms.util.Projection in project Signal-Android by signalapp.

the class ConversationItem method isTouchBelowBoundary.

private boolean isTouchBelowBoundary(@NonNull View child) {
    Projection childProjection = Projection.relativeToParent(this, child, null);
    float childBoundary = childProjection.getY() + childProjection.getHeight();
    return lastYDownRelativeToThis > childBoundary;
}
Also used : Projection(org.thoughtcrime.securesms.util.Projection)

Example 12 with Projection

use of org.thoughtcrime.securesms.util.Projection in project Signal-Android by signalapp.

the class ConversationItem method getProjectionTop.

private static int getProjectionTop(@NonNull View child) {
    Projection projection = Projection.relativeToViewRoot(child, null);
    int y = (int) projection.getY();
    projection.release();
    return y;
}
Also used : Projection(org.thoughtcrime.securesms.util.Projection) TextPaint(android.text.TextPaint) SuppressLint(android.annotation.SuppressLint)

Aggregations

Projection (org.thoughtcrime.securesms.util.Projection)12 SuppressLint (android.annotation.SuppressLint)6 TextPaint (android.text.TextPaint)6 ViewGroup (android.view.ViewGroup)4 NonNull (androidx.annotation.NonNull)4 ColorStateList (android.content.res.ColorStateList)2 Drawable (android.graphics.drawable.Drawable)2 Bundle (android.os.Bundle)2 DisplayMetrics (android.util.DisplayMetrics)2 LayoutInflater (android.view.LayoutInflater)2 View (android.view.View)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 Nullable (androidx.annotation.Nullable)2 AppCompatImageView (androidx.appcompat.widget.AppCompatImageView)2 SwitchCompat (androidx.appcompat.widget.SwitchCompat)2 Toolbar (androidx.appcompat.widget.Toolbar)2 ContextCompat (androidx.core.content.ContextCompat)2 ImageViewCompat (androidx.core.widget.ImageViewCompat)2 TextViewCompat (androidx.core.widget.TextViewCompat)2