Merge pull request #1053 from Bars107/master

Fixes and updates for themes.
This commit is contained in:
vshcherb 2015-01-30 09:25:34 +01:00
commit 24d444d1eb
22 changed files with 122 additions and 64 deletions

View file

@ -141,8 +141,8 @@
<activity android:name="net.osmand.plus.activities.search.SearchActivity" android:label="@string/search_activity" /> <activity android:name="net.osmand.plus.activities.search.SearchActivity" android:label="@string/search_activity" />
<activity android:name="net.osmand.plus.activities.ShowRouteInfoActivity" android:label="@string/show_route" /> <activity android:name="net.osmand.plus.activities.ShowRouteInfoActivity" android:label="@string/show_route" />
<activity android:name="net.osmand.plus.activities.FavouritesListActivity" android:label="@string/favourites_list_activity" /> <activity android:name=".activities.FavoritesListActivity" android:label="@string/favourites_list_activity" />
<activity android:name="net.osmand.plus.activities.FavouritesActivity" android:windowSoftInputMode="adjustPan" /> <activity android:name=".activities.FavoritesActivity" android:windowSoftInputMode="adjustPan" />
<activity android:name="net.osmand.plus.activities.PluginsActivity" /> <activity android:name="net.osmand.plus.activities.PluginsActivity" />
<activity android:name="net.osmand.plus.activities.ContributionVersionActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/contribution_activity" /> <activity android:name="net.osmand.plus.activities.ContributionVersionActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/contribution_activity" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_marginTop="?attr/actionBarSize">
<TextView
android:id="@+id/DescriptionText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:text=""
android:visibility="gone" />
<ExpandableListView
android:id="@android:id/list"
style="@style/OsmandListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:groupIndicator="@android:color/transparent"/>
</LinearLayout>

View file

@ -67,6 +67,8 @@
<style name="OsmandLightTheme" parent="Theme.AppCompat.Light"> <style name="OsmandLightTheme" parent="Theme.AppCompat.Light">
<item name="expandable_category_color">@color/group_background</item> <item name="expandable_category_color">@color/group_background</item>
<item name="android:actionDropDownStyle">@style/Widget.LightSpinner</item>
<item name="actionDropDownStyle">@style/Widget.LightSpinner</item>
<item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light --> <item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light -->
<item name="windowActionBarOverlay">true</item> <item name="windowActionBarOverlay">true</item>
<item name="bottomToolBarColor">@color/tool_bar_light_color</item> <item name="bottomToolBarColor">@color/tool_bar_light_color</item>
@ -76,14 +78,22 @@
<item name="pstsTextColor">@color/color_white</item> <item name="pstsTextColor">@color/color_white</item>
<item name="android:actionModeBackground">@color/actionbar_light_color</item> <item name="android:actionModeBackground">@color/actionbar_light_color</item>
<item name="actionModeBackground">@color/actionbar_light_color</item> <item name="actionModeBackground">@color/actionbar_light_color</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item> <item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="android:actionModeCloseDrawable">@drawable/action_mode_back</item>
<item name="actionModeCloseDrawable">@drawable/action_mode_back</item>
<item name="android:actionModeStyle">@style/WhiteActionMode</item>
<item name="actionModeStyle">@style/WhiteActionMode</item>
<item name="android:actionMenuTextColor">@color/color_white</item>
<item name="actionMenuTextColor">@color/color_white</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
</style> </style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat"> <style name="OsmandDarkTheme" parent="Theme.AppCompat">
<item name="reset_image">@drawable/ic_action_delete_dark</item> <!-- @drawable/a_1_navigation_cancel_dark --> <item name="reset_image">@drawable/ic_action_delete_dark</item> <!-- @drawable/a_1_navigation_cancel_dark -->
<item name="android:actionDropDownStyle">@style/Widget.DarkActionSpinner</item>
<item name="actionDropDownStyle">@style/Widget.DarkActionSpinner</item>
<item name="expandable_category_color">?android:attr/colorBackground</item> <item name="expandable_category_color">?android:attr/colorBackground</item>
<item name="android:spinnerStyle">@style/Widget.Spinner</item> <item name="android:spinnerStyle">@style/Widget.DarkSpinner</item>
<item name="windowActionBarOverlay">true</item> <item name="windowActionBarOverlay">true</item>
<item name="bottomToolBarColor">@color/tool_bar_dark_color</item> <item name="bottomToolBarColor">@color/tool_bar_dark_color</item>
<item name="pstsTabBackground">@color/actionbar_dark_color</item> <item name="pstsTabBackground">@color/actionbar_dark_color</item>
@ -122,11 +132,30 @@
<item name="android:textColor">@color/color_white</item> <item name="android:textColor">@color/color_white</item>
</style> </style>
<style name="Widget.Spinner" parent="android:Widget"> <style name="Widget.DarkSpinner" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:colorBackground">@color/dashboard_black</item> <item name="android:popupBackground">@color/actionbar_dark_color</item>
<item name="android:clickable">true</item> <item name="android:textColor">@color/color_white</item>
</style> </style>
<style name="Widget.DarkActionSpinner" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:popupBackground">@color/actionbar_dark_color</item>
<item name="android:textColor">@color/color_white</item>
</style>
<style name="Widget.LightSpinner" parent="@style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:popupBackground">@color/actionbar_light_color</item>
<item name="android:textColor">@color/color_white</item>
</style>
<style name="WhiteActionMode" parent="@style/Widget.AppCompat.ActionMode">
<item name="android:titleTextStyle">@style/WhiteActionModeTitleTextStyle</item>
<item name="titleTextStyle">@style/WhiteActionModeTitleTextStyle</item>
</style>
<style name="WhiteActionModeTitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionMode.Title">
<item name="android:textColor">@color/color_white</item>
</style>
<!-- Dialog popup --> <!-- Dialog popup -->
<style name="Animations" /> <style name="Animations" />
<!-- PopDownMenu --> <!-- PopDownMenu -->

