Skip to content

Commit 00a9094

Browse files
author
F4DIW
committed
Restructuration de l'app : Hub d'activités et mise à jour multilingue
1 parent 9842a1b commit 00a9094

9 files changed

Lines changed: 339 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# F4DIW Rotator App 📡🛰️
22

3-
Application Android moderne pour le contrôle du rotateur d'antenne satellite **F4DIW**. Cette application communique via Bluetooth Classic (SPP) avec un firmware basé sur ESP32 (Wemos D1 R32) et supporte les protocoles Look4Sat et EasyComm II.
3+
Application Android pour le contrôle du rotateur d'antenne satellite **F4DIW**. Cette application communique via Bluetooth Classic (SPP) avec un firmware basé sur ESP32 (Wemos D1 R32) et supporte les protocoles Look4Sat et EasyComm II.
44

55
## 🚀 Caractéristiques principales
66

7-
- **Interface High-Tech** : Design sombre inspiré de Look4Sat avec un rendu "Radar" et une typographie monospace pour les coordonnées.
8-
- **Splash Screen Premium** : Écran de démarrage plein écran (4s) avec logo et radar intégrés.
97
- **Contrôle Temps Réel** : Affichage AZ/EL en gros caractères avec mise à jour automatique via polling Bluetooth.
108
- **Système de Calibration Jog & Reset** :
119
- Déplacement manuel par pavé directionnel (Jog) de +/- 1.0°.

app/src/main/java/com/example/f4diwrotatorapp/MainActivity.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import android.os.Bundle
77
import androidx.appcompat.app.AppCompatActivity
88
import androidx.core.app.ActivityCompat
99
import androidx.fragment.app.Fragment
10+
import androidx.lifecycle.lifecycleScope
1011
import com.example.f4diwrotatorapp.databinding.ActivityMainBinding
11-
import com.example.f4diwrotatorapp.ui.control.ControlFragment
12+
import com.example.f4diwrotatorapp.ui.home.HomeFragment
1213
import com.example.f4diwrotatorapp.ui.settings.SettingsFragment
14+
import kotlinx.coroutines.delay
15+
import kotlinx.coroutines.launch
1316

