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.ShowRouteInfoActivity" android:label="@string/show_route" />
<activity android:name="net.osmand.plus.activities.FavouritesListActivity" android:label="@string/favourites_list_activity" />
<activity android:name="net.osmand.plus.activities.FavouritesActivity" android:windowSoftInputMode="adjustPan" />
<activity android:name=".activities.FavoritesListActivity" android:label="@string/favourites_list_activity" />
<activity android:name=".activities.FavoritesActivity" android:windowSoftInputMode="adjustPan" />
<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" />

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">
<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="windowActionBarOverlay">true</item>
<item name="bottomToolBarColor">@color/tool_bar_light_color</item>
@ -76,14 +78,22 @@
<item name="pstsTextColor">@color/color_white</item>
<item name="android: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: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 name="OsmandDarkTheme" parent="Theme.AppCompat">
<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="android:spinnerStyle">@style/Widget.Spinner</item>
<item name="android:spinnerStyle">@style/Widget.DarkSpinner</item>
<item name="windowActionBarOverlay">true</item>
<item name="bottomToolBarColor">@color/tool_bar_dark_color</item>
<item name="pstsTabBackground">@color/actionbar_dark_color</item>
@ -122,11 +132,30 @@
<item name="android:textColor">@color/color_white</item>
</style>
<style name="Widget.Spinner" parent="android:Widget">
<item name="android:colorBackground">@color/dashboard_black</item>
<item name="android:clickable">true</item>
<style name="Widget.DarkSpinner" 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.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 -->
<style name="Animations" />
<!-- PopDownMenu -->

View file

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

View file

