mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-26 23:46:36 +00:00
RCApp: NavDrawer new design (behind the status bar on API21+ [Lollipop])
This commit is contained in:
BIN
Binary file not shown.
|
After Width: | Height: | Size: 245 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 218 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 270 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 337 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 401 B |
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/ic_keyboard_backspace_white_18dp"
|
||||
android:fromDegrees="-90"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:toDegrees="-90" />
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/ic_keyboard_backspace_white_18dp"
|
||||
android:fromDegrees="90"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:toDegrees="90" />
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#000000"
|
||||
android:startColor="#00FFFFFF" />
|
||||
|
||||
</shape>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 666 KiB |
-60
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="Confirm Gate Timing" />
|
||||
|
||||
<NumberPicker
|
||||
android:id="@+id/time"
|
||||
style="@style/AppTheme.Widget.NumberPicker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/plusSign"
|
||||
style="@style/AppTheme.LargeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/time"
|
||||
android:layout_toStartOf="@id/time"
|
||||
android:text=" + " />
|
||||
|
||||
<TextView
|
||||
style="@style/AppTheme.LargeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBaseline="@id/plusSign"
|
||||
android:layout_toLeftOf="@id/plusSign"
|
||||
android:layout_toStartOf="@id/plusSign"
|
||||
android:text="@string/race_start_in_4_minutes" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/equalSign"
|
||||
style="@style/AppTheme.LargeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/time"
|
||||
android:layout_toRightOf="@id/time"
|
||||
android:text=" = " />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/resultTime"
|
||||
style="@style/AppTheme.LargeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBaseline="@id/equalSign"
|
||||
android:layout_toEndOf="@id/equalSign"
|
||||
android:layout_toRightOf="@id/equalSign"
|
||||
android:text="x Minuten" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,59 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/white" >
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar_layout"
|
||||
layout="@layout/toolbar" />
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/loginLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_below="@+id/toolbar_layout"
|
||||
android:orientation="vertical" >
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loginLayout"
|
||||
android:layout_width="match_parent"
|
||||
<View
|
||||
android:id="@+id/center_point"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.5"
|
||||
android:baselineAligned="false" >
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<View
|
||||
android:id="@+id/center_point"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_centerInParent="true" />
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_left_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/center_point"
|
||||
android:layout_alignEnd="@id/center_point"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignRight="@id/center_point" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_left_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignEnd="@id/center_point"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignRight="@id/center_point" >
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_right_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignLeft="@id/center_point"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignStart="@id/center_point" >
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_right_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/center_point"
|
||||
android:layout_alignLeft="@id/center_point"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignStart="@id/center_point" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_bottom_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="0.5" >
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/center_point" />
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
@@ -7,14 +7,20 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
android:layout_height="@dimen/navigation_drawer_image_height" >
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/nav_drawer_header" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/regatta_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/gradient"
|
||||
android:padding="10dp"
|
||||
android:text="@string/nav_header"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<include
|
||||
@@ -13,7 +14,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar_layout"
|
||||
android:layout_marginLeft="72dp"
|
||||
android:layout_marginRight="72dp" />
|
||||
android:layout_marginLeft="@dimen/preference_margin"
|
||||
android:layout_marginRight="@dimen/preference_margin" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -116,7 +116,7 @@
|
||||
android:id="@+id/arrow_direction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_expand_less_grey600_18dp" />
|
||||
android:src="@drawable/arrow_down_small" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/flag_timer"
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
<android.support.v4.widget.DrawerLayout
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="false" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/racingLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/white"
|
||||
android:baselineAligned="false"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<include layout="@layout/toolbar" />
|
||||
|
||||
@@ -10,6 +10,19 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="AUSWAHL" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
android:id="@+id/welcomeFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_light"
|
||||
android:background="@color/colorPrimaryDark"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
@@ -31,6 +31,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
@@ -39,6 +40,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/area_name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
@@ -47,6 +49,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/area_name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="navigation_drawer_image_height">300dp</dimen>
|
||||
<dimen name="navigation_drawer_width">400dp</dimen>
|
||||
<dimen name="navigation_drawer_right_box">150dp</dimen>
|
||||
|
||||
<dimen name="listview_side_padding">100dp</dimen>
|
||||
<dimen name="listview_row_padding">20dp</dimen>
|
||||
|
||||
<dimen name="preference_margin">0dp</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="navigation_drawer_image_height">300dp</dimen>
|
||||
<dimen name="navigation_drawer_width">500dp</dimen>
|
||||
<dimen name="navigation_drawer_right_box">150dp</dimen>
|
||||
|
||||
<dimen name="listview_side_padding">100dp</dimen>
|
||||
<dimen name="listview_row_padding">20dp</dimen>
|
||||
|
||||
<dimen name="preference_margin">72dp</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -5,6 +5,8 @@
|
||||
<item name="android:colorPrimary">@color/colorPrimary</item>
|
||||
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="android:colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
|
||||
<item name="android:alertDialogTheme">@style/AppTheme.AlertDialog</item>
|
||||
</style>
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<color name="orange">#ffe79b1d</color>
|
||||
<color name="orange_dark">#ffde892d</color>
|
||||
|
||||
<color name="colorPrimary">@color/orange_light</color>
|
||||
<color name="colorPrimaryDark">@color/orange_dark</color>
|
||||
<color name="colorPrimary">@color/black</color>
|
||||
<color name="colorPrimaryDark">@color/black</color>
|
||||
<color name="colorAccent">@color/red</color>
|
||||
|
||||
<color name="colorGreyDark">#ffcccccc</color>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="navigation_drawer_width">500dp</dimen>
|
||||
<dimen name="navigation_drawer_image_height">200dp</dimen>
|
||||
<dimen name="navigation_drawer_width">300dp</dimen>
|
||||
<dimen name="navigation_drawer_right_box">150dp</dimen>
|
||||
|
||||
<dimen name="listview_side_padding">100dp</dimen>
|
||||
<dimen name="listview_row_padding">20dp</dimen>
|
||||
|
||||
<dimen name="preference_margin">0dp</dimen>
|
||||
|
||||
</resources>
|
||||
+40
-43
@@ -78,18 +78,17 @@ public class OfflineDataManager extends DataManager {
|
||||
cal.set(2012, 12, 5);
|
||||
final TimePoint endDate = new MillisecondsTimePoint(cal.getTimeInMillis());
|
||||
|
||||
dataStore.addEvent(new StrippedEventImpl("Extreme Sailing Series 2012 (Cardiff)", startDate, endDate, "Cardiff", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase>emptySet()));
|
||||
dataStore.addEvent(new StrippedEventImpl("Extreme Sailing Series 2012 (Nice)", startDate, endDate, "Nice", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase>emptySet()));
|
||||
dataStore.addEvent(new StrippedEventImpl("Extreme Sailing Series 2012 (Rio)", startDate, endDate, "Rio", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase>emptySet()));
|
||||
EventBase newEvent = new StrippedEventImpl("Extreme Sailing Series 2013 (Muscat)", startDate, endDate, "Muscat", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase>emptySet());
|
||||
dataStore.addEvent(new StrippedEventImpl("Extreme Sailing Series 2012 (Cardiff)", startDate, endDate, "Cardiff", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase> emptySet()));
|
||||
dataStore.addEvent(new StrippedEventImpl("Extreme Sailing Series 2012 (Nice)", startDate, endDate, "Nice", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase> emptySet()));
|
||||
dataStore.addEvent(new StrippedEventImpl("Extreme Sailing Series 2012 (Rio)", startDate, endDate, "Rio", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase> emptySet()));
|
||||
EventBase newEvent = new StrippedEventImpl("Extreme Sailing Series 2013 (Muscat)", startDate, endDate, "Muscat", true, UUID.randomUUID(), Collections.<LeaderboardGroupBase> emptySet());
|
||||
newEvent.getVenue().addCourseArea(new CourseAreaImpl("Offshore", UUID.randomUUID()));
|
||||
newEvent.getVenue().addCourseArea(new CourseAreaImpl("Stadium", UUID.randomUUID()));
|
||||
dataStore.addEvent(newEvent);
|
||||
|
||||
SeriesWithRows qualifying = new SeriesWithRowsImpl("Qualifying", false, null);
|
||||
SeriesWithRows medal = new SeriesWithRowsImpl("Medal", true, null);
|
||||
RaceGroup raceGroup = new RaceGroupImpl("ESS", new BoatClassImpl("X40", false), null, Arrays.asList(qualifying,
|
||||
medal), new EmptyRegattaConfiguration());
|
||||
RaceGroup raceGroup = new RaceGroupImpl("ESS", new BoatClassImpl("X40", false), null, Arrays.asList(qualifying, medal), new EmptyRegattaConfiguration());
|
||||
|
||||
List<Competitor> competitors = new ArrayList<Competitor>();
|
||||
competitors.add(new CompetitorImpl(UUID.randomUUID(), "SAP Extreme Sailing Team", Color.BLUE, null, null));
|
||||
@@ -101,18 +100,17 @@ public class OfflineDataManager extends DataManager {
|
||||
RaceLogEventFactory factory = new RaceLogEventFactoryImpl();
|
||||
RaceLog log = new RaceLogImpl(UUID.randomUUID());
|
||||
final RaceLogEventAuthor author = AppPreferences.on(context).getAuthor();
|
||||
ConfigurationLoader<RegattaConfiguration> configuration = PreferencesRegattaConfigurationLoader.loadFromPreferences(preferences);
|
||||
|
||||
log.add(factory.createStartTimeEvent(new MillisecondsTimePoint(new Date().getTime() - 2000), author,
|
||||
1, new MillisecondsTimePoint(new Date().getTime() - 1000)));
|
||||
ConfigurationLoader<RegattaConfiguration> configuration = PreferencesRegattaConfigurationLoader
|
||||
.loadFromPreferences(preferences);
|
||||
|
||||
log.add(factory.createStartTimeEvent(new MillisecondsTimePoint(new Date().getTime() - 2000), author, 1,
|
||||
new MillisecondsTimePoint(new Date().getTime() - 1000)));
|
||||
|
||||
log.add(factory.createRaceStatusEvent(new MillisecondsTimePoint(new Date().getTime()),
|
||||
AppPreferences.on(context).getAuthor(),
|
||||
1, RaceLogRaceStatus.FINISHING));
|
||||
AppPreferences.on(context).getAuthor(), 1, RaceLogRaceStatus.FINISHING));
|
||||
|
||||
ManagedRace q1 = new ManagedRaceImpl(
|
||||
new ManagedRaceIdentifierImpl("A.B", new FleetImpl("A"), qualifying, raceGroup),
|
||||
RaceStateImpl.create(log, AppPreferences.on(context).getAuthor(), configuration));
|
||||
ManagedRace q1 = new ManagedRaceImpl(new ManagedRaceIdentifierImpl("A.B", new FleetImpl("A"), qualifying,
|
||||
raceGroup), RaceStateImpl.create(log, AppPreferences.on(context).getAuthor(), configuration));
|
||||
|
||||
log = new RaceLogImpl(UUID.randomUUID());
|
||||
/*
|
||||
@@ -120,18 +118,16 @@ public class OfflineDataManager extends DataManager {
|
||||
* new MillisecondsTimePoint(new Date().getTime() + 100000)));
|
||||
*/
|
||||
|
||||
ManagedRace q2 = new ManagedRaceImpl(
|
||||
new ManagedRaceIdentifierImpl("B", new FleetImpl("A.A"), qualifying, raceGroup),
|
||||
RaceStateImpl.create(log, AppPreferences.on(context).getAuthor(), configuration));
|
||||
ManagedRace q2 = new ManagedRaceImpl(new ManagedRaceIdentifierImpl("B", new FleetImpl("A.A"), qualifying,
|
||||
raceGroup), RaceStateImpl.create(log, AppPreferences.on(context).getAuthor(), configuration));
|
||||
|
||||
log = new RaceLogImpl(UUID.randomUUID());
|
||||
/*
|
||||
* log.add(factory.createRaceStatusEvent( new MillisecondsTimePoint(new Date()), 5,
|
||||
* RaceLogRaceStatus.FINISHED));
|
||||
*/
|
||||
ManagedRace q3 = new ManagedRaceImpl(
|
||||
new ManagedRaceIdentifierImpl("Q3", new FleetImpl("Default"), qualifying, raceGroup),
|
||||
RaceStateImpl.create(log, AppPreferences.on(context).getAuthor(), configuration));
|
||||
ManagedRace q3 = new ManagedRaceImpl(new ManagedRaceIdentifierImpl("Q3", new FleetImpl("Default"), qualifying,
|
||||
raceGroup), RaceStateImpl.create(log, AppPreferences.on(context).getAuthor(), configuration));
|
||||
/*
|
||||
* ManagedRace m1 = new ManagedRaceImpl( new ManagedRaceIdentifierImpl( "M1", new FleetImpl("Default"), medal,
|
||||
* raceGroup), null);
|
||||
@@ -174,19 +170,19 @@ public class OfflineDataManager extends DataManager {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CourseArea>>> createCourseAreasLoader(
|
||||
final EventBase parentEvent, LoadClient<Collection<CourseArea>> callback) {
|
||||
// TODO Auto-generated method stub
|
||||
return new ImmediateDataLoaderCallbacks<Collection<CourseArea>>(context, callback,
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CourseArea>>> createCourseAreasLoader(
|
||||
final EventBase parentEvent, LoadClient<Collection<CourseArea>> callback) {
|
||||
// TODO Auto-generated method stub
|
||||
return new ImmediateDataLoaderCallbacks<Collection<CourseArea>>(context, callback,
|
||||
new Callable<Collection<CourseArea>>() {
|
||||
@Override
|
||||
public Collection<CourseArea> call() throws Exception {
|
||||
return dataStore.getCourseAreas(parentEvent);
|
||||
return dataStore.getCourseAreas(parentEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<ManagedRace>>> createRacesLoader(Serializable courseAreaId,
|
||||
LoadClient<Collection<ManagedRace>> callback) {
|
||||
@@ -234,21 +230,22 @@ public class OfflineDataManager extends DataManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<DeviceConfiguration>> createConfigurationLoader(DeviceConfigurationIdentifier identifier,
|
||||
LoadClient<DeviceConfiguration> callback) {
|
||||
return new ImmediateDataLoaderCallbacks<DeviceConfiguration>(context, callback, new Callable<DeviceConfiguration>() {
|
||||
@Override
|
||||
public DeviceConfiguration call() throws Exception {
|
||||
throw new IllegalStateException("No remote configuration in offline mode.");
|
||||
}
|
||||
});
|
||||
public LoaderCallbacks<DataLoaderResult<DeviceConfiguration>> createConfigurationLoader(
|
||||
DeviceConfigurationIdentifier identifier, LoadClient<DeviceConfiguration> callback) {
|
||||
return new ImmediateDataLoaderCallbacks<DeviceConfiguration>(context, callback,
|
||||
new Callable<DeviceConfiguration>() {
|
||||
@Override
|
||||
public DeviceConfiguration call() throws Exception {
|
||||
throw new IllegalStateException("No remote configuration in offline mode.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CoursePosition>>> createPositionLoader(
|
||||
PositionListFragment positionListFragment) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CoursePosition>>> createPositionLoader(
|
||||
PositionListFragment positionListFragment) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+57
-57
@@ -103,15 +103,16 @@ public class OnlineDataManager extends DataManager {
|
||||
return new DataLoaderCallbacks<Collection<EventBase>>(callback, new LoaderCreator<Collection<EventBase>>() {
|
||||
@Override
|
||||
public Loader<DataLoaderResult<Collection<EventBase>>> create(int id, Bundle args) throws Exception {
|
||||
ExLog.i(context, TAG, String.format("Creating Events-OnlineDataLoader %d", id));
|
||||
EventBaseJsonDeserializer serializer = new EventBaseJsonDeserializer(new VenueJsonDeserializer(new CourseAreaJsonDeserializer(domainFactory)), new LeaderboardGroupBaseJsonDeserializer());
|
||||
ExLog.i(context, TAG, String.format("Creating Events-OnlineDataLoader %d", id));
|
||||
EventBaseJsonDeserializer serializer = new EventBaseJsonDeserializer(new VenueJsonDeserializer(
|
||||
new CourseAreaJsonDeserializer(domainFactory)), new LeaderboardGroupBaseJsonDeserializer());
|
||||
DataParser<Collection<EventBase>> parser = new EventsDataParser(serializer);
|
||||
DataHandler<Collection<EventBase>> handler = new EventsDataHandler(OnlineDataManager.this);
|
||||
|
||||
// ExLog.i(context, TAG, "getEventsLoader created new loader...");
|
||||
// ExLog.i(context, TAG, "getEventsLoader created new loader...");
|
||||
|
||||
return new OnlineDataLoader<Collection<EventBase>>(context,
|
||||
new URL(preferences.getServerBaseURL() + "/sailingserver/events"), parser, handler);
|
||||
return new OnlineDataLoader<Collection<EventBase>>(context, new URL(preferences.getServerBaseURL()
|
||||
+ "/sailingserver/events"), parser, handler);
|
||||
}
|
||||
}, getContext());
|
||||
}
|
||||
@@ -134,39 +135,39 @@ public class OnlineDataManager extends DataManager {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CourseArea>>> createCourseAreasLoader(
|
||||
final EventBase parentEvent, LoadClient<Collection<CourseArea>> callback) {
|
||||
// TODO Auto-generated method stub
|
||||
return new ImmediateDataLoaderCallbacks<Collection<CourseArea>>(context, callback,
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CourseArea>>> createCourseAreasLoader(
|
||||
final EventBase parentEvent, LoadClient<Collection<CourseArea>> callback) {
|
||||
// TODO Auto-generated method stub
|
||||
return new ImmediateDataLoaderCallbacks<Collection<CourseArea>>(context, callback,
|
||||
new Callable<Collection<CourseArea>>() {
|
||||
@Override
|
||||
public Collection<CourseArea> call() throws Exception {
|
||||
|
||||
|
||||
return dataStore.getCourseAreas(parentEvent);
|
||||
|
||||
return dataStore.getCourseAreas(parentEvent);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<ManagedRace>>> createRacesLoader(final Serializable courseAreaId,
|
||||
LoadClient<Collection<ManagedRace>> callback) {
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<ManagedRace>>> createRacesLoader(
|
||||
final Serializable courseAreaId, LoadClient<Collection<ManagedRace>> callback) {
|
||||
return new DataLoaderCallbacks<Collection<ManagedRace>>(callback, new LoaderCreator<Collection<ManagedRace>>() {
|
||||
@Override
|
||||
public Loader<DataLoaderResult<Collection<ManagedRace>>> create(int id, Bundle args) throws Exception {
|
||||
ExLog.i(context, TAG, String.format("Creating races-OnlineDataLoader %d", id));
|
||||
ConfigurationLoader<RegattaConfiguration> globalConfiguration = PreferencesRegattaConfigurationLoader.loadFromPreferences(preferences);
|
||||
|
||||
ExLog.i(context, TAG, String.format("Creating races-OnlineDataLoader %d", id));
|
||||
ConfigurationLoader<RegattaConfiguration> globalConfiguration = PreferencesRegattaConfigurationLoader
|
||||
.loadFromPreferences(preferences);
|
||||
|
||||
DataParser<Collection<ManagedRace>> parser = new ManagedRacesDataParser(preferences.getAuthor(),
|
||||
globalConfiguration, RaceGroupDeserializer.create(domainFactory, RegattaConfigurationJsonDeserializer.create()));
|
||||
globalConfiguration, RaceGroupDeserializer.create(domainFactory,
|
||||
RegattaConfigurationJsonDeserializer.create()));
|
||||
DataHandler<Collection<ManagedRace>> handler = new ManagedRacesDataHandler(OnlineDataManager.this);
|
||||
return new OnlineDataLoader<Collection<ManagedRace>>(context, new URL(preferences.getServerBaseURL()
|
||||
+ "/sailingserver/rc/racegroups?"+
|
||||
RaceLogServletConstants.PARAM_COURSE_AREA_FILTER + "=" + courseAreaId.toString()+"&"+
|
||||
RaceLogServletConstants.PARAMS_CLIENT_UUID + "=" + MessageSendingService.uuid), parser, handler);
|
||||
+ "/sailingserver/rc/racegroups?" + RaceLogServletConstants.PARAM_COURSE_AREA_FILTER + "="
|
||||
+ courseAreaId.toString() + "&" + RaceLogServletConstants.PARAMS_CLIENT_UUID + "="
|
||||
+ MessageSendingService.uuid), parser, handler);
|
||||
}
|
||||
}, getContext());
|
||||
}
|
||||
@@ -177,7 +178,7 @@ public class OnlineDataManager extends DataManager {
|
||||
return new DataLoaderCallbacks<Collection<Mark>>(callback, new LoaderCreator<Collection<Mark>>() {
|
||||
@Override
|
||||
public Loader<DataLoaderResult<Collection<Mark>>> create(int id, Bundle args) throws Exception {
|
||||
ExLog.i(context, TAG, String.format("Creating marks-OnlineDataLoader %d", id));
|
||||
ExLog.i(context, TAG, String.format("Creating marks-OnlineDataLoader %d", id));
|
||||
JsonDeserializer<Mark> markDeserializer = new MarkDeserializer(domainFactory);
|
||||
DataParser<Collection<Mark>> parser = new MarksDataParser(markDeserializer);
|
||||
DataHandler<Collection<Mark>> handler = new MarksDataHandler(OnlineDataManager.this);
|
||||
@@ -188,10 +189,10 @@ public class OnlineDataManager extends DataManager {
|
||||
String raceColumnName = URLEncoder.encode(identifier.getRaceName(), "UTF-8");
|
||||
String fleetName = URLEncoder.encode(identifier.getFleet().getName(), "UTF-8");
|
||||
|
||||
return new OnlineDataLoader<Collection<Mark>>(context, new URL(preferences.getServerBaseURL() +
|
||||
"/sailingserver/rc/marks?"+RaceLogServletConstants.PARAMS_LEADERBOARD_NAME + "=" + raceGroupName +
|
||||
"&"+RaceLogServletConstants.PARAMS_RACE_COLUMN_NAME+"=" + raceColumnName +
|
||||
"&"+RaceLogServletConstants.PARAMS_RACE_FLEET_NAME+"=" + fleetName), parser, handler);
|
||||
return new OnlineDataLoader<Collection<Mark>>(context, new URL(preferences.getServerBaseURL()
|
||||
+ "/sailingserver/rc/marks?" + RaceLogServletConstants.PARAMS_LEADERBOARD_NAME + "="
|
||||
+ raceGroupName + "&" + RaceLogServletConstants.PARAMS_RACE_COLUMN_NAME + "=" + raceColumnName
|
||||
+ "&" + RaceLogServletConstants.PARAMS_RACE_FLEET_NAME + "=" + fleetName), parser, handler);
|
||||
}
|
||||
}, getContext());
|
||||
}
|
||||
@@ -202,7 +203,7 @@ public class OnlineDataManager extends DataManager {
|
||||
return new DataLoaderCallbacks<CourseBase>(callback, new LoaderCreator<CourseBase>() {
|
||||
@Override
|
||||
public Loader<DataLoaderResult<CourseBase>> create(int id, Bundle args) throws Exception {
|
||||
ExLog.i(context, TAG, String.format("Creating Course-OnlineDataLoader %d", id));
|
||||
ExLog.i(context, TAG, String.format("Creating Course-OnlineDataLoader %d", id));
|
||||
JsonDeserializer<CourseBase> courseBaseDeserializer = new CourseBaseDeserializer(
|
||||
new WaypointDeserializer(new ControlPointDeserializer(new MarkDeserializer(domainFactory),
|
||||
new GateDeserializer(domainFactory, new MarkDeserializer(domainFactory)))));
|
||||
@@ -216,9 +217,9 @@ public class OnlineDataManager extends DataManager {
|
||||
String fleetName = URLEncoder.encode(identifier.getFleet().getName(), "UTF-8");
|
||||
|
||||
return new OnlineDataLoader<CourseBase>(context, new URL(preferences.getServerBaseURL()
|
||||
+ "/sailingserver/rc/currentcourse?" + RaceLogServletConstants.PARAMS_LEADERBOARD_NAME + "="
|
||||
+ raceGroupName + "&" + RaceLogServletConstants.PARAMS_RACE_COLUMN_NAME + "=" + raceColumnName
|
||||
+ "&"+RaceLogServletConstants.PARAMS_RACE_FLEET_NAME+"=" + fleetName), parser, handler);
|
||||
+ "/sailingserver/rc/currentcourse?" + RaceLogServletConstants.PARAMS_LEADERBOARD_NAME + "="
|
||||
+ raceGroupName + "&" + RaceLogServletConstants.PARAMS_RACE_COLUMN_NAME + "=" + raceColumnName
|
||||
+ "&" + RaceLogServletConstants.PARAMS_RACE_FLEET_NAME + "=" + fleetName), parser, handler);
|
||||
}
|
||||
}, getContext());
|
||||
}
|
||||
@@ -230,9 +231,10 @@ public class OnlineDataManager extends DataManager {
|
||||
@Override
|
||||
public Loader<DataLoaderResult<Collection<Competitor>>> create(int id, Bundle args) throws Exception {
|
||||
ExLog.i(context, TAG, String.format("Creating Competitor-OnlineDataLoader %d", id));
|
||||
JsonDeserializer<Competitor> competitorDeserializer = new CompetitorJsonDeserializer(domainFactory.getCompetitorStore(),
|
||||
new TeamJsonDeserializer(new PersonJsonDeserializer(new NationalityJsonDeserializer(domainFactory))),
|
||||
new BoatJsonDeserializer(new BoatClassJsonDeserializer(domainFactory)));
|
||||
JsonDeserializer<Competitor> competitorDeserializer = new CompetitorJsonDeserializer(
|
||||
domainFactory.getCompetitorStore(), new TeamJsonDeserializer(new PersonJsonDeserializer(
|
||||
new NationalityJsonDeserializer(domainFactory))), new BoatJsonDeserializer(
|
||||
new BoatClassJsonDeserializer(domainFactory)));
|
||||
DataParser<Collection<Competitor>> parser = new CompetitorsDataParser(competitorDeserializer);
|
||||
DataHandler<Collection<Competitor>> handler = new CompetitorsDataHandler(OnlineDataManager.this,
|
||||
managedRace);
|
||||
@@ -243,41 +245,39 @@ public class OnlineDataManager extends DataManager {
|
||||
String raceColumnName = URLEncoder.encode(identifier.getRaceName(), "UTF-8");
|
||||
String fleetName = URLEncoder.encode(identifier.getFleet().getName(), "UTF-8");
|
||||
|
||||
return new OnlineDataLoader<Collection<Competitor>>(context, new URL(
|
||||
preferences.getServerBaseURL() + "/sailingserver/rc/competitors?"
|
||||
+ RaceLogServletConstants.PARAMS_LEADERBOARD_NAME + "=" + raceGroupName + "&"
|
||||
+ RaceLogServletConstants.PARAMS_RACE_COLUMN_NAME + "=" + raceColumnName + "&"
|
||||
+ RaceLogServletConstants.PARAMS_RACE_FLEET_NAME + "=" + fleetName), parser, handler);
|
||||
return new OnlineDataLoader<Collection<Competitor>>(context, new URL(preferences.getServerBaseURL()
|
||||
+ "/sailingserver/rc/competitors?" + RaceLogServletConstants.PARAMS_LEADERBOARD_NAME + "="
|
||||
+ raceGroupName + "&" + RaceLogServletConstants.PARAMS_RACE_COLUMN_NAME + "=" + raceColumnName
|
||||
+ "&" + RaceLogServletConstants.PARAMS_RACE_FLEET_NAME + "=" + fleetName), parser, handler);
|
||||
}
|
||||
}, getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<DeviceConfiguration>> createConfigurationLoader(final DeviceConfigurationIdentifier identifier,
|
||||
LoadClient<DeviceConfiguration> callback) {
|
||||
public LoaderCallbacks<DataLoaderResult<DeviceConfiguration>> createConfigurationLoader(
|
||||
final DeviceConfigurationIdentifier identifier, LoadClient<DeviceConfiguration> callback) {
|
||||
return new DataLoaderCallbacks<DeviceConfiguration>(callback, new LoaderCreator<DeviceConfiguration>() {
|
||||
@Override
|
||||
public Loader<DataLoaderResult<DeviceConfiguration>> create(int id, Bundle args) throws Exception {
|
||||
ExLog.i(context, TAG, String.format("Creating Configuration-OnlineDataLoader %d", id));
|
||||
|
||||
|
||||
DataHandler<DeviceConfiguration> handler = new NullDataHandler<DeviceConfiguration>();
|
||||
DataParser<DeviceConfiguration> parser = new DeviceConfigurationParser(DeviceConfigurationJsonDeserializer.create());
|
||||
|
||||
DataParser<DeviceConfiguration> parser = new DeviceConfigurationParser(
|
||||
DeviceConfigurationJsonDeserializer.create());
|
||||
|
||||
String encodedIdentifier = URLEncoder.encode(identifier.getClientIdentifier(), "UTF-8");
|
||||
encodedIdentifier = encodedIdentifier.replace("+", "%20");
|
||||
|
||||
return new OnlineDataLoader<DeviceConfiguration>(
|
||||
context,
|
||||
new URL(preferences.getServerBaseURL() + "/sailingserver/rc/configuration?client="+ encodedIdentifier),
|
||||
parser, handler);
|
||||
|
||||
return new OnlineDataLoader<DeviceConfiguration>(context, new URL(preferences.getServerBaseURL()
|
||||
+ "/sailingserver/rc/configuration?client=" + encodedIdentifier), parser, handler);
|
||||
}
|
||||
}, getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CoursePosition>>> createPositionLoader(
|
||||
PositionListFragment positionListFragment) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public LoaderCallbacks<DataLoaderResult<Collection<CoursePosition>>> createPositionLoader(
|
||||
PositionListFragment positionListFragment) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-7
@@ -86,7 +86,6 @@ public class LoginActivity extends BaseActivity implements EventSelectedListener
|
||||
|
||||
private void addAreaPositionListFragment() {
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.setCustomAnimations(R.animator.slide_in, R.animator.slide_out);
|
||||
transaction.replace(R.id.login_view_bottom_container, mPositionListFragment, AreaPositionListFragmentTag);
|
||||
transaction.commitAllowingStateLoss();
|
||||
ExLog.i(this, "LoginActivity", "PositionFragment created.");
|
||||
@@ -100,17 +99,15 @@ public class LoginActivity extends BaseActivity implements EventSelectedListener
|
||||
Fragment fragment = new CourseAreaListFragment();
|
||||
fragment.setArguments(args);
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.setCustomAnimations(R.animator.slide_in, R.animator.slide_out);
|
||||
transaction.replace(R.id.login_view_right_container, fragment, CourseAreaListFragmentTag);
|
||||
transaction.commit();
|
||||
transaction.commitAllowingStateLoss();
|
||||
ExLog.i(this, "LoginActivity", "CourseFragment created.");
|
||||
}
|
||||
|
||||
private void addEventListFragment() {
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.login_view_left_container, new EventListFragment());
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_NONE);
|
||||
transaction.commit();
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
public ItemSelectedListener<CourseArea> getCourseAreaSelectionListener() {
|
||||
@@ -123,7 +120,6 @@ public class LoginActivity extends BaseActivity implements EventSelectedListener
|
||||
|
||||
private void hideAreaPositionListFragment() {
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.setCustomAnimations(R.animator.slide_in, R.animator.slide_out);
|
||||
transaction.replace(R.id.login_view_bottom_container, new Fragment(), AreaPositionListFragmentTag);
|
||||
transaction.commitAllowingStateLoss();
|
||||
ExLog.i(this, "LoginActivity", "PositionFragment created.");
|
||||
@@ -194,7 +190,7 @@ public class LoginActivity extends BaseActivity implements EventSelectedListener
|
||||
protected boolean onReset() {
|
||||
Fragment courseAreaFragment = getFragmentManager().findFragmentByTag(CourseAreaListFragmentTag);
|
||||
if (courseAreaFragment != null) {
|
||||
getFragmentManager().beginTransaction().remove(courseAreaFragment).commit();
|
||||
getFragmentManager().beginTransaction().remove(courseAreaFragment).commitAllowingStateLoss();
|
||||
}
|
||||
recreate();
|
||||
return true;
|
||||
|
||||
+121
-129
@@ -11,11 +11,15 @@ import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -109,7 +113,7 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
|
||||
private class EventLoadClient implements LoadClient<Collection<EventBase>> {
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void onLoadFailed(Exception ex) {
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(RacingActivity.this);
|
||||
@@ -120,9 +124,9 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
|
||||
// ExLog.i(RacingActivity.this, TAG, "Issuing a reload of managed races");
|
||||
// getLoaderManager().restartLoader(RacesLoaderId, null,
|
||||
// dataManager.createRacesLoader(courseArea.getId(), RaceLoadClient.this));
|
||||
// ExLog.i(RacingActivity.this, TAG, "Issuing a reload of managed races");
|
||||
// getLoaderManager().restartLoader(RacesLoaderId, null,
|
||||
// dataManager.createRacesLoader(courseArea.getId(), RaceLoadClient.this));
|
||||
dialog.cancel();
|
||||
}
|
||||
}).setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@@ -133,75 +137,73 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadSucceded(Collection<EventBase> data, boolean isCached) {
|
||||
// TODO Auto-generated method stub
|
||||
Toast.makeText(RacingActivity.this,
|
||||
@Override
|
||||
public void onLoadSucceded(Collection<EventBase> data, boolean isCached) {
|
||||
// TODO Auto-generated method stub
|
||||
Toast.makeText(RacingActivity.this,
|
||||
String.format(getString(R.string.loading_events_succeded), data.size()), Toast.LENGTH_SHORT).show();
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
|
||||
for (EventBase event : data) {
|
||||
dataManager.getDataStore().addEvent(event);
|
||||
if ( event.getId().toString().equals(mEventId.toString()) ){
|
||||
mEvent = event;
|
||||
}
|
||||
}
|
||||
|
||||
if (mCourseArea != null) {
|
||||
setupFragments();
|
||||
} else {
|
||||
loadCourses(mEvent);
|
||||
}
|
||||
}
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
|
||||
for (EventBase event : data) {
|
||||
dataManager.getDataStore().addEvent(event);
|
||||
if (event.getId().toString().equals(mEventId.toString())) {
|
||||
mEvent = event;
|
||||
}
|
||||
}
|
||||
|
||||
if (mCourseArea != null) {
|
||||
setupFragments();
|
||||
} else {
|
||||
loadCourses(mEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class CourseLoadClient implements LoadClient<Collection<CourseArea>> {
|
||||
|
||||
@Override
|
||||
public void onLoadFailed(Exception reason) {
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
ExLog.e(getApplicationContext(), TAG, "Errors loading CourseData");
|
||||
ExLog.e(getApplicationContext(), TAG, reason.getMessage());
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onLoadFailed(Exception reason) {
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
ExLog.e(getApplicationContext(), TAG, "Errors loading CourseData");
|
||||
ExLog.e(getApplicationContext(), TAG, reason.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadSucceded(Collection<CourseArea> data, boolean isCached) {
|
||||
Toast.makeText(RacingActivity.this, String.format("Loading of CourseData succeeded", data.size()),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
|
||||
for (CourseArea course : data) {
|
||||
if (course.getId().toString().equals(mCourseAreaId.toString())) {
|
||||
mCourseArea = course;
|
||||
setupFragments();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadSucceded(Collection<CourseArea> data, boolean isCached) {
|
||||
Toast.makeText(RacingActivity.this,
|
||||
String.format("Loading of CourseData succeeded", data.size()), Toast.LENGTH_SHORT).show();
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
|
||||
for (CourseArea course : data) {
|
||||
if ( course.getId().toString().equals(mCourseAreaId.toString())){
|
||||
mCourseArea = course;
|
||||
setupFragments();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setupFragments(){
|
||||
Handler handler = new Handler();
|
||||
final Runnable r = new Runnable() {
|
||||
public void run() {
|
||||
setupActionBar(mCourseArea);
|
||||
|
||||
private void setupFragments() {
|
||||
Handler handler = new Handler();
|
||||
final Runnable r = new Runnable() {
|
||||
public void run() {
|
||||
loadRaces(mCourseArea);
|
||||
loadNavDrawer( mCourseArea, mEvent);
|
||||
loadWelcomeFragment(mCourseArea, mEvent);
|
||||
}
|
||||
};
|
||||
handler.post(r);
|
||||
loadNavDrawer(mCourseArea, mEvent);
|
||||
loadWelcomeFragment(mCourseArea, mEvent);
|
||||
}
|
||||
};
|
||||
handler.post(r);
|
||||
}
|
||||
|
||||
|
||||
private static ProgressBar mProgressSpinner;
|
||||
private static final int RacesLoaderId = 2;
|
||||
private static final int EventsLoaderId = 1;
|
||||
private static final int CourseLoaderId = 0;
|
||||
|
||||
|
||||
private static final String TAG = RacingActivity.class.getName();
|
||||
|
||||
|
||||
private Button currentTime;
|
||||
private ReadonlyDataManager dataManager;
|
||||
@@ -213,10 +215,10 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
private Button windButton;
|
||||
|
||||
private WindFragment windFragment;
|
||||
private Serializable mEventId;
|
||||
private Serializable mEventId;
|
||||
private EventBase mEvent;
|
||||
private CourseArea mCourseArea;
|
||||
private Serializable mCourseAreaId;
|
||||
private CourseArea mCourseArea;
|
||||
private Serializable mCourseAreaId;
|
||||
|
||||
private Serializable getCourseAreaIdFromIntent() {
|
||||
if (getIntent() == null || getIntent().getExtras() == null) {
|
||||
@@ -245,35 +247,34 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
return eventId;
|
||||
}
|
||||
|
||||
private void loadCourses(final EventBase event){
|
||||
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
ExLog.i(this, TAG, "Issuing loading of courses from data manager");
|
||||
getLoaderManager().initLoader(CourseLoaderId, null, dataManager.createCourseAreasLoader(event, new CourseLoadClient()));
|
||||
private void loadCourses(final EventBase event) {
|
||||
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
ExLog.i(this, TAG, "Issuing loading of courses from data manager");
|
||||
getLoaderManager().initLoader(CourseLoaderId, null,
|
||||
dataManager.createCourseAreasLoader(event, new CourseLoadClient()));
|
||||
}
|
||||
|
||||
|
||||
private void loadRaces(final CourseArea courseArea) {
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
|
||||
ExLog.i(this, TAG, "Issuing loading of managed races from data manager");
|
||||
getLoaderManager().initLoader(RacesLoaderId, null, dataManager.createRacesLoader(courseArea.getId(), new RaceLoadClient(courseArea)));
|
||||
getLoaderManager().initLoader(RacesLoaderId, null,
|
||||
dataManager.createRacesLoader(courseArea.getId(), new RaceLoadClient(courseArea)));
|
||||
}
|
||||
|
||||
|
||||
private void loadEvents(){
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
ExLog.i(this, TAG, "Issuing loading of events from data manager");
|
||||
getLoaderManager().initLoader(EventsLoaderId, null, dataManager.createEventsLoader(new EventLoadClient()));
|
||||
|
||||
private void loadEvents() {
|
||||
setSupportProgressBarIndeterminateVisibility(true);
|
||||
ExLog.i(this, TAG, "Issuing loading of events from data manager");
|
||||
getLoaderManager().initLoader(EventsLoaderId, null, dataManager.createEventsLoader(new EventLoadClient()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void loadWindFragment() {
|
||||
// check if the fragment is actively shown already, otherwise show it
|
||||
if ((windFragment != null && !windFragment.isFragmentUIActive()) || windFragment == null) {
|
||||
windFragment = new WindFragment();
|
||||
getFragmentManager().beginTransaction()
|
||||
// .setCustomAnimations(R.animator.slide_in, R.animator.slide_out)
|
||||
// .setCustomAnimations(R.animator.slide_in, R.animator.slide_out)
|
||||
.replace(R.id.racing_view_container, windFragment)
|
||||
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).addToBackStack(null).commit();
|
||||
}
|
||||
@@ -303,7 +304,7 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
// fix for filled out RaceInfoFragment
|
||||
if (infoFragment != null && infoFragment.isFragmentUIActive() && selectedRace != null) {
|
||||
ExLog.i(this, this.getClass().getCanonicalName(), "Returning to RaceInfoFragment");
|
||||
|
||||
|
||||
getFragmentManager().popBackStackImmediate();
|
||||
onRaceItemClicked(selectedRace);
|
||||
}
|
||||
@@ -336,9 +337,8 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
setContentView(R.layout.racing_view);
|
||||
|
||||
dataManager = DataManager.create(this);
|
||||
navDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
|
||||
|
||||
navDrawerFragment = (NavigationDrawerFragment) getFragmentManager().findFragmentById(R.id.navigation_drawer);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
if (toolbar != null) {
|
||||
setSupportActionBar(toolbar);
|
||||
@@ -354,7 +354,7 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
if (courseAreaId == null) {
|
||||
throw new IllegalStateException("There was no course area id transmitted...");
|
||||
}
|
||||
ExLog.i(this, this.getClass().toString(), "trying to load courseArea via id: "+courseAreaId);
|
||||
ExLog.i(this, this.getClass().toString(), "trying to load courseArea via id: " + courseAreaId);
|
||||
CourseArea courseArea = dataManager.getDataStore().getCourseArea(courseAreaId);
|
||||
mCourseArea = courseArea;
|
||||
|
||||
@@ -381,56 +381,43 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
throw new IllegalStateException("There was no event id transmitted...");
|
||||
}
|
||||
mEventId = eventId;
|
||||
|
||||
|
||||
EventBase e = dataManager.getDataStore().getEvent(eventId);
|
||||
if ( e == null ){
|
||||
ExLog.e(this, TAG, "Noooo the event is null :/");
|
||||
loadEvents();
|
||||
//setupDataStore();
|
||||
//loadNavDrawer( courseAreaId, eventId);
|
||||
if (e == null) {
|
||||
ExLog.e(this, TAG, "Noooo the event is null :/");
|
||||
loadEvents();
|
||||
// setupDataStore();
|
||||
// loadNavDrawer( courseAreaId, eventId);
|
||||
} else {
|
||||
|
||||
|
||||
if (courseArea != null) {
|
||||
setupActionBar(courseArea);
|
||||
if (courseArea != null) {
|
||||
loadRaces(courseArea);
|
||||
ExLog.i(this, this.getClass().toString(), "did load courseArea!");
|
||||
} else {
|
||||
ExLog.i(this, this.getClass().toString(), "courseArea == null :(");
|
||||
ExLog.i(this, this.getClass().toString(), "courseArea == null :(");
|
||||
Toast.makeText(this, getString(R.string.racing_course_area_missing), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
loadNavDrawer( courseArea, e);
|
||||
loadWelcomeFragment(courseArea, e);
|
||||
|
||||
loadNavDrawer(courseArea, e);
|
||||
loadWelcomeFragment(courseArea, e);
|
||||
}
|
||||
|
||||
|
||||
// /CODE TO DEBUG
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void loadNavDrawer(CourseArea courseArea, EventBase event){
|
||||
String race = getResources().getString(R.string.nav_header)
|
||||
.replace("#AREA#", courseArea.getName())
|
||||
.replace("#EVENT#",event.getName())
|
||||
.replace("#AUTHOR#", preferences.getAuthor().getName());
|
||||
SpannableString string = new SpannableString(race);
|
||||
navDrawerFragment.setUp((DrawerLayout) findViewById(R.id.drawer_layout), string);
|
||||
}
|
||||
|
||||
private void loadWelcomeFragment(CourseArea courseArea, EventBase event){
|
||||
getFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.racing_view_container,
|
||||
new WelcomeFragment( event, courseArea, preferences.getAuthor()))
|
||||
.commit();
|
||||
|
||||
|
||||
private void loadNavDrawer(CourseArea courseArea, EventBase event) {
|
||||
String race = getResources().getString(R.string.nav_header).replace("#AREA#", courseArea.getName())
|
||||
.replace("#EVENT#", event.getName()).replace("#AUTHOR#", preferences.getAuthor().getName());
|
||||
SpannableString header = new SpannableString(race);
|
||||
StyleSpan spanBold = new StyleSpan(Typeface.BOLD);
|
||||
header.setSpan(spanBold, 0, event.getName().toString().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
navDrawerFragment.setUp((DrawerLayout) findViewById(R.id.drawer_layout), header);
|
||||
}
|
||||
|
||||
|
||||
private void loadWelcomeFragment(CourseArea courseArea, EventBase event) {
|
||||
getFragmentManager().beginTransaction()
|
||||
.replace(R.id.racing_view_container, new WelcomeFragment(event, courseArea, preferences.getAuthor()))
|
||||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNavigationDrawerItemSelected(RaceListDataType selectedItem) {
|
||||
if (selectedItem instanceof RaceListDataTypeRace) {
|
||||
@@ -453,7 +440,7 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
infoFragment.setArguments(RaceFragment.createArguments(managedRace));
|
||||
|
||||
getFragmentManager().beginTransaction()
|
||||
// .setCustomAnimations(R.animator.slide_in, R.animator.slide_out)
|
||||
// .setCustomAnimations(R.animator.slide_in, R.animator.slide_out)
|
||||
.replace(R.id.racing_view_container, infoFragment)
|
||||
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).addToBackStack(null).commit();
|
||||
}
|
||||
@@ -508,16 +495,21 @@ public class RacingActivity extends SessionActivity implements RaceInfoListener,
|
||||
}
|
||||
}
|
||||
|
||||
private void registerOnService(Collection<ManagedRace> races) {
|
||||
private void registerOnService(final Collection<ManagedRace> races) {
|
||||
// since the service is the long-living component
|
||||
// he should decide whether these races are already
|
||||
// registered or not.
|
||||
for (ManagedRace race : races) {
|
||||
Intent registerIntent = new Intent(this, RaceStateService.class);
|
||||
registerIntent.setAction(AppConstants.INTENT_ACTION_REGISTER_RACE);
|
||||
registerIntent.putExtra(AppConstants.RACE_ID_KEY, race.getId());
|
||||
this.startService(registerIntent);
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (ManagedRace race : races) {
|
||||
Intent registerIntent = new Intent(RacingActivity.this, RaceStateService.class);
|
||||
registerIntent.setAction(AppConstants.INTENT_ACTION_REGISTER_RACE);
|
||||
registerIntent.putExtra(AppConstants.RACE_ID_KEY, race.getId());
|
||||
RacingActivity.this.startService(registerIntent);
|
||||
}
|
||||
}
|
||||
}).run();
|
||||
}
|
||||
|
||||
public void replaceFragment(RaceFragment fragment) {
|
||||
|
||||
+4
-6
@@ -22,10 +22,8 @@ import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.gms.internal.mc;
|
||||
import com.sap.sailing.android.shared.util.ViewHolder;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.impl.MillisecondsTimePoint;
|
||||
@@ -61,7 +59,7 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
private LayoutInflater mInflater;
|
||||
private Resources mResources;
|
||||
private List<RaceListDataType> mShownViewItems;
|
||||
|
||||
|
||||
private ImageView update_badge;
|
||||
private LinearLayout race_flag;
|
||||
private TextView time;
|
||||
@@ -134,7 +132,7 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
dates = days + ":";
|
||||
}
|
||||
|
||||
dates += fill2((int) hrs) + ":";
|
||||
dates += (days != 0 || hrs != 0) ? fill2((int) hrs) + ":" : "";
|
||||
dates += fill2((int) min) + ":";
|
||||
dates += fill2((int) sec);
|
||||
|
||||
@@ -321,9 +319,9 @@ public class ManagedRaceListAdapter extends ArrayAdapter<RaceListDataType> imple
|
||||
flag_timer.setText(text.replace("-", ""));
|
||||
Drawable arrow;
|
||||
if (changePole.isDisplayed()) {
|
||||
arrow = getContext().getResources().getDrawable(R.drawable.ic_expand_less_grey600_18dp);
|
||||
arrow = getContext().getResources().getDrawable(R.drawable.arrow_up_small);
|
||||
} else {
|
||||
arrow = getContext().getResources().getDrawable(R.drawable.ic_expand_more_black_18dp);
|
||||
arrow = getContext().getResources().getDrawable(R.drawable.arrow_down_small);
|
||||
}
|
||||
arrow_direction.setImageBitmap(((BitmapDrawable) arrow).getBitmap());
|
||||
race_flag.setVisibility(View.VISIBLE);
|
||||
|
||||
+2
-1
@@ -158,7 +158,7 @@ public class NavigationDrawerFragment extends LoggableFragment implements OnItem
|
||||
break;
|
||||
|
||||
default:
|
||||
mCurrent.setTextColor(getResources().getColor(R.color.white));
|
||||
mCurrent.setTextColor(getResources().getColor(R.color.orange));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
mCurrent.setBackground(drawable);
|
||||
} else {
|
||||
@@ -339,6 +339,7 @@ public class NavigationDrawerFragment extends LoggableFragment implements OnItem
|
||||
|
||||
public void setUp(DrawerLayout drawerLayout, SpannableString header) {
|
||||
mDrawerLayout = drawerLayout;
|
||||
mDrawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
mDrawerToggle = new ActionBarDrawerToggle(getActivity(), mDrawerLayout, (Toolbar) getActivity().findViewById(
|
||||
R.id.toolbar), R.string.nav_drawer_open, R.string.nav_drawer_close) {
|
||||
@Override
|
||||
|
||||
+55
-57
@@ -29,22 +29,23 @@ import com.sap.sailing.racecommittee.app.ui.fragments.dialogs.LoadFailedDialog;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.lists.selection.ItemSelectedListener;
|
||||
import com.sap.sse.common.Named;
|
||||
|
||||
public abstract class NamedListFragment<T extends Named> extends LoggableListFragment implements LoadClient<Collection<T>> {
|
||||
|
||||
//private static String TAG = NamedListFragment.class.getName();
|
||||
public abstract class NamedListFragment<T extends Named> extends LoggableListFragment implements
|
||||
LoadClient<Collection<T>> {
|
||||
|
||||
private ItemSelectedListener<T> listener;
|
||||
// private static String TAG = NamedListFragment.class.getName();
|
||||
|
||||
private ItemSelectedListener<T> listener;
|
||||
private NamedArrayAdapter<T> listAdapter;
|
||||
private TextView txt_header;
|
||||
|
||||
private View lastSelected;
|
||||
private int mSelectedIndex = -1;
|
||||
|
||||
|
||||
protected ArrayList<T> namedList;
|
||||
|
||||
protected void addHeader() {
|
||||
txt_header.setText(getHeaderText());
|
||||
txt_header.setVisibility(View.VISIBLE);
|
||||
txt_header.setText(getHeaderText());
|
||||
txt_header.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
protected abstract ItemSelectedListener<T> attachListener(Activity activity);
|
||||
@@ -53,12 +54,11 @@ public abstract class NamedListFragment<T extends Named> extends LoggableListFra
|
||||
return new NamedArrayAdapter<T>(context, items);
|
||||
}
|
||||
|
||||
protected abstract LoaderCallbacks<DataLoaderResult<Collection<T>>> createLoaderCallbacks(ReadonlyDataManager manager);
|
||||
|
||||
protected abstract LoaderCallbacks<DataLoaderResult<Collection<T>>> createLoaderCallbacks(
|
||||
ReadonlyDataManager manager);
|
||||
|
||||
protected abstract String getHeaderText();
|
||||
|
||||
|
||||
|
||||
private void loadItems() {
|
||||
setListShown(false);
|
||||
setupLoader();
|
||||
@@ -72,29 +72,27 @@ public abstract class NamedListFragment<T extends Named> extends LoggableListFra
|
||||
|
||||
namedList = new ArrayList<T>();
|
||||
listAdapter = createAdapter(getActivity(), namedList);
|
||||
if (savedInstanceState != null){
|
||||
mSelectedIndex = savedInstanceState.getInt("position", -1);
|
||||
if ( mSelectedIndex >= 0 ){
|
||||
listAdapter.setSelected(mSelectedIndex);
|
||||
if (savedInstanceState != null) {
|
||||
mSelectedIndex = savedInstanceState.getInt("position", -1);
|
||||
if (mSelectedIndex >= 0) {
|
||||
listAdapter.setSelected(mSelectedIndex);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
this.getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
this.setListAdapter(listAdapter);
|
||||
getListView().setDivider(null);
|
||||
|
||||
|
||||
showProgressBar(true);
|
||||
loadItems();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
this.listener = attachListener(activity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View v = super.onCreateView(inflater, container, savedInstanceState);
|
||||
@@ -103,15 +101,15 @@ public abstract class NamedListFragment<T extends Named> extends LoggableListFra
|
||||
txt_header = (TextView) parent.findViewById(R.id.txt_listHeader);
|
||||
return parent;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||
super.onListItemClick(l, v, position, id);
|
||||
listAdapter.setSelected(position);
|
||||
setStyleClicked(v);
|
||||
|
||||
|
||||
mSelectedIndex = position;
|
||||
|
||||
|
||||
// this unchecked cast here seems unavoidable.
|
||||
// even SDK example code does it...
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -124,7 +122,7 @@ public abstract class NamedListFragment<T extends Named> extends LoggableListFra
|
||||
setListShown(true);
|
||||
namedList.clear();
|
||||
listAdapter.notifyDataSetChanged();
|
||||
|
||||
|
||||
showProgressBar(false);
|
||||
|
||||
String message = reason.getMessage();
|
||||
@@ -146,40 +144,40 @@ public abstract class NamedListFragment<T extends Named> extends LoggableListFra
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
outState.putInt("position", mSelectedIndex);
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
private void setStyleClicked(View v){
|
||||
// reset last styles:
|
||||
if ( lastSelected != null ){
|
||||
TextView lastText = (TextView)lastSelected.findViewById(R.id.txt_list_item);
|
||||
if ( lastText != null ){
|
||||
lastText.setTypeface(Typeface.DEFAULT);
|
||||
}
|
||||
|
||||
ImageView lastImg = (ImageView)lastSelected.findViewById(R.id.iv_check);
|
||||
if ( lastImg != null ){
|
||||
lastImg.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
// set new styles
|
||||
TextView txt_listitem = (TextView) v.findViewById(R.id.txt_list_item);
|
||||
if ( txt_listitem != null ){
|
||||
txt_listitem.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
}
|
||||
ImageView iv_check = (ImageView)v.findViewById(R.id.iv_check);
|
||||
if ( iv_check != null ){
|
||||
iv_check.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
lastSelected = v;
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
outState.putInt("position", mSelectedIndex);
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
public void setupLoader(){
|
||||
getLoaderManager().restartLoader(0, null, createLoaderCallbacks(OnlineDataManager.create(getActivity())));
|
||||
private void setStyleClicked(View v) {
|
||||
// reset last styles:
|
||||
if (lastSelected != null) {
|
||||
TextView lastText = (TextView) lastSelected.findViewById(R.id.txt_list_item);
|
||||
if (lastText != null) {
|
||||
lastText.setTypeface(Typeface.DEFAULT);
|
||||
}
|
||||
|
||||
ImageView lastImg = (ImageView) lastSelected.findViewById(R.id.iv_check);
|
||||
if (lastImg != null) {
|
||||
lastImg.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
// set new styles
|
||||
TextView txt_listitem = (TextView) v.findViewById(R.id.txt_list_item);
|
||||
if (txt_listitem != null) {
|
||||
txt_listitem.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
}
|
||||
ImageView iv_check = (ImageView) v.findViewById(R.id.iv_check);
|
||||
if (iv_check != null) {
|
||||
iv_check.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
lastSelected = v;
|
||||
}
|
||||
|
||||
public void setupLoader() {
|
||||
getLoaderManager().restartLoader(0, null, createLoaderCallbacks(OnlineDataManager.create(getActivity())));
|
||||
}
|
||||
|
||||
private void showLoadFailedDialog(String message) {
|
||||
|
||||
Reference in New Issue
Block a user