1417
class MainActivity : AppCompatActivity() {
1518

@@ -25,8 +28,8 @@ class MainActivity : AppCompatActivity() {
2528
binding.bottomNavigation.setOnItemSelectedListener { item ->
2629
try {
2730
when (item.itemId) {
28-
R.id.nav_control -> {
29-
replaceFragment(ControlFragment(), "control")
31+
R.id.nav_home -> {
32+
replaceFragment(HomeFragment(), "home")
3033
true
3134
}
3235
R.id.nav_settings -> {
@@ -41,7 +44,7 @@ class MainActivity : AppCompatActivity() {
4144
}
4245

4346
if (savedInstanceState == null) {
44-
binding.bottomNavigation.selectedItemId = R.id.nav_control
47+
binding.bottomNavigation.selectedItemId = R.id.nav_home
4548
}
4649
}
4750

app/src/main/java/com/example/f4diwrotatorapp/SplashActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ class SplashActivity : AppCompatActivity() {
1717
window.decorView.systemUiVisibility = android.view.View.SYSTEM_UI_FLAG_FULLSCREEN
1818

1919
Handler(Looper.getMainLooper()).postDelayed({
20+
// Le SplashActivity renvoie maintenant vers la MainActivity qui affichera le HomeFragment par défaut
2021
startActivity(Intent(this, MainActivity::class.java))
2122
finish()
22-
}, 4000) // 4 secondes
23+
}, 4000)
2324
}
2425
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.example.f4diwrotatorapp.ui.home
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import android.widget.Toast
8+
import androidx.fragment.app.Fragment
9+
import com.example.f4diwrotatorapp.R
10+
import com.example.f4diwrotatorapp.databinding.FragmentHomeBinding
11+
import com.example.f4diwrotatorapp.ui.control.ControlFragment
12+
13+
class HomeFragment : Fragment() {
14+
15+
private var _binding: FragmentHomeBinding? = null
16+
private val binding get() = _binding!!
17+
18+
override fun onCreateView(
19+
inflater: LayoutInflater, container: ViewGroup?,
20+
savedInstanceState: Bundle?
21+
): View {
22+
_binding = FragmentHomeBinding.inflate(inflater, container, false)
23+
return binding.root
24+
}
25+
26+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
27+
super.onViewCreated(view, savedInstanceState)
28+
29+
binding.cardManual.setOnClickListener {
30+
parentFragmentManager.beginTransaction()
31+
.replace(R.id.fragmentContainer, ControlFragment())
32+
.addToBackStack(null)
33+
.commit()
34+
}
35+
36+
binding.cardPlanets.setOnClickListener {
37+
Toast.makeText(requireContext(), "Bientôt disponible : Tracking Planétaire", Toast.LENGTH_SHORT).show()
38+
}
39+
40+
binding.cardAdsb.setOnClickListener {
41+
Toast.makeText(requireContext(), "Bientôt disponible : Tracking ADS-B", Toast.LENGTH_SHORT).show()
42+
}
43+
44+
binding.cardRadiosonde.setOnClickListener {
45+
Toast.makeText(requireContext(), "Bientôt disponible : Tracking Radiosondes", Toast.LENGTH_SHORT).show()
46+
}
47+
}
48+
49+
override fun onDestroyView() {
50+
super.onDestroyView()
51+
_binding = null
52+
}
53+
}
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:background="@color/bg_main">
7+
8+
<LinearLayout
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content"
11+
android:orientation="vertical"
12+
android:padding="20dp">
13+
14+
<TextView
15+
android:layout_width="match_parent"
16+
android:layout_height="wrap_content"
17+
android:text="@string/title_home"
18+
android:textColor="@color/white"
19+
android:textSize="22sp"
20+
android:textStyle="bold"
21+
android:letterSpacing="0.1"
22+
android:layout_marginBottom="24dp" />
23+
24+
<!-- Contrôle Manuel -->
25+
<com.google.android.material.card.MaterialCardView
26+
android:id="@+id/cardManual"
27+
android:layout_width="match_parent"
28+
android:layout_height="wrap_content"
29+
android:layout_marginBottom="16dp"
30+
android:clickable="true"
31+
android:focusable="true"
32+
app:cardCornerRadius="16dp"
33+
app:cardBackgroundColor="@color/bg_card"
34+
app:strokeWidth="1dp"
35+
app:strokeColor="@color/grid_blue">
36+
37+
<LinearLayout
38+
android:layout_width="match_parent"
39+
android:layout_height="wrap_content"
40+
android:orientation="horizontal"
41+
android:padding="20dp"
42+
android:gravity="center_vertical">
43+
44+
<ImageView
45+
android:layout_width="40dp"
46+
android:layout_height="40dp"
47+
android:src="@android:drawable/ic_menu_compass"
48+
app:tint="@color/white" />
49+
50+
<LinearLayout
51+
android:layout_width="0dp"
52+
android:layout_height="wrap_content"
53+
android:layout_weight="1"
54+
android:orientation="vertical"
55+
android:layout_marginStart="20dp">
56+
57+
<TextView
58+
android:layout_width="wrap_content"
59+
android:layout_height="wrap_content"
60+
android:text="@string/activity_manual"
61+
android:textColor="@color/white"
62+
android:textSize="18sp"
63+
android:textStyle="bold" />
64+
65+
<TextView
66+
android:layout_width="wrap_content"
67+
android:layout_height="wrap_content"
68+
android:text="@string/activity_manual_sub"
69+
android:textColor="@color/text_secondary"
70+
android:textSize="13sp" />
71+
</LinearLayout>
72+
</LinearLayout>
73+
</com.google.android.material.card.MaterialCardView>
74+
75+
<!-- Tracking Planétaire -->
76+
<com.google.android.material.card.MaterialCardView
77+
android:id="@+id/cardPlanets"
78+
android:layout_width="match_parent"
79+
android:layout_height="wrap_content"
80+
android:layout_marginBottom="16dp"
81+
android:clickable="true"
82+
android:focusable="true"
83+
app:cardCornerRadius="16dp"
84+
app:cardBackgroundColor="@color/bg_card"
85+
app:strokeWidth="0dp"
86+
android:alpha="0.6">
87+
88+
<LinearLayout
89+
android:layout_width="match_parent"
90+
android:layout_height="wrap_content"
91+
android:orientation="horizontal"
92+
android:padding="20dp"
93+
android:gravity="center_vertical">
94+
95+
<ImageView
96+
android:layout_width="40dp"
97+
android:layout_height="40dp"
98+
android:src="@android:drawable/btn_star_big_on"
99+
app:tint="@color/white" />
100+
101+
<LinearLayout
102+
android:layout_width="0dp"
103+
android:layout_height="wrap_content"
104+
android:layout_weight="1"
105+
android:orientation="vertical"
106+
android:layout_marginStart="20dp">
107+
108+
<TextView
109+
android:layout_width="wrap_content"
110+
android:layout_height="wrap_content"
111+
android:text="@string/activity_planets"
112+
android:textColor="@color/white"
113+
android:textSize="18sp"
114+
android:textStyle="bold" />
115+
116+
<TextView
117+
android:layout_width="wrap_content"
118+
android:layout_height="wrap_content"
119+
android:text="@string/activity_planets_sub"
120+
android:textColor="@color/text_secondary"
121+
android:textSize="13sp" />
122+
</LinearLayout>
123+
</LinearLayout>
124+
</com.google.android.material.card.MaterialCardView>
125+
126+
<!-- Tracking ADS-B -->
127+
<com.google.android.material.card.MaterialCardView
128+
android:id="@+id/cardAdsb"
129+
android:layout_width="match_parent"
130+
android:layout_height="wrap_content"
131+
android:layout_marginBottom="16dp"
132+
android:clickable="true"
133+
android:focusable="true"
134+
app:cardCornerRadius="16dp"
135+
app:cardBackgroundColor="@color/bg_card"
136+
app:strokeWidth="0dp"
137+
android:alpha="0.6">
138+
139+
<LinearLayout
140+
android:layout_width="match_parent"
141+
android:layout_height="wrap_content"
142+
android:orientation="horizontal"
143+
android:padding="20dp"
144+
android:gravity="center_vertical">
145+
146+
<ImageView
147+
android:layout_width="40dp"
148+
android:layout_height="40dp"
149+
android:src="@android:drawable/ic_menu_send"
150+
app:tint="@color/white" />
151+
152+
<LinearLayout
153+
android:layout_width="0dp"
154+
android:layout_height="wrap_content"
155+
android:layout_weight="1"
156+
android:orientation="vertical"
157+
android:layout_marginStart="20dp">
158+
159+
<TextView
160+
android:layout_width="wrap_content"
161+
android:layout_height="wrap_content"
162+
android:text="@string/activity_adsb"
163+
android:textColor="@color/white"
164+
android:textSize="18sp"
165+
android:textStyle="bold" />
166+
167+
<TextView
168+
android:layout_width="wrap_content"
169+
android:layout_height="wrap_content"
170+
android:text="@string/activity_adsb_sub"
171+
android:textColor="@color/text_secondary"
172+
android:textSize="13sp" />
173+
</LinearLayout>
174+
</LinearLayout>
175+
</com.google.android.material.card.MaterialCardView>
176+
177+
<!-- Tracking Radiosondes -->
178+
<com.google.android.material.card.MaterialCardView
179+
android:id="@+id/cardRadiosonde"
180+
android:layout_width="match_parent"
181+
android:layout_height="wrap_content"
182+
android:clickable="true"
183+
android:focusable="true"
184+
app:cardCornerRadius="16dp"
185+
app:cardBackgroundColor="@color/bg_card"
186+
app:strokeWidth="0dp"
187+
android:alpha="0.6">
188+
189+
<LinearLayout
190+
android:layout_width="match_parent"
191+
android:layout_height="wrap_content"
192+
android:orientation="horizontal"
193+
android:padding="20dp"
194+
android:gravity="center_vertical">
195+
196+
<ImageView
197+
android:layout_width="40dp"
198+
android:layout_height="40dp"
199+
android:src="@android:drawable/ic_menu_mylocation"
200+
app:tint="@color/white" />
201+
202+
<LinearLayout
203+
android:layout_width="0dp"
204+
android:layout_height="wrap_content"
205+
android:layout_weight="1"
206+
android:orientation="vertical"
207+
android:layout_marginStart="20dp">
208+
209+
<TextView
210+
android:layout_width="wrap_content"
211+
android:layout_height="wrap_content"
212+
android:text="@string/activity_radiosonde"
213+
android:textColor="@color/white"
214+
android:textSize="18sp"
215+
android:textStyle="bold" />
216+
217+
<TextView
218+
android:layout_width="wrap_content"
219+
android:layout_height="wrap_content"
220+
android:text="@string/activity_radiosonde_sub"
221+
android:textColor="@color/text_secondary"
222+
android:textSize="13sp" />
223+
</LinearLayout>
224+
</LinearLayout>
225+
</com.google.android.material.card.MaterialCardView>
226+
227+
</LinearLayout>
228+
</ScrollView>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<menu xmlns:android="http://schemas.android.com/apk/res/android">
33
<item
4-
android:id="@+id/nav_control"
5-
android:icon="@android:drawable/ic_menu_directions"
6-
android:title="Contrôle" />
4+
android:id="@+id/nav_home"
5+
android:icon="@android:drawable/ic_menu_today"
6+
android:title="@string/nav_home" />
77
<item
88
android:id="@+id/nav_settings"
99
android:icon="@android:drawable/ic_menu_manage"
10-
android:title="Réglages" />
10+
android:title="@string/nav_settings" />
1111
</menu>

app/src/main/res/values-en/strings.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
<resources>
22
<string name="app_name">F4DIW Rotator App</string>
3-
<string name="nav_control">Control</string>
3+
<string name="nav_home">Home</string>
44
<string name="nav_settings">Settings</string>
5+
6+
<!-- Hub Activities -->
7+
<string name="title_home">ACTIVITIES</string>
8+
<string name="activity_manual">Manual Control</string>
9+
<string name="activity_manual_sub">Direct AZ/EL control</string>
10+
<string name="activity_planets">Planets</string>
11+
<string name="activity_planets_sub">Solar System Tracking</string>
12+
<string name="activity_adsb">ADS-B</string>
13+
<string name="activity_adsb_sub">Aircraft Tracking</string>
14+
<string name="activity_radiosonde">Radiosondes</string>
15+
<string name="activity_radiosonde_sub">Weather Balloon Tracking</string>
16+
517
<string name="title_settings">SETTINGS</string>
618
<string name="settings_bluetooth">Bluetooth</string>
719
<string name="settings_bluetooth_sub">Select device</string>
820
<string name="settings_calibration">Calibration</string>
921
<string name="settings_calibration_sub">Set initial position (zero)</string>
1022
<string name="settings_language">Language</string>
11-
<string name="settings_language_sub">Choose Français or English</string>
23+
<string name="settings_language_sub">Choose Français, English or Русский</string>
24+
1225
<string name="status_connected">CONNECTED</string>
1326
<string name="status_disconnected">DISCONNECTED</string>
1427
<string name="pos_current">CURRENT POSITION</string>

0 commit comments

Comments
 (0)