v1.9 : bouton Appel Urgences 112 et carte de groupes épurée
- Carte du bas : suppression du libellé et de la liste des destinataires (les puces de groupe restent seules, roue crantée conservée ; message d'aide affiché uniquement quand aucun groupe n'existe) - Nouveau bouton pleine largeur en bas d'écran, rouge, coins arrondis : « APPEL URGENCES — 112 » — ouvre le composeur avec le 112 pré-rempli (ACTION_DIAL : l'appel direct d'un numéro d'urgence est réservé aux applications système par Android) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
bc0a860f2c
commit
940f4e6f70
4 changed files with 43 additions and 20 deletions
|
|
@ -13,6 +13,7 @@ import android.content.res.ColorStateList
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import android.location.Location
|
import android.location.Location
|
||||||
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
|
|
@ -97,6 +98,9 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
sendButton.setOnClickListener { startSendFlow() }
|
sendButton.setOnClickListener { startSendFlow() }
|
||||||
findViewById<MaterialCardView>(R.id.recipientsCard).setOnClickListener { openSettings() }
|
findViewById<MaterialCardView>(R.id.recipientsCard).setOnClickListener { openSettings() }
|
||||||
|
findViewById<View>(R.id.emergencyButton).setOnClickListener {
|
||||||
|
startActivity(Intent(Intent.ACTION_DIAL, Uri.parse("tel:112")))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
|
@ -122,9 +126,11 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
if (groups.isEmpty()) {
|
if (groups.isEmpty()) {
|
||||||
groupChips.visibility = View.GONE
|
groupChips.visibility = View.GONE
|
||||||
|
recipientsText.visibility = View.VISIBLE
|
||||||
recipientsText.text = getString(R.string.recipients_none)
|
recipientsText.text = getString(R.string.recipients_none)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
recipientsText.visibility = View.GONE
|
||||||
|
|
||||||
groupChips.visibility = View.VISIBLE
|
groupChips.visibility = View.VISIBLE
|
||||||
val active = Prefs.getActiveGroup(this)!!
|
val active = Prefs.getActiveGroup(this)!!
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,14 @@
|
||||||
android:id="@+id/recipientsCard"
|
android:id="@+id/recipientsCard"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="20dp"
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
app:cardCornerRadius="18dp"
|
app:cardCornerRadius="18dp"
|
||||||
app:cardElevation="3dp"
|
app:cardElevation="3dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toTopOf="@id/emergencyButton"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
|
@ -103,7 +105,10 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="10dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -111,39 +116,49 @@
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.chip.ChipGroup
|
||||||
|
android:id="@+id/groupChips"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/recipients_label"
|
app:chipSpacingVertical="0dp"
|
||||||
android:textColor="?attr/colorOnSurfaceVariant"
|
app:singleLine="false"
|
||||||
android:textSize="13sp"
|
app:singleSelection="true" />
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="20dp"
|
android:layout_width="22dp"
|
||||||
android:layout_height="20dp"
|
android:layout_height="22dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:src="@drawable/ic_settings"
|
android:src="@drawable/ic_settings"
|
||||||
app:tint="?attr/colorOnSurfaceVariant" />
|
app:tint="?attr/colorOnSurfaceVariant" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
|
||||||
android:id="@+id/groupChips"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
app:chipSpacingVertical="0dp"
|
|
||||||
app:singleLine="false"
|
|
||||||
app:singleSelection="true" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/recipientsText"
|
android:id="@+id/recipientsText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp"
|
||||||
|
android:visibility="gone" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/emergencyButton"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="@string/emergency_call"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="17sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:backgroundTint="@color/emergency_red"
|
||||||
|
app:cornerRadius="20dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
<color name="brand_blue">#1A73E8</color>
|
<color name="brand_blue">#1A73E8</color>
|
||||||
|
<color name="emergency_red">#C62828</color>
|
||||||
<color name="icon_bg">#708164</color>
|
<color name="icon_bg">#708164</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
<!-- Écran principal -->
|
<!-- Écran principal -->
|
||||||
<string name="send_button">ENVOYER\nMA POSITION</string>
|
<string name="send_button">ENVOYER\nMA POSITION</string>
|
||||||
|
<string name="emergency_call">🚨 APPEL URGENCES — 112</string>
|
||||||
<string name="recipients_label">Groupe de destinataires — toucher pour gérer</string>
|
<string name="recipients_label">Groupe de destinataires — toucher pour gérer</string>
|
||||||
<string name="recipients_none">Aucun groupe de destinataires.\nTouchez ici pour en créer un.</string>
|
<string name="recipients_none">Aucun groupe de destinataires.\nTouchez ici pour en créer un.</string>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue