Merge pull request #1050 from Bars107/master

Styles fix.
This commit is contained in:
vshcherb 2015-01-27 18:13:47 +01:00
commit f655a41b1e
27 changed files with 253 additions and 248 deletions

View file

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize">
<net.osmand.plus.views.controls.PagerSlidingTabStrip
android:id="@+id/sliding_tabs"
android:layout_width="fill_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
<LinearLayout
android:id="@+id/ProgressView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|left"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/IndeterminateProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone"/>
<TextView
android:id="@+id/ProgressPercent"
android:layout_width="48dp"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="right|center_vertical"
android:text=""
android:textSize="14sp"/>
<TextView
android:id="@+id/ProgressMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/ProgressPercent"
android:layout_toRightOf="@id/IndeterminateProgressBar"
android:ellipsize="end"
android:gravity="left|center_vertical"
android:singleLine="true"
android:text=""
android:textSize="14sp"/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/DeterminateProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<ImageView
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/a_1_navigation_cancel_small_dark"/>
</LinearLayout>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<Button
android:id="@+id/DownloadButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/download_files"
android:visibility="gone"/>
</LinearLayout>

View file

@ -1,25 +0,0 @@
<?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="match_parent"
android:orientation="vertical"
android:layout_marginTop="?attr/actionBarSize">
<net.osmand.plus.views.controls.PagerSlidingTabStrip
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<net.osmand.plus.activities.search.toolbar.SplitToolbar
android:id="@+id/bottomControls"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>

View file

@ -37,6 +37,7 @@
<net.osmand.plus.activities.search.toolbar.SplitToolbar <net.osmand.plus.activities.search.toolbar.SplitToolbar
android:orientation="horizontal" android:orientation="horizontal"
android:background="?attr/bottomToolBarColor"
android:id="@+id/bottomControls" android:id="@+id/bottomControls"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>

View file

@ -1,14 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:paddingTop="?attr/actionBarSize" android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_marginTop="?attr/actionBarSize">
android:layout_height="match_parent">
<net.osmand.plus.views.controls.PagerSlidingTabStrip <net.osmand.plus.views.controls.PagerSlidingTabStrip
android:id="@+id/sliding_tabs" android:id="@+id/sliding_tabs"
@ -16,101 +11,16 @@
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/> android:background="?attr/colorPrimary"/>
<LinearLayout <android.support.v4.view.ViewPager
android:id="@+id/ProgressView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|left"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/IndeterminateProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone" />
<TextView
android:id="@+id/ProgressPercent"
android:layout_width="48dp"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="right|center_vertical"
android:text=""
android:textSize="14sp" />
<TextView
android:id="@+id/ProgressMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/ProgressPercent"
android:layout_toRightOf="@id/IndeterminateProgressBar"
android:ellipsize="end"
android:gravity="left|center_vertical"
android:singleLine="true"
android:text=""
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/DeterminateProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/a_1_navigation_cancel_small_dark" />
</LinearLayout>
</LinearLayout>
<net.osmand.plus.CustomPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"/> android:layout_weight="1"/>
<Button
android:id="@+id/DownloadButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginTop="3dp"
android:gravity="center"
android:text="@string/download_files"
android:visibility="gone" />
<net.osmand.plus.activities.search.toolbar.SplitToolbar <net.osmand.plus.activities.search.toolbar.SplitToolbar
android:id="@+id/bottomControls" android:id="@+id/bottomControls"
android:background="?attr/bottomToolBarColor"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
</LinearLayout>
</TabHost> </LinearLayout>

View file

