@@ -18,7 +18,6 @@ public sealed class ScheduleListItemSubtitleManager(
1818{
1919 private string subtitle = string . Empty ;
2020 private string language = string . Empty ;
21- private FlowDirection flowDirection = FlowDirection . LeftToRight ;
2221
2322 public string SubTitle
2423 {
@@ -32,17 +31,11 @@ public string Language
3231 set => language = value ;
3332 }
3433
35- public FlowDirection FlowDirection
36- {
37- get => flowDirection ;
38- set => flowDirection = value ;
39- }
40-
4134 /// <summary>
4235 /// Refreshes subtitle from ScheduleStateItem in state (uses pre-populated SectionName).
4336 /// Falls back to async database lookup if SectionName is not available in state.
4437 /// </summary>
45- public void RefreshSubTitleFromState ( int scheduleId , ScheduleStateItem ? providedScheduleStateItem , Action < string > setSubTitle , Action < string > setLanguage , Action < FlowDirection > setFlowDirection , Action < string > onPropertyChanged )
38+ public void RefreshSubTitleFromState ( int scheduleId , ScheduleStateItem ? providedScheduleStateItem , Action < string > setSubTitle , Action < string > setLanguage , Action < string > onPropertyChanged )
4639 {
4740 if ( scheduleId <= 0 )
4841 {
@@ -66,7 +59,7 @@ public void RefreshSubTitleFromState(int scheduleId, ScheduleStateItem? provided
6659
6760 if ( scheduleStateItem ? . BiblePublicationScheduleId . HasValue == true )
6861 {
69- UpdateLanguageFromState ( scheduleStateItem , setLanguage , setFlowDirection , onPropertyChanged ) ;
62+ UpdateLanguageFromState ( scheduleStateItem , setLanguage , onPropertyChanged ) ;
7063 var subtitle = BuildSubtitleFromState ( scheduleStateItem ) ;
7164
7265 logger . Debug ( "ScheduleListItemSubtitleManager: RefreshSubTitleFromState - Built subtitle: '{Subtitle}' for schedule {ScheduleId}" , subtitle , scheduleId ) ;
@@ -103,21 +96,21 @@ public void RefreshSubTitleFromState(int scheduleId, ScheduleStateItem? provided
10396 else
10497 {
10598 logger . Debug ( "ScheduleListItemSubtitleManager: RefreshSubTitleFromState - No BiblePublicationScheduleId for schedule {ScheduleId}, clearing language" , scheduleId ) ;
106- ClearLanguage ( setLanguage , setFlowDirection , onPropertyChanged ) ;
99+ ClearLanguage ( setLanguage , onPropertyChanged ) ;
107100 }
108101
109102 // Only fall back to async lookup if display names are not expected to be populated
110103 logger . Debug ( "ScheduleListItemSubtitleManager: RefreshSubTitleFromState - Falling back to async lookup for schedule {ScheduleId}" , scheduleId ) ;
111- _ = RefreshTrackNameAsync ( scheduleId , force : false , setSubTitle , setLanguage , setFlowDirection , onPropertyChanged ) ;
104+ _ = RefreshTrackNameAsync ( scheduleId , force : false , setSubTitle , setLanguage , onPropertyChanged ) ;
112105 }
113106 catch ( Exception e )
114107 {
115108 logger . Error ( e , "An error happened while refreshing subtitle from state for schedule {ScheduleId}" , scheduleId ) ;
116- _ = RefreshTrackNameAsync ( scheduleId , force : false , setSubTitle , setLanguage , setFlowDirection , onPropertyChanged ) ;
109+ _ = RefreshTrackNameAsync ( scheduleId , force : false , setSubTitle , setLanguage , onPropertyChanged ) ;
117110 }
118111 }
119112
120- private static void UpdateLanguageFromState ( ScheduleStateItem scheduleStateItem , Action < string > setLanguage , Action < FlowDirection > setFlowDirection , Action < string > onPropertyChanged )
113+ private static void UpdateLanguageFromState ( ScheduleStateItem scheduleStateItem , Action < string > setLanguage , Action < string > onPropertyChanged )
121114 {
122115 if ( ! string . IsNullOrWhiteSpace ( scheduleStateItem . BiblePublicationLanguageName ) )
123116 {
@@ -132,14 +125,6 @@ private static void UpdateLanguageFromState(ScheduleStateItem scheduleStateItem,
132125 setLanguage ( string . Empty ) ;
133126 }
134127 onPropertyChanged ( "Language" ) ;
135-
136- // Update flow direction based on language direction
137- var direction = scheduleStateItem . BiblePublicationLanguageDirection ?? "ltr" ;
138- var flowDirection = string . Equals ( direction , "rtl" , StringComparison . OrdinalIgnoreCase )
139- ? FlowDirection . RightToLeft
140- : FlowDirection . LeftToRight ;
141- setFlowDirection ( flowDirection ) ;
142- onPropertyChanged ( "ContentFlowDirection" ) ;
143128 }
144129
145130 private static string BuildSubtitleFromState ( ScheduleStateItem scheduleStateItem )
@@ -183,19 +168,17 @@ private static string BuildSubtitleFromState(ScheduleStateItem scheduleStateItem
183168 }
184169 }
185170
186- private static void ClearLanguage ( Action < string > setLanguage , Action < FlowDirection > setFlowDirection , Action < string > onPropertyChanged )
171+ private static void ClearLanguage ( Action < string > setLanguage , Action < string > onPropertyChanged )
187172 {
188173 setLanguage ( string . Empty ) ;
189174 onPropertyChanged ( "Language" ) ;
190- setFlowDirection ( FlowDirection . LeftToRight ) ;
191- onPropertyChanged ( "ContentFlowDirection" ) ;
192175 }
193176
194177 /// <summary>
195178 /// Async fallback method for refreshing track name from database.
196179 /// Only used if SectionName is not available in state.
197180 /// </summary>
198- public async Task RefreshTrackNameAsync ( int scheduleId , bool force , Action < string > setSubTitle , Action < string > setLanguage , Action < FlowDirection > setFlowDirection , Action < string > onPropertyChanged )
181+ public async Task RefreshTrackNameAsync ( int scheduleId , bool force , Action < string > setSubTitle , Action < string > setLanguage , Action < string > onPropertyChanged )
199182 {
200183 if ( scheduleId <= 0 )
201184 {
@@ -209,7 +192,6 @@ public async Task RefreshTrackNameAsync(int scheduleId, bool force, Action<strin
209192 . FirstOrDefault ( s => s . Id == scheduleId ) ;
210193
211194 string language = string . Empty ;
212- string direction = "ltr" ;
213195 if ( scheduleStateItem != null )
214196 {
215197 if ( ! string . IsNullOrWhiteSpace ( scheduleStateItem . BiblePublicationLanguageName ) )
@@ -220,17 +202,12 @@ public async Task RefreshTrackNameAsync(int scheduleId, bool force, Action<strin
220202 {
221203 language = scheduleStateItem . BiblePublicationLanguageCode ;
222204 }
223- direction = scheduleStateItem . BiblePublicationLanguageDirection ?? "ltr" ;
224205 }
225206
226207 // Run database operations off UI thread
227208 var displayName = await Task . Run ( async ( ) =>
228209 await displayService . GetTrackDisplayNameAsync ( scheduleId , force ) ) ;
229210
230- var flowDirection = string . Equals ( direction , "rtl" , StringComparison . OrdinalIgnoreCase )
231- ? FlowDirection . RightToLeft
232- : FlowDirection . LeftToRight ;
233-
234211 // Update UI on main thread
235212 await MainThread . InvokeOnMainThreadAsync ( ( ) =>
236213 {
@@ -243,10 +220,6 @@ await MainThread.InvokeOnMainThreadAsync(() =>
243220 // Update Language property
244221 setLanguage ( language ) ;
245222 onPropertyChanged ( "Language" ) ;
246-
247- // Update FlowDirection property
248- setFlowDirection ( flowDirection ) ;
249- onPropertyChanged ( "ContentFlowDirection" ) ;
250223 } ) ;
251224 }
252225 catch ( Exception e )
0 commit comments