mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 09:41:00 +00:00
# action bar is used for title showing running course area (more space for races)
# prepared filtering via action bar # simplified some layout code (a lot of work left...) and removed obsolete TwoPaneActivity
This commit is contained in:
1 parent
b2cd8efc12
commit
4bf84356ad
20 files changed
+171
-164
No files matched your search
BIN
Binary file not shown.
|
After Width: | Height: | Size: 306 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 302 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 331 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 352 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 420 B |
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/spinner_disabled_holo_dark" />
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/spinner_pressed_holo_dark" />
|
||||
<item android:state_pressed="false" android:state_focused="true"
|
||||
android:drawable="@drawable/spinner_focused_holo_dark" />
|
||||
<item android:drawable="@drawable/spinner_default_holo_dark" />
|
||||
</selector>
|
||||
@@ -1,19 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:left="@dimen/tab_space" android:right="@dimen/tab_space">
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<gradient android:angle="-90" android:startColor="@color/tabMedium"
|
||||
android:endColor="@color/tabDark" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
<!--
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item
|
||||
android:left="@dimen/tab_space"
|
||||
android:right="@dimen/tab_space">
|
||||
<shape android:shape="rectangle" >
|
||||
<gradient
|
||||
android:angle="-90"
|
||||
android:endColor="@color/tabDark"
|
||||
android:startColor="@color/tabMedium" />
|
||||
</shape>
|
||||
</item>
|
||||
<!--
|
||||
<item android:top="1sp" android:bottom="26sp" >
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/tabTransparent"/>
|
||||
</shape>
|
||||
|
||||
</item> -->
|
||||
</item>
|
||||
-->
|
||||
|
||||
</layer-list>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/spinnerText"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/welter_light_gray"
|
||||
android:textIsSelectable="false"
|
||||
android:textSize="16sp" />
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:drawSelectorOnTop="false" />
|
||||
android:drawSelectorOnTop="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@id/android:empty"
|
||||
@@ -7,42 +7,26 @@
|
||||
android:baselineAligned="false"
|
||||
android:background="@drawable/background" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="0.5">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/leftContainer"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_left_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.5">
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="0.99"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/welter_deep_gray">
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rightLayout"
|
||||
android:visibility="invisible"
|
||||
<FrameLayout
|
||||
android:id="@+id/login_view_right_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="0.5">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/rightContainer"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -7,29 +7,11 @@
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<RelativeLayout
|
||||
<FrameLayout
|
||||
android:id="@+id/racing_view_left_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.70"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/welter_extralight_gray_transparent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textListHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dip"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textIsSelectable="false"
|
||||
android:textAppearance="@style/TextAppearance.Welter.BigTitleLabel" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/races_and_details_left"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@+id/textListHeader" />
|
||||
|
||||
</RelativeLayout>
|
||||
android:layout_weight="0.70" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -38,18 +20,10 @@
|
||||
android:background="@color/welter_deep_gray"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rightLayout"
|
||||
<FrameLayout
|
||||
android:id="@+id/racing_view_right_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.30"
|
||||
android:orientation="vertical"
|
||||
android:visibility="invisible" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/races_and_details_right"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
</LinearLayout>
|
||||
android:layout_weight="0.30" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -3,7 +3,7 @@
|
||||
<item android:id="@+id/options_menu_live"
|
||||
android:icon="@drawable/ic_menu_share_local"
|
||||
android:title="@string/options_menu_live"
|
||||
android:showAsAction="always" />
|
||||
android:showAsAction="ifRoom" />
|
||||
<item android:id="@+id/options_menu_wind"
|
||||
android:icon="@drawable/ic_menu_btn_wind"
|
||||
android:title="@string/options_menu_wind"
|
||||
|
||||
@@ -6,10 +6,15 @@
|
||||
<item name="android:layout">@layout/welter_timepicker</item>
|
||||
</style>
|
||||
-->
|
||||
|
||||
<style name="MyDropDownNav" parent="@android:style/Widget.Holo.Light.Spinner">
|
||||
<item name="android:background">@drawable/spinner_background_holo_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.ActionBar" parent="@android:style/Widget.Holo.ActionBar">
|
||||
<style name="Widget.Welter.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
|
||||
<item name="android:background">@drawable/title_bar_bg</item>
|
||||
<item name="android:titleTextStyle">@style/Welter.ActionBar.TitleTextStyle</item>
|
||||
<item name="android:textStyle">@style/Welter.ActionBar.TitleTextStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="Welter.ActionBar.TitleTextStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<style name="Theme.DimDisabledDialog" parent="Theme.Welter">
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
<style name="Theme.DimDisabledDialog" parent="Theme.Welter">
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Welter" parent="android:Theme.Holo.Light">
|
||||
<item name="android:actionBarStyle">@style/Widget.ActionBar</item>
|
||||
<item name="android:actionDropDownStyle">@style/MyDropDownNav</item>
|
||||
<item name="android:actionBarStyle">@style/Widget.Welter.ActionBar</item>
|
||||
<item name="android:textColorPrimary">@color/welter_deep_gray</item>
|
||||
|
||||
<!--
|
||||
<item name="timePickerStyle">@style/Widget.TimePicker</item>
|
||||
-->
|
||||
|
||||
<!--
|
||||
|
||||
<!-- <item name="timePickerStyle">@style/Widget.TimePicker</item> -->
|
||||
|
||||
|
||||
<!--
|
||||
<item name="android:textColorSecondary">@color/welter_white</item>
|
||||
<item name="android:textColorTertiary">@color/welter_white</item>
|
||||
<item name="android:textColorPrimaryInverse">@color/welter_white</item>
|
||||
@@ -34,10 +34,11 @@
|
||||
<item name="android:textColorHighlightInverse">@color/welter_white</item>
|
||||
<item name="android:textColorLink">@color/welter_white</item>
|
||||
<item name="android:textColorLinkInverse">@color/welter_white</item>
|
||||
<item name="android:textColorAlertDialogListItem">@color/welter_white</item>
|
||||
<item name="android:textColorAlertDialogListItem">@color/welter_white</item>␍␍
|
||||
-->
|
||||
|
||||
<!--
|
||||
|
||||
|
||||
<!--
|
||||
<item name="android:windowTitleStyle">@style/WindowTitle.Welter</item>
|
||||
<item name="android:windowTitleSize">@dimen/Welter.TitleBarSize</item>
|
||||
<item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground.Welter</item>
|
||||
@@ -45,9 +46,10 @@
|
||||
<item name="android:listViewStyle">@style/Widget.ListView.Welter</item>
|
||||
item name="android:windowNoTitle">true</item
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:tabWidgetStyle">@style/LightTabWidget</item>
|
||||
<item name="android:tabWidgetStyle">@style/LightTabWidget</item>␍␍
|
||||
-->
|
||||
</style>
|
||||
<style name="Theme" parent="android:Theme.Light.NoTitleBar">
|
||||
</style>
|
||||
</resources>
|
||||
</style>
|
||||
|
||||
<style name="Theme" parent="android:Theme.Light.NoTitleBar"></style>
|
||||
|
||||
</resources>
|
||||
+3
-5
@@ -6,7 +6,6 @@ import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -23,7 +22,7 @@ import com.sap.sailing.racecommittee.app.ui.fragments.lists.selection.CourseArea
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.lists.selection.EventSelectedListenerHost;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.lists.selection.ItemSelectedListener;
|
||||
|
||||
public class LoginActivity extends TwoPaneActivity implements EventSelectedListenerHost,
|
||||
public class LoginActivity extends BaseActivity implements EventSelectedListenerHost,
|
||||
CourseAreaSelectedListenerHost, DialogFragmentButtonListener {
|
||||
private final static String TAG = LoginActivity.class.getName();
|
||||
|
||||
@@ -54,7 +53,7 @@ public class LoginActivity extends TwoPaneActivity implements EventSelectedListe
|
||||
|
||||
private void addEventListFragment() {
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.add(R.id.leftContainer, new EventListFragment());
|
||||
transaction.add(R.id.login_view_left_container, new EventListFragment());
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_NONE);
|
||||
transaction.commit();
|
||||
}
|
||||
@@ -67,7 +66,7 @@ public class LoginActivity extends TwoPaneActivity implements EventSelectedListe
|
||||
fragment.setArguments(args);
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.setCustomAnimations(R.animator.slide_in, R.animator.slide_out);
|
||||
transaction.replace(R.id.rightContainer, fragment);
|
||||
transaction.replace(R.id.login_view_right_container, fragment);
|
||||
transaction.commit();
|
||||
ExLog.i("LoginActivity", "CourseFragment created.");
|
||||
}
|
||||
@@ -87,7 +86,6 @@ public class LoginActivity extends TwoPaneActivity implements EventSelectedListe
|
||||
|
||||
private void showCourseAreaListFragment(Serializable eventId) {
|
||||
Toast.makeText(LoginActivity.this, eventId.toString(), Toast.LENGTH_LONG).show();
|
||||
getRightLayout().setVisibility(View.VISIBLE);
|
||||
addCourseAreaListFragment(eventId);
|
||||
}
|
||||
|
||||
|
||||
+47
-31
@@ -3,6 +3,8 @@ package com.sap.sailing.racecommittee.app.ui.activities;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.ActionBar.OnNavigationListener;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
@@ -10,9 +12,8 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.sap.sailing.domain.base.CourseArea;
|
||||
@@ -28,18 +29,18 @@ import com.sap.sailing.racecommittee.app.ui.fragments.dialogs.CourseDesignListen
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.lists.ManagedRaceListFragment;
|
||||
import com.sap.sailing.racecommittee.app.ui.fragments.raceinfo.RaceInfoListener;
|
||||
|
||||
public class RacingActivity extends TwoPaneActivity implements RaceInfoListener, CourseDesignListener /*
|
||||
* implements
|
||||
* ResetTimeListener
|
||||
* ,
|
||||
* StartModeSelectionListener
|
||||
* ,
|
||||
* PathfinderSelectionListener
|
||||
* ,
|
||||
* GateLineOpeningTimeSelectionListener
|
||||
* ,
|
||||
* CourseDesignSelectionListener
|
||||
*/{
|
||||
public class RacingActivity extends BaseActivity implements RaceInfoListener, CourseDesignListener /*
|
||||
* implements
|
||||
* ResetTimeListener
|
||||
* ,
|
||||
* StartModeSelectionListener
|
||||
* ,
|
||||
* PathfinderSelectionListener
|
||||
* ,
|
||||
* GateLineOpeningTimeSelectionListener
|
||||
* ,
|
||||
* CourseDesignSelectionListener
|
||||
*/{
|
||||
// private final static String TAG = RacingActivity.class.getName();
|
||||
|
||||
private final static String ListFragmentTag = RacingActivity.class.getName() + ".ManagedRaceListFragment";
|
||||
@@ -47,7 +48,7 @@ public class RacingActivity extends TwoPaneActivity implements RaceInfoListener,
|
||||
/**
|
||||
* Selection list of all races
|
||||
*/
|
||||
private ManagedRaceListFragment listFragment;
|
||||
private ManagedRaceListFragment raceListFragment;
|
||||
|
||||
/**
|
||||
* Container fragment for currently selected race
|
||||
@@ -66,16 +67,15 @@ public class RacingActivity extends TwoPaneActivity implements RaceInfoListener,
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
// features must be requested before anything else
|
||||
getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
dataManager = DataManager.create(this);
|
||||
|
||||
setContentView(R.layout.racing_view);
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
|
||||
listFragment = getOrCreateListFragment();
|
||||
raceListFragment = getOrCreateRaceListFragment();
|
||||
|
||||
Serializable courseAreaId = getCourseAreaIdFromIntent();
|
||||
if (courseAreaId == null) {
|
||||
@@ -86,26 +86,26 @@ public class RacingActivity extends TwoPaneActivity implements RaceInfoListener,
|
||||
throw new IllegalStateException("Course Area was not found.");
|
||||
}
|
||||
|
||||
setupTitle(courseArea);
|
||||
setupActionBar(courseArea);
|
||||
// unload and unregister from aaaaaaall races here!
|
||||
unloadAllRaces();
|
||||
loadRaces(courseArea);
|
||||
// StaticVibrator.prepareVibrator(this);
|
||||
}
|
||||
|
||||
private ManagedRaceListFragment getOrCreateListFragment() {
|
||||
private ManagedRaceListFragment getOrCreateRaceListFragment() {
|
||||
Fragment fragment = getFragmentManager().findFragmentByTag(ListFragmentTag);
|
||||
// on first create add race list fragment
|
||||
if (fragment == null) {
|
||||
fragment = createListFragment();
|
||||
fragment = createRaceListFragment();
|
||||
}
|
||||
return (ManagedRaceListFragment) fragment;
|
||||
}
|
||||
|
||||
private Fragment createListFragment() {
|
||||
private Fragment createRaceListFragment() {
|
||||
Fragment fragment = new ManagedRaceListFragment();
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.add(R.id.races_and_details_left, fragment, ListFragmentTag);
|
||||
transaction.add(R.id.racing_view_left_container, fragment, ListFragmentTag);
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_NONE);
|
||||
transaction.commit();
|
||||
return fragment;
|
||||
@@ -129,9 +129,26 @@ public class RacingActivity extends TwoPaneActivity implements RaceInfoListener,
|
||||
return courseId;
|
||||
}
|
||||
|
||||
private void setupTitle(CourseArea courseArea) {
|
||||
TextView label = (TextView) findViewById(R.id.textListHeader);
|
||||
label.setText(String.format(getString(R.string.racingview_header), courseArea.getName()));
|
||||
private void setupActionBar(CourseArea courseArea) {
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
actionBar.setTitle(String.format(getString(R.string.racingview_header), courseArea.getName()));
|
||||
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
|
||||
ArrayAdapter<ManagedRaceListFragment.FilterMode> adapter = new ArrayAdapter<ManagedRaceListFragment.FilterMode>(
|
||||
this, R.layout.action_bar_spinner_item);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter.addAll(ManagedRaceListFragment.FilterMode.values());
|
||||
actionBar.setListNavigationCallbacks(adapter, new OnNavigationListener() {
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
|
||||
Toast.makeText(RacingActivity.this, itemPosition + " | " + itemId, Toast.LENGTH_LONG).show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void unloadAllRaces() {
|
||||
@@ -157,7 +174,7 @@ public class RacingActivity extends TwoPaneActivity implements RaceInfoListener,
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
|
||||
registerOnService(data);
|
||||
listFragment.setupOn(data);
|
||||
raceListFragment.setupOn(data);
|
||||
|
||||
Toast.makeText(RacingActivity.this, "Loaded " + data.size() + " races for course " + courseArea.getId(),
|
||||
Toast.LENGTH_LONG).show();
|
||||
@@ -203,16 +220,15 @@ public class RacingActivity extends TwoPaneActivity implements RaceInfoListener,
|
||||
if (infoFragment != null && infoFragment.getRace().equals(managedRace)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
infoFragment = new RaceInfoFragment();
|
||||
infoFragment.setArguments(RaceFragment.createArguments(managedRace));
|
||||
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
transaction.setCustomAnimations(R.animator.slide_in, R.animator.slide_out);
|
||||
transaction.replace(R.id.races_and_details_right, infoFragment);
|
||||
transaction.replace(R.id.racing_view_right_container, infoFragment);
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
|
||||
transaction.commit();
|
||||
getRightLayout().setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void onResetTime() {
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.activities;
|
||||
|
||||
import com.sap.sailing.racecommittee.app.R;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* A two-pane activity - saves the visibility state of the right pane.
|
||||
*/
|
||||
public class TwoPaneActivity extends BaseActivity {
|
||||
|
||||
private final static String VisibilityTag = TwoPaneActivity.class.getName() + ".rightlayoutvisibility";
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
if (savedInstanceState != null) {
|
||||
if (savedInstanceState.getBoolean(VisibilityTag)) {
|
||||
getRightLayout().setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putBoolean(VisibilityTag, getRightLayout().getVisibility() == View.VISIBLE);
|
||||
}
|
||||
|
||||
protected View getRightLayout() {
|
||||
return findViewById(R.id.rightLayout);
|
||||
}
|
||||
}
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.racecommittee.app.ui.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Context;
|
||||
|
||||
+24
@@ -11,7 +11,9 @@ import java.util.TreeMap;
|
||||
|
||||
import android.app.ListFragment;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
|
||||
@@ -34,6 +36,23 @@ import com.sap.sailing.racecommittee.app.ui.comparators.BoatClassSeriesBaseFleet
|
||||
import com.sap.sailing.racecommittee.app.ui.comparators.NamedRaceComparator;
|
||||
|
||||
public class ManagedRaceListFragment extends ListFragment implements JuryFlagClickedListener, RaceStateChangedListener {
|
||||
|
||||
public enum FilterMode {
|
||||
ALL("Show all"),
|
||||
ACTIVE("Show active");
|
||||
|
||||
private String displayName;
|
||||
|
||||
private FilterMode(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Serializable selectedRaceId;
|
||||
private HashMap<Serializable, ManagedRace> managedRacesById;
|
||||
@@ -47,6 +66,11 @@ public class ManagedRaceListFragment extends ListFragment implements JuryFlagCli
|
||||
this.managedRacesById = new HashMap<Serializable, ManagedRace>();
|
||||
this.raceDataTypeList = new ArrayList<RaceListDataType>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.list_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public abstract class NamedListFragment<T extends Named> extends ListFragment im
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.named_list_fragment, container, false);
|
||||
return inflater.inflate(R.layout.list_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user