@ -6,9 +6,11 @@
<declare-styleable name="OsmAndTheme"> <declare-styleable name="OsmAndTheme">
<attr name="expandable_category_color" format="reference"/> <attr name="expandable_category_color" format="reference"/>
<attr name="reset_image" format="reference"/> <attr name="reset_image" format="reference"/>
<attr name="bottomToolBarColor" format="color" />
</declare-styleable> </declare-styleable>
<declare-styleable name="PagerSlidingTabStrip"> <declare-styleable name="PagerSlidingTabStrip">
<attr name="pstsTextColor" format="color"/>
<attr name="pstsIndicatorColor" format="color"/> <attr name="pstsIndicatorColor" format="color"/>
<attr name="pstsUnderlineColor" format="color"/> <attr name="pstsUnderlineColor" format="color"/>
<attr name="pstsDividerColor" format="color"/> <attr name="pstsDividerColor" format="color"/>

View file

@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="actionbar_color">#ff8f00</color> <color name="actionbar_dark_color">#39464d</color>
<color name="tool_bar_dark_color">#CC080B0D</color>
<color name="actionbar_light_color">#ff8f00</color>
<color name="tool_bar_light_color">#CC080B0D</color>
<color name="dashboard_descr_colol">#727272</color> <color name="dashboard_descr_colol">#727272</color>
<color name="dashboard_background">#eaeaea</color> <color name="dashboard_background">#eaeaea</color>
<color name="dashboard_divider">#f0f0f0</color> <color name="dashboard_divider">#F0F0F0</color>
<color name="dashboard_black">#212121</color> <color name="dashboard_black">#212121</color>
<color name="dashboard_blue">#536DFE</color> <color name="dashboard_blue">#536DFE</color>
<color name="gpx_color_point">#cd2c33</color> <color name="gpx_color_point">#cd2c33</color>

View file

@ -69,33 +69,50 @@
<item name="expandable_category_color">@color/group_background</item> <item name="expandable_category_color">@color/group_background</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="pstsTabBackground">@color/actionbar_light_color</item>
<item name="pstsIndicatorColor">@color/color_white</item>
<item name="pstsTextColor">@color/color_white</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
</style> </style>
<style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!--<item name="android:windowContentOverlay">@null</item>
<item name="android:windowBackground">@color/activity_background</item>
<item name="android:colorBackground">@color/activity_background</item>
<item name="android:colorBackgroundCacheHint">?android:attr/colorBackground</item>
<item name="android:textColor">@color/activity_text</item>
<item name="android:textColorPrimary">@color/activity_text</item>
<item name="android:textColorSecondary">@color/activity_text</item>
<item name="android:textColorTertiary">@color/activity_text</item>
<item name="android:listViewStyle">@style/OsmandListView</item>
-->
<item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light -->
<item name="expandable_category_color">@color/group_background</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
</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="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.Spinner</item>
<item name="windowActionBarOverlay">true</item> <item name="windowActionBarOverlay">true</item>
<item name="bottomToolBarColor">@color/tool_bar_dark_color</item>
<item name="pstsTabBackground">@color/actionbar_dark_color</item>
<item name="pstsIndicatorColor">@color/actionbar_light_color</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
</style> </style>
<style name="Widget.Styled.ActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse"> <style name="OsmandLightDarkActionBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="background">@drawable/bg_striped</item> <item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light -->
<item name="android:background">@drawable/bg_striped</item> <item name="expandable_category_color">@color/group_background</item>
<item name="bottomToolBarColor">@color/tool_bar_dark_color</item>
<item name="pstsTabBackground">@color/actionbar_dark_color</item>
<item name="pstsIndicatorColor">@color/actionbar_light_color</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
</style>
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">@color/actionbar_dark_color</item>
<item name="android:background">@color/actionbar_dark_color</item>
</style>
<style name="Widget.Styled.ActionBarLight" parent="Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">@color/actionbar_light_color</item>
<item name="android:background">@color/actionbar_light_color</item>
<item name="android:titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
<item name="titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
</style>
<style name="Widget.Styled.LightActionBarHeader" parent="@android:style/TextAppearance">
<item name="android:textColor">@color/color_white</item>
</style> </style>
<style name="Widget.Spinner" parent="android:Widget"> <style name="Widget.Spinner" parent="android:Widget">

