diff --git a/AndroidManifest.xml b/AndroidManifest.xml index da0eff59..b3a9b0df 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -19,7 +19,7 @@ (android.content.Context, android.util.AttributeSet); +} +-keep public class * extends android.view.View { +public (android.content.Context); +public (android.content.Context, android.util.AttributeSet); +public (android.content.Context, android.util.AttributeSet, int); +} +-optimizationpasses 2 +-flattenpackagehierarchy +-printmapping map.txt +-printseeds seeds.txt +-printusage unused.txt diff --git a/res/values/strings.xml b/res/values/strings.xml index 6fc60ea6..aa09bca4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -61,7 +61,7 @@ Playing %s 1 song added to playlist %2$s. - %d songs added to playlist %s. + %1$d songs added to playlist %2$s. Deleting... Playlist %s deleted. @@ -77,7 +77,7 @@ None Unknown - %s by %s + %1$s by %2$s @@ -120,4 +120,4 @@ The amount of time that must pass before becoming idle Use ScrobbleDroid API Scrobble to Last.FM through ScrobbleDroid or Simple Last.FM Scrobbler - \ No newline at end of file + diff --git a/src/org/kreed/vanilla/FullPlaybackActivity.java b/src/org/kreed/vanilla/FullPlaybackActivity.java index 36e3a405..410f2d4b 100644 --- a/src/org/kreed/vanilla/FullPlaybackActivity.java +++ b/src/org/kreed/vanilla/FullPlaybackActivity.java @@ -18,8 +18,6 @@ package org.kreed.vanilla; -import org.kreed.vanilla.R; - import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; diff --git a/src/org/kreed/vanilla/MiniPlaybackActivity.java b/src/org/kreed/vanilla/MiniPlaybackActivity.java index 81efe629..f9b888f6 100644 --- a/src/org/kreed/vanilla/MiniPlaybackActivity.java +++ b/src/org/kreed/vanilla/MiniPlaybackActivity.java @@ -18,14 +18,9 @@ package org.kreed.vanilla; -import org.kreed.vanilla.R; - -import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.util.AttributeSet; import android.view.View; -import android.view.ViewGroup; import android.view.Window; /** @@ -73,76 +68,3 @@ public class MiniPlaybackActivity extends PlaybackActivity implements View.OnCli } } } - -/** - * Custom layout that acts like a very simple vertical LinearLayout with - * special case: CoverViews will be made square at all costs. - */ -/* - * I would prefer this to be a nested class, but it does not seem like - * Android's layout inflater supports referencing nested classes in XML. - */ -class MiniPlaybackActivityLayout extends ViewGroup { - private int mCoverSize; - - public MiniPlaybackActivityLayout(Context context, AttributeSet attrs) - { - super(context, attrs); - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) - { - int maxHeight = MeasureSpec.getSize(heightMeasureSpec); - - int measuredHeight = 0; - int measuredWidth = 0; - - View coverView = null; - for (int i = getChildCount(); --i != -1; ) { - View view = getChildAt(i); - if (view instanceof CoverView) { - coverView = view; - } else { - int spec = MeasureSpec.makeMeasureSpec(maxHeight - measuredHeight, MeasureSpec.AT_MOST); - view.measure(widthMeasureSpec, spec); - measuredHeight += view.getMeasuredHeight(); - if (view.getMeasuredWidth() > measuredWidth) - measuredWidth = view.getMeasuredWidth(); - } - } - - if (coverView != null) { - if (measuredHeight + measuredWidth > maxHeight) { - mCoverSize = maxHeight - measuredHeight; - measuredHeight = maxHeight; - } else { - mCoverSize = measuredWidth; - measuredHeight += measuredWidth; - } - } - - setMeasuredDimension(measuredWidth, measuredHeight); - } - - @Override - protected void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4) - { - int layoutWidth = getMeasuredWidth(); - int top = 0; - - for (int i = 0, end = getChildCount(); i != end; ++i) { - View view = getChildAt(i); - if (view instanceof CoverView) { - view.layout(0, top, layoutWidth, top + mCoverSize); - top += mCoverSize; - } else { - int height = view.getMeasuredHeight(); - int width = view.getMeasuredWidth(); - int left = (layoutWidth - width) / 2; - view.layout(left, top, layoutWidth - left, top + height); - top += height; - } - } - } -} \ No newline at end of file diff --git a/src/org/kreed/vanilla/MiniPlaybackActivityLayout.java b/src/org/kreed/vanilla/MiniPlaybackActivityLayout.java new file mode 100644 index 00000000..428075f4 --- /dev/null +++ b/src/org/kreed/vanilla/MiniPlaybackActivityLayout.java @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2010 Christopher Eby + * + * This file is part of Vanilla Music Player. + * + * Vanilla Music Player is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Vanilla Music Player is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.kreed.vanilla; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; + +/** + * Custom layout that acts like a very simple vertical LinearLayout with + * special case: CoverViews will be made square at all costs. + */ +public class MiniPlaybackActivityLayout extends ViewGroup { + private int mCoverSize; + + public MiniPlaybackActivityLayout(Context context, AttributeSet attrs) + { + super(context, attrs); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) + { + int maxHeight = MeasureSpec.getSize(heightMeasureSpec); + + int measuredHeight = 0; + int measuredWidth = 0; + + View coverView = null; + for (int i = getChildCount(); --i != -1; ) { + View view = getChildAt(i); + if (view instanceof CoverView) { + coverView = view; + } else { + int spec = MeasureSpec.makeMeasureSpec(maxHeight - measuredHeight, MeasureSpec.AT_MOST); + view.measure(widthMeasureSpec, spec); + measuredHeight += view.getMeasuredHeight(); + if (view.getMeasuredWidth() > measuredWidth) + measuredWidth = view.getMeasuredWidth(); + } + } + + if (coverView != null) { + if (measuredHeight + measuredWidth > maxHeight) { + mCoverSize = maxHeight - measuredHeight; + measuredHeight = maxHeight; + } else { + mCoverSize = measuredWidth; + measuredHeight += measuredWidth; + } + } + + setMeasuredDimension(measuredWidth, measuredHeight); + } + + @Override + protected void onLayout(boolean arg0, int arg1, int arg2, int arg3, int arg4) + { + int layoutWidth = getMeasuredWidth(); + int top = 0; + + for (int i = 0, end = getChildCount(); i != end; ++i) { + View view = getChildAt(i); + if (view instanceof CoverView) { + view.layout(0, top, layoutWidth, top + mCoverSize); + top += mCoverSize; + } else { + int height = view.getMeasuredHeight(); + int width = view.getMeasuredWidth(); + int left = (layoutWidth - width) / 2; + view.layout(left, top, layoutWidth - left, top + height); + top += height; + } + } + } +} diff --git a/src/org/kreed/vanilla/PreferencesActivity.java b/src/org/kreed/vanilla/PreferencesActivity.java index b3028c08..cf97c9f9 100644 --- a/src/org/kreed/vanilla/PreferencesActivity.java +++ b/src/org/kreed/vanilla/PreferencesActivity.java @@ -18,8 +18,6 @@ package org.kreed.vanilla; -import org.kreed.vanilla.R; - import android.os.Bundle; import android.preference.PreferenceActivity; import android.view.KeyEvent; @@ -54,4 +52,4 @@ public class PreferencesActivity extends PreferenceActivity { { return PlaybackActivity.handleKeyLongPress(keyCode); } -} \ No newline at end of file +} diff --git a/src/org/kreed/vanilla/SongSelector.java b/src/org/kreed/vanilla/SongSelector.java index 568685b0..44bde628 100644 --- a/src/org/kreed/vanilla/SongSelector.java +++ b/src/org/kreed/vanilla/SongSelector.java @@ -18,8 +18,6 @@ package org.kreed.vanilla; -import org.kreed.vanilla.R; - import android.content.ContentResolver; import android.content.Intent; import android.content.SharedPreferences;