View file

@ -10,7 +10,7 @@ import net.osmand.IndexConstants;
import net.osmand.Location; import net.osmand.Location;
import net.osmand.data.LocationPoint; import net.osmand.data.LocationPoint;
import net.osmand.plus.activities.MainMenuActivity; import net.osmand.plus.activities.MainMenuActivity;
import net.osmand.plus.activities.FavouritesActivity; import net.osmand.plus.activities.FavoritesActivity;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.PluginsActivity; import net.osmand.plus.activities.PluginsActivity;
import net.osmand.plus.activities.SettingsActivity; import net.osmand.plus.activities.SettingsActivity;
@ -60,8 +60,8 @@ public class OsmAndAppCustomization {
return SearchActivity.class; return SearchActivity.class;
} }
public Class<FavouritesActivity> getFavoritesActivity(){ public Class<FavoritesActivity> getFavoritesActivity(){
return FavouritesActivity.class; return FavoritesActivity.class;
} }
public Class<MainMenuActivity> getMainMenuActivity() { public Class<MainMenuActivity> getMainMenuActivity() {

View file

@ -155,9 +155,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}); });
if (isOrientationPortrait()) { if (isOrientationPortrait()) {
menu = ((FavouritesActivity) getActivity()).getClearToolbar(true).getMenu(); menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu();
} else { } else {
((FavouritesActivity) getActivity()).getClearToolbar(false); ((FavoritesActivity) getActivity()).getClearToolbar(false);
} }
@ -242,12 +242,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
} }
public void showProgressBar() { public void showProgressBar() {
((FavouritesActivity)getActivity()).setSupportProgressBarIndeterminateVisibility(true); ((FavoritesActivity)getActivity()).setSupportProgressBarIndeterminateVisibility(true);
} }
public void hideProgressBar() { public void hideProgressBar() {
if (getActivity() != null){ if (getActivity() != null){
((FavouritesActivity)getActivity()).setSupportProgressBarIndeterminateVisibility(false); ((FavoritesActivity)getActivity()).setSupportProgressBarIndeterminateVisibility(false);
} }
} }
@ -262,7 +262,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
private void enableSelectionMode(boolean selectionMode) { private void enableSelectionMode(boolean selectionMode) {
this.selectionMode = selectionMode; this.selectionMode = selectionMode;
if (isOrientationPortrait()) { if (isOrientationPortrait()) {
((FavouritesActivity)getActivity()).setToolbarVisibility(!selectionMode); ((FavoritesActivity)getActivity()).setToolbarVisibility(!selectionMode);
} }
} }

