mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Call icon and toast restructure.
This commit is contained in:
@@ -9,8 +9,11 @@ import android.widget.PopupWindow
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.core.view.ViewCompat
|
||||
import org.signal.core.util.dp
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.util.Debouncer
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
@@ -70,6 +73,7 @@ class CallStateUpdatePopupWindow(private val parent: ViewGroup) : PopupWindow(
|
||||
iconView.setImageResource(callStateUpdate.iconRes)
|
||||
}
|
||||
|
||||
iconView.visible = callStateUpdate.iconRes != null
|
||||
descriptionView.setText(callStateUpdate.stringRes)
|
||||
}
|
||||
|
||||
@@ -78,8 +82,19 @@ class CallStateUpdatePopupWindow(private val parent: ViewGroup) : PopupWindow(
|
||||
return
|
||||
}
|
||||
|
||||
showAtLocation(parent, Gravity.TOP or Gravity.START, 0, 0)
|
||||
measureChild()
|
||||
|
||||
val anchor: View = ViewCompat.requireViewById(parent, R.id.call_screen_footer_gradient_barrier)
|
||||
val pill: View = ViewCompat.requireViewById(contentView, R.id.call_state_pill)
|
||||
|
||||
// 54 is the top margin of the contentView (30) plus the desired padding (24)
|
||||
showAtLocation(
|
||||
parent,
|
||||
Gravity.TOP or Gravity.START,
|
||||
0,
|
||||
anchor.top - 54.dp - pill.measuredHeight
|
||||
)
|
||||
|
||||
update()
|
||||
dismissDebouncer.publish { dismiss() }
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<item>
|
||||
<layer-list>
|
||||
<item android:drawable="@drawable/webrtc_call_screen_circle_unchecked" />
|
||||
<item android:bottom="14dp" android:drawable="@drawable/symbol_bell_ring_fill_24" android:left="14dp" android:right="14dp" android:top="14dp" />
|
||||
<item android:bottom="14dp" android:drawable="@drawable/symbol_bell_slash_fill_24" android:left="14dp" android:right="14dp" android:top="14dp" />
|
||||
</layer-list>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -15,7 +15,7 @@
|
||||
<item>
|
||||
<layer-list>
|
||||
<item android:bottom="4dp" android:drawable="@drawable/webrtc_call_screen_circle_unchecked" android:left="4dp" android:right="4dp" android:top="4dp" />
|
||||
<item android:bottom="14dp" android:drawable="@drawable/symbol_bell_ring_fill_24" android:left="14dp" android:right="14dp" android:top="14dp" />
|
||||
<item android:bottom="14dp" android:drawable="@drawable/symbol_bell_slash_fill_24" android:left="14dp" android:right="14dp" android:top="14dp" />
|
||||
</layer-list>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -4,10 +4,11 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="94dp"
|
||||
android:minHeight="82dp"
|
||||
tools:viewBindingIgnore="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/call_state_pill"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
@@ -21,8 +22,8 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginVertical="16dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -37,9 +38,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/Signal.Text.BodyMedium"
|
||||
android:textColor="@color/signal_light_colorOnSecondaryContainer"
|
||||
@@ -50,7 +51,7 @@
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
app:layout_goneMarginStart="24dp"
|
||||
app:layout_goneMarginStart="16dp"
|
||||
tools:text="Kiera joined" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user