diff --git a/src/android/support/v4/view/ViewPager.java b/src/android/support/v4/view/ViewPager.java index 2189809b..b8658454 100644 --- a/src/android/support/v4/view/ViewPager.java +++ b/src/android/support/v4/view/ViewPager.java @@ -2088,7 +2088,7 @@ public class ViewPager extends ViewGroup { public int gravity; public LayoutParams() { - super(FILL_PARENT, FILL_PARENT); + super(MATCH_PARENT, MATCH_PARENT); } public LayoutParams(Context context, AttributeSet attrs) { diff --git a/src/com/viewpagerindicator/TabPageIndicator.java b/src/com/viewpagerindicator/TabPageIndicator.java index 9ba43005..64088906 100644 --- a/src/com/viewpagerindicator/TabPageIndicator.java +++ b/src/com/viewpagerindicator/TabPageIndicator.java @@ -57,7 +57,7 @@ public class TabPageIndicator extends HorizontalScrollView setHorizontalScrollBarEnabled(false); mTabLayout = new LinearLayout(getContext()); - addView(mTabLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.FILL_PARENT)); + addView(mTabLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT)); } @Override @@ -129,7 +129,7 @@ public class TabPageIndicator extends HorizontalScrollView tabView.setOnClickListener(this); tabView.setText(text); - mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, LayoutParams.FILL_PARENT, 1)); + mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1)); } @Override @@ -186,7 +186,7 @@ public class TabPageIndicator extends HorizontalScrollView final int tabCount = mTabLayout.getChildCount(); for (int i = 0; i < tabCount; i++) { final View child = mTabLayout.getChildAt(i); - final boolean isSelected = (i == item); + final boolean isSelected = i == item; child.setSelected(isSelected); if (isSelected) { animateToTab(item); diff --git a/src/org/kreed/vanilla/FullPlaybackActivity.java b/src/org/kreed/vanilla/FullPlaybackActivity.java index 1d570d31..9cf95f3f 100644 --- a/src/org/kreed/vanilla/FullPlaybackActivity.java +++ b/src/org/kreed/vanilla/FullPlaybackActivity.java @@ -250,8 +250,8 @@ public class FullPlaybackActivity extends PlaybackActivity view.setClickable(true); view.setOnClickListener(this); addContentView(view, - new ViewGroup.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, - LinearLayout.LayoutParams.FILL_PARENT)); + new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT)); mOverlayText = view; } else { mOverlayText.setVisibility(View.VISIBLE); diff --git a/src/org/kreed/vanilla/IdlePreference.java b/src/org/kreed/vanilla/IdlePreference.java index 4af181d2..e83a8cc2 100644 --- a/src/org/kreed/vanilla/IdlePreference.java +++ b/src/org/kreed/vanilla/IdlePreference.java @@ -69,7 +69,7 @@ public class IdlePreference extends DialogPreference implements SeekBar.OnSeekBa protected void onPrepareDialogBuilder(Builder builder) { Context context = getContext(); - ViewGroup.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + ViewGroup.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); mValue = getPersistedInt(DEFAULT_VALUE); diff --git a/src/org/kreed/vanilla/MediaAdapter.java b/src/org/kreed/vanilla/MediaAdapter.java index 34fd47a0..36b220c1 100644 --- a/src/org/kreed/vanilla/MediaAdapter.java +++ b/src/org/kreed/vanilla/MediaAdapter.java @@ -427,7 +427,7 @@ public class MediaAdapter { if (mSections == null) { if (mSortMode == 0) - mSections = mIndexer.getSections(); + mSections = MusicAlphabetIndexer.getSections(); else mSections = new String[] { " " }; } diff --git a/src/org/kreed/vanilla/PlaybackService.java b/src/org/kreed/vanilla/PlaybackService.java index a61421d4..c29d2b4b 100644 --- a/src/org/kreed/vanilla/PlaybackService.java +++ b/src/org/kreed/vanilla/PlaybackService.java @@ -685,8 +685,23 @@ public final class PlaybackService extends Service /** * Return true if audio would play through the speaker. */ + @SuppressWarnings("deprecation") private boolean isSpeakerOn() { + // Android seems very intent on making this difficult to detect. In + // Android 1.5, this worked great with AudioManager.getRouting(), + // which definitively answered if audio would play through the speakers. + // Android 2.0 deprecated this method and made it no longer function. + // So this hacky alternative was created. But with Android 4.0, + // isWiredHeadsetOn() was deprecated, though it still works. But for + // how much longer? + // + // I'd like to remove this feature so I can avoid fighting Android to + // keep it working, but some users seem to really like it. I think the + // best solution to this problem is for Android to have separate media + // volumes for speaker, headphones, etc. That way the speakers can be + // muted system-wide. There is not much I can do about that here, + // though. return !mAudioManager.isWiredHeadsetOn() && !mAudioManager.isBluetoothA2dpOn() && !mAudioManager.isBluetoothScoOn(); }