View file

@ -32,7 +32,7 @@ import net.osmand.plus.views.controls.PagerSlidingTabStrip;
/** /**
* *
*/ */
public class FavouritesActivity extends TabActivity { public class FavoritesActivity extends TabActivity {
private static final String FAVOURITES_INFO = "FAVOURITES_INFO"; private static final String FAVOURITES_INFO = "FAVOURITES_INFO";
private static final String TRACKS = "TRACKS"; private static final String TRACKS = "TRACKS";
@ -67,7 +67,7 @@ public class FavouritesActivity extends TabActivity {
if(!hasGpx) { if(!hasGpx) {
setContentView(R.layout.search_activity_single); setContentView(R.layout.search_activity_single);
getSupportFragmentManager().beginTransaction().add(R.id.layout, new FavouritesTreeFragment()).commit(); getSupportFragmentManager().beginTransaction().add(R.id.layout, new FavoritesTreeFragment()).commit();
} else { } else {
setContentView(R.layout.tab_content); setContentView(R.layout.tab_content);
@ -77,7 +77,7 @@ public class FavouritesActivity extends TabActivity {
ViewPager mViewPager = (ViewPager) findViewById(R.id.pager); ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
List<TabItem> mTabs = new ArrayList<TabItem>(); List<TabItem> mTabs = new ArrayList<TabItem>();
mTabs.add(getTabIndicator(R.string.my_favorites, FavouritesTreeFragment.class)); mTabs.add(getTabIndicator(R.string.my_favorites, FavoritesTreeFragment.class));
mTabs.add(getTabIndicator(R.string.my_tracks, AvailableGPXFragment.class)); mTabs.add(getTabIndicator(R.string.my_tracks, AvailableGPXFragment.class));
mTabs.add(getTabIndicator(R.string.selected_track, SelectedGPXFragment.class)); mTabs.add(getTabIndicator(R.string.selected_track, SelectedGPXFragment.class));
@ -107,7 +107,7 @@ public class FavouritesActivity extends TabActivity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavouritesActivity.class,new Runnable() { ((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavoritesActivity.class,new Runnable() {
@Override @Override
public void run() { public void run() {
@ -119,7 +119,7 @@ public class FavouritesActivity extends TabActivity {
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavouritesActivity.class, null); ((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavoritesActivity.class, null);
} }
public void updateSelectedTracks() { public void updateSelectedTracks() {

View file

@ -5,7 +5,7 @@ import net.osmand.plus.OsmandApplication;
import android.os.Bundle; import android.os.Bundle;
public class FavouritesListActivity extends OsmandActionBarActivity { public class FavoritesListActivity extends OsmandActionBarActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -13,7 +13,7 @@ public class FavouritesListActivity extends OsmandActionBarActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (savedInstanceState == null) { if (savedInstanceState == null) {
// During initial setup, plug in the details fragment. // During initial setup, plug in the details fragment.
FavouritesListFragment details = new FavouritesListFragment(); FavoritesListFragment details = new FavoritesListFragment();
details.setArguments(getIntent().getExtras()); details.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(android.R.id.content, details).commit(); getSupportFragmentManager().beginTransaction().add(android.R.id.content, details).commit();
} }

View file

@ -37,7 +37,7 @@ import android.widget.TextView.BufferType;
/** /**
* *
*/ */
public class FavouritesListFragment extends ListFragment implements SearchActivityChild { public class FavoritesListFragment extends ListFragment implements SearchActivityChild {
public static final String SELECT_FAVORITE_POINT_INTENT_KEY = "SELECT_FAVORITE_POINT_INTENT_KEY"; public static final String SELECT_FAVORITE_POINT_INTENT_KEY = "SELECT_FAVORITE_POINT_INTENT_KEY";
public static final int SELECT_FAVORITE_POINT_RESULT_OK = 1; public static final int SELECT_FAVORITE_POINT_RESULT_OK = 1;

View file

@ -31,12 +31,10 @@ import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.base.FavoriteImageDrawable; import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.dialogs.DirectionsDialogs; import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.helpers.ColorDialogs; import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.plus.helpers.ScreenOrientationHelper; import net.osmand.plus.helpers.ScreenOrientationHelper;
import net.osmand.plus.helpers.WaypointDialogHelper;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
@ -64,7 +62,7 @@ import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
public class FavouritesTreeFragment extends OsmandExpandableListFragment { public class FavoritesTreeFragment extends OsmandExpandableListFragment {
public static final int SEARCH_ID = -1; public static final int SEARCH_ID = -1;
// public static final int EXPORT_ID = 0; // public static final int EXPORT_ID = 0;
@ -339,9 +337,9 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment {
boolean portrait = orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || boolean portrait = orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ||
orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT; orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
if (portrait) { if (portrait) {
menu = ((FavouritesActivity) getActivity()).getClearToolbar(true).getMenu(); menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu();
} else { } else {
((FavouritesActivity) getActivity()).getClearToolbar(false); ((FavoritesActivity) getActivity()).getClearToolbar(false);
} }
@ -374,7 +372,7 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment {
public boolean onCreateActionMode(ActionMode mode, Menu menu) { public boolean onCreateActionMode(ActionMode mode, Menu menu) {
enableSelectionMode(true); enableSelectionMode(true);
createMenuItem(menu, SELECT_DESTINATIONS_ACTION_MODE_ID, R.string.select_destination_and_intermediate_points, createMenuItem(menu, SELECT_DESTINATIONS_ACTION_MODE_ID, R.string.select_destination_and_intermediate_points,
R.drawable.ic_action_flage_light, R.drawable.ic_action_flage_dark, R.drawable.ic_action_flage_dark, R.drawable.ic_action_flage_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
favoritesSelected.clear(); favoritesSelected.clear();
groupsToDelete.clear(); groupsToDelete.clear();
@ -465,7 +463,7 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment {
private void enableSelectionMode(boolean selectionMode) { private void enableSelectionMode(boolean selectionMode) {
this.selectionMode = selectionMode; this.selectionMode = selectionMode;
((FavouritesActivity)getActivity()).setToolbarVisibility(!selectionMode); ((FavoritesActivity)getActivity()).setToolbarVisibility(!selectionMode);
} }
protected void openChangeGroupDialog(final FavoriteGroup group) { protected void openChangeGroupDialog(final FavoriteGroup group) {

View file

@ -144,6 +144,7 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
getMyApplication().applyTheme(this); getMyApplication().applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
haveHomeButton = false;
if (getIntent() != null) { if (getIntent() != null) {
Intent intent = getIntent(); Intent intent = getIntent();
if (intent.getExtras() != null && intent.getExtras().containsKey(APP_EXIT_KEY)) { if (intent.getExtras() != null && intent.getExtras().containsKey(APP_EXIT_KEY)) {

View file

@ -13,6 +13,8 @@ import net.osmand.plus.R;
*/ */
public class OsmandActionBarActivity extends ActionBarActivity { public class OsmandActionBarActivity extends ActionBarActivity {
protected boolean haveHomeButton = true;
//should be called after set content view //should be called after set content view
protected void setupHomeButton(){ protected void setupHomeButton(){
Drawable back = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha); Drawable back = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
@ -25,18 +27,24 @@ public class OsmandActionBarActivity extends ActionBarActivity {
@Override @Override
public void setContentView(int layoutResID) { public void setContentView(int layoutResID) {
super.setContentView(layoutResID); super.setContentView(layoutResID);
setupHomeButton(); if (haveHomeButton) {
setupHomeButton();
}
} }
@Override @Override
public void setContentView(View view) { public void setContentView(View view) {
super.setContentView(view); super.setContentView(view);
setupHomeButton(); if (haveHomeButton) {
setupHomeButton();
}
} }
@Override @Override
public void setContentView(View view, ViewGroup.LayoutParams params) { public void setContentView(View view, ViewGroup.LayoutParams params) {
super.setContentView(view, params); super.setContentView(view, params);
setupHomeButton(); if (haveHomeButton) {
setupHomeButton();
}
} }
} }

View file

@ -243,7 +243,7 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment {
@Override @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
((FavouritesActivity) getActivity()).getClearToolbar(false); ((FavoritesActivity) getActivity()).getClearToolbar(false);
// MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_light, // MenuItem mi = createMenuItem(menu, SEARCH_ID, R.string.search_poi_filter, R.drawable.ic_action_search_light,
// R.drawable.ic_action_search_dark, MenuItem.SHOW_AS_ACTION_ALWAYS // R.drawable.ic_action_search_dark, MenuItem.SHOW_AS_ACTION_ALWAYS
// | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); // | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);

View file

@ -40,8 +40,6 @@ public class SettingsActivity extends SettingsBaseActivity {
PreferenceScreen screen = getPreferenceScreen(); PreferenceScreen screen = getPreferenceScreen();
localIndexes =(Preference) screen.findPreference("local_indexes"); localIndexes =(Preference) screen.findPreference("local_indexes");
localIndexes.setOnPreferenceClickListener(this); localIndexes.setOnPreferenceClickListener(this);
// bidforfix = (Preference) screen.findPreference("bidforfix");
// bidforfix.setOnPreferenceClickListener(this);
plugins = (Preference) screen.findPreference("plugins"); plugins = (Preference) screen.findPreference("plugins");
plugins.setOnPreferenceClickListener(this); plugins.setOnPreferenceClickListener(this);
general = (Preference) screen.findPreference("general_settings"); general = (Preference) screen.findPreference("general_settings");

View file

@ -9,6 +9,8 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.preference.*; import android.preference.*;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.AdapterView; import android.widget.AdapterView;

View file

@ -16,8 +16,8 @@ import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.FavouritesListActivity; import net.osmand.plus.activities.FavoritesListActivity;
import net.osmand.plus.activities.FavouritesListFragment; import net.osmand.plus.activities.FavoritesListFragment;
import net.osmand.plus.activities.NavigatePointFragment; import net.osmand.plus.activities.NavigatePointFragment;
import net.osmand.plus.activities.TabActivity; import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.plus.views.controls.PagerSlidingTabStrip;
@ -171,7 +171,7 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
} else if(tab == TRANSPORT_TAB_INDEX) { } else if(tab == TRANSPORT_TAB_INDEX) {
return SearchTransportFragment.class; return SearchTransportFragment.class;
} else if(tab == FAVORITES_TAB_INDEX) { } else if(tab == FAVORITES_TAB_INDEX) {
return FavouritesListFragment.class; return FavoritesListFragment.class;
} }
return SearchPoiFilterFragment.class; return SearchPoiFilterFragment.class;
} }
@ -218,9 +218,9 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
if (position == POSITION_LAST_MAP_VIEW) { if (position == POSITION_LAST_MAP_VIEW) {
updateSearchPoint(settings.getLastKnownMapLocation(), getString(R.string.select_search_position) + " " + getString(R.string.search_position_map_view), false); updateSearchPoint(settings.getLastKnownMapLocation(), getString(R.string.select_search_position) + " " + getString(R.string.search_position_map_view), false);
} else if (position == POSITION_FAVORITES) { } else if (position == POSITION_FAVORITES) {
Intent intent = new Intent(SearchActivity.this, FavouritesListActivity.class); Intent intent = new Intent(SearchActivity.this, FavoritesListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra(FavouritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY, (Serializable) null); intent.putExtra(FavoritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY, (Serializable) null);
startActivityForResult(intent, REQUEST_FAVORITE_SELECT); startActivityForResult(intent, REQUEST_FAVORITE_SELECT);
getSupportActionBar().setSelectedNavigationItem(0); getSupportActionBar().setSelectedNavigationItem(0);
} else if (position == POSITION_ADDRESS) { } else if (position == POSITION_ADDRESS) {
@ -249,8 +249,8 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
if(requestCode == REQUEST_FAVORITE_SELECT && resultCode == FavouritesListFragment.SELECT_FAVORITE_POINT_RESULT_OK){ if(requestCode == REQUEST_FAVORITE_SELECT && resultCode == FavoritesListFragment.SELECT_FAVORITE_POINT_RESULT_OK){
FavouritePoint p = (FavouritePoint) data.getSerializableExtra(FavouritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY); FavouritePoint p = (FavouritePoint) data.getSerializableExtra(FavoritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY);
if (p != null) { if (p != null) {
LatLon latLon = new LatLon(p.getLatitude(), p.getLongitude()); LatLon latLon = new LatLon(p.getLatitude(), p.getLongitude());
updateSearchPoint(latLon, getString(R.string.select_search_position) + " " + p.getName(), false); updateSearchPoint(latLon, getString(R.string.select_search_position) + " " + p.getName(), false);

View file

@ -138,7 +138,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
new OsMoIntentHandler(app, osMoPlugin).execute(getIntent()); new OsMoIntentHandler(app, osMoPlugin).execute(getIntent());
} }
} }
setContentView(R.layout.expandable_list); setContentView(R.layout.osmo_group_list);
getSupportActionBar().setTitle(R.string.osmo_activity); getSupportActionBar().setTitle(R.string.osmo_activity);
setSupportProgressBarIndeterminateVisibility(false); setSupportProgressBarIndeterminateVisibility(false);
setupHeader(); setupHeader();
@ -952,13 +952,13 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
0, 0,/*R.drawable.ic_action_marker_light,*/ 0, 0,/*R.drawable.ic_action_marker_light,*/
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
createMenuItem(menu, SHARE_SESSION, R.string.osmo_share_session, createMenuItem(menu, SHARE_SESSION, R.string.osmo_share_session,
R.drawable.ic_action_gshare_light, R.drawable.ic_action_gshare_dark, R.drawable.ic_action_gshare_dark, R.drawable.ic_action_gshare_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
createMenuItem(menu, CREATE_GROUP, R.string.osmo_create_group, createMenuItem(menu, CREATE_GROUP, R.string.osmo_create_group,
R.drawable.ic_action_plus_light, R.drawable.ic_action_plus_dark, R.drawable.ic_action_plus_dark, R.drawable.ic_action_plus_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
createMenuItem(menu, SETTINGS_ID, R.string.settings, createMenuItem(menu, SETTINGS_ID, R.string.settings,
R.drawable.ic_action_settings_light, R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_dark,
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
return super.onCreateOptionsMenu(menu); return super.onCreateOptionsMenu(menu);
} }

View file

@ -3,13 +3,10 @@ package net.osmand.plus.views.controls;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import android.graphics.Point;
import android.os.SystemClock;
import android.view.*; import android.view.*;
import net.osmand.data.FavouritePoint; import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.RotatedTileBox; import net.osmand.data.RotatedTileBox;
import net.osmand.data.RotatedTileBox.RotatedTileBoxBuilder;
import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
@ -17,8 +14,7 @@ import net.osmand.plus.development.OsmandDevelopmentPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.FavouritesListFragment.FavouritesAdapter; import net.osmand.plus.activities.FavoritesListFragment.FavouritesAdapter;
import net.osmand.plus.activities.IntermediatePointsDialog;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.ShowRouteInfoActivity; import net.osmand.plus.activities.ShowRouteInfoActivity;
import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RouteDirectionInfo;

View file

@ -43,6 +43,7 @@ import android.widget.HorizontalScrollView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.helpers.FontCache;
import java.util.Locale; import java.util.Locale;
@ -50,7 +51,7 @@ import java.util.Locale;
public class PagerSlidingTabStrip extends HorizontalScrollView { public class PagerSlidingTabStrip extends HorizontalScrollView {
private static final float OPAQUE = 1.0f; private static final float OPAQUE = 1.0f;
private static final float HALF_TRANSP = 0.5f; private static final float HALF_TRANSP = 0.6f;
public interface CustomTabProvider { public interface CustomTabProvider {
public View getCustomTabView(ViewGroup parent, int position); public View getCustomTabView(ViewGroup parent, int position);
@ -110,7 +111,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
private int tabPadding = 12; private int tabPadding = 12;
private int tabTextSize = 14; private int tabTextSize = 14;
private int tabTextColor = 0; private int tabTextColor = 0;
private float tabTextAlpha = OPAQUE; private float tabTextAlpha = HALF_TRANSP;
private float tabTextSelectedAlpha = OPAQUE; private float tabTextSelectedAlpha = OPAQUE;
private int padding = 0; private int padding = 0;
@ -120,8 +121,8 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
private boolean isPaddingMiddle = false; private boolean isPaddingMiddle = false;
private Typeface tabTypeface = null; private Typeface tabTypeface = null;
private int tabTypefaceStyle = Typeface.BOLD; private int tabTypefaceStyle = Typeface.NORMAL;
private int tabTypefaceSelectedStyle = Typeface.BOLD; private int tabTypefaceSelectedStyle = Typeface.NORMAL;
private int scrollOffset; private int scrollOffset;
private int lastScrollX = 0; private int lastScrollX = 0;
@ -159,13 +160,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
// get system attrs (android:textSize and android:textColor) // get system attrs (android:textSize and android:textColor)
TypedArray a = context.obtainStyledAttributes(attrs, ATTRS); TypedArray a = context.obtainStyledAttributes(attrs, ATTRS);
tabTextSize = a.getDimensionPixelSize(TEXT_SIZE_INDEX, tabTextSize); tabTextSize = a.getDimensionPixelSize(TEXT_SIZE_INDEX, tabTextSize);
ColorStateList colorStateList = a.getColorStateList(TEXT_COLOR_INDEX);
int textPrimaryColor = a.getColor(TEXT_COLOR_PRIMARY, android.R.color.white); int textPrimaryColor = a.getColor(TEXT_COLOR_PRIMARY, android.R.color.white);
// if (colorStateList != null) {
// tabTextColor = colorStateList;
// } else {
// tabTextColor = getColorStateList(textPrimaryColor);
// }
underlineColor = textPrimaryColor; underlineColor = textPrimaryColor;
dividerColor = textPrimaryColor; dividerColor = textPrimaryColor;
@ -195,8 +190,9 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
isPaddingMiddle = a.getBoolean(R.styleable.PagerSlidingTabStrip_pstsPaddingMiddle, isPaddingMiddle); isPaddingMiddle = a.getBoolean(R.styleable.PagerSlidingTabStrip_pstsPaddingMiddle, isPaddingMiddle);
tabTypefaceStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextStyle, Typeface.BOLD); tabTypefaceStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextStyle, Typeface.BOLD);
tabTypefaceSelectedStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextSelectedStyle, Typeface.BOLD); tabTypefaceSelectedStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextSelectedStyle, Typeface.BOLD);
tabTextAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextAlpha, OPAQUE); tabTextAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextAlpha, HALF_TRANSP);
tabTextSelectedAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextSelectedAlpha, OPAQUE); tabTextSelectedAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextSelectedAlpha, OPAQUE);
tabTypeface = FontCache.getRobotoMedium(context);
a.recycle(); a.recycle();
setMarginBottomTabContainer(); setMarginBottomTabContainer();