Update: 2026-08-07 06:00:56
This commit is contained in:
+36
-2
@@ -581,6 +581,35 @@ class TripOverlayService : Service() {
|
||||
}
|
||||
detailsContainer.addView(offerBadge)
|
||||
|
||||
// شارة الرحلة المجدولة — تظهر مع شارة نوع الطلب لا بدلاً منها:
|
||||
// الأولى تصف الرحلة والثانية تصف العرض، ومعلومتان مختلفتان.
|
||||
if (trip.isScheduled) {
|
||||
val scheduledBadge =
|
||||
TextView(ctx).apply {
|
||||
val color = Color.parseColor("#6A5ACD")
|
||||
text = if (trip.scheduledAt.isEmpty()) "🗓️ رحلة مجدولة"
|
||||
else "🗓️ رحلة مجدولة · " + trip.scheduledAt
|
||||
gravity = Gravity.CENTER
|
||||
textSize = 13f
|
||||
typeface = android.graphics.Typeface.DEFAULT_BOLD
|
||||
setPadding(24, 12, 24, 12)
|
||||
setTextColor(color)
|
||||
background =
|
||||
android.graphics.drawable.GradientDrawable().apply {
|
||||
setColor(Color.parseColor("#F0EDFB"))
|
||||
cornerRadius = 40f
|
||||
setStroke(2, color)
|
||||
}
|
||||
layoutParams =
|
||||
LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
.apply { bottomMargin = 24 }
|
||||
}
|
||||
detailsContainer.addView(scheduledBadge)
|
||||
}
|
||||
|
||||
// ── 4. شريط الوقت ──
|
||||
val countdownLabel =
|
||||
TextView(ctx).apply {
|
||||
@@ -925,7 +954,9 @@ class TripOverlayService : Service() {
|
||||
pickupLat = obj.getDouble("pickupLat"),
|
||||
pickupLng = obj.getDouble("pickupLng"),
|
||||
offerType = obj.optString("offerType", ""),
|
||||
offerExpiresIn = obj.optInt("offerExpiresIn", 0)
|
||||
offerExpiresIn = obj.optInt("offerExpiresIn", 0),
|
||||
isScheduled = obj.optBoolean("isScheduled", false),
|
||||
scheduledAt = obj.optString("scheduledAt", "")
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
@@ -944,6 +975,9 @@ class TripOverlayService : Service() {
|
||||
val pickupLng: Double,
|
||||
// "exclusive" خلال السبق الحصري، "public" بعده، وفارغ في البثّ الحر
|
||||
val offerType: String = "",
|
||||
val offerExpiresIn: Int = 0
|
||||
val offerExpiresIn: Int = 0,
|
||||
// رحلة محجوزة مسبقاً — موعد مضبوط لا طلب فوري
|
||||
val isScheduled: Boolean = false,
|
||||
val scheduledAt: String = ""
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user