Version 0.1 build 16
This commit is contained in:
parent
587dff0a75
commit
4169dd05b3
@ -19,7 +19,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.kreed.vanilla"
|
||||
android:versionName="0.1"
|
||||
android:versionCode="12"
|
||||
android:versionCode="16"
|
||||
android:installLocation="auto">
|
||||
<application
|
||||
android:icon="@drawable/icon"
|
||||
|
@ -11,3 +11,4 @@
|
||||
split.density=false
|
||||
# Project target.
|
||||
target=android-8
|
||||
proguard.config=proguard.config
|
||||
|
20
proguard.config
Normal file
20
proguard.config
Normal file
@ -0,0 +1,20 @@
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends android.app.Application
|
||||
-keep public class * extends android.view.View
|
||||
-keep public class * extends android.app.Service
|
||||
-keep public class * extends android.content.BroadcastReceiver
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
-keep public class * extends android.view.ViewGroup
|
||||
-keep public class * extends android.preference.Preference {
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
}
|
||||
-keep public class * extends android.view.View {
|
||||
public <init>(android.content.Context);
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
-optimizationpasses 2
|
||||
-flattenpackagehierarchy
|
||||
-printmapping map.txt
|
||||
-printseeds seeds.txt
|
||||
-printusage unused.txt
|
@ -61,7 +61,7 @@
|
||||
<string name="playing">Playing %s</string>
|
||||
<plurals name="added_to_playlist">
|
||||
<item quantity="one">1 song added to playlist %2$s.</item>
|
||||
<item quantity="other">%d songs added to playlist %s.</item>
|
||||
<item quantity="other">%1$d songs added to playlist %2$s.</item>
|
||||
</plurals>
|
||||
<string name="deleting">Deleting...</string>
|
||||
<string name="playlist_deleted">Playlist %s deleted.</string>
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
<string name="none">None</string>
|
||||
<string name="unknown">Unknown</string>
|
||||
<string name="title_by_artist">%s by %s</string>
|
||||
<string name="title_by_artist">%1$s by %2$s</string>
|
||||
|
||||
<!-- Preferences -->
|
||||
<plurals name="minutes">
|
||||
@ -120,4 +120,4 @@
|
||||
<string name="idle_timeout_summary">The amount of time that must pass before becoming idle</string>
|
||||
<string name="scrobble_title">Use ScrobbleDroid API</string>
|
||||
<string name="scrobble_summary">Scrobble to Last.FM through ScrobbleDroid or Simple Last.FM Scrobbler</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
93
src/org/kreed/vanilla/MiniPlaybackActivityLayout.java
Normal file
93
src/org/kreed/vanilla/MiniPlaybackActivityLayout.java
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Christopher Eby <kreed@kreed.org>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user