View file

@ -1,6 +1,7 @@
package net.osmand.access; package net.osmand.access;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.access.AccessibilityMode; import net.osmand.plus.access.AccessibilityMode;
import net.osmand.plus.access.RelativeDirectionStyle; import net.osmand.plus.access.RelativeDirectionStyle;
@ -22,6 +23,7 @@ public class SettingsAccessibilityActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.accessibility_preferences); getToolbar().setTitle(R.string.accessibility_preferences);
PreferenceScreen grp = getPreferenceScreen(); PreferenceScreen grp = getPreferenceScreen();

View file

@ -1,6 +1,7 @@
package net.osmand.plus.activities; package net.osmand.plus.activities;
import android.app.Activity; import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Build.VERSION; import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES; import android.os.Build.VERSION_CODES;
@ -43,6 +44,13 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
finish(); finish();
} }
}); });
if (((OsmandApplication)getApplication()).getSettings().isLightActionBar()){
toolbar.setBackgroundColor(getResources().getColor(R.color.actionbar_light_color));
toolbar.setTitleTextColor(getResources().getColor(R.color.color_white));
} else {
toolbar.setBackgroundColor(getResources().getColor(R.color.actionbar_dark_color));
}
getSpinner().setVisibility(View.GONE); getSpinner().setVisibility(View.GONE);
setProgressVisibility(false); setProgressVisibility(false);
} }

View file