@ -155,9 +155,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
});
if (isOrientationPortrait()) {
menu = ((FavouritesActivity) getActivity()).getClearToolbar(true).getMenu();
menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu();
} else {
((FavouritesActivity) getActivity()).getClearToolbar(false);
((FavoritesActivity) getActivity()).getClearToolbar(false);
}
@ -242,12 +242,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
public void showProgressBar() {
((FavouritesActivity)getActivity()).setSupportProgressBarIndeterminateVisibility(true);
((FavoritesActivity)getActivity()).setSupportProgressBarIndeterminateVisibility(true);
}
public void hideProgressBar() {
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) {
this.selectionMode = selectionMode;
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 TRACKS = "TRACKS";
@ -67,7 +67,7 @@ public class FavouritesActivity extends TabActivity {
if(!hasGpx) {
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 {
setContentView(R.layout.tab_content);
@ -77,7 +77,7 @@ public class FavouritesActivity extends TabActivity {
ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
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.selected_track, SelectedGPXFragment.class));
@ -107,7 +107,7 @@ public class FavouritesActivity extends TabActivity {
@Override
protected void onResume() {
super.onResume();
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavouritesActivity.class,new Runnable() {
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavoritesActivity.class,new Runnable() {
@Override
public void run() {
@ -119,7 +119,7 @@ public class FavouritesActivity extends TabActivity {
@Override
protected void onPause() {
super.onPause();
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavouritesActivity.class, null);
((OsmandApplication) getApplication()).getSelectedGpxHelper().setUiListener(FavoritesActivity.class, null);
}
public void updateSelectedTracks() {

View file

@ -5,7 +5,7 @@ import net.osmand.plus.OsmandApplication;
import android.os.Bundle;
public class FavouritesListActivity extends OsmandActionBarActivity {
public class FavoritesListActivity extends OsmandActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -13,7 +13,7 @@ public class FavouritesListActivity extends OsmandActionBarActivity {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
// During initial setup, plug in the details fragment.
FavouritesListFragment details = new FavouritesListFragment();
FavoritesListFragment details = new FavoritesListFragment();
details.setArguments(getIntent().getExtras());
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 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.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.plus.helpers.ScreenOrientationHelper;
import net.osmand.plus.helpers.WaypointDialogHelper;
import net.osmand.util.MapUtils;
import android.app.Activity;
import android.app.AlertDialog;
@ -64,7 +62,7 @@ import android.widget.TextView;
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 EXPORT_ID = 0;
@ -339,9 +337,9 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment {
boolean portrait = orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT ||
orientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
if (portrait) {
menu = ((FavouritesActivity) getActivity()).getClearToolbar(true).getMenu();
menu = ((FavoritesActivity) getActivity()).getClearToolbar(true).getMenu();
} 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) {
enableSelectionMode(true);
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);
favoritesSelected.clear();
groupsToDelete.clear();
@ -465,7 +463,7 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment {
private void enableSelectionMode(boolean selectionMode) {
this.selectionMode = selectionMode;
((FavouritesActivity)getActivity()).setToolbarVisibility(!selectionMode);
((FavoritesActivity)getActivity()).setToolbarVisibility(!selectionMode);
}
protected void openChangeGroupDialog(final FavoriteGroup group) {

View file

@ -144,6 +144,7 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca
protected void onCreate(Bundle savedInstanceState) {
getMyApplication().applyTheme(this);
super.onCreate(savedInstanceState);
haveHomeButton = false;
if (getIntent() != null) {
Intent intent = getIntent();
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 {
protected boolean haveHomeButton = true;
//should be called after set content view
protected void setupHomeButton(){
Drawable back = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
@ -25,18 +27,24 @@ public class OsmandActionBarActivity extends ActionBarActivity {
@Override
public void setContentView(int layoutResID) {
super.setContentView(layoutResID);
setupHomeButton();
if (haveHomeButton) {
setupHomeButton();
}
}
@Override
public void setContentView(View view) {
super.setContentView(view);
setupHomeButton();
if (haveHomeButton) {
setupHomeButton();
}
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
super.setContentView(view, params);
setupHomeButton();
if (haveHomeButton) {
setupHomeButton();
}
}
}

View file

@ -243,7 +243,7 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment {
@Override
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,
// R.drawable.ic_action_search_dark, MenuItem.SHOW_AS_ACTION_ALWAYS
// | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);

View file

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

View file

@ -9,6 +9,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.preference.*;
import android.view.MenuItem;
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.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.FavouritesListActivity;
import net.osmand.plus.activities.FavouritesListFragment;
import net.osmand.plus.activities.FavoritesListActivity;
import net.osmand.plus.activities.FavoritesListFragment;
import net.osmand.plus.activities.NavigatePointFragment;
import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
@ -171,7 +171,7 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
} else if(tab == TRANSPORT_TAB_INDEX) {
return SearchTransportFragment.class;
} else if(tab == FAVORITES_TAB_INDEX) {
return FavouritesListFragment.class;
return FavoritesListFragment.class;
}
return SearchPoiFilterFragment.class;
}
@ -218,9 +218,9 @@ public class SearchActivity extends TabActivity implements OsmAndLocationListene
if (position == POSITION_LAST_MAP_VIEW) {
updateSearchPoint(settings.getLastKnownMapLocation(), getString(R.string.select_search_position) + " " + getString(R.string.search_position_map_view), false);
} 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.putExtra(FavouritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY, (Serializable) null);
intent.putExtra(FavoritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY, (Serializable) null);
startActivityForResult(intent, REQUEST_FAVORITE_SELECT);
getSupportActionBar().setSelectedNavigationItem(0);
} 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) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == REQUEST_FAVORITE_SELECT && resultCode == FavouritesListFragment.SELECT_FAVORITE_POINT_RESULT_OK){
FavouritePoint p = (FavouritePoint) data.getSerializableExtra(FavouritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY);
if(requestCode == REQUEST_FAVORITE_SELECT && resultCode == FavoritesListFragment.SELECT_FAVORITE_POINT_RESULT_OK){
FavouritePoint p = (FavouritePoint) data.getSerializableExtra(FavoritesListFragment.SELECT_FAVORITE_POINT_INTENT_KEY);
if (p != null) {
LatLon latLon = new LatLon(p.getLatitude(), p.getLongitude());
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());
}
}
setContentView(R.layout.expandable_list);
setContentView(R.layout.osmo_group_list);
getSupportActionBar().setTitle(R.string.osmo_activity);
setSupportProgressBarIndeterminateVisibility(false);
setupHeader();
@ -952,13 +952,13 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
0, 0,/*R.drawable.ic_action_marker_light,*/
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
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);
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);
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);
return super.onCreateOptionsMenu(menu);
}

View file

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

View file

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