Massiv design optimizations and settings
|
|
@ -42,6 +42,10 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
compile files('../libs/jaudiotagger-2.0.4-20111207.115108-15.jar')
|
||||||
|
compile('com.crashlytics.sdk.android:crashlytics:2.2.1@aar') {
|
||||||
|
transitive = true;
|
||||||
|
}
|
||||||
compile 'com.afollestad:material-dialogs:0.6.4.1'
|
compile 'com.afollestad:material-dialogs:0.6.4.1'
|
||||||
compile 'com.android.support:appcompat-v7:22.0.0'
|
compile 'com.android.support:appcompat-v7:22.0.0'
|
||||||
compile 'com.android.support:recyclerview-v7:22.0.0'
|
compile 'com.android.support:recyclerview-v7:22.0.0'
|
||||||
|
|
@ -59,10 +63,8 @@ dependencies {
|
||||||
compile 'com.squareup.picasso:picasso:2.5.0'
|
compile 'com.squareup.picasso:picasso:2.5.0'
|
||||||
compile 'com.squareup:otto:1.3.6'
|
compile 'com.squareup:otto:1.3.6'
|
||||||
compile 'com.squareup.okhttp:okhttp:2.2.0'
|
compile 'com.squareup.okhttp:okhttp:2.2.0'
|
||||||
compile files('../libs/jaudiotagger-2.0.4-20111207.115108-15.jar')
|
|
||||||
compile 'asia.ivity.android:drag-sort-listview:1.0'
|
compile 'asia.ivity.android:drag-sort-listview:1.0'
|
||||||
compile 'de.hdodenhof:circleimageview:1.2.2'
|
compile 'de.hdodenhof:circleimageview:1.2.2'
|
||||||
compile('com.crashlytics.sdk.android:crashlytics:2.2.1@aar') {
|
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
|
||||||
transitive = true;
|
compile 'com.android.support:support-v4:22.0.0'
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,10 @@
|
||||||
android:name=".ui.activities.PlaylistDetailActivity"
|
android:name=".ui.activities.PlaylistDetailActivity"
|
||||||
android:label="@string/title_activity_playlist_detail" >
|
android:label="@string/title_activity_playlist_detail" >
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.activities.SettingsActivity"
|
||||||
|
android:label="@string/title_activity_settings" >
|
||||||
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
|
@ -1,319 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2014 Google Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.google.samples.apps.iosched.ui.widget;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.support.v4.view.PagerAdapter;
|
|
||||||
import android.support.v4.view.ViewPager;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.util.SparseArray;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.HorizontalScrollView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* To be used with ViewPager to provide a tab indicator component which give constant feedback as to
|
|
||||||
* the user's scroll progress.
|
|
||||||
* <p/>
|
|
||||||
* To use the component, simply add it to your view hierarchy. Then in your
|
|
||||||
* {@link android.app.Activity} or {@link android.support.v4.app.Fragment} call
|
|
||||||
* {@link #setViewPager(android.support.v4.view.ViewPager)} providing it the ViewPager this layout is being used for.
|
|
||||||
* <p/>
|
|
||||||
* The colors can be customized in two ways. The first and simplest is to provide an array of colors
|
|
||||||
* via {@link #setSelectedIndicatorColors(int...)}. The
|
|
||||||
* alternative is via the {@link com.google.samples.apps.iosched.ui.widget.SlidingTabLayout.TabColorizer} interface which provides you complete control over
|
|
||||||
* which color is used for any individual position.
|
|
||||||
* <p/>
|
|
||||||
* The views used as tabs can be customized by calling {@link #setCustomTabView(int, int)},
|
|
||||||
* providing the layout ID of your custom layout.
|
|
||||||
*/
|
|
||||||
public class SlidingTabLayout extends HorizontalScrollView {
|
|
||||||
private static final int TITLE_OFFSET_DIPS = 24;
|
|
||||||
private static final int TAB_VIEW_PADDING_DIPS = 16;
|
|
||||||
private static final int TAB_VIEW_TEXT_SIZE_SP = 12;
|
|
||||||
private final SlidingTabStrip mTabStrip;
|
|
||||||
private int mTitleOffset;
|
|
||||||
|
|
||||||
private int mTabViewLayoutId;
|
|
||||||
private int mTabViewTextViewId;
|
|
||||||
private boolean mDistributeEvenly;
|
|
||||||
|
|
||||||
private ViewPager mViewPager;
|
|
||||||
private SparseArray<String> mContentDescriptions = new SparseArray<String>();
|
|
||||||
private ViewPager.OnPageChangeListener mViewPagerPageChangeListener;
|
|
||||||
|
|
||||||
public SlidingTabLayout(Context context) {
|
|
||||||
this(context, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SlidingTabLayout(Context context, AttributeSet attrs) {
|
|
||||||
this(context, attrs, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SlidingTabLayout(Context context, AttributeSet attrs, int defStyle) {
|
|
||||||
super(context, attrs, defStyle);
|
|
||||||
|
|
||||||
// Disable the Scroll Bar
|
|
||||||
setHorizontalScrollBarEnabled(false);
|
|
||||||
// Make sure that the Tab Strips fills this View
|
|
||||||
setFillViewport(true);
|
|
||||||
|
|
||||||
mTitleOffset = (int) (TITLE_OFFSET_DIPS * getResources().getDisplayMetrics().density);
|
|
||||||
|
|
||||||
mTabStrip = new SlidingTabStrip(context);
|
|
||||||
addView(mTabStrip, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the custom {@link com.google.samples.apps.iosched.ui.widget.SlidingTabLayout.TabColorizer} to be used.
|
|
||||||
* <p/>
|
|
||||||
* If you only require simple custmisation then you can use
|
|
||||||
* {@link #setSelectedIndicatorColors(int...)} to achieve
|
|
||||||
* similar effects.
|
|
||||||
*/
|
|
||||||
public void setCustomTabColorizer(TabColorizer tabColorizer) {
|
|
||||||
mTabStrip.setCustomTabColorizer(tabColorizer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDistributeEvenly(boolean distributeEvenly) {
|
|
||||||
mDistributeEvenly = distributeEvenly;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the colors to be used for indicating the selected tab. These colors are treated as a
|
|
||||||
* circular array. Providing one color will mean that all tabs are indicated with the same color.
|
|
||||||
*/
|
|
||||||
public void setSelectedIndicatorColors(int... colors) {
|
|
||||||
mTabStrip.setSelectedIndicatorColors(colors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the {@link android.support.v4.view.ViewPager.OnPageChangeListener}. When using {@link com.google.samples.apps.iosched.ui.widget.SlidingTabLayout} you are
|
|
||||||
* required to set any {@link android.support.v4.view.ViewPager.OnPageChangeListener} through this method. This is so
|
|
||||||
* that the layout can update it's scroll position correctly.
|
|
||||||
*
|
|
||||||
* @see android.support.v4.view.ViewPager#setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener)
|
|
||||||
*/
|
|
||||||
public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
|
|
||||||
mViewPagerPageChangeListener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the custom layout to be inflated for the tab views.
|
|
||||||
*
|
|
||||||
* @param layoutResId Layout id to be inflated
|
|
||||||
* @param textViewId id of the {@link android.widget.TextView} in the inflated view
|
|
||||||
*/
|
|
||||||
public void setCustomTabView(int layoutResId, int textViewId) {
|
|
||||||
mTabViewLayoutId = layoutResId;
|
|
||||||
mTabViewTextViewId = textViewId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the associated view pager. Note that the assumption here is that the pager content
|
|
||||||
* (number of tabs and tab titles) does not change after this call has been made.
|
|
||||||
*/
|
|
||||||
public void setViewPager(ViewPager viewPager) {
|
|
||||||
mTabStrip.removeAllViews();
|
|
||||||
|
|
||||||
mViewPager = viewPager;
|
|
||||||
if (viewPager != null) {
|
|
||||||
viewPager.setOnPageChangeListener(new InternalViewPagerListener());
|
|
||||||
populateTabStrip();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void populateTabStrip() {
|
|
||||||
final PagerAdapter adapter = mViewPager.getAdapter();
|
|
||||||
final OnClickListener tabClickListener = new TabClickListener();
|
|
||||||
|
|
||||||
for (int i = 0; i < adapter.getCount(); i++) {
|
|
||||||
View tabView = null;
|
|
||||||
TextView tabTitleView = null;
|
|
||||||
|
|
||||||
if (mTabViewLayoutId != 0) {
|
|
||||||
// If there is a custom tab view layout id set, try and inflate it
|
|
||||||
tabView = LayoutInflater.from(getContext()).inflate(mTabViewLayoutId, mTabStrip,
|
|
||||||
false);
|
|
||||||
tabTitleView = (TextView) tabView.findViewById(mTabViewTextViewId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tabView == null) {
|
|
||||||
tabView = createDefaultTabView(getContext());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tabTitleView == null && TextView.class.isInstance(tabView)) {
|
|
||||||
tabTitleView = (TextView) tabView;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mDistributeEvenly) {
|
|
||||||
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tabView.getLayoutParams();
|
|
||||||
lp.width = 0;
|
|
||||||
lp.weight = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
tabTitleView.setText(adapter.getPageTitle(i));
|
|
||||||
tabView.setOnClickListener(tabClickListener);
|
|
||||||
String desc = mContentDescriptions.get(i, null);
|
|
||||||
if (desc != null) {
|
|
||||||
tabView.setContentDescription(desc);
|
|
||||||
}
|
|
||||||
|
|
||||||
mTabStrip.addView(tabView);
|
|
||||||
if (i == mViewPager.getCurrentItem()) {
|
|
||||||
tabView.setSelected(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a default view to be used for tabs. This is called if a custom tab view is not set via
|
|
||||||
* {@link #setCustomTabView(int, int)}.
|
|
||||||
*/
|
|
||||||
protected TextView createDefaultTabView(Context context) {
|
|
||||||
TextView textView = new TextView(context);
|
|
||||||
textView.setGravity(Gravity.CENTER);
|
|
||||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP);
|
|
||||||
textView.setTypeface(Typeface.DEFAULT_BOLD);
|
|
||||||
textView.setLayoutParams(new LinearLayout.LayoutParams(
|
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
|
|
||||||
|
|
||||||
TypedValue outValue = new TypedValue();
|
|
||||||
getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground,
|
|
||||||
outValue, true);
|
|
||||||
textView.setBackgroundResource(outValue.resourceId);
|
|
||||||
textView.setAllCaps(true);
|
|
||||||
|
|
||||||
int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density);
|
|
||||||
textView.setPadding(padding, padding, padding, padding);
|
|
||||||
|
|
||||||
return textView;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContentDescription(int i, String desc) {
|
|
||||||
mContentDescriptions.put(i, desc);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onAttachedToWindow() {
|
|
||||||
super.onAttachedToWindow();
|
|
||||||
|
|
||||||
if (mViewPager != null) {
|
|
||||||
scrollToTab(mViewPager.getCurrentItem(), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void scrollToTab(int tabIndex, int positionOffset) {
|
|
||||||
final int tabStripChildCount = mTabStrip.getChildCount();
|
|
||||||
if (tabStripChildCount == 0 || tabIndex < 0 || tabIndex >= tabStripChildCount) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
View selectedChild = mTabStrip.getChildAt(tabIndex);
|
|
||||||
if (selectedChild != null) {
|
|
||||||
int targetScrollX = selectedChild.getLeft() + positionOffset;
|
|
||||||
|
|
||||||
if (tabIndex > 0 || positionOffset > 0) {
|
|
||||||
// If we're not at the first child and are mid-scroll, make sure we obey the offset
|
|
||||||
targetScrollX -= mTitleOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollTo(targetScrollX, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows complete control over the colors drawn in the tab layout. Set with
|
|
||||||
* {@link #setCustomTabColorizer(com.google.samples.apps.iosched.ui.widget.SlidingTabLayout.TabColorizer)}.
|
|
||||||
*/
|
|
||||||
public interface TabColorizer {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return return the color of the indicator used when {@code position} is selected.
|
|
||||||
*/
|
|
||||||
int getIndicatorColor(int position);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private class InternalViewPagerListener implements ViewPager.OnPageChangeListener {
|
|
||||||
private int mScrollState;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
||||||
int tabStripChildCount = mTabStrip.getChildCount();
|
|
||||||
if ((tabStripChildCount == 0) || (position < 0) || (position >= tabStripChildCount)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mTabStrip.onViewPagerPageChanged(position, positionOffset);
|
|
||||||
|
|
||||||
View selectedTitle = mTabStrip.getChildAt(position);
|
|
||||||
int extraOffset = (selectedTitle != null)
|
|
||||||
? (int) (positionOffset * selectedTitle.getWidth())
|
|
||||||
: 0;
|
|
||||||
scrollToTab(position, extraOffset);
|
|
||||||
|
|
||||||
if (mViewPagerPageChangeListener != null) {
|
|
||||||
mViewPagerPageChangeListener.onPageScrolled(position, positionOffset,
|
|
||||||
positionOffsetPixels);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageSelected(int position) {
|
|
||||||
if (mScrollState == ViewPager.SCROLL_STATE_IDLE) {
|
|
||||||
mTabStrip.onViewPagerPageChanged(position, 0f);
|
|
||||||
scrollToTab(position, 0);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < mTabStrip.getChildCount(); i++) {
|
|
||||||
mTabStrip.getChildAt(i).setSelected(position == i);
|
|
||||||
}
|
|
||||||
if (mViewPagerPageChangeListener != null) {
|
|
||||||
mViewPagerPageChangeListener.onPageSelected(position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPageScrollStateChanged(int state) {
|
|
||||||
mScrollState = state;
|
|
||||||
|
|
||||||
if (mViewPagerPageChangeListener != null) {
|
|
||||||
mViewPagerPageChangeListener.onPageScrollStateChanged(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TabClickListener implements OnClickListener {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
for (int i = 0; i < mTabStrip.getChildCount(); i++) {
|
|
||||||
if (v == mTabStrip.getChildAt(i)) {
|
|
||||||
mViewPager.setCurrentItem(i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,166 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2014 Google Inc. All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.google.samples.apps.iosched.ui.widget;
|
|
||||||
|
|
||||||
import android.R;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
class SlidingTabStrip extends LinearLayout {
|
|
||||||
|
|
||||||
private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 0;
|
|
||||||
private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26;
|
|
||||||
private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 3;
|
|
||||||
private static final int DEFAULT_SELECTED_INDICATOR_COLOR = 0xFF33B5E5;
|
|
||||||
|
|
||||||
private final int mBottomBorderThickness;
|
|
||||||
private final Paint mBottomBorderPaint;
|
|
||||||
|
|
||||||
private final int mSelectedIndicatorThickness;
|
|
||||||
private final Paint mSelectedIndicatorPaint;
|
|
||||||
|
|
||||||
private final int mDefaultBottomBorderColor;
|
|
||||||
private final SimpleTabColorizer mDefaultTabColorizer;
|
|
||||||
private int mSelectedPosition;
|
|
||||||
private float mSelectionOffset;
|
|
||||||
private SlidingTabLayout.TabColorizer mCustomTabColorizer;
|
|
||||||
|
|
||||||
SlidingTabStrip(Context context) {
|
|
||||||
this(context, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
SlidingTabStrip(Context context, AttributeSet attrs) {
|
|
||||||
super(context, attrs);
|
|
||||||
setWillNotDraw(false);
|
|
||||||
|
|
||||||
final float density = getResources().getDisplayMetrics().density;
|
|
||||||
|
|
||||||
TypedValue outValue = new TypedValue();
|
|
||||||
context.getTheme().resolveAttribute(R.attr.colorForeground, outValue, true);
|
|
||||||
final int themeForegroundColor = outValue.data;
|
|
||||||
|
|
||||||
mDefaultBottomBorderColor = setColorAlpha(themeForegroundColor,
|
|
||||||
DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);
|
|
||||||
|
|
||||||
mDefaultTabColorizer = new SimpleTabColorizer();
|
|
||||||
mDefaultTabColorizer.setIndicatorColors(DEFAULT_SELECTED_INDICATOR_COLOR);
|
|
||||||
|
|
||||||
mBottomBorderThickness = (int) (DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
|
|
||||||
mBottomBorderPaint = new Paint();
|
|
||||||
mBottomBorderPaint.setColor(mDefaultBottomBorderColor);
|
|
||||||
|
|
||||||
mSelectedIndicatorThickness = (int) (SELECTED_INDICATOR_THICKNESS_DIPS * density);
|
|
||||||
mSelectedIndicatorPaint = new Paint();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the alpha value of the {@code color} to be the given {@code alpha} value.
|
|
||||||
*/
|
|
||||||
private static int setColorAlpha(int color, byte alpha) {
|
|
||||||
return Color.argb(alpha, Color.red(color), Color.green(color), Color.blue(color));
|
|
||||||
}
|
|
||||||
|
|
||||||
void setCustomTabColorizer(SlidingTabLayout.TabColorizer customTabColorizer) {
|
|
||||||
mCustomTabColorizer = customTabColorizer;
|
|
||||||
invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSelectedIndicatorColors(int... colors) {
|
|
||||||
// Make sure that the custom colorizer is removed
|
|
||||||
mCustomTabColorizer = null;
|
|
||||||
mDefaultTabColorizer.setIndicatorColors(colors);
|
|
||||||
invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
void onViewPagerPageChanged(int position, float positionOffset) {
|
|
||||||
mSelectedPosition = position;
|
|
||||||
mSelectionOffset = positionOffset;
|
|
||||||
invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDraw(Canvas canvas) {
|
|
||||||
final int height = getHeight();
|
|
||||||
final int childCount = getChildCount();
|
|
||||||
final SlidingTabLayout.TabColorizer tabColorizer = mCustomTabColorizer != null
|
|
||||||
? mCustomTabColorizer
|
|
||||||
: mDefaultTabColorizer;
|
|
||||||
|
|
||||||
// Thick colored underline below the current selection
|
|
||||||
if (childCount > 0) {
|
|
||||||
View selectedTitle = getChildAt(mSelectedPosition);
|
|
||||||
int left = selectedTitle.getLeft();
|
|
||||||
int right = selectedTitle.getRight();
|
|
||||||
int color = tabColorizer.getIndicatorColor(mSelectedPosition);
|
|
||||||
|
|
||||||
if (mSelectionOffset > 0f && mSelectedPosition < (getChildCount() - 1)) {
|
|
||||||
int nextColor = tabColorizer.getIndicatorColor(mSelectedPosition + 1);
|
|
||||||
if (color != nextColor) {
|
|
||||||
color = blendColors(nextColor, color, mSelectionOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw the selection partway between the tabs
|
|
||||||
View nextTitle = getChildAt(mSelectedPosition + 1);
|
|
||||||
left = (int) (mSelectionOffset * nextTitle.getLeft() +
|
|
||||||
(1.0f - mSelectionOffset) * left);
|
|
||||||
right = (int) (mSelectionOffset * nextTitle.getRight() +
|
|
||||||
(1.0f - mSelectionOffset) * right);
|
|
||||||
}
|
|
||||||
|
|
||||||
mSelectedIndicatorPaint.setColor(color);
|
|
||||||
|
|
||||||
canvas.drawRect(left, height - mSelectedIndicatorThickness, right,
|
|
||||||
height, mSelectedIndicatorPaint);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Thin underline along the entire bottom edge
|
|
||||||
canvas.drawRect(0, height - mBottomBorderThickness, getWidth(), height, mBottomBorderPaint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Blend {@code color1} and {@code color2} using the given ratio.
|
|
||||||
*
|
|
||||||
* @param ratio of which to blend. 1.0 will return {@code color1}, 0.5 will give an even blend,
|
|
||||||
* 0.0 will return {@code color2}.
|
|
||||||
*/
|
|
||||||
private static int blendColors(int color1, int color2, float ratio) {
|
|
||||||
final float inverseRation = 1f - ratio;
|
|
||||||
float r = (Color.red(color1) * ratio) + (Color.red(color2) * inverseRation);
|
|
||||||
float g = (Color.green(color1) * ratio) + (Color.green(color2) * inverseRation);
|
|
||||||
float b = (Color.blue(color1) * ratio) + (Color.blue(color2) * inverseRation);
|
|
||||||
return Color.rgb((int) r, (int) g, (int) b);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class SimpleTabColorizer implements SlidingTabLayout.TabColorizer {
|
|
||||||
private int[] mIndicatorColors;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final int getIndicatorColor(int position) {
|
|
||||||
return mIndicatorColors[position % mIndicatorColors.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
void setIndicatorColors(int... colors) {
|
|
||||||
mIndicatorColors = colors;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -18,11 +18,9 @@ import io.fabric.sdk.android.Fabric;
|
||||||
* Created by karim on 25.11.14.
|
* Created by karim on 25.11.14.
|
||||||
*/
|
*/
|
||||||
public class App extends Application {
|
public class App extends Application {
|
||||||
private static final String TAG = App.class.getSimpleName();
|
public static final String TAG = App.class.getSimpleName();
|
||||||
|
|
||||||
public static Bus bus = new Bus(ThreadEnforcer.MAIN);
|
public static Bus bus = new Bus(ThreadEnforcer.MAIN);
|
||||||
|
|
||||||
private int appTheme;
|
|
||||||
private RequestQueue requestQueue;
|
private RequestQueue requestQueue;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -33,18 +31,6 @@ public class App extends Application {
|
||||||
//Picasso.with(this).setIndicatorsEnabled(true);// debug only
|
//Picasso.with(this).setIndicatorsEnabled(true);// debug only
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAppTheme() {
|
|
||||||
if (appTheme == 0) {
|
|
||||||
appTheme = PreferenceManager.getDefaultSharedPreferences(this).getInt(AppKeys.SP_THEME, R.style.Theme_MaterialMusic);
|
|
||||||
}
|
|
||||||
return appTheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppTheme(int appTheme) {
|
|
||||||
this.appTheme = appTheme;
|
|
||||||
PreferenceManager.getDefaultSharedPreferences(this).edit().putInt(AppKeys.SP_THEME, appTheme).apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addToVolleyRequestQueue(Request request) {
|
public void addToVolleyRequestQueue(Request request) {
|
||||||
request.setTag(TAG);
|
request.setTag(TAG);
|
||||||
getVolleyRequestQueue().add(request);
|
getVolleyRequestQueue().add(request);
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,11 @@ import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
||||||
import com.kabouzeid.gramophone.model.Album;
|
import com.kabouzeid.gramophone.model.Album;
|
||||||
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||||
import com.kabouzeid.gramophone.util.Util;
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
|
@ -47,7 +49,7 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
||||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||||
final Album album = dataSet.get(position);
|
final Album album = dataSet.get(position);
|
||||||
|
|
||||||
if (usePalette) resetColors(holder.title, holder.artist, holder.footer);
|
resetColors(holder.title, holder.artist, holder.footer);
|
||||||
Picasso.with(activity)
|
Picasso.with(activity)
|
||||||
.load(MusicUtil.getAlbumArtUri(album.id))
|
.load(MusicUtil.getAlbumArtUri(album.id))
|
||||||
.placeholder(R.drawable.default_album_art)
|
.placeholder(R.drawable.default_album_art)
|
||||||
|
|
@ -109,8 +111,7 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
||||||
|
|
||||||
public AlbumAdapter(Activity activity) {
|
public AlbumAdapter(Activity activity) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
//TODO shared prefs
|
usePalette = PreferenceUtils.getInstance(activity).coloredAlbumFootersEnabled();
|
||||||
usePalette = true;
|
|
||||||
loadDataSet();
|
loadDataSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,7 +127,7 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
||||||
if (vibrantSwatch != null) {
|
if (vibrantSwatch != null) {
|
||||||
title.setTextColor(vibrantSwatch.getTitleTextColor());
|
title.setTextColor(vibrantSwatch.getTitleTextColor());
|
||||||
artist.setTextColor(vibrantSwatch.getTitleTextColor());
|
artist.setTextColor(vibrantSwatch.getTitleTextColor());
|
||||||
ViewUtil.animateViewColor(footer, activity.getResources().getColor(R.color.materialmusic_default_bar_color), vibrantSwatch.getRgb());
|
ViewUtil.animateViewColor(footer, Util.resolveColor(activity, R.attr.default_bar_color), vibrantSwatch.getRgb());
|
||||||
} else {
|
} else {
|
||||||
paletteBlackAndWhite(title, artist, footer);
|
paletteBlackAndWhite(title, artist, footer);
|
||||||
}
|
}
|
||||||
|
|
@ -137,14 +138,14 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
||||||
private void paletteBlackAndWhite(final TextView title, final TextView artist, final View footer) {
|
private void paletteBlackAndWhite(final TextView title, final TextView artist, final View footer) {
|
||||||
title.setTextColor(Util.resolveColor(activity, R.attr.title_text_color));
|
title.setTextColor(Util.resolveColor(activity, R.attr.title_text_color));
|
||||||
artist.setTextColor(Util.resolveColor(activity, R.attr.caption_text_color));
|
artist.setTextColor(Util.resolveColor(activity, R.attr.caption_text_color));
|
||||||
int defaultBarColor = activity.getResources().getColor(R.color.materialmusic_default_bar_color);
|
int defaultBarColor = Util.resolveColor(activity, R.attr.default_bar_color);
|
||||||
ViewUtil.animateViewColor(footer, defaultBarColor, defaultBarColor);
|
ViewUtil.animateViewColor(footer, defaultBarColor, defaultBarColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetColors(final TextView title, final TextView artist, final View footer) {
|
private void resetColors(final TextView title, final TextView artist, final View footer) {
|
||||||
title.setTextColor(Util.resolveColor(activity, R.attr.title_text_color));
|
title.setTextColor(Util.resolveColor(activity, R.attr.title_text_color));
|
||||||
artist.setTextColor(Util.resolveColor(activity, R.attr.caption_text_color));
|
artist.setTextColor(Util.resolveColor(activity, R.attr.caption_text_color));
|
||||||
int defaultBarColor = activity.getResources().getColor(R.color.materialmusic_default_bar_color);
|
int defaultBarColor = Util.resolveColor(activity, R.attr.default_bar_color);
|
||||||
footer.setBackgroundColor(defaultBarColor);
|
footer.setBackgroundColor(defaultBarColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,4 +171,14 @@ public class AlbumAdapter extends RecyclerView.Adapter<AlbumAdapter.ViewHolder>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onUIChangeEvent(UIPreferenceChangedEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case UIPreferenceChangedEvent.ALBUM_OVERVIEW_PALETTE_CHANGED:
|
||||||
|
usePalette = (boolean) event.getValue();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,12 @@ public class NavigationDrawerItemAdapter extends ArrayAdapter<NavigationDrawerIt
|
||||||
TextView title = (TextView) convertView.findViewById(R.id.title);
|
TextView title = (TextView) convertView.findViewById(R.id.title);
|
||||||
ImageView icon = (ImageView) convertView.findViewById(R.id.album_art);
|
ImageView icon = (ImageView) convertView.findViewById(R.id.album_art);
|
||||||
title.setText(item.title);
|
title.setText(item.title);
|
||||||
icon.setImageResource(item.imageRes);
|
|
||||||
if (position == currentChecked) {
|
if (position == currentChecked) {
|
||||||
title.setTextColor(Util.resolveColor(getContext(), R.attr.colorAccent));
|
title.setTextColor(Util.resolveColor(getContext(), R.attr.colorAccent));
|
||||||
|
icon.setImageDrawable(Util.getTintedDrawable(getContext().getResources(), item.imageRes, Util.resolveColor(getContext(), R.attr.colorAccent)));
|
||||||
} else {
|
} else {
|
||||||
title.setTextColor(Util.resolveColor(getContext(), R.attr.title_text_color));
|
title.setTextColor(Util.resolveColor(getContext(), R.attr.title_text_color));
|
||||||
|
icon.setImageDrawable(Util.getTintedDrawable(getContext().getResources(), item.imageRes, Util.resolveColor(getContext(), R.attr.title_text_color)));
|
||||||
}
|
}
|
||||||
View container = convertView.findViewById(R.id.container);
|
View container = convertView.findViewById(R.id.container);
|
||||||
container.setActivated(position == currentChecked);
|
container.setActivated(position == currentChecked);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.tageditor.SongTagEditorActivity;
|
import com.kabouzeid.gramophone.ui.activities.tageditor.SongTagEditorActivity;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -50,10 +51,9 @@ public class PlayingQueueAdapter extends ArrayAdapter<Song> {
|
||||||
title.setText(song.title);
|
title.setText(song.title);
|
||||||
if (MusicPlayerRemote.getPosition() == position) {
|
if (MusicPlayerRemote.getPosition() == position) {
|
||||||
playingIndicator.setVisibility(View.VISIBLE);
|
playingIndicator.setVisibility(View.VISIBLE);
|
||||||
playingIndicator.setImageResource(R.drawable.ic_speaker_white_48dp);
|
playingIndicator.setImageDrawable(Util.getTintedDrawable(getContext().getResources(), R.drawable.ic_speaker_white_48dp, Util.resolveColor(getContext(), R.attr.themed_drawable_color)));
|
||||||
} else {
|
} else {
|
||||||
playingIndicator.setVisibility(View.GONE);
|
playingIndicator.setVisibility(View.GONE);
|
||||||
playingIndicator.setImageBitmap(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
overflowButton.setOnClickListener(new View.OnClickListener() {
|
overflowButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
||||||
import com.kabouzeid.gramophone.model.Playlist;
|
import com.kabouzeid.gramophone.model.Playlist;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -60,11 +62,14 @@ public class PlaylistAdapter extends RecyclerView.Adapter<PlaylistAdapter.ViewHo
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
public TextView playlistName;
|
public TextView playlistName;
|
||||||
private ImageView menu;
|
private ImageView menu;
|
||||||
|
private ImageView playlistIcon;
|
||||||
|
|
||||||
public ViewHolder(View itemView) {
|
public ViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
playlistName = (TextView) itemView.findViewById(R.id.playlist_name);
|
playlistName = (TextView) itemView.findViewById(R.id.playlist_name);
|
||||||
menu = (ImageView) itemView.findViewById(R.id.menu);
|
menu = (ImageView) itemView.findViewById(R.id.menu);
|
||||||
|
playlistIcon = (ImageView) itemView.findViewById(R.id.playlist_icon);
|
||||||
|
playlistIcon.setImageDrawable(Util.getTintedDrawable(activity.getResources(), R.drawable.ic_queue_music_white_24dp, Util.resolveColor(activity, R.attr.themed_drawable_color)));
|
||||||
itemView.setOnClickListener(this);
|
itemView.setOnClickListener(this);
|
||||||
menu.setOnClickListener(new View.OnClickListener() {
|
menu.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.model.SearchEntry;
|
import com.kabouzeid.gramophone.model.SearchEntry;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.SearchActivity;
|
import com.kabouzeid.gramophone.ui.activities.SearchActivity;
|
||||||
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -42,7 +43,7 @@ public class SearchAdapter extends ArrayAdapter<SearchEntry> {
|
||||||
title.setTypeface(null, Typeface.BOLD);
|
title.setTypeface(null, Typeface.BOLD);
|
||||||
subTitle.setVisibility(View.GONE);
|
subTitle.setVisibility(View.GONE);
|
||||||
imageView.setVisibility(View.GONE);
|
imageView.setVisibility(View.GONE);
|
||||||
convertView.setBackgroundColor(getContext().getResources().getColor(R.color.materialmusic_default_bar_color));
|
convertView.setBackgroundColor(Util.resolveColor(getContext(), R.attr.default_bar_color));
|
||||||
} else if (item instanceof Song) {
|
} else if (item instanceof Song) {
|
||||||
title.setTypeface(null, Typeface.NORMAL);
|
title.setTypeface(null, Typeface.NORMAL);
|
||||||
subTitle.setVisibility(View.VISIBLE);
|
subTitle.setVisibility(View.VISIBLE);
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public class AlbumSongAdapter extends RecyclerView.Adapter<AlbumSongAdapter.View
|
||||||
|
|
||||||
holder.songTitle.setText(song.title);
|
holder.songTitle.setText(song.title);
|
||||||
holder.trackNumber.setText(String.valueOf(MusicUtil.getFixedTrackNumber(song.trackNumber)));
|
holder.trackNumber.setText(String.valueOf(MusicUtil.getFixedTrackNumber(song.trackNumber)));
|
||||||
holder.songDuration.setText(MusicUtil.getReadableDurationString(song.duration));
|
holder.artistName.setText(MusicUtil.getReadableDurationString(song.duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -65,14 +65,14 @@ public class AlbumSongAdapter extends RecyclerView.Adapter<AlbumSongAdapter.View
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
TextView songTitle;
|
TextView songTitle;
|
||||||
TextView trackNumber;
|
TextView trackNumber;
|
||||||
TextView songDuration;
|
TextView artistName;
|
||||||
ImageView overflowButton;
|
ImageView overflowButton;
|
||||||
|
|
||||||
public ViewHolder(View itemView) {
|
public ViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
songTitle = (TextView) itemView.findViewById(R.id.song_title);
|
songTitle = (TextView) itemView.findViewById(R.id.song_title);
|
||||||
trackNumber = (TextView) itemView.findViewById(R.id.track_number);
|
trackNumber = (TextView) itemView.findViewById(R.id.track_number);
|
||||||
songDuration = (TextView) itemView.findViewById(R.id.song_duration);
|
artistName = (TextView) itemView.findViewById(R.id.song_info);
|
||||||
overflowButton = (ImageView) itemView.findViewById(R.id.menu);
|
overflowButton = (ImageView) itemView.findViewById(R.id.menu);
|
||||||
overflowButton.setOnClickListener(this);
|
overflowButton.setOnClickListener(this);
|
||||||
itemView.setOnClickListener(new View.OnClickListener() {
|
itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
||||||
|
|
@ -83,11 +83,12 @@ public class SongAdapter extends RecyclerView.Adapter<SongAdapter.ViewHolder> {
|
||||||
holder.songTitle.setTextColor(accentColor);
|
holder.songTitle.setTextColor(accentColor);
|
||||||
holder.songInfo.setVisibility(View.GONE);
|
holder.songInfo.setVisibility(View.GONE);
|
||||||
holder.overflowButton.setVisibility(View.GONE);
|
holder.overflowButton.setVisibility(View.GONE);
|
||||||
final int padding = activity.getResources().getDimensionPixelSize(R.dimen.default_item_margin);
|
final int padding = activity.getResources().getDimensionPixelSize(R.dimen.default_item_margin) / 2;
|
||||||
holder.albumArt.setPadding(padding, padding, padding, padding);
|
holder.albumArt.setPadding(padding, padding, padding, padding);
|
||||||
holder.albumArt.setColorFilter(accentColor);
|
holder.albumArt.setColorFilter(accentColor);
|
||||||
holder.albumArt.setImageResource(R.drawable.ic_shuffle_white_48dp);
|
holder.albumArt.setImageResource(R.drawable.ic_shuffle_white_48dp);
|
||||||
holder.separator.setVisibility(View.VISIBLE);
|
holder.separator.setVisibility(View.VISIBLE);
|
||||||
|
holder.short_separator.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,6 +103,7 @@ public class SongAdapter extends RecyclerView.Adapter<SongAdapter.ViewHolder> {
|
||||||
ImageView overflowButton;
|
ImageView overflowButton;
|
||||||
ImageView albumArt;
|
ImageView albumArt;
|
||||||
View separator;
|
View separator;
|
||||||
|
View short_separator;
|
||||||
|
|
||||||
public ViewHolder(View itemView) {
|
public ViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
@ -110,6 +112,7 @@ public class SongAdapter extends RecyclerView.Adapter<SongAdapter.ViewHolder> {
|
||||||
albumArt = (ImageView) itemView.findViewById(R.id.album_art);
|
albumArt = (ImageView) itemView.findViewById(R.id.album_art);
|
||||||
overflowButton = (ImageView) itemView.findViewById(R.id.menu);
|
overflowButton = (ImageView) itemView.findViewById(R.id.menu);
|
||||||
separator = itemView.findViewById(R.id.separator);
|
separator = itemView.findViewById(R.id.separator);
|
||||||
|
short_separator = itemView.findViewById(R.id.short_separator);
|
||||||
|
|
||||||
overflowButton.setOnClickListener(this);
|
overflowButton.setOnClickListener(this);
|
||||||
itemView.setOnClickListener(new View.OnClickListener() {
|
itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,10 @@ public class MusicPlayerRemote {
|
||||||
public static Song getCurrentSong() {
|
public static Song getCurrentSong() {
|
||||||
final int position = getPosition();
|
final int position = getPosition();
|
||||||
if (position != -1) {
|
if (position != -1) {
|
||||||
return getPlayingQueue().get(position);
|
try {
|
||||||
|
return getPlayingQueue().get(position);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new Song();
|
return new Song();
|
||||||
}
|
}
|
||||||
|
|
@ -222,10 +225,11 @@ public class MusicPlayerRemote {
|
||||||
if (musicService != null) {
|
if (musicService != null) {
|
||||||
musicService.setShuffleMode(shuffleMode);
|
musicService.setShuffleMode(shuffleMode);
|
||||||
return true;
|
return true;
|
||||||
} return false;
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void forceSetShuffleMode(final Context context, final int shuffleMode){
|
public static void forceSetShuffleMode(final Context context, final int shuffleMode) {
|
||||||
if (musicService != null) {
|
if (musicService != null) {
|
||||||
musicService.setShuffleMode(shuffleMode);
|
musicService.setShuffleMode(shuffleMode);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -235,7 +239,7 @@ public class MusicPlayerRemote {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void shuffleAllSongs(final Context context){
|
public static void shuffleAllSongs(final Context context) {
|
||||||
List<Song> songs = SongLoader.getAllSongs(context);
|
List<Song> songs = SongLoader.getAllSongs(context);
|
||||||
MusicPlayerRemote.openQueue(songs, new Random().nextInt(songs.size()), true);
|
MusicPlayerRemote.openQueue(songs, new Random().nextInt(songs.size()), true);
|
||||||
forceSetShuffleMode(context, MusicService.SHUFFLE_MODE_SHUFFLE);
|
forceSetShuffleMode(context, MusicService.SHUFFLE_MODE_SHUFFLE);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class AlbumLoader {
|
||||||
MediaStore.Audio.AlbumColumns.NUMBER_OF_SONGS,
|
MediaStore.Audio.AlbumColumns.NUMBER_OF_SONGS,
|
||||||
/* 5 */
|
/* 5 */
|
||||||
MediaStore.Audio.AlbumColumns.FIRST_YEAR
|
MediaStore.Audio.AlbumColumns.FIRST_YEAR
|
||||||
}, selection, values, PreferenceUtils.getInstace(context).getAlbumSortOrder());
|
}, selection, values, PreferenceUtils.getInstance(context).getAlbumSortOrder());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Album getAlbum(Context context, int albumId) {
|
public static Album getAlbum(Context context, int albumId) {
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,6 @@ public class AlbumSongLoader {
|
||||||
MediaStore.Audio.AudioColumns.TRACK,
|
MediaStore.Audio.AudioColumns.TRACK,
|
||||||
/* 6 */
|
/* 6 */
|
||||||
MediaStore.Audio.AudioColumns.ARTIST_ID
|
MediaStore.Audio.AudioColumns.ARTIST_ID
|
||||||
}, selection.toString(), null, PreferenceUtils.getInstace(context).getAlbumSongSortOrder());
|
}, selection.toString(), null, PreferenceUtils.getInstance(context).getAlbumSongSortOrder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,6 @@ public class ArtistAlbumLoader {
|
||||||
MediaStore.Audio.AlbumColumns.NUMBER_OF_SONGS,
|
MediaStore.Audio.AlbumColumns.NUMBER_OF_SONGS,
|
||||||
/* 4 */
|
/* 4 */
|
||||||
MediaStore.Audio.AlbumColumns.FIRST_YEAR
|
MediaStore.Audio.AlbumColumns.FIRST_YEAR
|
||||||
}, null, null, PreferenceUtils.getInstace(context).getArtistAlbumSortOrder());
|
}, null, null, PreferenceUtils.getInstance(context).getArtistAlbumSortOrder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class ArtistLoader {
|
||||||
MediaStore.Audio.ArtistColumns.NUMBER_OF_ALBUMS,
|
MediaStore.Audio.ArtistColumns.NUMBER_OF_ALBUMS,
|
||||||
/* 3 */
|
/* 3 */
|
||||||
MediaStore.Audio.ArtistColumns.NUMBER_OF_TRACKS
|
MediaStore.Audio.ArtistColumns.NUMBER_OF_TRACKS
|
||||||
}, selection, values, PreferenceUtils.getInstace(context).getArtistSortOrder());
|
}, selection, values, PreferenceUtils.getInstance(context).getArtistSortOrder());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Artist getArtist(Context context, int artistId) {
|
public static Artist getArtist(Context context, int artistId) {
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,6 @@ public class ArtistSongLoader {
|
||||||
MediaStore.Audio.AudioColumns.TRACK,
|
MediaStore.Audio.AudioColumns.TRACK,
|
||||||
/* 6 */
|
/* 6 */
|
||||||
MediaStore.Audio.AudioColumns.ALBUM_ID
|
MediaStore.Audio.AudioColumns.ALBUM_ID
|
||||||
}, selection.toString(), null, PreferenceUtils.getInstace(context).getArtistSongSortOrder());
|
}, selection.toString(), null, PreferenceUtils.getInstance(context).getArtistSongSortOrder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ import java.util.List;
|
||||||
* Created by karim on 29.12.14.
|
* Created by karim on 29.12.14.
|
||||||
*/
|
*/
|
||||||
public class SongLoader {
|
public class SongLoader {
|
||||||
|
private static final String BASE_SELECTION = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''";
|
||||||
|
|
||||||
public static List<Song> getAllSongs(Context context) {
|
public static List<Song> getAllSongs(Context context) {
|
||||||
Cursor cursor = makeSongCursor(context);
|
Cursor cursor = makeSongCursor(context);
|
||||||
List<Song> songs = new ArrayList<>();
|
List<Song> songs = new ArrayList<>();
|
||||||
|
|
@ -40,11 +42,16 @@ public class SongLoader {
|
||||||
return songs;
|
return songs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Cursor makeSongCursor(final Context context) {
|
public static Cursor makeSongCursor(final Context context) {
|
||||||
return makeSongCursor(context, MediaStore.Audio.AudioColumns.IS_MUSIC + "=?", new String[]{"1"});
|
return makeSongCursor(context, MediaStore.Audio.AudioColumns.IS_MUSIC + "=?", new String[]{"1"});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Cursor makeSongCursor(final Context context, final String selection, final String[] values) {
|
public static Cursor makeSongCursor(final Context context, final String selection, final String[] values) {
|
||||||
|
String finalSelection = BASE_SELECTION;
|
||||||
|
if(selection != null){
|
||||||
|
finalSelection += " AND " + selection;
|
||||||
|
}
|
||||||
|
|
||||||
return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
|
return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
|
||||||
new String[]{
|
new String[]{
|
||||||
/* 0 */
|
/* 0 */
|
||||||
|
|
@ -63,7 +70,7 @@ public class SongLoader {
|
||||||
MediaStore.Audio.AudioColumns.ARTIST_ID,
|
MediaStore.Audio.AudioColumns.ARTIST_ID,
|
||||||
/* 7 */
|
/* 7 */
|
||||||
MediaStore.Audio.AudioColumns.ALBUM_ID
|
MediaStore.Audio.AudioColumns.ALBUM_ID
|
||||||
}, selection, values, PreferenceUtils.getInstace(context).getSongSortOrder());
|
}, finalSelection, values, PreferenceUtils.getInstance(context).getSongSortOrder());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Song> getSongs(final Context context, final String query) {
|
public static List<Song> getSongs(final Context context, final String query) {
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,7 @@ package com.kabouzeid.gramophone.misc;
|
||||||
public final class AppKeys {
|
public final class AppKeys {
|
||||||
public static final String CL_CURRENT_ACTIVITY = "Current activity";
|
public static final String CL_CURRENT_ACTIVITY = "Current activity";
|
||||||
|
|
||||||
public static final String SP_THEME = "com.kabouzeid.gramophone.THEME";
|
|
||||||
public static final String SP_VIEWPAGER_ITEM_POSITION = "com.kabouzeid.gramophone.NAVIGATION_DRAWER_ITEM_POSITION";
|
|
||||||
public static final String SP_USER_LEARNED_DRAWER = "com.kabouzeid.gramophone.NAVIGATION_DRAWER_LEARNED";
|
public static final String SP_USER_LEARNED_DRAWER = "com.kabouzeid.gramophone.NAVIGATION_DRAWER_LEARNED";
|
||||||
public static final String SP_ONLY_ON_WIFI = "com.kabouzeid.gramophone.ONLY_ON_WIFI";
|
|
||||||
public static final String SP_SHUFFLE_MODE = "com.kabouzeid.gramophone.SHUFFLE_MODE";
|
public static final String SP_SHUFFLE_MODE = "com.kabouzeid.gramophone.SHUFFLE_MODE";
|
||||||
public static final String SP_REPEAT_MODE = "com.kabouzeid.gramophone.REPEAT_MODE";
|
public static final String SP_REPEAT_MODE = "com.kabouzeid.gramophone.REPEAT_MODE";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.kabouzeid.gramophone.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by karim on 28.03.15.
|
||||||
|
*/
|
||||||
|
public class UIPreferenceChangedEvent {
|
||||||
|
public static final int THEME_CHANGED = 0;
|
||||||
|
public static final int ALBUM_OVERVIEW_PALETTE_CHANGED = 1;
|
||||||
|
public static final int COLORED_NAVIGATION_BAR_ARTIST_CHANGED = 2;
|
||||||
|
public static final int COLORED_NAVIGATION_BAR_ALBUM_CHANGED = 3;
|
||||||
|
public static final int PLAYBACK_CONTROLLER_CARD_CHANGED = 4;
|
||||||
|
|
||||||
|
private int action;
|
||||||
|
private Object value;
|
||||||
|
|
||||||
|
public UIPreferenceChangedEvent(int action, Object value) {
|
||||||
|
this.action = action;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -296,8 +296,11 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
||||||
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STOP);
|
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STOP);
|
||||||
playingNotificationHelper.updatePlayState(false);
|
playingNotificationHelper.updatePlayState(false);
|
||||||
remoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
|
remoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
|
||||||
updateNotification();
|
try {
|
||||||
updateRemoteControlClient();
|
updateNotification();
|
||||||
|
updateRemoteControlClient();
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.TRACK_CHANGED);
|
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.TRACK_CHANGED);
|
||||||
|
|
@ -311,7 +314,7 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRemoteControlClient() {
|
private void updateRemoteControlClient() {
|
||||||
final Song song = getPlayingQueue().get(getPosition());
|
final Song song = playingQueue.get(getPosition());
|
||||||
remoteControlClient
|
remoteControlClient
|
||||||
.editMetadata(false)
|
.editMetadata(false)
|
||||||
.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, song.artistName)
|
.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, song.artistName)
|
||||||
|
|
@ -598,7 +601,7 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resumePlaying() {
|
public void resumePlaying() {
|
||||||
if(!isPlaying()) {
|
if (!isPlaying()) {
|
||||||
if (requestFocus()) {
|
if (requestFocus()) {
|
||||||
if (isPlayerPrepared) {
|
if (isPlayerPrepared) {
|
||||||
player.start();
|
player.start();
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package com.kabouzeid.gramophone.ui.activities;
|
package com.kabouzeid.gramophone.ui.activities;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
@ -30,13 +30,16 @@ import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
import com.kabouzeid.gramophone.misc.SmallObservableScrollViewCallbacks;
|
import com.kabouzeid.gramophone.misc.SmallObservableScrollViewCallbacks;
|
||||||
import com.kabouzeid.gramophone.model.Album;
|
import com.kabouzeid.gramophone.model.Album;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
||||||
import com.kabouzeid.gramophone.ui.activities.tageditor.AlbumTagEditorActivity;
|
import com.kabouzeid.gramophone.ui.activities.tageditor.AlbumTagEditorActivity;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||||
import com.kabouzeid.gramophone.util.Util;
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
import com.nineoldandroids.view.ViewHelper;
|
import com.nineoldandroids.view.ViewHelper;
|
||||||
|
import com.squareup.otto.Subscribe;
|
||||||
import com.squareup.picasso.Callback;
|
import com.squareup.picasso.Callback;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
|
|
@ -102,15 +105,14 @@ public class AlbumDetailActivity extends AbsFabActivity {
|
||||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
app = (App) getApplicationContext();
|
|
||||||
setTheme(app.getAppTheme());
|
|
||||||
setUpTranslucence(true, false);
|
setUpTranslucence(true, false);
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_album_detail);
|
setContentView(R.layout.activity_album_detail);
|
||||||
|
|
||||||
|
App.bus.register(this);
|
||||||
|
|
||||||
if (Util.hasLollipopSDK()) postponeEnterTransition();
|
if (Util.hasLollipopSDK()) postponeEnterTransition();
|
||||||
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(getResources().getColor(R.color.materialmusic_default_bar_color));
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(this).coloredNavigationBarAlbumEnabled()) getWindow().setNavigationBarColor(Util.resolveColor(this, R.attr.default_bar_color));
|
||||||
|
|
||||||
Bundle intentExtras = getIntent().getExtras();
|
Bundle intentExtras = getIntent().getExtras();
|
||||||
int albumId = -1;
|
int albumId = -1;
|
||||||
|
|
@ -146,7 +148,7 @@ public class AlbumDetailActivity extends AbsFabActivity {
|
||||||
|
|
||||||
private void setUpObservableListViewParams() {
|
private void setUpObservableListViewParams() {
|
||||||
albumArtViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
albumArtViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
||||||
toolbarColor = getResources().getColor(R.color.materialmusic_default_bar_color);
|
toolbarColor = Util.resolveColor(this, R.attr.default_bar_color);
|
||||||
toolbarHeight = Util.getActionBarSize(this);
|
toolbarHeight = Util.getActionBarSize(this);
|
||||||
titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height);
|
titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height);
|
||||||
headerOffset = toolbarHeight;
|
headerOffset = toolbarHeight;
|
||||||
|
|
@ -187,14 +189,24 @@ public class AlbumDetailActivity extends AbsFabActivity {
|
||||||
Palette.Swatch swatch = palette.getVibrantSwatch();
|
Palette.Swatch swatch = palette.getVibrantSwatch();
|
||||||
if (swatch != null) {
|
if (swatch != null) {
|
||||||
toolbarColor = swatch.getRgb();
|
toolbarColor = swatch.getRgb();
|
||||||
albumTitleView.setBackgroundColor(swatch.getRgb());
|
albumTitleView.setBackgroundColor(toolbarColor);
|
||||||
albumTitleView.setTextColor(swatch.getTitleTextColor());
|
albumTitleView.setTextColor(swatch.getTitleTextColor());
|
||||||
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(swatch.getRgb());
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(AlbumDetailActivity.this).coloredNavigationBarAlbumEnabled())
|
||||||
|
getWindow().setNavigationBarColor(toolbarColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
private void setNavigationBarColored(boolean colored){
|
||||||
|
if (colored){
|
||||||
|
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(toolbarColor);
|
||||||
|
} else {
|
||||||
|
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(Color.BLACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setUpListView() {
|
private void setUpListView() {
|
||||||
recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
||||||
recyclerView.setPadding(0, albumArtViewHeight + titleViewHeight, 0, 0);
|
recyclerView.setPadding(0, albumArtViewHeight + titleViewHeight, 0, 0);
|
||||||
|
|
@ -204,6 +216,8 @@ public class AlbumDetailActivity extends AbsFabActivity {
|
||||||
public void run() {
|
public void run() {
|
||||||
songsBackgroundView.getLayoutParams().height = contentView.getHeight();
|
songsBackgroundView.getLayoutParams().height = contentView.getHeight();
|
||||||
observableScrollViewCallbacks.onScrollChanged(-(albumArtViewHeight + titleViewHeight), false, false);
|
observableScrollViewCallbacks.onScrollChanged(-(albumArtViewHeight + titleViewHeight), false, false);
|
||||||
|
recyclerView.scrollBy(0,1);
|
||||||
|
recyclerView.scrollBy(0,-1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -255,7 +269,7 @@ public class AlbumDetailActivity extends AbsFabActivity {
|
||||||
NavigationUtil.openPlayingQueueDialog(this);
|
NavigationUtil.openPlayingQueueDialog(this);
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_settings:
|
case R.id.action_settings:
|
||||||
Toast.makeText(this, "This feature is not available yet", Toast.LENGTH_SHORT).show();
|
startActivity(new Intent(this, SettingsActivity.class));
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_current_playing:
|
case R.id.action_current_playing:
|
||||||
NavigationUtil.openCurrentPlayingIfPossible(this, getSharedViewsWithFab(null));
|
NavigationUtil.openCurrentPlayingIfPossible(this, getSharedViewsWithFab(null));
|
||||||
|
|
@ -273,4 +287,18 @@ public class AlbumDetailActivity extends AbsFabActivity {
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe public void onUIPreferenceChanged(UIPreferenceChangedEvent event){
|
||||||
|
switch (event.getAction()){
|
||||||
|
case UIPreferenceChangedEvent.COLORED_NAVIGATION_BAR_ALBUM_CHANGED:
|
||||||
|
setNavigationBarColored((boolean) event.getValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
App.bus.unregister(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.kabouzeid.gramophone.ui.activities;
|
package com.kabouzeid.gramophone.ui.activities;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
@ -24,6 +24,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
import com.github.ksoichiro.android.observablescrollview.ObservableListView;
|
import com.github.ksoichiro.android.observablescrollview.ObservableListView;
|
||||||
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.ArtistAlbumAdapter;
|
import com.kabouzeid.gramophone.adapter.ArtistAlbumAdapter;
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.ArtistSongAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.ArtistSongAdapter;
|
||||||
|
|
@ -38,11 +39,14 @@ import com.kabouzeid.gramophone.misc.SmallObservableScrollViewCallbacks;
|
||||||
import com.kabouzeid.gramophone.model.Album;
|
import com.kabouzeid.gramophone.model.Album;
|
||||||
import com.kabouzeid.gramophone.model.Artist;
|
import com.kabouzeid.gramophone.model.Artist;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||||
import com.kabouzeid.gramophone.util.Util;
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
import com.nineoldandroids.view.ViewHelper;
|
import com.nineoldandroids.view.ViewHelper;
|
||||||
|
import com.squareup.otto.Subscribe;
|
||||||
import com.squareup.picasso.Callback;
|
import com.squareup.picasso.Callback;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
|
|
@ -120,8 +124,10 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_artist_detail);
|
setContentView(R.layout.activity_artist_detail);
|
||||||
|
|
||||||
|
App.bus.register(this);
|
||||||
|
|
||||||
if (Util.hasLollipopSDK()) postponeEnterTransition();
|
if (Util.hasLollipopSDK()) postponeEnterTransition();
|
||||||
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(getResources().getColor(R.color.materialmusic_default_bar_color));
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(this).coloredNavigationBarArtistEnabled()) getWindow().setNavigationBarColor(Util.resolveColor(this, R.attr.default_bar_color));
|
||||||
|
|
||||||
getIntentExtras();
|
getIntentExtras();
|
||||||
initViews();
|
initViews();
|
||||||
|
|
@ -147,7 +153,7 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
|
|
||||||
private void setUpObservableListViewParams() {
|
private void setUpObservableListViewParams() {
|
||||||
artistImageViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
artistImageViewHeight = getResources().getDimensionPixelSize(R.dimen.header_image_height);
|
||||||
toolbarColor = getResources().getColor(R.color.materialmusic_default_bar_color);
|
toolbarColor = Util.resolveColor(this, R.attr.default_bar_color);
|
||||||
toolbarHeight = Util.getActionBarSize(this);
|
toolbarHeight = Util.getActionBarSize(this);
|
||||||
titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height);
|
titleViewHeight = getResources().getDimensionPixelSize(R.dimen.title_view_height);
|
||||||
headerOffset = toolbarHeight;
|
headerOffset = toolbarHeight;
|
||||||
|
|
@ -173,6 +179,15 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
loadBiography();
|
loadBiography();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
private void setNavigationBarColored(boolean colored){
|
||||||
|
if (colored){
|
||||||
|
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(toolbarColor);
|
||||||
|
} else {
|
||||||
|
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(Color.BLACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setUpSongListView() {
|
private void setUpSongListView() {
|
||||||
songListView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
songListView.setScrollViewCallbacks(observableScrollViewCallbacks);
|
||||||
songListView.setPadding(0, artistImageViewHeight + titleViewHeight, 0, 0);
|
songListView.setPadding(0, artistImageViewHeight + titleViewHeight, 0, 0);
|
||||||
|
|
@ -259,7 +274,8 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
toolbarColor = swatch.getRgb();
|
toolbarColor = swatch.getRgb();
|
||||||
artistNameTv.setBackgroundColor(swatch.getRgb());
|
artistNameTv.setBackgroundColor(swatch.getRgb());
|
||||||
artistNameTv.setTextColor(swatch.getTitleTextColor());
|
artistNameTv.setTextColor(swatch.getTitleTextColor());
|
||||||
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(swatch.getRgb());
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(ArtistDetailActivity.this).coloredNavigationBarArtistEnabled())
|
||||||
|
getWindow().setNavigationBarColor(swatch.getRgb());
|
||||||
} else {
|
} else {
|
||||||
setStandardColors();
|
setStandardColors();
|
||||||
}
|
}
|
||||||
|
|
@ -270,13 +286,13 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
private void setStandardColors() {
|
private void setStandardColors() {
|
||||||
int titleTextColor = Util.resolveColor(this, R.attr.title_text_color);
|
int titleTextColor = Util.resolveColor(this, R.attr.title_text_color);
|
||||||
int defaultBarColor = getResources().getColor(R.color.materialmusic_default_bar_color);
|
int defaultBarColor = Util.resolveColor(this, R.attr.default_bar_color);
|
||||||
|
|
||||||
toolbarColor = defaultBarColor;
|
toolbarColor = defaultBarColor;
|
||||||
artistNameTv.setBackgroundColor(defaultBarColor);
|
artistNameTv.setBackgroundColor(defaultBarColor);
|
||||||
artistNameTv.setTextColor(titleTextColor);
|
artistNameTv.setTextColor(titleTextColor);
|
||||||
|
|
||||||
if (Util.hasLollipopSDK()) getWindow().setNavigationBarColor(getResources().getColor(R.color.materialmusic_default_bar_color));
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(this).coloredNavigationBarArtistEnabled()) getWindow().setNavigationBarColor(Util.resolveColor(this, R.attr.default_bar_color));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
|
|
@ -323,6 +339,7 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
case R.id.action_re_download_artist_image:
|
case R.id.action_re_download_artist_image:
|
||||||
Toast.makeText(ArtistDetailActivity.this, getResources().getString(R.string.updating), Toast.LENGTH_SHORT).show();
|
Toast.makeText(ArtistDetailActivity.this, getResources().getString(R.string.updating), Toast.LENGTH_SHORT).show();
|
||||||
setUpArtistImageAndApplyPalette(true);
|
setUpArtistImageAndApplyPalette(true);
|
||||||
|
return true;
|
||||||
case R.id.action_settings:
|
case R.id.action_settings:
|
||||||
Toast.makeText(this, "This feature is not available yet", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "This feature is not available yet", Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -376,4 +393,19 @@ public class ArtistDetailActivity extends AbsFabActivity {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onUIPreferenceChanged(UIPreferenceChangedEvent event){
|
||||||
|
switch (event.getAction()){
|
||||||
|
case UIPreferenceChangedEvent.COLORED_NAVIGATION_BAR_ARTIST_CHANGED:
|
||||||
|
setNavigationBarColored((boolean) event.getValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
App.bus.unregister(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
import android.support.v13.app.FragmentPagerAdapter;
|
import android.support.v13.app.FragmentPagerAdapter;
|
||||||
import android.support.v4.util.Pair;
|
import android.support.v4.util.Pair;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
|
|
@ -17,9 +18,8 @@ import android.util.SparseArray;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.google.samples.apps.iosched.ui.widget.SlidingTabLayout;
|
import com.astuetz.PagerSlidingTabStrip;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.helper.AboutDeveloperDialogHelper;
|
import com.kabouzeid.gramophone.helper.AboutDeveloperDialogHelper;
|
||||||
import com.kabouzeid.gramophone.helper.CreatePlaylistDialogHelper;
|
import com.kabouzeid.gramophone.helper.CreatePlaylistDialogHelper;
|
||||||
|
|
@ -53,7 +53,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
private View statusBar;
|
private View statusBar;
|
||||||
private MainActivityViewPagerAdapter viewPagerAdapter;
|
private MainActivityViewPagerAdapter viewPagerAdapter;
|
||||||
private ViewPager viewPager;
|
private ViewPager viewPager;
|
||||||
private SlidingTabLayout slidingTabLayout;
|
private PagerSlidingTabStrip slidingTabLayout;
|
||||||
private int currentPage = -1;
|
private int currentPage = -1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -74,13 +74,16 @@ public class MainActivity extends AbsFabActivity
|
||||||
private void setUpViewPager() {
|
private void setUpViewPager() {
|
||||||
viewPagerAdapter = new MainActivityViewPagerAdapter(this);
|
viewPagerAdapter = new MainActivityViewPagerAdapter(this);
|
||||||
viewPager.setAdapter(viewPagerAdapter);
|
viewPager.setAdapter(viewPagerAdapter);
|
||||||
int startPosition = PreferenceUtils.getInstace(this).getStartPage();
|
int startPosition = PreferenceUtils.getInstance(this).getDefaultStartPage();
|
||||||
|
startPosition = startPosition == -1 ? PreferenceUtils.getInstance(this).getLastStartPage() : startPosition;
|
||||||
currentPage = startPosition;
|
currentPage = startPosition;
|
||||||
viewPager.setCurrentItem(startPosition);
|
viewPager.setCurrentItem(startPosition);
|
||||||
navigationDrawerFragment.setItemChecked(startPosition);
|
navigationDrawerFragment.setItemChecked(startPosition);
|
||||||
|
|
||||||
slidingTabLayout.setSelectedIndicatorColors(Util.resolveColor(MainActivity.this, R.attr.colorAccent));
|
final int accentColor = Util.resolveColor(MainActivity.this, R.attr.colorAccent);
|
||||||
|
slidingTabLayout.setIndicatorColor(accentColor);
|
||||||
slidingTabLayout.setViewPager(viewPager);
|
slidingTabLayout.setViewPager(viewPager);
|
||||||
|
|
||||||
slidingTabLayout.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
slidingTabLayout.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||||
|
|
@ -89,7 +92,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(final int position) {
|
public void onPageSelected(final int position) {
|
||||||
PreferenceUtils.getInstace(MainActivity.this).setStartPage(position);
|
PreferenceUtils.getInstance(MainActivity.this).setLastStartPage(position);
|
||||||
navigationDrawerFragment.setItemChecked(position);
|
navigationDrawerFragment.setItemChecked(position);
|
||||||
currentPage = position;
|
currentPage = position;
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
|
@ -104,7 +107,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
|
|
||||||
private void initViews() {
|
private void initViews() {
|
||||||
viewPager = (ViewPager) findViewById(R.id.pager);
|
viewPager = (ViewPager) findViewById(R.id.pager);
|
||||||
slidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
|
slidingTabLayout = (PagerSlidingTabStrip) findViewById(R.id.tabs);
|
||||||
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
navigationDrawerFragment = (NavigationDrawerFragment)
|
navigationDrawerFragment = (NavigationDrawerFragment)
|
||||||
getFragmentManager().findFragmentById(R.id.navigation_drawer);
|
getFragmentManager().findFragmentById(R.id.navigation_drawer);
|
||||||
|
|
@ -246,7 +249,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
startActivity(new Intent(MainActivity.this, SearchActivity.class));
|
startActivity(new Intent(MainActivity.this, SearchActivity.class));
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_settings:
|
case R.id.action_settings:
|
||||||
Toast.makeText(this, "This feature is not available yet", Toast.LENGTH_SHORT).show();
|
startActivity(new Intent(MainActivity.this, SettingsActivity.class));
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_about:
|
case R.id.action_about:
|
||||||
AboutDeveloperDialogHelper.getDialog(this).show();
|
AboutDeveloperDialogHelper.getDialog(this).show();
|
||||||
|
|
@ -291,12 +294,12 @@ public class MainActivity extends AbsFabActivity
|
||||||
context.getResources().getString(R.string.songs),
|
context.getResources().getString(R.string.songs),
|
||||||
context.getResources().getString(R.string.albums),
|
context.getResources().getString(R.string.albums),
|
||||||
context.getResources().getString(R.string.artists),
|
context.getResources().getString(R.string.artists),
|
||||||
context.getResources().getString(R.string.playlists) + " BETA"
|
context.getResources().getString(R.string.playlists)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(final int position) {
|
public AbsMainActivityFragment getItem(final int position) {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
return pages.get(position, new SongViewFragment());
|
return pages.get(position, new SongViewFragment());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.kabouzeid.gramophone.ui.activities;
|
package com.kabouzeid.gramophone.ui.activities;
|
||||||
|
|
||||||
|
import android.annotation.TargetApi;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
|
@ -18,6 +19,7 @@ import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.helper.AddToPlaylistDialogHelper;
|
import com.kabouzeid.gramophone.helper.AddToPlaylistDialogHelper;
|
||||||
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
|
|
@ -27,14 +29,17 @@ import com.kabouzeid.gramophone.loader.SongFilePathLoader;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
import com.kabouzeid.gramophone.service.MusicService;
|
import com.kabouzeid.gramophone.service.MusicService;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
||||||
import com.kabouzeid.gramophone.ui.activities.tageditor.SongTagEditorActivity;
|
import com.kabouzeid.gramophone.ui.activities.tageditor.SongTagEditorActivity;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||||
import com.kabouzeid.gramophone.util.Util;
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
import com.nineoldandroids.view.ViewPropertyAnimator;
|
import com.nineoldandroids.view.ViewPropertyAnimator;
|
||||||
|
import com.squareup.otto.Subscribe;
|
||||||
import com.squareup.picasso.Callback;
|
import com.squareup.picasso.Callback;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
|
|
@ -59,6 +64,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
private ImageButton prevButton;
|
private ImageButton prevButton;
|
||||||
private ImageButton repeatButton;
|
private ImageButton repeatButton;
|
||||||
private ImageButton shuffleButton;
|
private ImageButton shuffleButton;
|
||||||
|
private View mediaControllerContainer;
|
||||||
|
|
||||||
private int lastFooterColor = -1;
|
private int lastFooterColor = -1;
|
||||||
|
|
||||||
|
|
@ -71,6 +77,8 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
|
|
||||||
setContentView(R.layout.activity_music_controller);
|
setContentView(R.layout.activity_music_controller);
|
||||||
|
|
||||||
|
App.bus.register(this);
|
||||||
|
|
||||||
initViews();
|
initViews();
|
||||||
|
|
||||||
moveSeekBarIntoPlace();
|
moveSeekBarIntoPlace();
|
||||||
|
|
@ -102,6 +110,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
totalSongDuration = (TextView) findViewById(R.id.song_total_time);
|
totalSongDuration = (TextView) findViewById(R.id.song_total_time);
|
||||||
footer = findViewById(R.id.footer);
|
footer = findViewById(R.id.footer);
|
||||||
progressSlider = (SeekBar) findViewById(R.id.progress_slider);
|
progressSlider = (SeekBar) findViewById(R.id.progress_slider);
|
||||||
|
mediaControllerContainer = findViewById(R.id.media_controller_container);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpMusicControllers() {
|
private void setUpMusicControllers() {
|
||||||
|
|
@ -109,6 +118,24 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
setUpRepeatButton();
|
setUpRepeatButton();
|
||||||
setUpShuffleButton();
|
setUpShuffleButton();
|
||||||
setUpProgressSlider();
|
setUpProgressSlider();
|
||||||
|
setUpBox(PreferenceUtils.getInstance(this).playbackControllerBoxEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
private void setUpBox(boolean boxEnabled) {
|
||||||
|
if (boxEnabled) {
|
||||||
|
if (Util.hasLollipopSDK()) {
|
||||||
|
mediaControllerContainer.setElevation(getResources().getDimensionPixelSize(R.dimen.cardview_default_elevation));
|
||||||
|
}
|
||||||
|
mediaControllerContainer.setBackgroundColor(Util.resolveColor(this, R.attr.music_controller_container_color));
|
||||||
|
} else {
|
||||||
|
if (Util.hasLollipopSDK() && !Util.isInPortraitMode(this)) {
|
||||||
|
mediaControllerContainer.setElevation(getResources().getDimensionPixelSize(R.dimen.cardview_default_elevation));
|
||||||
|
mediaControllerContainer.setBackgroundColor(Util.resolveColor(this, R.attr.music_controller_container_color));
|
||||||
|
} else {
|
||||||
|
mediaControllerContainer.setBackground(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpProgressSlider() {
|
private void setUpProgressSlider() {
|
||||||
|
|
@ -131,6 +158,8 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpPrevNext() {
|
private void setUpPrevNext() {
|
||||||
|
nextButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_skip_next_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_color)));
|
||||||
|
prevButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_skip_previous_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_color)));
|
||||||
nextButton.setOnClickListener(new View.OnClickListener() {
|
nextButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
@ -158,10 +187,10 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
private void updateShuffleState() {
|
private void updateShuffleState() {
|
||||||
switch (MusicPlayerRemote.getShuffleMode()) {
|
switch (MusicPlayerRemote.getShuffleMode()) {
|
||||||
case MusicService.SHUFFLE_MODE_SHUFFLE:
|
case MusicService.SHUFFLE_MODE_SHUFFLE:
|
||||||
shuffleButton.setImageResource(R.drawable.ic_shuffle_white_48dp);
|
shuffleButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_shuffle_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_activated_color)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
shuffleButton.setImageResource(R.drawable.ic_shuffle_grey600_48dp);
|
shuffleButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_shuffle_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_color)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -179,13 +208,13 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
private void updateRepeatState() {
|
private void updateRepeatState() {
|
||||||
switch (MusicPlayerRemote.getRepeatMode()) {
|
switch (MusicPlayerRemote.getRepeatMode()) {
|
||||||
case MusicService.REPEAT_MODE_NONE:
|
case MusicService.REPEAT_MODE_NONE:
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_grey600_48dp);
|
repeatButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_repeat_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_color)));
|
||||||
break;
|
break;
|
||||||
case MusicService.REPEAT_MODE_ALL:
|
case MusicService.REPEAT_MODE_ALL:
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_white_48dp);
|
repeatButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_repeat_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_activated_color)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_one_white_48dp);
|
repeatButton.setImageDrawable(Util.getTintedDrawable(getResources(), R.drawable.ic_repeat_one_white_48dp, Util.resolveColor(this, R.attr.themed_drawable_activated_color)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -266,7 +295,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
private void setStandardColors() {
|
private void setStandardColors() {
|
||||||
int songTitleTextColor = Util.resolveColor(this, R.attr.title_text_color);
|
int songTitleTextColor = Util.resolveColor(this, R.attr.title_text_color);
|
||||||
int artistNameTextColor = Util.resolveColor(this, R.attr.caption_text_color);
|
int artistNameTextColor = Util.resolveColor(this, R.attr.caption_text_color);
|
||||||
int defaultBarColor = getResources().getColor(R.color.materialmusic_default_bar_color);
|
int defaultBarColor = Util.resolveColor(this, R.attr.default_bar_color);
|
||||||
|
|
||||||
animateColorChange(defaultBarColor);
|
animateColorChange(defaultBarColor);
|
||||||
|
|
||||||
|
|
@ -274,15 +303,15 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
songArtist.setTextColor(artistNameTextColor);
|
songArtist.setTextColor(artistNameTextColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
private void animateColorChange(final int newColor) {
|
private void animateColorChange(final int newColor) {
|
||||||
if (lastFooterColor != -1 && lastFooterColor != newColor) {
|
if (lastFooterColor != -1 && lastFooterColor != newColor) {
|
||||||
ViewUtil.animateViewColor(footer, lastFooterColor, newColor, 300);
|
ViewUtil.animateViewColor(footer, lastFooterColor, newColor, 300);
|
||||||
} else {
|
} else {
|
||||||
footer.setBackgroundColor(newColor);
|
footer.setBackgroundColor(newColor);
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Util.hasLollipopSDK() && PreferenceUtils.getInstance(this).coloredNavigationBarCurrentPlayingEnabled())
|
||||||
getWindow().setNavigationBarColor(newColor);
|
getWindow().setNavigationBarColor(newColor);
|
||||||
}
|
|
||||||
lastFooterColor = newColor;
|
lastFooterColor = newColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -432,4 +461,19 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
.setStartDelay(startDelay)
|
.setStartDelay(startDelay)
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onUIPrefsChanged(UIPreferenceChangedEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case UIPreferenceChangedEvent.PLAYBACK_CONTROLLER_CARD_CHANGED:
|
||||||
|
setUpBox((boolean) event.getValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
App.bus.unregister(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,125 @@
|
||||||
|
package com.kabouzeid.gramophone.ui.activities;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.ListPreference;
|
||||||
|
import android.preference.Preference;
|
||||||
|
import android.preference.PreferenceFragment;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import com.kabouzeid.gramophone.App;
|
||||||
|
import com.kabouzeid.gramophone.R;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
|
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
|
||||||
|
|
||||||
|
public class SettingsActivity extends AbsBaseActivity {
|
||||||
|
public static final String TAG = SettingsActivity.class.getSimpleName();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_preferences);
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getFragmentManager().beginTransaction().replace(R.id.content_frame, new SettingsFragment()).commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class SettingsFragment extends PreferenceFragment {
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
addPreferencesFromResource(R.xml.pref_general);
|
||||||
|
addPreferencesFromResource(R.xml.pref_ui);
|
||||||
|
|
||||||
|
final Preference defaultStartPage = findPreference("default_start_page");
|
||||||
|
setSummary(defaultStartPage);
|
||||||
|
defaultStartPage.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
setSummary(defaultStartPage, o);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
final Preference generalTheme = findPreference("general_theme");
|
||||||
|
setSummary(generalTheme);
|
||||||
|
generalTheme.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
setSummary(generalTheme, o);
|
||||||
|
App.bus.post(new UIPreferenceChangedEvent(UIPreferenceChangedEvent.THEME_CHANGED, o));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference("colored_album_footers").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
App.bus.post(new UIPreferenceChangedEvent(UIPreferenceChangedEvent.ALBUM_OVERVIEW_PALETTE_CHANGED, o));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference("colored_navigation_bar_artist").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
App.bus.post(new UIPreferenceChangedEvent(UIPreferenceChangedEvent.COLORED_NAVIGATION_BAR_ARTIST_CHANGED, o));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference("colored_navigation_bar_album").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
App.bus.post(new UIPreferenceChangedEvent(UIPreferenceChangedEvent.COLORED_NAVIGATION_BAR_ALBUM_CHANGED, o));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference("playback_controller_card").setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object o) {
|
||||||
|
App.bus.post(new UIPreferenceChangedEvent(UIPreferenceChangedEvent.PLAYBACK_CONTROLLER_CARD_CHANGED, o));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setSummary(Preference preference) {
|
||||||
|
setSummary(preference, PreferenceManager
|
||||||
|
.getDefaultSharedPreferences(preference.getContext())
|
||||||
|
.getString(preference.getKey(), ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setSummary(Preference preference, Object value) {
|
||||||
|
String stringValue = value.toString();
|
||||||
|
|
||||||
|
if (preference instanceof ListPreference) {
|
||||||
|
ListPreference listPreference = (ListPreference) preference;
|
||||||
|
int index = listPreference.findIndexOfValue(stringValue);
|
||||||
|
preference.setSummary(
|
||||||
|
index >= 0
|
||||||
|
? listPreference.getEntries()[index]
|
||||||
|
: null);
|
||||||
|
} else {
|
||||||
|
preference.setSummary(stringValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.kabouzeid.gramophone.ui.activities.base;
|
package com.kabouzeid.gramophone.ui.activities.base;
|
||||||
|
|
||||||
|
import android.annotation.TargetApi;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
|
@ -8,7 +9,10 @@ import com.crashlytics.android.Crashlytics;
|
||||||
import com.kabouzeid.gramophone.App;
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
|
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||||
import com.kabouzeid.gramophone.util.Util;
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
|
import com.squareup.otto.Subscribe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by karim on 20.01.15.
|
* Created by karim on 20.01.15.
|
||||||
|
|
@ -16,12 +20,22 @@ import com.kabouzeid.gramophone.util.Util;
|
||||||
public abstract class AbsBaseActivity extends ActionBarActivity implements KabViewsDisableAble {
|
public abstract class AbsBaseActivity extends ActionBarActivity implements KabViewsDisableAble {
|
||||||
private App app;
|
private App app;
|
||||||
private boolean areViewsEnabled;
|
private boolean areViewsEnabled;
|
||||||
|
private Object uiPreferenceChangeListener = new Object() {
|
||||||
|
@Subscribe
|
||||||
|
public void onUIPreferenceChangedEvent(UIPreferenceChangedEvent event) {
|
||||||
|
AbsBaseActivity.this.onUIPreferenceChangedEvent(event);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Crashlytics.setString(AppKeys.CL_CURRENT_ACTIVITY, getTag());
|
Crashlytics.setString(AppKeys.CL_CURRENT_ACTIVITY, getTag());
|
||||||
setTheme(getApp().getAppTheme());
|
setTheme(PreferenceUtils.getInstance(this).getGeneralTheme());
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
try {
|
||||||
|
App.bus.register(uiPreferenceChangeListener);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected App getApp() {
|
protected App getApp() {
|
||||||
|
|
@ -39,6 +53,15 @@ public abstract class AbsBaseActivity extends ActionBarActivity implements KabVi
|
||||||
enableViews();
|
enableViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||||
|
public void onUIPreferenceChangedEvent(UIPreferenceChangedEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case UIPreferenceChangedEvent.THEME_CHANGED:
|
||||||
|
recreate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enableViews() {
|
public void enableViews() {
|
||||||
areViewsEnabled = true;
|
areViewsEnabled = true;
|
||||||
|
|
@ -64,4 +87,13 @@ public abstract class AbsBaseActivity extends ActionBarActivity implements KabVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
try {
|
||||||
|
App.bus.unregister(uiPreferenceChangeListener);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,7 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
||||||
super.onPostCreate(savedInstanceState);
|
super.onPostCreate(savedInstanceState);
|
||||||
try {
|
try {
|
||||||
App.bus.register(busEventListener);
|
App.bus.register(busEventListener);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {}
|
||||||
}
|
|
||||||
setUpFab();
|
setUpFab();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,8 +141,7 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
try {
|
try {
|
||||||
App.bus.unregister(busEventListener);
|
App.bus.unregister(busEventListener);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMusicRemoteEvent(MusicRemoteEvent event) {
|
public void onMusicRemoteEvent(MusicRemoteEvent event) {
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
import com.kabouzeid.gramophone.misc.SmallObservableScrollViewCallbacks;
|
import com.kabouzeid.gramophone.misc.SmallObservableScrollViewCallbacks;
|
||||||
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
||||||
|
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.kabouzeid.gramophone.util.Util;
|
import com.kabouzeid.gramophone.util.Util;
|
||||||
import com.kabouzeid.gramophone.util.ViewUtil;
|
import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
|
|
@ -51,7 +52,7 @@ import java.util.Map;
|
||||||
/**
|
/**
|
||||||
* Created by karim on 18.01.15.
|
* Created by karim on 18.01.15.
|
||||||
*/
|
*/
|
||||||
public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
public abstract class AbsTagEditorActivity extends AbsBaseActivity {
|
||||||
public static final String TAG = AbsTagEditorActivity.class.getSimpleName();
|
public static final String TAG = AbsTagEditorActivity.class.getSimpleName();
|
||||||
private static final int REQUEST_CODE_SELECT_IMAGE = 1337;
|
private static final int REQUEST_CODE_SELECT_IMAGE = 1337;
|
||||||
|
|
||||||
|
|
@ -85,10 +86,7 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
app = (App) getApplicationContext();
|
setUpTranslucence(false, false);
|
||||||
setTheme(app.getAppTheme());
|
|
||||||
setUpTranslucence();
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(getContentViewResId());
|
setContentView(getContentViewResId());
|
||||||
|
|
||||||
|
|
@ -197,13 +195,6 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpTranslucence() {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
|
||||||
Util.setStatusBarTranslucent(getWindow(), false);
|
|
||||||
Util.setNavBarTranslucent(getWindow(), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getIntentExtras() {
|
private void getIntentExtras() {
|
||||||
Bundle intentExtras = getIntent().getExtras();
|
Bundle intentExtras = getIntent().getExtras();
|
||||||
if (intentExtras != null) {
|
if (intentExtras != null) {
|
||||||
|
|
@ -232,12 +223,6 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.menu_tag_editor, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
@ -245,8 +230,6 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_settings:
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
@ -290,7 +273,7 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
|
||||||
Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() {
|
Palette.generateAsync(bitmap, new Palette.PaletteAsyncListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onGenerated(Palette palette) {
|
public void onGenerated(Palette palette) {
|
||||||
final int vibrantColor = palette.getVibrantColor(getResources().getColor(R.color.materialmusic_default_bar_color));
|
final int vibrantColor = palette.getVibrantColor(Util.resolveColor(AbsTagEditorActivity.this, R.attr.default_bar_color));
|
||||||
paletteColorPrimary = vibrantColor;
|
paletteColorPrimary = vibrantColor;
|
||||||
observableScrollViewCallbacks.onScrollChanged(scrollView.getCurrentScrollY(), false, false);
|
observableScrollViewCallbacks.onScrollChanged(scrollView.getCurrentScrollY(), false, false);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,11 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
|
||||||
setUpViews();
|
setUpViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
private void initViews() {
|
private void initViews() {
|
||||||
albumTitle = (EditText) findViewById(R.id.album_title);
|
albumTitle = (EditText) findViewById(R.id.album_title);
|
||||||
albumArtistName = (EditText) findViewById(R.id.album_artist);
|
albumArtistName = (EditText) findViewById(R.id.album_artist);
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,11 @@ public class SongTagEditorActivity extends AbsTagEditorActivity implements TextW
|
||||||
setUpViews();
|
setUpViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTag() {
|
||||||
|
return TAG;
|
||||||
|
}
|
||||||
|
|
||||||
private void initViews() {
|
private void initViews() {
|
||||||
songTitle = (EditText) findViewById(R.id.title1);
|
songTitle = (EditText) findViewById(R.id.title1);
|
||||||
albumTitle = (EditText) findViewById(R.id.title2);
|
albumTitle = (EditText) findViewById(R.id.title2);
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,16 @@ package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
|
|
||||||
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.AlbumAdapter;
|
import com.kabouzeid.gramophone.adapter.AlbumAdapter;
|
||||||
|
import com.kabouzeid.gramophone.model.UIPreferenceChangedEvent;
|
||||||
|
import com.squareup.otto.Subscribe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by karim on 22.11.14.
|
* Created by karim on 22.11.14.
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,20 @@ import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
|
import com.kabouzeid.gramophone.R;
|
||||||
|
|
||||||
public final class PreferenceUtils {
|
public final class PreferenceUtils {
|
||||||
|
|
||||||
/* Default start page (Artist page) */
|
/* Default start page (Album page) */
|
||||||
public static final int DEFAULT_PAGE = 2;
|
public static final int DEFAULT_PAGE = 1;
|
||||||
|
|
||||||
/* Saves the last page the pager was on in {@link MusicBrowserPhoneFragment} */
|
public static final String GENERAL_THEME = "general_theme";
|
||||||
public static final String START_PAGE = "start_page";
|
|
||||||
|
/* Saves the last page the pager was on in {@link MainActivity} */
|
||||||
|
public static final String DEFAULT_START_PAGE = "default_start_page";
|
||||||
|
|
||||||
|
/* Saves the last page the pager was on in {@link MainActivity} */
|
||||||
|
public static final String LAST_START_PAGE = "last_start_page";
|
||||||
|
|
||||||
// Sort order for the artist list
|
// Sort order for the artist list
|
||||||
public static final String ARTIST_SORT_ORDER = "artist_sort_order";
|
public static final String ARTIST_SORT_ORDER = "artist_sort_order";
|
||||||
|
|
@ -31,10 +38,25 @@ public final class PreferenceUtils {
|
||||||
public static final String SONG_SORT_ORDER = "song_sort_order";
|
public static final String SONG_SORT_ORDER = "song_sort_order";
|
||||||
|
|
||||||
// Key used to download images only on Wi-Fi
|
// Key used to download images only on Wi-Fi
|
||||||
public static final String ONLY_ON_WIFI = "only_on_wifi";
|
public static final String ONLY_ON_WIFI = "auto_download_artist_images";
|
||||||
|
|
||||||
// Key that gives permissions to download missing artist images
|
// Key that gives permissions to download missing artist images
|
||||||
public static final String DOWNLOAD_MISSING_ARTIST_IMAGES = "download_missing_artist_images";
|
public static final String DOWNLOAD_MISSING_ARTIST_IMAGES = "auto_download_artist_images";
|
||||||
|
|
||||||
|
// Key used to en or disable palette
|
||||||
|
public static final String COLORED_ALBUM_FOOTERS = "colored_album_footers";
|
||||||
|
|
||||||
|
// Key used to en or disable the colored navigation bar
|
||||||
|
public static final String COLORED_NAVIGATION_BAR_ALBUM = "colored_navigation_bar_album";
|
||||||
|
|
||||||
|
// Key used to en or disable the colored navigation bar
|
||||||
|
public static final String COLORED_NAVIGATION_BAR_ARTIST = "colored_navigation_bar_artist";
|
||||||
|
|
||||||
|
// Key used to en or disable the colored navigation bar
|
||||||
|
public static final String COLORED_NAVIGATION_BAR_CURRENT_PLAYING = "colored_navigation_bar_current_playing_enabled";
|
||||||
|
|
||||||
|
// Key used to en or disable the colored navigation bar
|
||||||
|
public static final String PLAYBACK_CONTROLLER_BOX = "playback_controller_card";
|
||||||
|
|
||||||
private static PreferenceUtils sInstance;
|
private static PreferenceUtils sInstance;
|
||||||
|
|
||||||
|
|
@ -44,33 +66,122 @@ public final class PreferenceUtils {
|
||||||
mPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
mPreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final PreferenceUtils getInstace(final Context context) {
|
public static final PreferenceUtils getInstance(final Context context) {
|
||||||
if (sInstance == null) {
|
if (sInstance == null) {
|
||||||
sInstance = new PreferenceUtils(context.getApplicationContext());
|
sInstance = new PreferenceUtils(context.getApplicationContext());
|
||||||
}
|
}
|
||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStartPage(final int value) {
|
public int getGeneralTheme() {
|
||||||
|
int value = Integer.parseInt(mPreferences.getString(GENERAL_THEME, "1"));
|
||||||
|
switch (value){
|
||||||
|
case 0:
|
||||||
|
return R.style.Theme_MaterialMusic_Light;
|
||||||
|
case 1:
|
||||||
|
return R.style.Theme_MaterialMusic;
|
||||||
|
}
|
||||||
|
return R.style.Theme_MaterialMusic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGeneralTheme(int appTheme) {
|
||||||
|
int value = -1;
|
||||||
|
switch (appTheme) {
|
||||||
|
case R.style.Theme_MaterialMusic_Light:
|
||||||
|
value = 0;
|
||||||
|
break;
|
||||||
|
case R.style.Theme_MaterialMusic:
|
||||||
|
value = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (value != 0 && value != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
editor.putInt(START_PAGE, value);
|
editor.putString(GENERAL_THEME, String.valueOf(value));
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getStartPage() {
|
public void setDefaultStartPage(final int value) {
|
||||||
return mPreferences.getInt(START_PAGE, DEFAULT_PAGE);
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putString(DEFAULT_START_PAGE, String.valueOf(value));
|
||||||
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean onlyOnWifi() {
|
public final int getDefaultStartPage() {
|
||||||
return mPreferences.getBoolean(ONLY_ON_WIFI, true);
|
return Integer.parseInt(mPreferences.getString(DEFAULT_START_PAGE, "-1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOnlyOnWifi(final boolean value) {
|
public void setLastStartPage(final int value) {
|
||||||
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putInt(LAST_START_PAGE, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getLastStartPage() {
|
||||||
|
return mPreferences.getInt(LAST_START_PAGE, DEFAULT_PAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean autoDownloadOnlyOnWifi() {
|
||||||
|
return mPreferences.getBoolean(ONLY_ON_WIFI, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutoDownloadOnlyOnWifi(final boolean value) {
|
||||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
editor.putBoolean(ONLY_ON_WIFI, value);
|
editor.putBoolean(ONLY_ON_WIFI, value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean coloredAlbumFootersEnabled() {
|
||||||
|
return mPreferences.getBoolean(COLORED_ALBUM_FOOTERS, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColoredAlbumFootersEnabled(final boolean value) {
|
||||||
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putBoolean(COLORED_ALBUM_FOOTERS, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean coloredNavigationBarAlbumEnabled() {
|
||||||
|
return mPreferences.getBoolean(COLORED_NAVIGATION_BAR_ALBUM, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColoredNavigationBarAlbumEnabled(final boolean value) {
|
||||||
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putBoolean(COLORED_NAVIGATION_BAR_ALBUM, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean coloredNavigationBarArtistEnabled() {
|
||||||
|
return mPreferences.getBoolean(COLORED_NAVIGATION_BAR_ARTIST, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColoredNavigationBarArtistEnabled(final boolean value) {
|
||||||
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putBoolean(COLORED_NAVIGATION_BAR_ARTIST, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean coloredNavigationBarCurrentPlayingEnabled() {
|
||||||
|
return mPreferences.getBoolean(COLORED_NAVIGATION_BAR_CURRENT_PLAYING, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColoredNavigationBarCurrentPlayingEnabled(final boolean value) {
|
||||||
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putBoolean(COLORED_NAVIGATION_BAR_CURRENT_PLAYING, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean playbackControllerBoxEnabled() {
|
||||||
|
return mPreferences.getBoolean(PLAYBACK_CONTROLLER_BOX, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlaybackControllerBoxEnabled(final boolean value) {
|
||||||
|
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||||
|
editor.putBoolean(PLAYBACK_CONTROLLER_BOX, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
public final boolean downloadMissingArtistImages() {
|
public final boolean downloadMissingArtistImages() {
|
||||||
return mPreferences.getBoolean(DOWNLOAD_MISSING_ARTIST_IMAGES, true);
|
return mPreferences.getBoolean(DOWNLOAD_MISSING_ARTIST_IMAGES, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,18 @@ import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
import android.support.annotation.DrawableRes;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
|
@ -35,7 +39,7 @@ public class Util {
|
||||||
|
|
||||||
public static int resolveColor(Context context, int color) {
|
public static int resolveColor(Context context, int color) {
|
||||||
TypedArray a = context.obtainStyledAttributes(new int[]{color});
|
TypedArray a = context.obtainStyledAttributes(new int[]{color});
|
||||||
int resId = a.getColor(0, context.getResources().getColor(R.color.materialmusic_color));
|
int resId = a.getColor(0, 0);
|
||||||
a.recycle();
|
a.recycle();
|
||||||
return resId;
|
return resId;
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +119,7 @@ public class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean state = false;
|
boolean state = false;
|
||||||
final boolean onlyOnWifi = PreferenceUtils.getInstace(context).onlyOnWifi();
|
final boolean onlyOnWifi = PreferenceUtils.getInstance(context).autoDownloadOnlyOnWifi();
|
||||||
|
|
||||||
/* Monitor network connections */
|
/* Monitor network connections */
|
||||||
final ConnectivityManager connectivityManager = (ConnectivityManager) context
|
final ConnectivityManager connectivityManager = (ConnectivityManager) context
|
||||||
|
|
@ -196,4 +200,12 @@ public class Util {
|
||||||
public static boolean isInPortraitMode(final Context context) {
|
public static boolean isInPortraitMode(final Context context) {
|
||||||
return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
|
return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Drawable getTintedDrawable(Resources res, @DrawableRes int drawableResId, int color) {
|
||||||
|
Drawable drawable = res.getDrawable(drawableResId);
|
||||||
|
if (drawable != null) {
|
||||||
|
drawable.setColorFilter(color, PorterDuff.Mode.SRC_IN);
|
||||||
|
}
|
||||||
|
return drawable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
app/src/main/res/drawable-hdpi/ic_equalizer_black_24dp.png
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
app/src/main/res/drawable-hdpi/ic_equalizer_white_24dp.png
Normal file
|
After Width: | Height: | Size: 192 B |
BIN
app/src/main/res/drawable-hdpi/ic_more_vert_black_24dp.png
Normal file
|
After Width: | Height: | Size: 214 B |
BIN
app/src/main/res/drawable-hdpi/ic_more_vert_white_24dp.png
Normal file
|
After Width: | Height: | Size: 219 B |
BIN
app/src/main/res/drawable-hdpi/ic_queue_music_black_24dp.png
Normal file
|
After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 409 B |
BIN
app/src/main/res/drawable-hdpi/ic_settings_white_24dp.png
Normal file
|
After Width: | Height: | Size: 561 B |
BIN
app/src/main/res/drawable-mdpi/ic_equalizer_black_24dp.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
app/src/main/res/drawable-mdpi/ic_equalizer_white_24dp.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
app/src/main/res/drawable-mdpi/ic_more_vert_black_24dp.png
Normal file
|
After Width: | Height: | Size: 189 B |
BIN
app/src/main/res/drawable-mdpi/ic_more_vert_white_24dp.png
Normal file
|
After Width: | Height: | Size: 202 B |
BIN
app/src/main/res/drawable-mdpi/ic_queue_music_black_24dp.png
Normal file
|
After Width: | Height: | Size: 214 B |
|
Before Width: | Height: | Size: 333 B |
BIN
app/src/main/res/drawable-mdpi/ic_settings_white_24dp.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
app/src/main/res/drawable-xhdpi/ic_equalizer_black_24dp.png
Normal file
|
After Width: | Height: | Size: 202 B |
BIN
app/src/main/res/drawable-xhdpi/ic_equalizer_white_24dp.png
Normal file
|
After Width: | Height: | Size: 207 B |
BIN
app/src/main/res/drawable-xhdpi/ic_more_vert_black_24dp.png
Normal file
|
After Width: | Height: | Size: 239 B |
BIN
app/src/main/res/drawable-xhdpi/ic_more_vert_white_24dp.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
app/src/main/res/drawable-xhdpi/ic_queue_music_black_24dp.png
Normal file
|
After Width: | Height: | Size: 281 B |
|
Before Width: | Height: | Size: 538 B |
BIN
app/src/main/res/drawable-xhdpi/ic_settings_white_24dp.png
Normal file
|
After Width: | Height: | Size: 737 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_equalizer_black_24dp.png
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_equalizer_white_24dp.png
Normal file
|
After Width: | Height: | Size: 235 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_more_vert_black_24dp.png
Normal file
|
After Width: | Height: | Size: 296 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_more_vert_white_24dp.png
Normal file
|
After Width: | Height: | Size: 313 B |
|
Before Width: | Height: | Size: 701 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_queue_music_black_24dp.png
Normal file
|
After Width: | Height: | Size: 345 B |
|
Before Width: | Height: | Size: 747 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_settings_white_24dp.png
Normal file
|
After Width: | Height: | Size: 974 B |
|
Before Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 675 B |
|
Before Width: | Height: | Size: 567 B |
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_equalizer_black_24dp.png
Normal file
|
After Width: | Height: | Size: 245 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_equalizer_white_24dp.png
Normal file
|
After Width: | Height: | Size: 265 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_more_vert_black_24dp.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_more_vert_white_24dp.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_queue_music_black_24dp.png
Normal file
|
After Width: | Height: | Size: 483 B |
|
Before Width: | Height: | Size: 1,005 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_settings_white_24dp.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<solid android:color="@color/list_item_selected"/>
|
|
||||||
</shape>
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:shape="rectangle">
|
|
||||||
<solid android:color="@color/list_item_selected_dark"/>
|
|
||||||
</shape>
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item android:drawable="@drawable/list_item_activated" android:state_activated="true"/>
|
<item android:drawable="@drawable/list_item_activated" android:state_activated="true"/>
|
||||||
<item android:drawable="@drawable/list_item_selected" android:state_pressed="true"/>
|
|
||||||
<item android:drawable="@drawable/transparent"/>
|
<item android:drawable="@drawable/transparent"/>
|
||||||
|
|
||||||
</selector>
|
</selector>
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item android:drawable="@drawable/list_item_activated_dark" android:state_activated="true"/>
|
<item android:drawable="@drawable/list_item_activated_dark" android:state_activated="true"/>
|
||||||
<item android:drawable="@drawable/list_item_selected_dark" android:state_pressed="true"/>
|
|
||||||
<item android:drawable="@drawable/transparent"/>
|
<item android:drawable="@drawable/transparent"/>
|
||||||
|
|
||||||
</selector>
|
</selector>
|
||||||
|
|
@ -32,6 +32,12 @@
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:scaleType="centerCrop"/>
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/footer"
|
||||||
|
android:background="@drawable/shadow_up"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -44,28 +50,23 @@
|
||||||
android:id="@+id/song_current_progress"
|
android:id="@+id/song_current_progress"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="2"
|
android:layout_weight="1"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:gravity="bottom|left"
|
android:gravity="bottom|left"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="1:24"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/title_text_color"
|
android:textColor="@color/white"/>
|
||||||
android:textSize="30sp"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/song_total_time"
|
android:id="@+id/song_total_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:gravity="bottom|right"
|
android:gravity="bottom|right"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="3:58"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
android:textColor="@color/white"/>
|
||||||
android:textColor="?attr/caption_text_color"
|
|
||||||
android:textSize="18sp"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -125,8 +126,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:background="?attr/music_controller_container_color"
|
android:background="?attr/music_controller_container_color">
|
||||||
android:elevation="2dp">
|
|
||||||
|
|
||||||
<com.melnykov.fab.FloatingActionButton
|
<com.melnykov.fab.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
|
|
@ -197,17 +197,23 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<LinearLayout
|
||||||
android:id="@+id/toolbar"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="#00000000"
|
android:layout_alignParentTop="true"
|
||||||
android:elevation="2dp"
|
android:orientation="vertical">
|
||||||
android:fitsSystemWindows="true"
|
|
||||||
android:minHeight="@dimen/abc_action_bar_default_height_material"
|
<ImageView
|
||||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
android:id="@+id/statusBar"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/statusMargin"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@
|
||||||
android:id="@+id/list"
|
android:id="@+id/list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:divider="@null"
|
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
android:divider="@null"
|
||||||
android:dividerHeight="0dp"
|
android:dividerHeight="0dp"
|
||||||
android:scrollbars="none"/>
|
android:scrollbars="none"/>
|
||||||
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/title_view_height"
|
android:layout_height="@dimen/title_view_height"
|
||||||
android:height="@dimen/title_view_height"
|
android:height="@dimen/title_view_height"
|
||||||
android:background="@color/materialmusic_default_bar_color"
|
android:background="?default_bar_color"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:elevation="@dimen/toolbar_elevation"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
|
@ -66,8 +66,7 @@
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
style="@style/Toolbar"
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="@android:color/transparent"/>
|
android:background="@android:color/transparent"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
|
@ -44,7 +45,7 @@
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/title_text_color"/>
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -53,7 +54,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/header"
|
android:layout_below="@+id/header"
|
||||||
android:background="@color/background_material_dark"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="16dp">
|
||||||
|
|
||||||
|
|
@ -146,15 +146,10 @@
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
style="@style/Toolbar"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:background="#00000000"
|
android:background="#00000000"/>
|
||||||
android:minHeight="@dimen/abc_action_bar_default_height_material"
|
|
||||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
|
||||||
|
|
||||||
<com.melnykov.fab.FloatingActionButton
|
<com.melnykov.fab.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/title_view_height"
|
android:layout_height="@dimen/title_view_height"
|
||||||
android:height="@dimen/title_view_height"
|
android:height="@dimen/title_view_height"
|
||||||
android:background="@color/materialmusic_default_bar_color"
|
android:background="?default_bar_color"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:elevation="@dimen/toolbar_elevation"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
|
@ -66,8 +66,7 @@
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
style="@style/Toolbar"
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="@android:color/transparent"/>
|
android:background="@android:color/transparent"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,23 +38,37 @@
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
style="@style/Toolbar"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:background="?colorPrimary">
|
||||||
android:background="?colorPrimary"
|
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
|
||||||
|
|
||||||
<com.google.samples.apps.iosched.ui.widget.SlidingTabLayout
|
<TextView
|
||||||
android:id="@+id/sliding_tabs"
|
android:id="@+id/toolbar_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
|
android:gravity="left|center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="20sp"/>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
<com.astuetz.PagerSlidingTabStrip
|
||||||
|
android:id="@+id/tabs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/tab_height"
|
android:layout_height="@dimen/tab_height"
|
||||||
android:background="?colorPrimary"
|
android:background="?colorPrimary"
|
||||||
android:elevation="2dp"/>
|
app:elevation="@dimen/toolbar_elevation"
|
||||||
|
android:paddingLeft="64dp"
|
||||||
|
android:textColor="@color/grey_400"
|
||||||
|
android:textColorPrimary="@color/white"
|
||||||
|
app:pstsTabPaddingLeftRight="8dp"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="5dp"
|
android:layout_height="5dp"
|
||||||
android:background="@drawable/shadow_down" />
|
android:background="@drawable/shadow_down"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
@ -30,16 +31,16 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textStyle="bold"
|
|
||||||
android:id="@+id/song_current_progress"
|
android:id="@+id/song_current_progress"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:gravity="bottom|left"
|
android:gravity="bottom|left"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/title_text_color"/>
|
android:textColor="@color/white"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/song_total_time"
|
android:id="@+id/song_total_time"
|
||||||
|
|
@ -50,7 +51,7 @@
|
||||||
android:gravity="bottom|right"
|
android:gravity="bottom|right"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/caption_text_color"/>
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -60,7 +61,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_above="@+id/media_controller_container"
|
android:layout_above="@+id/media_controller_container"
|
||||||
android:background="@color/materialmusic_default_bar_color"
|
android:background="@color/materialmusic_default_bar_color"
|
||||||
android:elevation="2dp"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="16dp"
|
android:paddingBottom="16dp"
|
||||||
android:paddingLeft="72dp"
|
android:paddingLeft="72dp"
|
||||||
|
|
@ -89,14 +89,13 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:layout_margin="16dp"
|
||||||
android:id="@+id/media_controller_container"
|
android:id="@+id/media_controller_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="88dp"
|
android:layout_height="88dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_margin="16dp"
|
android:background="?music_controller_container_color">
|
||||||
android:background="?attr/music_controller_container_color"
|
|
||||||
android:elevation="2dp">
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/prev_button"
|
android:id="@+id/prev_button"
|
||||||
|
|
@ -149,28 +148,32 @@
|
||||||
<com.melnykov.fab.FloatingActionButton
|
<com.melnykov.fab.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
style="@style/PlayPauseFab"
|
style="@style/PlayPauseFab"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"/>
|
||||||
/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<SeekBar
|
<SeekBar
|
||||||
android:elevation="2dp"
|
|
||||||
android:id="@+id/progress_slider"
|
android:id="@+id/progress_slider"
|
||||||
style="@style/MusicProgressSlider"
|
style="@style/MusicProgressSlider"
|
||||||
android:layout_above="@+id/footer"/>
|
android:layout_above="@+id/footer"
|
||||||
|
android:elevation="2dp"/>
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<LinearLayout
|
||||||
android:id="@+id/toolbar"
|
android:layout_alignParentTop="true"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:orientation="vertical">
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:background="#00000000"
|
<ImageView
|
||||||
android:elevation="2dp"
|
android:id="@+id/statusBar"
|
||||||
android:fitsSystemWindows="true"
|
android:layout_width="match_parent"
|
||||||
android:minHeight="@dimen/abc_action_bar_default_height_material"
|
android:layout_height="@dimen/statusMargin"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="?colorPrimary"
|
android:background="?colorPrimary"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
app:elevation="@dimen/toolbar_elevation"
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
|
|
|
||||||
17
app/src/main/res/layout/activity_preferences.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
android:background="?colorPrimary"/>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/content_frame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
@ -7,26 +7,25 @@
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
style="@style/Toolbar"
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="?colorPrimary"
|
android:background="?colorPrimary"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
app:elevation="@dimen/toolbar_elevation"/>
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="5dp"
|
android:layout_height="5dp"
|
||||||
android:background="@drawable/shadow_down" />
|
android:background="@drawable/shadow_down"/>
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/list"
|
android:id="@+id/list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:dividerHeight="0px"
|
android:divider="@null"
|
||||||
android:divider="@null"/>
|
android:dividerHeight="0px"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
|
@ -44,7 +45,7 @@
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/title_text_color"/>
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/title2"
|
android:id="@+id/title2"
|
||||||
|
|
@ -57,7 +58,7 @@
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/title_text_color"/>
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -66,7 +67,6 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/header"
|
android:layout_below="@+id/header"
|
||||||
android:background="@color/background_material_dark"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="16dp">
|
||||||
|
|
||||||
|
|
@ -186,15 +186,10 @@
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
style="@style/Toolbar"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:background="#00000000"
|
android:background="#00000000"/>
|
||||||
android:minHeight="@dimen/abc_action_bar_default_height_material"
|
|
||||||
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
|
||||||
|
|
||||||
<com.melnykov.fab.FloatingActionButton
|
<com.melnykov.fab.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="164dp"
|
android:layout_height="164dp"
|
||||||
android:paddingTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:paddingBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:scrollbars="none"/>
|
android:scrollbars="none"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="#0CFFFFFF"/>
|
android:background="?separator_color"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -3,15 +3,13 @@
|
||||||
android:id="@+id/fragment_album_view"
|
android:id="@+id/fragment_album_view"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:padding="2dp">
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:padding="2dp"
|
|
||||||
android:scrollbars="vertical"/>
|
android:scrollbars="vertical"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="14sp"/>
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="2dp"
|
||||||
android:elevation="3dp"
|
android:foreground="?rect_selector"
|
||||||
android:foreground="?rect_selector">
|
app:elevation="3dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -36,10 +36,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="sans-serif-medium"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
android:textColor="?attr/title_text_color"
|
android:textColor="?title_text_color"/>
|
||||||
android:textSize="16sp"
|
|
||||||
tools:text="Album Title"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/album_interpret"
|
android:id="@+id/album_interpret"
|
||||||
|
|
@ -47,10 +45,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
android:textColor="?attr/caption_text_color"
|
android:textColor="?caption_text_color"/>
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="Interpret"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="104dp"
|
android:layout_width="104dp"
|
||||||
android:layout_height="148dp"
|
android:layout_height="148dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:elevation="3dp"
|
app:elevation="3dp"
|
||||||
android:foreground="?rect_selector">
|
android:foreground="?rect_selector">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -39,9 +40,9 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
android:textColor="?attr/title_text_color"
|
android:textColor="?title_text_color"
|
||||||
android:textSize="12sp"
|
android:textSize="14sp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -49,9 +50,9 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
android:textColor="?attr/caption_text_color"
|
android:textColor="?caption_text_color"
|
||||||
android:textSize="10sp"
|
android:textSize="12sp"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,71 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="72dp"
|
||||||
android:background="?rect_selector"
|
android:background="?rect_selector">
|
||||||
android:descendantFocusability="blocksDescendants"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/track_number"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="40dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:fontFamily="sans-serif"
|
android:orientation="horizontal"
|
||||||
android:gravity="center"
|
android:paddingLeft="16dp"
|
||||||
android:singleLine="true"
|
>
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/song_title"
|
android:id="@+id/track_number"
|
||||||
android:layout_width="0dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginLeft="16dp"
|
android:fontFamily="sans-serif"
|
||||||
android:layout_marginRight="16dp"
|
android:gravity="center"
|
||||||
android:layout_weight="1"
|
android:singleLine="true"
|
||||||
android:fontFamily="sans-serif"
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
android:singleLine="true"
|
android:textColor="?title_text_color"/>
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/song_duration"
|
android:layout_width="0dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_gravity="center"
|
||||||
android:layout_gravity="center"
|
android:layout_marginLeft="16dp"
|
||||||
android:fontFamily="sans-serif"
|
android:layout_marginRight="16dp"
|
||||||
android:gravity="center"
|
android:layout_weight="1"
|
||||||
android:singleLine="true"
|
android:orientation="vertical">
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/menu"
|
android:id="@+id/song_title"
|
||||||
style="@style/OverFlowButton"
|
android:layout_width="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="2dp"
|
android:fontFamily="sans-serif"
|
||||||
android:layout_marginRight="2dp"/>
|
android:singleLine="true"
|
||||||
</LinearLayout>
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?title_text_color"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/song_info"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:textColor="?caption_text_color"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/menu"
|
||||||
|
style="@style/OverFlowButton"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="2dp"
|
||||||
|
android:layout_marginRight="2dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/short_separator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginLeft="72dp"
|
||||||
|
android:background="?separator_color"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
@ -1,45 +1,60 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="72dp"
|
||||||
android:layout_height="72dp"
|
android:background="?rect_selector">
|
||||||
android:background="?rect_selector"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp">
|
|
||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
|
||||||
android:id="@+id/artist_image"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="16dp"
|
android:orientation="horizontal"
|
||||||
android:layout_marginRight="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:layout_weight="1"
|
android:paddingRight="16dp">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:id="@+id/artist_name"
|
android:id="@+id/artist_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="40dp"
|
||||||
android:fontFamily="sans-serif"
|
android:layout_gravity="center"
|
||||||
android:singleLine="true"
|
android:gravity="center"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/artist_info"
|
android:layout_width="0dp"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="sans-serif"
|
android:layout_gravity="center"
|
||||||
android:singleLine="true"
|
android:layout_marginLeft="16dp"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/artist_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?title_text_color"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/artist_info"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:textColor="?caption_text_color"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<View
|
||||||
|
android:id="@+id/short_separator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginLeft="72dp"
|
||||||
|
android:background="?separator_color"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
@ -1,49 +1,65 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="72dp">
|
||||||
android:layout_height="72dp"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="16dp">
|
|
||||||
|
|
||||||
<com.kabouzeid.gramophone.view.SquareImageView
|
|
||||||
android:id="@+id/album_art"
|
|
||||||
android:layout_width="56dp"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_marginLeft="16dp"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:layout_gravity="center"
|
android:orientation="horizontal"
|
||||||
android:layout_weight="1"
|
android:paddingLeft="16dp">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
<com.kabouzeid.gramophone.view.SquareImageView
|
||||||
android:id="@+id/song_title"
|
android:id="@+id/album_art"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="40dp"
|
||||||
android:fontFamily="sans-serif"
|
android:layout_gravity="center"
|
||||||
android:singleLine="true"
|
android:gravity="center"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/song_info"
|
android:layout_width="0dp"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="sans-serif"
|
android:layout_gravity="center"
|
||||||
android:singleLine="true"
|
android:layout_marginLeft="16dp"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:textColor="?title_text_color"
|
||||||
|
android:id="@+id/song_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:textColor="?caption_text_color"
|
||||||
|
android:id="@+id/song_info"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/menu"
|
||||||
|
style="@style/OverFlowButton"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginRight="2dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<View
|
||||||
android:id="@+id/menu"
|
android:id="@+id/short_separator"
|
||||||
style="@style/OverFlowButton"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_height="1dp"
|
||||||
android:layout_marginRight="2dp"/>
|
android:layout_gravity="bottom"
|
||||||
</LinearLayout>
|
android:layout_marginLeft="72dp"
|
||||||
|
android:background="?separator_color"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
@ -1,36 +1,53 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="64dp"
|
||||||
android:layout_height="64dp"
|
android:background="?rect_selector">
|
||||||
android:background="?rect_selector"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="16dp">
|
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
|
||||||
android:src="@drawable/ic_queue_music_white_24dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
android:orientation="horizontal"
|
||||||
android:layout_weight="1"
|
android:paddingLeft="16dp">
|
||||||
android:id="@+id/playlist_name"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:fontFamily="sans-serif"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/menu"
|
android:id="@+id/playlist_icon"
|
||||||
style="@style/OverFlowButton"
|
android:layout_width="40dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_height="40dp"
|
||||||
android:layout_marginRight="2dp"/>
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:src="@drawable/ic_queue_music_white_24dp"
|
||||||
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
<TextView
|
||||||
|
android:id="@+id/playlist_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?title_text_color"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/menu"
|
||||||
|
style="@style/OverFlowButton"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginRight="2dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/short_separator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginLeft="72dp"
|
||||||
|
android:background="?separator_color"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
<com.kabouzeid.gramophone.view.SquareImageView
|
<com.kabouzeid.gramophone.view.SquareImageView
|
||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
android:layout_width="60dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="40dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
|
|
@ -31,7 +31,8 @@
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?title_text_color"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sub_title"
|
android:id="@+id/sub_title"
|
||||||
|
|
@ -41,6 +42,7 @@
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:textColor="?caption_text_color"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:background="?rect_selector"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="72dp"
|
||||||
|
android:background="?rect_selector">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="72dp"
|
android:layout_height="match_parent"
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="16dp">
|
android:paddingLeft="16dp">
|
||||||
|
|
||||||
<com.kabouzeid.gramophone.view.SquareImageView
|
<com.kabouzeid.gramophone.view.SquareImageView
|
||||||
android:id="@+id/album_art"
|
android:id="@+id/album_art"
|
||||||
android:layout_width="56dp"
|
android:layout_width="40dp"
|
||||||
android:layout_height="56dp"
|
android:layout_height="40dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:scaleType="centerCrop"/>
|
android:scaleType="centerCrop"/>
|
||||||
|
|
@ -30,20 +30,22 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:textColor="?title_text_color"
|
||||||
android:id="@+id/song_title"
|
android:id="@+id/song_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:textColor="?caption_text_color"
|
||||||
android:id="@+id/song_info"
|
android:id="@+id/song_info"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|
@ -58,6 +60,14 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="#0CFFFFFF"
|
android:background="?separator_color"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/short_separator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_marginLeft="72dp"
|
||||||
|
android:background="?separator_color"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||