@ -27,10 +27,6 @@ import android.widget.TabHost;
import android.widget.TabHost.TabSpec; import android.widget.TabHost.TabSpec;
import android.widget.TabWidget; import android.widget.TabWidget;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.dashboard.DashDownloadMapsFragment;
import net.osmand.plus.dashboard.DashUpdatesFragment;
import net.osmand.plus.download.IndexItem;
import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.plus.views.controls.PagerSlidingTabStrip;
/** /**
@ -57,6 +53,7 @@ public class FavouritesActivity extends TabActivity {
setSupportProgressBarIndeterminateVisibility(false); setSupportProgressBarIndeterminateVisibility(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.favorites_Button); getSupportActionBar().setTitle(R.string.favorites_Button);
getSupportActionBar().setElevation(0);
// getSupportActionBar().setTitle(""); // getSupportActionBar().setTitle("");
// getSupportActionBar().setIcon(R.drawable.tab_search_favorites_icon); // getSupportActionBar().setIcon(R.drawable.tab_search_favorites_icon);
File[] lf = ((OsmandApplication) getApplication()).getAppPath(TRACKS).listFiles(); File[] lf = ((OsmandApplication) getApplication()).getAppPath(TRACKS).listFiles();
@ -74,7 +71,7 @@ public class FavouritesActivity extends TabActivity {
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 FavouritesTreeFragment()).commit();
} else { } else {
setContentView(R.layout.search_main); setContentView(R.layout.tab_content);
PagerSlidingTabStrip mSlidingTabLayout = (PagerSlidingTabStrip) findViewById(R.id.sliding_tabs); PagerSlidingTabStrip mSlidingTabLayout = (PagerSlidingTabStrip) findViewById(R.id.sliding_tabs);
OsmandSettings settings = ((OsmandApplication) getApplication()).getSettings(); OsmandSettings settings = ((OsmandApplication) getApplication()).getSettings();

View file

@ -880,7 +880,7 @@ public class MapActivityActions implements DialogProvider {
}).reg(); }).reg();
optionsMenuHelper.item(R.string.settings_activity) optionsMenuHelper.item(R.string.settings_activity)
.icons(R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_light) .icons(R.drawable.ic_action_settings_light, R.drawable.ic_action_settings_dark)
.listen(new OnContextMenuClick() { .listen(new OnContextMenuClick() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) { public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {

View file

@ -4,6 +4,7 @@ package net.osmand.plus.activities;
import java.io.File; import java.io.File;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import android.content.Intent; import android.content.Intent;
@ -33,6 +34,7 @@ public class SettingsActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings_pref); addPreferencesFromResource(R.xml.settings_pref);
PreferenceScreen screen = getPreferenceScreen(); PreferenceScreen screen = getPreferenceScreen();

View file

@ -303,8 +303,6 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this); ((OsmandApplication) getApplication()).applyTheme(this);
//getToolbar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.settings_activity); getToolbar().setTitle(R.string.settings_activity);
settings = getMyApplication().getSettings(); settings = getMyApplication().getSettings();
@ -316,7 +314,6 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
modes.add(a); modes.add(a);
} }
} }
//getToolbar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
List<String> s = new ArrayList<String>(); List<String> s = new ArrayList<String>();
for (ApplicationMode a : modes) { for (ApplicationMode a : modes) {
s.add(a.toHumanString(getMyApplication())); s.add(a.toHumanString(getMyApplication()));

View file

@ -67,7 +67,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); ((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.global_app_settings); getToolbar().setTitle(R.string.global_app_settings);
addPreferencesFromResource(R.xml.general_settings); addPreferencesFromResource(R.xml.general_settings);

View file

@ -5,13 +5,9 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.*;
import net.osmand.plus.DeviceAdminRecv;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.AutoZoomMap; import net.osmand.plus.OsmandSettings.AutoZoomMap;
import net.osmand.plus.OsmandSettings.OsmandPreference; import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.routing.RouteProvider.RouteService; import net.osmand.plus.routing.RouteProvider.RouteService;
import net.osmand.router.GeneralRouter; import net.osmand.router.GeneralRouter;
import net.osmand.router.GeneralRouter.RoutingParameter; import net.osmand.router.GeneralRouter.RoutingParameter;
@ -52,6 +48,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.routing_settings); getToolbar().setTitle(R.string.routing_settings);

View file

@ -24,16 +24,11 @@ import net.osmand.plus.views.controls.PagerSlidingTabStrip;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import android.app.ActionBar; import android.app.ActionBar;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener; import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.support.v7.app.ActionBar.OnNavigationListener; import android.support.v7.app.ActionBar.OnNavigationListener;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
import android.view.MenuItem; import android.view.MenuItem;
@ -41,8 +36,6 @@ import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import com.example.android.common.view.SlidingTabLayout;
public class SearchActivity extends TabActivity implements OsmAndLocationListener { public class SearchActivity extends TabActivity implements OsmAndLocationListener {
public static final int POI_TAB_INDEX = 0; public static final int POI_TAB_INDEX = 0;
public static final int ADDRESS_TAB_INDEX = 1; public static final int ADDRESS_TAB_INDEX = 1;
@ -86,8 +79,7 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
((OsmandApplication) getApplication()).applyTheme(this); ((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
long t = System.currentTimeMillis(); long t = System.currentTimeMillis();
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); setContentView(R.layout.tab_content);
setContentView(R.layout.search_main);
settings = ((OsmandApplication) getApplication()).getSettings(); settings = ((OsmandApplication) getApplication()).getSettings();
Integer tab = settings.SEARCH_TAB.get(); Integer tab = settings.SEARCH_TAB.get();
showOnlyOneTab = getIntent() != null && getIntent().getBooleanExtra(SHOW_ONLY_ONE_TAB, false); showOnlyOneTab = getIntent() != null && getIntent().getBooleanExtra(SHOW_ONLY_ONE_TAB, false);

View file

@ -17,6 +17,7 @@ import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_I
import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_MACRO; import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_MACRO;
import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_CONTINUOUS; import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_CONTINUOUS;
//// ////
import net.osmand.plus.OsmandApplication;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import java.util.List; import java.util.List;
@ -36,6 +37,7 @@ public class SettingsAudioVideoActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.av_settings); getToolbar().setTitle(R.string.av_settings);
PreferenceScreen grp = getPreferenceScreen(); PreferenceScreen grp = getPreferenceScreen();

View file

@ -20,7 +20,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Created by Denis on 23.12.2014. * Created by Denis
* on 23.12.2014.
*/ */
public class DashAudioVideoNotesActivity extends ActionBarActivity { public class DashAudioVideoNotesActivity extends ActionBarActivity {
AudioVideoNotesPlugin plugin; AudioVideoNotesPlugin plugin;
@ -33,17 +34,13 @@ public class DashAudioVideoNotesActivity extends ActionBarActivity {
setContentView(R.layout.editing_poi_filter); setContentView(R.layout.editing_poi_filter);
plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class);
int c = getResources().getColor(R.color.actionbar_color);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
Window window = getWindow(); Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(c);
} }
ColorDrawable color = new ColorDrawable(c);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(R.string.audionotes_plugin_name); actionBar.setTitle(R.string.audionotes_plugin_name);
actionBar.setBackgroundDrawable(color);
actionBar.setIcon(android.R.color.transparent); actionBar.setIcon(android.R.color.transparent);
actionBar.setHomeButtonEnabled(true); actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true);

