diff --git a/OsmAnd/res/layout/dash_plugin_item.xml b/OsmAnd/res/layout/dash_plugin_item.xml
index ac296c3c05..46532ea266 100644
--- a/OsmAnd/res/layout/dash_plugin_item.xml
+++ b/OsmAnd/res/layout/dash_plugin_item.xml
@@ -1,35 +1,47 @@
-
-
-
-
-
-
-
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavouritesListFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavouritesListFragment.java
index 7e56826c40..b0d1f70c1c 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavouritesListFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavouritesListFragment.java
@@ -17,6 +17,7 @@ import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.dialogs.DirectionsDialogs;
+import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import android.app.Activity;
import android.content.Intent;
@@ -164,7 +165,10 @@ public class FavouritesListFragment extends SherlockListFragment implements Sear
}
public String getName(FavouritePoint model){
- return model.getCategory() + " : " + model.getName();
+ if(Algorithms.isEmpty(model.getCategory())) {
+ return model.getName();
+ }
+ return model.getCategory() + ": " + model.getName();
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index cbe2ad4153..59cad43da4 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -680,6 +680,17 @@ public class MapActivityActions implements DialogProvider {
final OsmandApplication app = mapActivity.getMyApplication();
ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter(app);
currentDrawer = DrawerType.MAIN_MENU;
+
+ optionsMenuHelper.item(R.string.home_button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
+ .listen(new OnContextMenuClick() {
+ @Override
+ public boolean onContextMenuClick(ArrayAdapter> adapter, int itemId, int pos, boolean isChecked) {
+ Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getMainMenuActivity());
+ newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ mapActivity.startActivity(newIntent);
+ return true;
+ }
+ }).reg();
// 1. Where am I
optionsMenuHelper.item(R.string.where_am_i).
@@ -886,7 +897,7 @@ public class MapActivityActions implements DialogProvider {
}
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);
- optionsMenuHelper.item(R.string.home_button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
+ optionsMenuHelper.item(R.string.exit_Button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light )
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter> adapter, int itemId, int pos, boolean isChecked) {
@@ -894,7 +905,7 @@ public class MapActivityActions implements DialogProvider {
Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getMainMenuActivity());
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// not exit
- // newIntent.putExtra(DashboardActivity.APP_EXIT_KEY, DashboardActivity.APP_EXIT_CODE);
+ newIntent.putExtra(MainMenuActivity.APP_EXIT_KEY, MainMenuActivity.APP_EXIT_CODE);
mapActivity.startActivity(newIntent);
// In future when map will be main screen this should change
// app.closeApplication(mapActivity);
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java
index cbe8b65169..fab5215a23 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java
@@ -33,6 +33,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
@@ -67,6 +68,7 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo
public static final String SEARCH_LAT = "net.osmand.search_lat"; //$NON-NLS-1$
public static final String SEARCH_LON = "net.osmand.search_lon"; //$NON-NLS-1$
+ public static final String SHOW_ONLY_ONE_TAB = "SHOW_ONLY_ONE_TAB"; //$NON-NLS-1$
Button searchPOIButton;
private LatLon searchPoint = null;
@@ -78,8 +80,7 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo
private OsmandSettings settings;
private TabsAdapter mTabsAdapter;
List> fragList = new ArrayList>();
-
-
+ private boolean showOnlyOneTab;
public interface SearchActivityChild {
@@ -106,37 +107,55 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo
setContentView(R.layout.search_main);
settings = ((OsmandApplication) getApplication()).getSettings();
Integer tab = settings.SEARCH_TAB.get();
+ showOnlyOneTab = getIntent() != null && getIntent().getBooleanExtra(SHOW_ONLY_ONE_TAB, false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("");
// getSupportActionBar().setTitle(R.string.select_search_position);
-
- final TextView tabinfo = (TextView) findViewById(R.id.textViewADesc);
- TabWidget tabs = (TabWidget) findViewById(android.R.id.tabs);
- tabs.setBackgroundResource(R.drawable.tab_icon_background);
-
- TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
- tabHost.setup();
-
- ViewPager mViewPager = (ViewPager)findViewById(R.id.pager);
- mTabsAdapter = new TabsAdapter(this, tabHost, tabinfo, mViewPager, settings);
- TabSpec poiTab = tabHost.newTabSpec(SEARCH_POI).setIndicator(getTabIndicator(tabHost, R.drawable.tab_search_poi_icon, R.string.poi));
- mTabsAdapter.addTab(poiTab, SearchPoiFilterActivity.class, null);
-
- TabSpec addressSpec = tabHost.newTabSpec(SEARCH_ADDRESS).setIndicator(
- getTabIndicator(tabHost, R.drawable.tab_search_address_icon, R.string.address));
- mTabsAdapter.addTab(addressSpec, searchOnLine? SearchAddressOnlineFragment.class : SearchAddressFragment.class, null);
- // mTabsAdapter.addTab(addressSpec, SearchAddressOnlineActivity.class, null);
- TabSpec locationTab = tabHost.newTabSpec(SEARCH_LOCATION).setIndicator(getTabIndicator(tabHost, R.drawable.tab_search_location_icon, R.string.search_tabs_location));
- mTabsAdapter.addTab(locationTab, NavigatePointFragment.class, null);
- TabSpec favoriteTab = tabHost.newTabSpec(SEARCH_FAVORITES).setIndicator(getTabIndicator(tabHost, R.drawable.tab_search_favorites_icon, R.string.favorite));
- mTabsAdapter.addTab(favoriteTab, FavouritesListFragment.class, null);
- TabSpec historyTab = tabHost.newTabSpec(SEARCH_HISTORY).setIndicator(getTabIndicator(tabHost, R.drawable.tab_search_history_icon, R.string.history));
- mTabsAdapter.addTab(historyTab, SearchHistoryFragment.class, null);
- TabSpec transportTab = tabHost.newTabSpec(SEARCH_TRANSPORT).setIndicator(getTabIndicator(tabHost, R.drawable.tab_search_transport_icon, R.string.transport));
- mTabsAdapter.addTab(transportTab, SearchTransportFragment.class, null);
- tabHost.setCurrentTab(tab);
+
+ if (!showOnlyOneTab) {
+ final TextView tabinfo = (TextView) findViewById(R.id.textViewADesc);
+ TabWidget tabs = (TabWidget) findViewById(android.R.id.tabs);
+ tabs.setBackgroundResource(R.drawable.tab_icon_background);
+
+ TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
+ tabHost.setup();
+ ViewPager mViewPager = (ViewPager)findViewById(R.id.pager);
+ mTabsAdapter = new TabsAdapter(this, tabHost, tabinfo, mViewPager, settings);
+ TabSpec poiTab = tabHost.newTabSpec(SEARCH_POI).setIndicator(
+ getTabIndicator(tabHost, R.drawable.tab_search_poi_icon, R.string.poi));
+ mTabsAdapter.addTab(poiTab, getFragment(POI_TAB_INDEX), null);
+ TabSpec addressSpec = tabHost.newTabSpec(SEARCH_ADDRESS).setIndicator(
+ getTabIndicator(tabHost, R.drawable.tab_search_address_icon, R.string.address));
+ mTabsAdapter.addTab(addressSpec, getFragment(ADDRESS_TAB_INDEX), null);
+
+ TabSpec locationTab = tabHost.newTabSpec(SEARCH_LOCATION).setIndicator(
+ getTabIndicator(tabHost, R.drawable.tab_search_location_icon, R.string.search_tabs_location));
+ mTabsAdapter.addTab(locationTab, getFragment(LOCATION_TAB_INDEX), null);
+ TabSpec favoriteTab = tabHost.newTabSpec(SEARCH_FAVORITES).setIndicator(
+ getTabIndicator(tabHost, R.drawable.tab_search_favorites_icon, R.string.favorite));
+ mTabsAdapter.addTab(favoriteTab, getFragment(FAVORITES_TAB_INDEX), null);
+ TabSpec historyTab = tabHost.newTabSpec(SEARCH_HISTORY).setIndicator(
+ getTabIndicator(tabHost, R.drawable.tab_search_history_icon, R.string.history));
+ mTabsAdapter.addTab(historyTab, getFragment(HISTORY_TAB_INDEX), null);
+ TabSpec transportTab = tabHost.newTabSpec(SEARCH_TRANSPORT).setIndicator(
+ getTabIndicator(tabHost, R.drawable.tab_search_transport_icon, R.string.transport));
+ mTabsAdapter.addTab(transportTab, getFragment(TRANSPORT_TAB_INDEX), null);
+ tabHost.setCurrentTab(tab);
+ } else {
+ FrameLayout fl = new FrameLayout(this);
+ fl.setId(R.id.layout);
+ setContentView(fl);
+ Class> cl = getFragment(tab);
+ try {
+ getSupportFragmentManager().beginTransaction().replace(R.id.layout, (Fragment) cl.newInstance()).commit();
+ } catch (InstantiationException e) {
+ throw new IllegalStateException(e);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ }
+ }
setTopSpinner();
Log.i("net.osmand", "Start on create " + (System.currentTimeMillis() - t ));
@@ -162,6 +181,23 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo
}
}
}
+
+ protected Class> getFragment(int tab) {
+ if(tab == POI_TAB_INDEX) {
+ return SearchPoiFilterActivity.class;
+ } else if(tab == ADDRESS_TAB_INDEX) {
+ return searchOnLine ? SearchAddressOnlineFragment.class : SearchAddressFragment.class;
+ } else if(tab == LOCATION_TAB_INDEX) {
+ return NavigatePointFragment.class;
+ } else if(tab == HISTORY_TAB_INDEX) {
+ return SearchHistoryFragment.class;
+ } else if(tab == TRANSPORT_TAB_INDEX) {
+ return SearchTransportFragment.class;
+ } else if(tab == FAVORITES_TAB_INDEX) {
+ return FavouritesListFragment.class;
+ }
+ return SearchPoiFilterActivity.class;
+ }
@Override
public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) {
@@ -438,24 +474,24 @@ public class SearchActivity extends SherlockFragmentActivity implements OsmAndLo
}
@Override
- public void onTabChanged(String tabId) {
- int position = mTabHost.getCurrentTab();
- osmSettings.SEARCH_TAB.set(position);
- mViewPager.setCurrentItem(position);
- if (SEARCH_POI.equals(tabId)) {
+ public void onTabChanged(String tabId) {
+ int position = mTabHost.getCurrentTab();
+ osmSettings.SEARCH_TAB.set(position);
+ mViewPager.setCurrentItem(position);
+ if (SEARCH_POI.equals(tabId)) {
tabInfo.setText(R.string.poi_search_desc);
- } else if (SEARCH_ADDRESS.equals(tabId)) {
- tabInfo.setText(searchOnLine? R.string.search_osm_nominatim : R.string.address_search_desc);
- } else if (SEARCH_LOCATION.equals(tabId)) {
+ } else if (SEARCH_ADDRESS.equals(tabId)) {
+ tabInfo.setText(searchOnLine ? R.string.search_osm_nominatim : R.string.address_search_desc);
+ } else if (SEARCH_LOCATION.equals(tabId)) {
tabInfo.setText(R.string.navpoint_search_desc);
- } else if (SEARCH_TRANSPORT.equals(tabId)) {
+ } else if (SEARCH_TRANSPORT.equals(tabId)) {
tabInfo.setText(R.string.transport_search_desc);
- } else if (SEARCH_FAVORITES.equals(tabId)) {
+ } else if (SEARCH_FAVORITES.equals(tabId)) {
tabInfo.setText(R.string.favourites_search_desc);
- } else if (SEARCH_HISTORY.equals(tabId)) {
+ } else if (SEARCH_HISTORY.equals(tabId)) {
tabInfo.setText(R.string.history_search_desc);
}
- }
+ }
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java
index 87997852db..cdd8fc50a2 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashPluginsFragment.java
@@ -1,10 +1,18 @@
package net.osmand.plus.dashboard;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.R;
+import net.osmand.plus.development.OsmandDevelopmentPlugin;
+import net.osmand.plus.helpers.FontCache;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.annotation.Nullable;
-import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -12,11 +20,6 @@ import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.TextView;
-import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.R;
-import net.osmand.plus.helpers.FontCache;
-
-import java.util.List;
/**
* Created by Denis on 21.11.2014.
@@ -24,6 +27,8 @@ import java.util.List;
public class DashPluginsFragment extends DashBaseFragment {
public static final String TAG = "DASH_PLUGINS_FRAGMENT";
+ private ArrayList showedPlugins;
+ private ArrayList checks;
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -37,43 +42,67 @@ public class DashPluginsFragment extends DashBaseFragment {
startActivityForResult(new Intent(getActivity(), getMyApplication().getAppCustomization().getPluginsActivity()), 1);
}
});
-
+ LinearLayout layout = (LinearLayout) view.findViewById(R.id.plugins);
+ addPlugins(inflater, layout);
return view;
}
@Override
public void onResume() {
super.onResume();
- LinearLayout layout = (LinearLayout) getView().findViewById(R.id.plugins);
- layout.removeAllViews();
- addPlugins(layout);
+ for (int i = 0; i < checks.size(); i++) {
+ final CompoundButton ch = checks.get(i);
+ final OsmandPlugin o = showedPlugins.get(i);
+ ch.setOnCheckedChangeListener(null);
+ ch.setChecked(OsmandPlugin.getEnabledPlugins().contains(o));
+ ch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
+ OsmandPlugin.enablePlugin(getMyApplication(), o, b);
+ }
+ });
+ }
+
}
- private void addPlugins(View parent){
+ private void addPlugins(LayoutInflater inflater, View parent) {
LinearLayout layout = (LinearLayout) parent;
- LayoutInflater inflater = getActivity().getLayoutInflater();
List availablePlugins = OsmandPlugin.getAvailablePlugins();
List enabledPlugins = OsmandPlugin.getEnabledPlugins();
- for (int i=0; i < availablePlugins.size(); i++){
- if (i> 2){
+ List toShow = new ArrayList();
+ showedPlugins = new ArrayList();
+ checks = new ArrayList();
+ for(OsmandPlugin o : availablePlugins) {
+ if(!(o instanceof OsmandDevelopmentPlugin)) {
+ if(enabledPlugins.contains(o)) {
+ showedPlugins.add(o);
+ } else{
+ toShow.add(o);
+ }
+ }
+ }
+ Collections.shuffle(toShow, new Random(System.currentTimeMillis()));
+ while (!toShow.isEmpty()) {
+ showedPlugins.add(toShow.remove(0));
+ if (showedPlugins.size() > 2) {
break;
}
+ }
+
+ for (int i = 0; i < showedPlugins.size(); i++) {
final OsmandPlugin plugin = availablePlugins.get(i);
View view = inflater.inflate(R.layout.dash_plugin_item, null, false);
((TextView) view.findViewById(R.id.plugin_name)).setText(plugin.getName());
((TextView) view.findViewById(R.id.plugin_descr)).setText(plugin.getDescription());
+
CompoundButton check = (CompoundButton) view.findViewById(R.id.check_item);
+ checks.add(check);
check.setChecked(enabledPlugins.contains(plugin));
- check.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
- OsmandPlugin.enablePlugin(getMyApplication(),plugin, b);
- }
- });
- int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics());
- LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
- view.setLayoutParams(lp);
+// int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources()
+// .getDisplayMetrics());
+// LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height);
+// view.setLayoutParams(lp);
layout.addView(view);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java
index 77906528af..9d656e5735 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashSearchFragment.java
@@ -9,13 +9,9 @@ import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.annotation.Nullable;
-import android.text.Editable;
-import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.AutoCompleteTextView;
-import android.widget.EditText;
import android.widget.TextView;
/**
@@ -40,6 +36,14 @@ public class DashSearchFragment extends DashBaseFragment {
}
+ protected void searchActivity(final Activity activity, final OsmAndAppCustomization appCustomization, int tab) {
+ final Intent search = new Intent(activity, appCustomization.getSearchActivity());
+ search.putExtra(SearchActivity.SHOW_ONLY_ONE_TAB, true);
+ search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ getMyApplication().getSettings().SEARCH_TAB.set(tab);
+ activity.startActivity(search);
+ }
+
private void setupButtons(View view){
final Activity activity = getActivity();
final OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
@@ -48,60 +52,42 @@ public class DashSearchFragment extends DashBaseFragment {
(view.findViewById(R.id.poi)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- final Intent search = new Intent(activity, appCustomization.getSearchActivity());
- search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.POI_TAB_INDEX);
- activity.startActivity(search);
+ searchActivity(activity, appCustomization, SearchActivity.POI_TAB_INDEX);
}
});
(view.findViewById(R.id.address)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- final Intent search = new Intent(activity, appCustomization.getSearchActivity());
- search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.ADDRESS_TAB_INDEX);
- activity.startActivity(search);
+ searchActivity(activity, appCustomization, SearchActivity.ADDRESS_TAB_INDEX);
}
});
(view.findViewById(R.id.coord)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- final Intent search = new Intent(activity, appCustomization.getSearchActivity());
- search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.LOCATION_TAB_INDEX);
- activity.startActivity(search);
+ searchActivity(activity, appCustomization, SearchActivity.LOCATION_TAB_INDEX);
}
});
(view.findViewById(R.id.fav_btn)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- final Intent search = new Intent(activity, appCustomization.getSearchActivity());
- search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.FAVORITES_TAB_INDEX);
- activity.startActivity(search);
+ searchActivity(activity, appCustomization, SearchActivity.FAVORITES_TAB_INDEX);
}
});
(view.findViewById(R.id.history)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- final Intent search = new Intent(activity, appCustomization.getSearchActivity());
- search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.HISTORY_TAB_INDEX);
- activity.startActivity(search);
+ searchActivity(activity, appCustomization, SearchActivity.HISTORY_TAB_INDEX);
}
});
(view.findViewById(R.id.transport)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- final Intent search = new Intent(activity, appCustomization.getSearchActivity());
- search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
- getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.TRANSPORT_TAB_INDEX);
- activity.startActivity(search);
+ searchActivity(activity, appCustomization, SearchActivity.TRANSPORT_TAB_INDEX);
}
});
}
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java
index bcb67527c4..e9ed8de377 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java
@@ -1,7 +1,14 @@
package net.osmand.plus.dashboard;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.osmand.plus.R;
+import net.osmand.plus.base.BasicProgressAsyncTask;
+import net.osmand.plus.download.BaseDownloadActivity;
+import net.osmand.plus.download.DownloadActivity;
+import net.osmand.plus.download.IndexItem;
import android.content.Intent;
-import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
@@ -12,15 +19,6 @@ import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
-import net.osmand.plus.R;
-import net.osmand.plus.base.BasicProgressAsyncTask;
-import net.osmand.plus.download.BaseDownloadActivity;
-import net.osmand.plus.download.DownloadActivity;
-import net.osmand.plus.download.DownloadEntry;
-import net.osmand.plus.download.IndexItem;
-
-import java.util.ArrayList;
-import java.util.List;
/**
* Created by Denis on 21.11.2014.