diff --git a/app/src/main/java/com/jordanbot/autoride/TutorialActivity.kt b/app/src/main/java/com/jordanbot/autoride/TutorialActivity.kt index 836bb44..664a766 100644 --- a/app/src/main/java/com/jordanbot/autoride/TutorialActivity.kt +++ b/app/src/main/java/com/jordanbot/autoride/TutorialActivity.kt @@ -1,29 +1,155 @@ package com.jordanbot.autoride +import android.graphics.BitmapFactory import android.media.MediaPlayer import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.view.View import android.widget.Button +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.ProgressBar +import android.widget.ScrollView +import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import java.net.URL class TutorialActivity : AppCompatActivity() { private var mediaPlayer: MediaPlayer? = null + // Tutorial steps: image URL + title + description + private data class TutorialStep( + val imageUrl: String, + val title: String, + val description: String, + val titleColor: String + ) + + private val steps = listOf( + TutorialStep( + imageUrl = "https://lawer.tripz-egypt.com/jordan_bot/tutorial/step1.png", + title = "الخطوة ١: ابحث عن التطبيق", + description = "اذهب إلى إعدادات الهاتف → إدارة التطبيقات → ابحث عن Jordan Bot واضغط عليه.", + titleColor = "#4CAF50" + ), + TutorialStep( + imageUrl = "https://lawer.tripz-egypt.com/jordan_bot/tutorial/step2.png", + title = "الخطوة ٢: فك القيود (أهم خطوة!)", + description = "اضغط على النقاط الثلاث ⋮ في أعلى الصفحة واختر 'السماح بالإعدادات المقيدة' أو 'Allow restricted settings'.", + titleColor = "#FF5252" + ), + TutorialStep( + imageUrl = "https://lawer.tripz-egypt.com/jordan_bot/tutorial/step3.png", + title = "الخطوة ٣: فعّل الصلاحية", + description = "ارجع إلى التطبيق وقم بتفعيل صلاحيات إمكانية الوصول والإشعارات. اضغط 'سماح' عند ظهور التأكيد.", + titleColor = "#4CAF50" + ) + ) + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_tutorial) + // Load images from server + loadTutorialImages() + + // Audio button findViewById