View file

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.SettingsBaseActivity; import net.osmand.plus.activities.SettingsBaseActivity;
import net.osmand.plus.activities.actions.AppModeDialog; import net.osmand.plus.activities.actions.AppModeDialog;
@ -30,6 +31,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.debugging_and_development); getToolbar().setTitle(R.string.debugging_and_development);
PreferenceScreen cat = getPreferenceScreen(); PreferenceScreen cat = getPreferenceScreen();

View file

@ -14,7 +14,6 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.Version; import net.osmand.plus.Version;
import net.osmand.plus.activities.FavouritesActivity;
import net.osmand.plus.activities.LocalIndexInfo; import net.osmand.plus.activities.LocalIndexInfo;
import net.osmand.plus.activities.TabActivity; import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.base.BasicProgressAsyncTask; import net.osmand.plus.base.BasicProgressAsyncTask;
@ -28,11 +27,9 @@ import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.Window;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TabHost;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.plus.views.controls.PagerSlidingTabStrip;
@ -70,12 +67,9 @@ public class DownloadActivity extends BaseDownloadActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
getMyApplication().applyTheme(this); getMyApplication().applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setupIntermediateProgressBar();
updateDownloads(); updateDownloads();
setContentView(R.layout.download);
setContentView(R.layout.tab_content);
findViewById(R.id.bottomControls).setVisibility(View.GONE);
singleTab = getIntent() != null && getIntent().getBooleanExtra(SINGLE_TAB, false); singleTab = getIntent() != null && getIntent().getBooleanExtra(SINGLE_TAB, false);
int currentTab = 0; int currentTab = 0;
String tab = getIntent() == null || getIntent().getExtras() == null ? null : getIntent().getExtras().getString(TAB_TO_OPEN); String tab = getIntent() == null || getIntent().getExtras() == null ? null : getIntent().getExtras().getString(TAB_TO_OPEN);

View file

@ -21,7 +21,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* Created by Denis on 09.09.2014. * Created by Denis
* on 09.09.2014.
*/ */
public class UpdatesIndexFragment extends ListFragment { public class UpdatesIndexFragment extends ListFragment {

View file

@ -4,6 +4,7 @@ package net.osmand.plus.monitoring;
import android.view.Window; import android.view.Window;
import net.osmand.plus.NavigationService; import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmAndTaskManager.OsmAndTaskRunnable; import net.osmand.plus.OsmAndTaskManager.OsmAndTaskRunnable;
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.SavingTrackHelper; import net.osmand.plus.activities.SavingTrackHelper;
@ -38,10 +39,10 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); ((OsmandApplication) getApplication()).applyTheme(this);
requestWindowFeature(Window.FEATURE_PROGRESS); requestWindowFeature(Window.FEATURE_PROGRESS);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
//setSupportProgressBarIndeterminateVisibility(false); setProgressVisibility(false);
getToolbar().setTitle(R.string.monitoring_settings); getToolbar().setTitle(R.string.monitoring_settings);
PreferenceScreen grp = getPreferenceScreen(); PreferenceScreen grp = getPreferenceScreen();
@ -121,7 +122,7 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity {
} }
private void saveCurrentTracks(final SavingTrackHelper helper) { private void saveCurrentTracks(final SavingTrackHelper helper) {
//setSupportProgressBarIndeterminateVisibility(true); setProgressVisibility(true);
getMyApplication().getTaskManager().runInBackground(new OsmAndTaskRunnable<Void, Void, Void>() { getMyApplication().getTaskManager().runInBackground(new OsmAndTaskRunnable<Void, Void, Void>() {
@Override @Override
@ -133,7 +134,7 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity {
} }
@Override @Override
protected void onPostExecute(Void result) { protected void onPostExecute(Void result) {
//setSupportProgressBarIndeterminateVisibility(false); setProgressVisibility(false);
} }
}, (Void) null); }, (Void) null);

View file

@ -1,6 +1,7 @@
package net.osmand.plus.osmedit; package net.osmand.plus.osmedit;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.SettingsBaseActivity; import net.osmand.plus.activities.SettingsBaseActivity;
import android.content.Intent; import android.content.Intent;
@ -17,6 +18,7 @@ public class SettingsOsmEditingActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.osm_settings); getToolbar().setTitle(R.string.osm_settings);
PreferenceScreen grp = getPreferenceScreen(); PreferenceScreen grp = getPreferenceScreen();

View file

@ -4,6 +4,7 @@ package net.osmand.plus.osmo;
import java.util.List; import java.util.List;
import net.osmand.access.AccessibleToast; import net.osmand.access.AccessibleToast;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.SettingsBaseActivity; import net.osmand.plus.activities.SettingsBaseActivity;
@ -37,6 +38,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.osmo_settings); getToolbar().setTitle(R.string.osmo_settings);
PreferenceScreen grp = getPreferenceScreen(); PreferenceScreen grp = getPreferenceScreen();

View file

@ -5,6 +5,7 @@ import java.util.Map;
import net.osmand.ResultMatcher; import net.osmand.ResultMatcher;
import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.map.TileSourceManager.TileSourceTemplate;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.SettingsBaseActivity; import net.osmand.plus.activities.SettingsBaseActivity;
import net.osmand.plus.views.SeekBarPreference; import net.osmand.plus.views.SeekBarPreference;
@ -27,6 +28,7 @@ public class SettingsRasterMapsActivity extends SettingsBaseActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.online_map_settings); getToolbar().setTitle(R.string.online_map_settings);
PreferenceScreen grp = getPreferenceScreen(); PreferenceScreen grp = getPreferenceScreen();

View file

@ -115,7 +115,7 @@ public class SherpafyStageFragment extends Fragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.tab_content, container, false); view = inflater.inflate(R.layout.download, container, false);
tabHost = (TabHost) view.findViewById(android.R.id.tabhost); tabHost = (TabHost) view.findViewById(android.R.id.tabhost);
tabHost.setup(); tabHost.setup();

View file

@ -109,8 +109,8 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
private int tabPadding = 12; private int tabPadding = 12;
private int tabTextSize = 14; private int tabTextSize = 14;
private ColorStateList tabTextColor = null; private int tabTextColor = 0;
private float tabTextAlpha = HALF_TRANSP; private float tabTextAlpha = OPAQUE;
private float tabTextSelectedAlpha = OPAQUE; private float tabTextSelectedAlpha = OPAQUE;
private int padding = 0; private int padding = 0;
@ -161,11 +161,11 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
tabTextSize = a.getDimensionPixelSize(TEXT_SIZE_INDEX, tabTextSize); tabTextSize = a.getDimensionPixelSize(TEXT_SIZE_INDEX, tabTextSize);
ColorStateList colorStateList = a.getColorStateList(TEXT_COLOR_INDEX); 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) { // if (colorStateList != null) {
tabTextColor = colorStateList; // tabTextColor = colorStateList;
} else { // } else {
tabTextColor = getColorStateList(textPrimaryColor); // tabTextColor = getColorStateList(textPrimaryColor);
} // }
underlineColor = textPrimaryColor; underlineColor = textPrimaryColor;
dividerColor = textPrimaryColor; dividerColor = textPrimaryColor;
@ -179,6 +179,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
// get custom attrs // get custom attrs
a = context.obtainStyledAttributes(attrs, R.styleable.PagerSlidingTabStrip); a = context.obtainStyledAttributes(attrs, R.styleable.PagerSlidingTabStrip);
tabTextColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsTextColor, underlineColor);
indicatorColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsIndicatorColor, indicatorColor); indicatorColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsIndicatorColor, indicatorColor);
underlineColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsUnderlineColor, underlineColor); underlineColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsUnderlineColor, underlineColor);
dividerColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsDividerColor, dividerColor); dividerColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsDividerColor, dividerColor);
@ -194,7 +195,7 @@ 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, HALF_TRANSP); tabTextAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextAlpha, OPAQUE);
tabTextSelectedAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextSelectedAlpha, OPAQUE); tabTextSelectedAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextSelectedAlpha, OPAQUE);
a.recycle(); a.recycle();
@ -301,6 +302,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
} }
private void updateTabStyles() { private void updateTabStyles() {
tabsContainer.setBackgroundResource(tabBackgroundResId);
for (int i = 0; i < tabCount; i++) { for (int i = 0; i < tabCount; i++) {
View v = tabsContainer.getChildAt(i); View v = tabsContainer.getChildAt(i);
v.setBackgroundResource(tabBackgroundResId); v.setBackgroundResource(tabBackgroundResId);
@ -310,9 +312,8 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
if (tab_title != null) { if (tab_title != null) {
tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize); tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize);
tab_title.setTypeface(tabTypeface, pager.getCurrentItem() == i ? tabTypefaceSelectedStyle : tabTypefaceStyle); tab_title.setTypeface(tabTypeface, pager.getCurrentItem() == i ? tabTypefaceSelectedStyle : tabTypefaceStyle);
if (tabTextColor != null) {
tab_title.setTextColor(tabTextColor); tab_title.setTextColor(tabTextColor);
}
// setAllCaps() is only available from API 14, so the upper case is made manually if we are on a // setAllCaps() is only available from API 14, so the upper case is made manually if we are on a
// pre-ICS-build // pre-ICS-build
if (textAllCaps) { if (textAllCaps) {
@ -657,7 +658,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
return textAllCaps; return textAllCaps;
} }
public ColorStateList getTextColor() { public int getTextColor() {
return tabTextColor; return tabTextColor;
} }
@ -741,24 +742,20 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
} }
public void setTextColor(int textColor) { public void setTextColor(int textColor) {
setTextColor(getColorStateList(textColor)); tabTextColor = textColor;
} }
private ColorStateList getColorStateList(int textColor) { private ColorStateList getColorStateList(int textColor) {
return new ColorStateList(new int[][]{new int[]{}}, new int[]{textColor}); return new ColorStateList(new int[][]{new int[]{}}, new int[]{textColor});
} }
public void setTextColor(ColorStateList colorStateList) {
this.tabTextColor = colorStateList;
updateTabStyles();
}
public void setTextColorResource(int resId) { public void setTextColorResource(int resId) {
setTextColor(getResources().getColor(resId)); setTextColor(getResources().getColor(resId));
} }
public void setTextColorStateListResource(int resId) { public void setTextColorStateListResource(int resId) {
setTextColor(getResources().getColorStateList(resId)); setTextColor(getResources().getColor(resId));
} }
public void setTypeface(Typeface typeface, int style) { public void setTypeface(Typeface typeface, int style) {