This commit is contained in:
h4h13 2018-08-08 13:33:38 +05:30
parent 3d2adc1ca2
commit c648dcb378
84 changed files with 6018 additions and 5405 deletions

View file

@ -133,6 +133,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkNormalDebugClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
@ -141,18 +142,14 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_main_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/linked_res_for_bundle" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint_jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged-not-compiled-resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/module_bundle" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />

View file

@ -11,8 +11,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 207
versionName '1.7.10'
versionCode 209
versionName '1.7.100'
multiDexEnabled true
@ -86,7 +86,7 @@ static def getProperty(Properties properties, String name) {
}
static def getDate() {
new Date().format('yyyyMMdd')
new Date().format('MMdd')
}
ext {

View file

@ -26,7 +26,7 @@
</style>
</head>
<body style="padding: 1.0rem 0.5rem 2.5rem 0.5rem;">
<body style="padding: 1.0rem 0.5rem 1.0rem 0.5rem;">
<p><b><a href="https://github.com/kabouzeid/Phonograph" title="Phonograph"> Phonograph</a></b> by Karim Abou Zeid</p>
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxAndroid"> RxAndroid</a></b> by RxAndroid authors</p>
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxJava"> RxJava</a></b> by RxJava authors</p>

View file

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ol { list-style-position: inside; padding-left: 0; padding-right: 0; } li { padding-top: 8px; } </style> </head> <body> <p>You can view the changelog dialog again at any time from the <i>about</i> section.</p> <h3>Version 1.7.50</h3> <ol> <li><b>Fix:</b> Playlist renaming</li> <li><b>Improvement:</b> Version naming</li> <li><b>Added:</b> Changelog dialog</li> <li><b>Added:</b> Home banner toggle.</li> <li><b>Improvement:</b> Grammatical mistakes</li> </ol> </body>
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ol { list-style-position: inside; padding-left: 0; padding-right: 0; } li { padding-top: 8px; } </style> </head> <body> <p>You can view the changelog dialog again at any time from the <i>about</i> section.</p> <h3>Version 1.7.100</h3> <ol> <li><b>Fix:</b> same theme follows entire app </li> <li><b>Added:</b> Volume toggle for lock screen to support small screen </li> <li><b>Added:</b> Volume toggle for lock screen to support small screen </li> </ol> <h3>Version 1.7.50</h3> <ol> <li><b>Fix:</b> Playlist renaming</li> <li><b>Improvement:</b> Version naming</li> <li><b>Added:</b> Changelog dialog</li> <li><b>Added:</b> Home banner toggle.</li> <li><b>Improvement:</b> Grammatical mistakes</li> </ol> </body>

View file

@ -110,7 +110,8 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
if (mainActivity == null) {
return;
}
mainActivity.setCurrentFragment(FoldersFragment.newInstance(getContext()), true);
mainActivity.setCurrentFragment(FoldersFragment.newInstance(getContext()), true,
FoldersFragment.TAG);
break;
case R.id.action_settings:
NavigationUtil.goToSettings(getActivity());

View file

@ -1,14 +1,17 @@
package code.name.monkey.retromusic.loaders;
import android.content.Context;
import android.support.annotation.NonNull;
import java.util.ArrayList;
import code.name.monkey.retromusic.model.Playlist;
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
import io.reactivex.Observable;
import java.util.ArrayList;
public class HomeLoader {

View file

@ -1,6 +1,6 @@
package code.name.monkey.retromusic.model;
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
import android.support.annotation.StringRes;
import java.util.ArrayList;
@ -10,41 +10,20 @@ import java.util.ArrayList;
*/
public class Home {
public String sectionTitle;
public ArrayList<Object> list;
public AbsSmartPlaylist playlist;
public Home(String sectionTitle, AbsSmartPlaylist playlist) {
this.sectionTitle = sectionTitle;
this.playlist = playlist;
}
private int sectionTitle;
private ArrayList list;
public Home(String sectionTitle, ArrayList<Object> list) {
public Home(@StringRes int sectionTitle, ArrayList list) {
this.sectionTitle = sectionTitle;
this.list = list;
}
public Home(AbsSmartPlaylist playlist) {
this.playlist = playlist;
}
public AbsSmartPlaylist getPlaylist() {
return playlist;
}
@Override
public String toString() {
return "Home{" +
"sectionTitle='" + sectionTitle + '\'' +
", songs=" + list +
'}';
}
public String getSectionTitle() {
public int getSectionTitle() {
return sectionTitle;
}
public ArrayList<Object> getList() {
public ArrayList getList() {
return list;
}
}

View file

@ -1,15 +1,14 @@
package code.name.monkey.retromusic.mvp.contract;
import java.util.ArrayList;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.model.Artist;
import code.name.monkey.retromusic.model.Genre;
import code.name.monkey.retromusic.model.Playlist;
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
import code.name.monkey.retromusic.mvp.BasePresenter;
import code.name.monkey.retromusic.mvp.BaseView;
import java.util.ArrayList;
public interface HomeContract {
interface HomeView extends BaseView<ArrayList<Object>> {

View file

@ -2,12 +2,11 @@ package code.name.monkey.retromusic.providers;
import android.content.Context;
import code.name.monkey.retromusic.RetroApplication;
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
import java.io.File;
import java.util.ArrayList;
import code.name.monkey.retromusic.Injection;
import code.name.monkey.retromusic.RetroApplication;
import code.name.monkey.retromusic.loaders.AlbumLoader;
import code.name.monkey.retromusic.loaders.ArtistLoader;
import code.name.monkey.retromusic.loaders.GenreLoader;
@ -23,6 +22,7 @@ import code.name.monkey.retromusic.model.Artist;
import code.name.monkey.retromusic.model.Genre;
import code.name.monkey.retromusic.model.Playlist;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
import code.name.monkey.retromusic.providers.interfaces.Repository;
import code.name.monkey.retromusic.rest.model.KuGouRawLyric;
import code.name.monkey.retromusic.rest.model.KuGouSearchLyricResult;

View file

@ -5,7 +5,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ShareCompat;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
@ -40,11 +39,16 @@ public class AboutActivity extends AbsBaseActivity {
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.app_bar)
View background;
@BindView(R.id.app_version)
TextView appVersion;
@BindView(R.id.title)
TextView title;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -62,7 +66,7 @@ public class AboutActivity extends AbsBaseActivity {
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
@ -71,13 +75,13 @@ public class AboutActivity extends AbsBaseActivity {
}
private void setUpToolbar() {
title.setTextColor(ThemeStore.textColorPrimary(this));
int primaryColor = ThemeStore.primaryColor(this);
toolbar.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
toolbar.setNavigationOnClickListener(v -> onBackPressed());
setTitle(null);
setSupportActionBar(toolbar);
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@ -91,7 +95,7 @@ public class AboutActivity extends AbsBaseActivity {
@OnClick({R.id.app_github, R.id.faq_link, R.id.app_google_plus, R.id.app_translation,
R.id.app_rate, R.id.app_share, R.id.instagram_link, R.id.twitter_link, R.id.changelog,
R.id.open_source, R.id.discord_link, R.id.telegram_link})
R.id.open_source, R.id.discord_link, R.id.telegram_link, R.id.donate_link})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.faq_link:

View file

@ -86,9 +86,6 @@ public class AlbumDetailsActivity extends AbsSlidingMusicPanelActivity implement
@BindView(R.id.app_bar)
@Nullable
AppBarLayout appBarLayout;
@BindView(R.id.image_container)
@Nullable
View imageContainer;
@BindView(R.id.content)
View contentContainer;
@BindView(R.id.toolbar)

View file

@ -25,6 +25,12 @@ import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.Locale;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
@ -54,9 +60,6 @@ import code.name.monkey.retromusic.util.DensityUtil;
import code.name.monkey.retromusic.util.MusicUtil;
import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroUtil;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.Locale;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@ -66,6 +69,13 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
public static final String EXTRA_ARTIST_ID = "extra_artist_id";
private static final int REQUEST_CODE_SELECT_IMAGE = 9003;
@BindView(R.id.app_bar)
@Nullable
AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar)
@Nullable
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.image)
ImageView image;
@BindView(R.id.biography)
@ -86,12 +96,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
TextView text;
@BindView(R.id.action_shuffle_all)
FloatingActionButton shuffleButton;
@BindView(R.id.collapsing_toolbar)
@Nullable
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.app_bar)
@Nullable
AppBarLayout appBarLayout;
@BindView(R.id.gradient_background)
@Nullable
View background;

View file

@ -15,6 +15,7 @@ import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import code.name.monkey.appthemehelper.ThemeStore;
@ -31,28 +32,37 @@ public class EqualizerActivity extends AbsMusicServiceActivity implements
@BindView(R.id.equalizer)
SwitchCompat mEnable;
@BindView(R.id.content)
LinearLayout mContent;
@BindView(R.id.bands)
LinearLayout mLinearLayout;
@BindView(R.id.bass_boost_strength)
SeekBar mBassBoostStrength;
@BindView(R.id.virtualizer_strength)
SeekBar mVirtualizerStrength;
@BindView(R.id.bass_boost)
TextView mBassBoost;
@BindView(R.id.virtualizer)
TextView mVirtualizer;
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.app_bar)
AppBarLayout mAppBar;
@BindView(R.id.presets)
Spinner mPresets;
@BindView(R.id.title)
TextView mTitle;
private CompoundButton.OnCheckedChangeListener mListener = (buttonView, isChecked) -> {
switch (buttonView.getId()) {
case R.id.equalizer:
@ -101,19 +111,7 @@ public class EqualizerActivity extends AbsMusicServiceActivity implements
setTaskDescriptionColorAuto();
setLightNavigationBar(true);
int primaryColor = ThemeStore.primaryColor(this);
mToolbar.setBackgroundColor(primaryColor);
mAppBar.setBackgroundColor(primaryColor);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mToolbar.setTitle(R.string.equalizer);
setSupportActionBar(mToolbar);
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setupToolbar();
mEnable.setChecked(EqualizerHelper.getInstance().getEqualizer().getEnabled());
mEnable.setOnCheckedChangeListener(mListener);
@ -136,9 +134,20 @@ public class EqualizerActivity extends AbsMusicServiceActivity implements
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
private void setupToolbar() {
mTitle.setTextColor(ThemeStore.textColorPrimary(this));
int primaryColor = ThemeStore.primaryColor(this);
mToolbar.setBackgroundColor(primaryColor);
mAppBar.setBackgroundColor(primaryColor);
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
mToolbar.setNavigationOnClickListener(v -> onBackPressed());
setSupportActionBar(mToolbar);
setTitle(null);
}
private void addPresets() {

View file

@ -3,7 +3,6 @@ package code.name.monkey.retromusic.ui.activities;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
@ -18,7 +17,6 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import com.afollestad.materialcab.MaterialCab;
import code.name.monkey.retromusic.ui.activities.base.AbsSlidingMusicPanelActivity;
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
import java.util.ArrayList;
@ -39,6 +37,7 @@ import code.name.monkey.retromusic.model.Genre;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.mvp.contract.GenreDetailsContract;
import code.name.monkey.retromusic.mvp.presenter.GenreDetailsPresenter;
import code.name.monkey.retromusic.ui.activities.base.AbsSlidingMusicPanelActivity;
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter;
import code.name.monkey.retromusic.util.RetroColorUtil;
import code.name.monkey.retromusic.util.RetroUtil;
@ -72,8 +71,8 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
@BindView(R.id.app_bar)
AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar)
CollapsingToolbarLayout toolbarLayout;
@BindView(R.id.title)
TextView title;
private Genre genre;
private GenreDetailsPresenter presenter;
@ -101,7 +100,6 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
RetroUtil.statusBarHeight(statusBar);
genre = getIntent().getParcelableExtra(EXTRA_GENRE_ID);
presenter = new GenreDetailsPresenter(this, genre.id);
@ -119,14 +117,14 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
}
private void setUpToolBar() {
title.setText(genre.name);
title.setTextColor(ThemeStore.textColorPrimary(this));
int primaryColor = ThemeStore.primaryColor(this);
toolbar.setBackgroundColor(primaryColor);
appBarLayout.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
setTitle(null);
setSupportActionBar(toolbar);
//noinspection ConstantConditions
getSupportActionBar().setTitle(genre.name);
setTitle(R.string.app_name);
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
@ -140,7 +138,6 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
color = ATHUtil.resolveColor(GenreDetailsActivity.this, android.R.attr.textColorPrimary);
break;
}
toolbarLayout.setExpandedTitleColor(color);
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, GenreDetailsActivity.this);
}
});
@ -267,6 +264,4 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
super.onMediaStoreChanged();
presenter.subscribe();
}
}

View file

@ -6,6 +6,8 @@ import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.webkit.WebView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import code.name.monkey.appthemehelper.ThemeStore;
@ -15,11 +17,16 @@ import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity;
public class LicenseActivity extends AbsBaseActivity {
@BindView(R.id.license)
WebView mLicense;
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.appbar)
@BindView(R.id.app_bar)
AppBarLayout mAppbar;
@BindView(R.id.title)
TextView title;
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == android.R.id.home) {
@ -42,11 +49,12 @@ public class LicenseActivity extends AbsBaseActivity {
mLicense.loadUrl("file:///android_asset/index.html");
mToolbar.setTitle(R.string.licenses);
title.setTextColor(ThemeStore.textColorPrimary(this));
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
mAppbar.setBackgroundColor(ThemeStore.primaryColor(this));
setTitle(null);
setSupportActionBar(mToolbar);
}
}

View file

@ -155,14 +155,16 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
PreferenceUtil.getInstance(this).unregisterOnSharedPreferenceChangedListener(this);
}
public void setCurrentFragment(@Nullable Fragment fragment, boolean isStackAdd) {
public void setCurrentFragment(@Nullable Fragment fragment, boolean isStackAdd, String tag) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, fragment, TAG);
fragmentTransaction.replace(R.id.fragment_container, fragment, tag);
if (isStackAdd) {
fragmentTransaction.addToBackStack(TAG);
fragmentTransaction.addToBackStack(tag);
}
fragmentTransaction.commit();
currentFragment = (MainActivityFragmentCallbacks) fragment;
}
@ -186,13 +188,13 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
case R.id.action_album:
case R.id.action_artist:
case R.id.action_playlist:
setCurrentFragment(LibraryFragment.newInstance(menuItem), false);
setCurrentFragment(LibraryFragment.newInstance(menuItem), false, LibraryFragment.TAG);
break;
default:
case R.id.action_home:
setCurrentFragment(PreferenceUtil.getInstance(this).toggleHomeBanner() ? BannerHomeFragment
.newInstance() : HomeFragment.newInstance(),
false);
setCurrentFragment(PreferenceUtil.getInstance(this).toggleHomeBanner() ?
BannerHomeFragment.newInstance() : HomeFragment.newInstance(), false,
HomeFragment.TAG);
break;
}
}

View file

@ -5,6 +5,7 @@ import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import butterknife.BindDrawable;
import butterknife.BindString;
import butterknife.BindView;
@ -21,15 +22,22 @@ public class PlayingQueueActivity extends AbsMusicServiceActivity {
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindDrawable(R.drawable.ic_close_white_24dp)
@BindDrawable(R.drawable.ic_keyboard_backspace_black_24dp)
Drawable mClose;
@BindView(R.id.player_queue_sub_header)
TextView mPlayerQueueSubHeader;
@BindString(R.string.queue)
String queue;
@BindView(R.id.app_bar)
AppBarLayout mAppBarLayout;
@BindView(R.id.title)
TextView title;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -50,19 +58,18 @@ public class PlayingQueueActivity extends AbsMusicServiceActivity {
}
protected String getUpNextAndQueueTime() {
return getResources().getString(R.string.up_next) + "" + MusicUtil
.getReadableDurationString(
MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.getPosition()));
return getResources().getString(R.string.up_next) + "" + MusicUtil.getReadableDurationString(MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.getPosition()));
}
private void setupToolbar() {
title.setTextColor(ThemeStore.textColorPrimary(this));
mPlayerQueueSubHeader.setText(getUpNextAndQueueTime());
mPlayerQueueSubHeader.setTextColor(ThemeStore.accentColor(this));
mAppBarLayout.setBackgroundColor(ThemeStore.primaryColor(this));
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
mToolbar.setNavigationIcon(mClose);
setSupportActionBar(mToolbar);
setTitle(queue);
setTitle(null);
mToolbar.setNavigationOnClickListener(v -> onBackPressed());
}
}

View file

@ -3,7 +3,6 @@ package code.name.monkey.retromusic.ui.activities;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@ -29,13 +28,11 @@ import butterknife.ButterKnife;
import butterknife.OnClick;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.util.TintHelper;
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper;
import code.name.monkey.retromusic.interfaces.CabHolder;
import code.name.monkey.retromusic.loaders.PlaylistLoader;
import code.name.monkey.retromusic.misc.AppBarStateChangeListener;
import code.name.monkey.retromusic.model.AbsCustomPlaylist;
import code.name.monkey.retromusic.model.Playlist;
import code.name.monkey.retromusic.model.PlaylistSong;
@ -72,8 +69,8 @@ public class PlaylistDetailActivity extends AbsSlidingMusicPanelActivity impleme
@BindView(R.id.app_bar)
AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar)
CollapsingToolbarLayout toolbarLayout;
@BindView(R.id.title)
TextView title;
@BindView(R.id.status_bar)
View statusBar;
@ -182,33 +179,17 @@ public class PlaylistDetailActivity extends AbsSlidingMusicPanelActivity impleme
}
private void setUpToolBar() {
title.setTextColor(ThemeStore.textColorPrimary(this));
TintHelper.setTintAuto(shuffleButton, ThemeStore.accentColor(this), true);
int primaryColor = ThemeStore.primaryColor(this);
toolbar.setBackgroundColor(primaryColor);
appBarLayout.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
title.setText(playlist.name);
setTitle(null);
setSupportActionBar(toolbar);
//noinspection ConstantConditions
getSupportActionBar().setTitle(playlist.name);
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
public void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state) {
int color;
switch (state) {
default:
case COLLAPSED:
case EXPANDED:
case IDLE:
color = ThemeStore.textColorPrimary(PlaylistDetailActivity.this);
break;
}
toolbarLayout.setExpandedTitleColor(color);
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, PlaylistDetailActivity.this);
}
});
TintHelper.setTintAuto(shuffleButton, ThemeStore.accentColor(this), true);
}
@Override

View file

@ -44,28 +44,38 @@ public class SearchActivity extends AbsMusicServiceActivity implements OnQueryTe
public static final String TAG = SearchActivity.class.getSimpleName();
public static final String QUERY = "query";
private static final int REQ_CODE_SPEECH_INPUT = 9002;
@BindView(R.id.voice_search)
View micIcon;
@BindView(R.id.recycler_view)
RecyclerView recyclerView;
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(android.R.id.empty)
TextView empty;
@BindView(R.id.title)
TextView title;
@BindView(R.id.search_view)
EditText searchView;
@BindView(R.id.root)
CoordinatorLayout container;
@BindView(R.id.appbar)
@BindView(R.id.app_bar)
AppBarLayout appbar;
@BindView(R.id.status_bar)
View statusBar;
private SearchPresenter searchPresenter;
private SearchAdapter adapter;
private String query;
private boolean isMicSearch = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
setDrawUnderStatusBar(true);
@ -94,7 +104,7 @@ public class SearchActivity extends AbsMusicServiceActivity implements OnQueryTe
if (getIntent().getBooleanExtra("mic_search", false)) {
startMicSearch();
isMicSearch = true;
boolean isMicSearch = true;
}
}
@ -145,12 +155,13 @@ public class SearchActivity extends AbsMusicServiceActivity implements OnQueryTe
}
private void setUpToolBar() {
title.setTextColor(ThemeStore.textColorPrimary(this));
int primaryColor = ThemeStore.primaryColor(this);
toolbar.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
appbar.setBackgroundColor(primaryColor);
setSupportActionBar(toolbar);
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setTitle(null);
}
@Override

View file

@ -5,6 +5,7 @@ import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.AppBarLayout;
import android.support.transition.TransitionManager;
import android.support.v4.app.Fragment;
@ -12,20 +13,20 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.afollestad.materialdialogs.color.ColorChooserDialog;
import butterknife.BindView;
import butterknife.ButterKnife;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.util.ColorUtil;
import code.name.monkey.appthemehelper.util.TintHelper;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager;
import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity;
import code.name.monkey.retromusic.ui.fragments.settings.MainSettingsFragment;
import code.name.monkey.retromusic.util.PreferenceUtil;
import com.afollestad.materialdialogs.color.ColorChooserDialog;
public class SettingsActivity extends AbsBaseActivity implements ColorChooserDialog.ColorCallback {
@ -33,6 +34,8 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
Toolbar toolbar;
@BindView(R.id.app_bar)
AppBarLayout appBarLayout;
@BindView(R.id.title)
TextView title;
@BindView(R.id.detail_content_frame)
@Nullable
FrameLayout detailsFrame;
@ -80,34 +83,27 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
if (bundle == null) {
fragmentManager.beginTransaction().replace(R.id.content_frame, new MainSettingsFragment())
.commit();
} else {
restoreFragment();
}
}
private void setupToolbar() {
title.setTextColor(ThemeStore.textColorPrimary(this));
int primaryColor = ThemeStore.primaryColor(this);
appBarLayout.setBackgroundColor(primaryColor);
toolbar.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
toolbar.setNavigationOnClickListener(v -> onBackPressed());
setTitle(R.string.app_name);
setTitle(null);
setSupportActionBar(toolbar);
}
private void restoreFragment() {
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
if (fragmentManager.getBackStackEntryCount() > 0) {
appBarLayout.setExpanded(false, true);
} else {
appBarLayout.setExpanded(true, true);
}
setupToolbar();
}
public void setupFragment(Fragment fragment) {
public void setupFragment(Fragment fragment, @StringRes int titleName) {
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction()
.setCustomAnimations(R.animator.slide_up, 0, 0, R.animator.slide_down);
title.setText(titleName);
if (detailsFrame == null) {
fragmentTransaction.replace(R.id.content_frame, fragment, fragment.getTag());
fragmentTransaction.addToBackStack(null);
@ -117,14 +113,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
fragmentTransaction.commit();
}
fragmentManager.addOnBackStackChangedListener(() -> {
if (fragmentManager.getBackStackEntryCount() > 0) {
appBarLayout.setExpanded(false, true);
} else {
appBarLayout.setExpanded(true, true);
}
setupToolbar();
});
}
@ -133,6 +122,7 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
if (fragmentManager.getBackStackEntryCount() == 0) {
super.onBackPressed();
} else {
title.setText(R.string.action_settings);
fragmentManager.popBackStack();
}
}

View file

@ -14,6 +14,7 @@ import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
@ -53,18 +54,27 @@ import static code.name.monkey.retromusic.Constants.PAYPAL_ME_URL;
public class SupportDevelopmentActivity extends AbsBaseActivity implements BillingProcessor.IBillingHandler {
public static final String TAG = SupportDevelopmentActivity.class.getSimpleName();
private static final int DONATION_PRODUCT_IDS = R.array.donation_ids;
@BindView(R.id.progress)
ProgressBar mProgressBar;
@BindView(R.id.progress_container)
View mProgressContainer;
@BindView(R.id.list)
RecyclerView mListView;
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.app_bar)
AppBarLayout mAppBarLayout;
@BindView(R.id.root)
ViewGroup mViewGroup;
@BindView(R.id.title)
TextView title;
private BillingProcessor mBillingProcessor;
private AsyncTask skuDetailsLoadAsyncTask;
@ -86,6 +96,15 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
return skuDetails;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
private void donate(int i) {
final String[] ids = getResources().getStringArray(DONATION_PRODUCT_IDS);
mBillingProcessor.purchase(this, ids[i]);
@ -107,13 +126,8 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
setTaskDescriptionColorAuto();
setLightNavigationBar(true);
int primaryColor = ThemeStore.primaryColor(this);
mAppBarLayout.setBackgroundColor(primaryColor);
mToolbar.setBackgroundColor(primaryColor);
setSupportActionBar(mToolbar);
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
setupToolbar();
mBillingProcessor
= new BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSE_KEY, this);
@ -122,6 +136,17 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
((TextView) findViewById(R.id.donation)).setTextColor(ThemeStore.accentColor(this));
}
private void setupToolbar() {
title.setTextColor(ThemeStore.textColorPrimary(this));
int primaryColor = ThemeStore.primaryColor(this);
mAppBarLayout.setBackgroundColor(primaryColor);
mToolbar.setBackgroundColor(primaryColor);
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
setSupportActionBar(mToolbar);
setTitle(null);
}
@Override
public void onBillingInitialized() {
loadSkuDetails();
@ -173,7 +198,7 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
private static class SkuDetailsLoadAsyncTask extends AsyncTask<Void, Void, List<SkuDetails>> {
private final WeakReference<SupportDevelopmentActivity> donationDialogWeakReference;
public SkuDetailsLoadAsyncTask(SupportDevelopmentActivity donationsDialog) {
SkuDetailsLoadAsyncTask(SupportDevelopmentActivity donationsDialog) {
this.donationDialogWeakReference = new WeakReference<>(donationsDialog);
}
@ -205,8 +230,6 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
if (dialog == null) return;
if (skuDetails == null || skuDetails.isEmpty()) {
//Toast.makeText(dialog, "Error loading items", Toast.LENGTH_SHORT).show();
//dialog.finish();
dialog.mProgressContainer.setVisibility(View.GONE);
return;
}
@ -229,7 +252,7 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
SupportDevelopmentActivity donationsDialog;
List<SkuDetails> skuDetailsList = new ArrayList<>();
public SkuDetailsAdapter(@NonNull SupportDevelopmentActivity donationsDialog, @NonNull List<SkuDetails> objects) {
SkuDetailsAdapter(@NonNull SupportDevelopmentActivity donationsDialog, @NonNull List<SkuDetails> objects) {
this.donationsDialog = donationsDialog;
skuDetailsList = objects;
}
@ -260,14 +283,15 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
}
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
return new ViewHolder(LayoutInflater.from(donationsDialog)
.inflate(LAYOUT_RES_ID, viewGroup, false));
}
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
SkuDetails skuDetails = skuDetailsList.get(i);
if (skuDetails != null) {
viewHolder.title.setText(skuDetails.title.replace("(Retro Music Player)", "").trim());

View file

@ -1,52 +1,53 @@
package code.name.monkey.retromusic.ui.adapter;
import android.app.Activity;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindViews;
import butterknife.ButterKnife;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.glide.SongGlideRequest;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter.CollageSongViewHolder;
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
import code.name.monkey.retromusic.util.NavigationUtil;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
/**
* @author Hemanth S (h4h13).
*/
public class CollageSongAdapter extends RecyclerView.Adapter<CollageSongViewHolder> {
private AppCompatActivity activity;
private ArrayList<Album> dataSet;
private int itemLayoutRes;
private Activity activity;
private ArrayList<Song> dataSet;
public CollageSongAdapter(AppCompatActivity activity, ArrayList<Album> dataSet,
int itemLayoutRes) {
public CollageSongAdapter(Activity activity, ArrayList<Song> dataSet) {
this.activity = activity;
this.dataSet = dataSet;
this.itemLayoutRes = itemLayoutRes;
}
@Override
public void onBindViewHolder(@NonNull CollageSongViewHolder holder, int position) {
ArrayList<Album> albums = dataSet;
holder.bindSongs(albums);
if (albums.size() > 9) {
for (int i = 0; i < albums.subList(0, 9).size(); i++) {
holder.bindSongs();
if (dataSet.size() > 9) {
for (int i = 0; i < dataSet.subList(0, 9).size(); i++) {
if (holder.imageViews != null) {
SongGlideRequest.Builder.from(Glide.with(activity), albums.get(i).safeGetFirstSong())
.checkIgnoreMediaStore(activity).build().into(holder.imageViews.get(i));
SongGlideRequest.Builder.from(Glide.with(activity), dataSet.get(i))
.checkIgnoreMediaStore(activity)
.build()
.into(holder.imageViews.get(i));
}
}
}
@ -59,9 +60,9 @@ public class CollageSongAdapter extends RecyclerView.Adapter<CollageSongViewHold
@NonNull
@Override
public CollageSongViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public CollageSongViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new CollageSongViewHolder(
LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false));
LayoutInflater.from(activity).inflate(R.layout.item_collage, parent, false));
}
class CollageSongViewHolder extends MediaEntryViewHolder {
@ -76,19 +77,14 @@ public class CollageSongAdapter extends RecyclerView.Adapter<CollageSongViewHold
ButterKnife.bind(this, itemView);
}
@Override
public void onClick(View v) {
super.onClick(v);
NavigationUtil.goToAlbum(activity, dataSet.get(getAdapterPosition() + 1).getId());
}
void bindSongs(ArrayList<Album> albums) {
void bindSongs() {
if (imageViews != null) {
for (int i = 0; i < imageViews.size(); i++) {
final int startPosition = i;
ImageView imageView = imageViews.get(i);
imageView.setOnClickListener(
v -> NavigationUtil.goToAlbum(activity, albums.get(startPosition).getId()));
imageView.setOnClickListener(view -> {
});
}
}
}

View file

@ -60,8 +60,11 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
this.usePalette = usePalette;
setHasStableIds(true);
this.textColor = ThemeStore.textColorPrimary(activity);
Typeface mTypeface = Typeface
.createFromAsset(activity.getAssets(), activity.getString(R.string.sans_regular));
}
public AlbumAdapter(@NonNull AppCompatActivity activity, ArrayList<Album> dataSet,
@LayoutRes int itemLayoutRes) {
this(activity, dataSet, itemLayoutRes, false, null);
}
public void useItemLayout(int itemLayoutRes) {

View file

@ -25,6 +25,12 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget;
import code.name.monkey.retromusic.glide.SongGlideRequest;
@ -32,9 +38,6 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.util.NavigationUtil;
import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
public class AlbumFullWithAdapter extends
MetalRecyclerViewPager.MetalAdapter<AlbumFullWithAdapter.FullMetalViewHolder> {
@ -53,8 +56,9 @@ public class AlbumFullWithAdapter extends
notifyDataSetChanged();
}
@NonNull
@Override
public FullMetalViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
public FullMetalViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View viewItem = LayoutInflater.from(parent.getContext())
.inflate(R.layout.pager_item, parent, false);
return new FullMetalViewHolder(viewItem);
@ -84,7 +88,7 @@ public class AlbumFullWithAdapter extends
}
@Override
public void onBindViewHolder(FullMetalViewHolder holder, int position) {
public void onBindViewHolder(@NonNull FullMetalViewHolder holder, int position) {
// don't forget about calling supper.onBindViewHolder!
super.onBindViewHolder(holder, position);

View file

@ -9,6 +9,13 @@ import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import com.bumptech.glide.Glide;
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
import java.util.ArrayList;
import java.util.List;
import code.name.monkey.appthemehelper.util.ColorUtil;
import code.name.monkey.appthemehelper.util.MaterialValueHelper;
import code.name.monkey.retromusic.R;
@ -22,10 +29,6 @@ import code.name.monkey.retromusic.ui.adapter.base.AbsMultiSelectAdapter;
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
import code.name.monkey.retromusic.util.MusicUtil;
import code.name.monkey.retromusic.util.NavigationUtil;
import com.bumptech.glide.Glide;
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
import java.util.ArrayList;
import java.util.List;
public class ArtistAdapter extends
@ -50,6 +53,14 @@ public class ArtistAdapter extends
//setHasStableIds(true);
}
public ArtistAdapter(@NonNull AppCompatActivity activity, ArrayList<Artist> dataSet,
@LayoutRes int itemLayoutRes ) {
super(activity, null, R.menu.menu_media_selection);
this.activity = activity;
this.dataSet = dataSet;
this.itemLayoutRes = itemLayoutRes;
}
public void swapDataSet(ArrayList<Artist> dataSet) {
this.dataSet = dataSet;
notifyDataSetChanged();

View file

@ -10,6 +10,7 @@ import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import code.name.monkey.appthemehelper.ThemeStore;

View file

@ -1,167 +1,126 @@
package code.name.monkey.retromusic.ui.adapter.home;
import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.BindView;
import java.util.ArrayList;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.loaders.SongLoader;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.model.Artist;
import code.name.monkey.retromusic.model.Genre;
import code.name.monkey.retromusic.model.Home;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter;
import code.name.monkey.retromusic.ui.adapter.GenreAdapter;
import code.name.monkey.retromusic.ui.adapter.album.AlbumAdapter;
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter;
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter;
import code.name.monkey.retromusic.util.NavigationUtil;
import java.util.ArrayList;
public class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.ViewHolder> {
private static final int SUB_HEADER = 0;
private static final int ABS_PLAYLITS = 1;
private static final int DATA = 2;
private ArrayList<Object> dataSet = new ArrayList<>();
private AppCompatActivity activity;
private static final int ALBUMS = 0;
private static final int ARTISTS = 1;
private static final int GENERS = 2;
private static final int SUGGESTIONS = 3;
private Activity activity;
private ArrayList<Home> sections = new ArrayList<>();
public HomeAdapter(@NonNull AppCompatActivity activity) {
public HomeAdapter(Activity activity) {
this.activity = activity;
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
switch (i) {
case ABS_PLAYLITS:
return new ViewHolder(LayoutInflater.from(activity)
.inflate(R.layout.abs_playlists, viewGroup, false));
default:
case DATA:
return new ViewHolder(LayoutInflater.from(activity)
.inflate(R.layout.recycler_view_sec, viewGroup, false));
case SUB_HEADER:
return new ViewHolder(LayoutInflater.from(activity)
.inflate(R.layout.sub_header, viewGroup, false));
}
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
Context context = parent.getContext();
return new ViewHolder(LayoutInflater.from(context).inflate(R.layout.home_section_recycler_view,
parent, false));
}
@Override
public int getItemViewType(int position) {
if (dataSet.get(position) instanceof String) {
return SUB_HEADER;
} else if (dataSet.get(position) instanceof Integer) {
return ABS_PLAYLITS;
} else if (dataSet.get(position) instanceof ArrayList) {
return DATA;
Home home = sections.get(position);
ArrayList arrayList = home.getList();
if (arrayList.get(0) instanceof Album) {
return ALBUMS;
} else if (arrayList.get(0) instanceof Artist) {
return ARTISTS;
} else if (arrayList.get(0) instanceof Genre) {
return GENERS;
} else {
return SUGGESTIONS;
}
return super.getItemViewType(position);
}
private DisplayMetrics getDisplayMetrics() {
Display display = activity.getWindowManager().getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
return metrics;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int i) {
ViewHolder viewholder = (ViewHolder) holder;
switch (getItemViewType(i)) {
case ABS_PLAYLITS:
bindAbsActions(viewholder);
break;
case SUB_HEADER:
String title = (String) dataSet.get(i);
if (viewholder.title != null) {
viewholder.title.setText(title);
}
break;
case DATA:
parseAllSections(i, viewholder);
break;
}
}
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Home home = sections.get(position);
private void bindAbsActions(ViewHolder viewholder) {
if (viewholder.shuffle != null) {
viewholder.shuffle.setOnClickListener(view -> MusicPlayerRemote
.openAndShuffleQueue(SongLoader.getAllSongs(activity).blockingFirst(), true));
if (holder.title != null) {
holder.title.setText(home.getSectionTitle());
}
/*if (viewholder.search != null) {
viewholder.search.setBackgroundTintList(ColorStateList.valueOf(ColorUtil.withAlpha(ThemeStore.textColorPrimary(activity), 0.2f)));
viewholder.search.setOnClickListener(view -> {
activity.startActivity(new Intent(activity, SearchActivity.class));
});
}*/
ArrayList arrayList = home.getList();
if (arrayList.get(0) instanceof Album) {
AlbumAdapter albumAdapter = new AlbumAdapter((AppCompatActivity) activity,
(ArrayList<Album>) arrayList, R.layout.item_image);
if (holder.recyclerView != null) {
holder.recyclerView.setLayoutManager(new GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false));
holder.recyclerView.setAdapter(albumAdapter);
}
@SuppressWarnings("unchecked")
private void parseAllSections(int i, ViewHolder viewholder) {
if (viewholder.recyclerView != null) {
ArrayList arrayList = (ArrayList) dataSet.get(i);
if (arrayList.isEmpty()) {
return;
} else if (arrayList.get(0) instanceof Artist) {
ArtistAdapter artistAdapter = new ArtistAdapter((AppCompatActivity) activity, (ArrayList<Artist>) arrayList, R.layout.item_artist);
GridLayoutManager layoutManager = new GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false);
if (holder.recyclerView != null) {
holder.recyclerView.setLayoutManager(layoutManager);
holder.recyclerView.setAdapter(artistAdapter);
}
Object something = arrayList.get(0);
if (something instanceof Artist) {
layoutManager(viewholder);
viewholder.recyclerView.setAdapter(
new ArtistAdapter(activity, (ArrayList<Artist>) arrayList, R.layout.item_artist, false,
null));
} else if (something instanceof Album) {
layoutManager(viewholder);
viewholder.recyclerView.setItemAnimator(new DefaultItemAnimator());
viewholder.recyclerView.setAdapter(
new AlbumAdapter(activity, (ArrayList<Album>) arrayList, R.layout.item_image, false,
null));
} else if (something instanceof Song) {
GridLayoutManager layoutManager = new GridLayoutManager(activity, 1,
LinearLayoutManager.HORIZONTAL, false);
viewholder.recyclerView.setLayoutManager(layoutManager);
viewholder.recyclerView.setAdapter(
new SongAdapter(activity, (ArrayList<Song>) arrayList, R.layout.item_image, false,
null));
} else if (arrayList.get(0) instanceof Genre) {
GenreAdapter genreAdapter = new GenreAdapter(activity, (ArrayList<Genre>) arrayList, R.layout.item_list);
if (holder.recyclerView != null) {
holder.recyclerView.setLayoutManager(new LinearLayoutManager(activity));
holder.recyclerView.setAdapter(genreAdapter);
}
} else if (arrayList.get(0) instanceof Song) {
CollageSongAdapter collageSongAdapter = new CollageSongAdapter(activity, (ArrayList<Song>) arrayList);
if (holder.recyclerView != null) {
holder.recyclerView.setLayoutManager(new LinearLayoutManager(activity));
holder.recyclerView.setAdapter(collageSongAdapter);
}
}
}
private void layoutManager(ViewHolder viewholder) {
if (viewholder.recyclerView != null) {
viewholder.recyclerView.setLayoutManager(
new GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false));
viewholder.recyclerView.setItemAnimator(new DefaultItemAnimator());
}
}
@Override
public int getItemCount() {
return dataSet.size();
return sections.size();
}
public void swapDataSet(@NonNull ArrayList<Object> data) {
dataSet = data;
public void swapData(ArrayList<Home> sections) {
this.sections = sections;
notifyDataSetChanged();
}
public ArrayList<Object> getDataset() {
return dataSet;
}
public class ViewHolder extends MediaEntryViewHolder {
@BindView(R.id.action_shuffle)
@Nullable
View shuffle;
public ViewHolder(View itemView) {
super(itemView);
}

View file

@ -35,11 +35,11 @@ public abstract class AbsMainActivityFragment extends AbsMusicServiceFragment {
final View statusBar = view.findViewById(R.id.status_bar);
if (statusBar != null) {
RetroUtil.statusBarHeight(statusBar);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
statusBar.setBackgroundColor(ColorUtil.darkenColor(color));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
statusBar.setBackgroundColor(color);
getMainActivity().setLightStatusbarAuto(color);
} else {
statusBar.setBackgroundColor(color);
statusBar.setBackgroundColor(ColorUtil.darkenColor(color));
}
}
}
@ -47,6 +47,7 @@ public abstract class AbsMainActivityFragment extends AbsMusicServiceFragment {
public void setStatusbarColorAuto(View view) {
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
//noinspection ConstantConditions
setStatusbarColor(view, ThemeStore.primaryColor(getContext()));
}
}

View file

@ -4,6 +4,9 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import java.util.ArrayList;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.mvp.contract.AlbumContract;
@ -11,7 +14,6 @@ import code.name.monkey.retromusic.mvp.presenter.AlbumPresenter;
import code.name.monkey.retromusic.ui.adapter.album.AlbumAdapter;
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
import code.name.monkey.retromusic.util.PreferenceUtil;
import java.util.ArrayList;
public class AlbumsFragment extends
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridLayoutManager> implements
@ -39,6 +41,7 @@ public class AlbumsFragment extends
int itemLayoutRes = getItemLayoutRes();
notifyLayoutResChanged(itemLayoutRes);
if (itemLayoutRes != R.layout.item_list) {
//noinspection ConstantConditions
itemLayoutRes = PreferenceUtil.getInstance(getContext()).getAlbumGridStyle(getContext());
}
ArrayList<Album> dataSet =
@ -54,6 +57,7 @@ public class AlbumsFragment extends
@Override
public boolean loadUsePalette() {
//noinspection ConstantConditions
return PreferenceUtil.getInstance(getActivity()).albumColoredFooters();
}
@ -75,36 +79,43 @@ public class AlbumsFragment extends
@Override
protected String loadSortOrder() {
//noinspection ConstantConditions
return PreferenceUtil.getInstance(getActivity()).getAlbumSortOrder();
}
@Override
protected void saveSortOrder(String sortOrder) {
//noinspection ConstantConditions
PreferenceUtil.getInstance(getActivity()).setAlbumSortOrder(sortOrder);
}
@Override
protected int loadGridSize() {
//noinspection ConstantConditions
return PreferenceUtil.getInstance(getActivity()).getAlbumGridSize(getActivity());
}
@Override
protected void saveGridSize(int gridSize) {
//noinspection ConstantConditions
PreferenceUtil.getInstance(getActivity()).setAlbumGridSize(gridSize);
}
@Override
protected int loadGridSizeLand() {
//noinspection ConstantConditions
return PreferenceUtil.getInstance(getActivity()).getAlbumGridSizeLand(getActivity());
}
@Override
protected void saveGridSizeLand(int gridSize) {
//noinspection ConstantConditions
PreferenceUtil.getInstance(getActivity()).setAlbumGridSizeLand(gridSize);
}
@Override
protected void saveUsePalette(boolean usePalette) {
//noinspection ConstantConditions
PreferenceUtil.getInstance(getActivity()).setAlbumColoredFooters(usePalette);
}
@ -123,6 +134,7 @@ public class AlbumsFragment extends
public void setMenuVisibility(boolean menuVisible) {
super.setMenuVisibility(menuVisible);
if (menuVisible) {
//noinspection ConstantConditions
getLibraryFragment().setTitle(
PreferenceUtil.getInstance(getContext()).tabTitles() ? R.string.library
: R.string.albums);
@ -132,6 +144,7 @@ public class AlbumsFragment extends
@Override
public void onResume() {
super.onResume();
//noinspection ConstantConditions
getLibraryFragment().setTitle(
PreferenceUtil.getInstance(getContext()).tabTitles() ? R.string.library : R.string.albums);
if (getAdapter().getDataSet().isEmpty()) {

View file

@ -7,7 +7,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
@ -19,12 +18,18 @@ import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.afollestad.materialcab.MaterialCab;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.common.ATHToolbarActivity;
import code.name.monkey.appthemehelper.util.ATHUtil;
import code.name.monkey.appthemehelper.util.TintHelper;
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
@ -40,20 +45,22 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
import code.name.monkey.retromusic.util.NavigationUtil;
import code.name.monkey.retromusic.util.RetroColorUtil;
import code.name.monkey.retromusic.util.RetroUtil;
import com.afollestad.materialcab.MaterialCab;
import code.name.monkey.retromusic.views.IconImageView;
public class LibraryFragment extends AbsMainActivityFragment implements CabHolder,
MainActivityFragmentCallbacks {
private static final String TAG = "LibraryFragment";
public static final String TAG = "LibraryFragment";
private static final String CURRENT_TAB_ID = "current_tab_id";
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.app_bar)
AppBarLayout appbar;
@BindView(R.id.collapsing_toolbar)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.title)
TextView title;
@BindView(R.id.search)
IconImageView search;
private Unbinder unBinder;
private MaterialCab cab;
@ -68,7 +75,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
}
public void setTitle(@StringRes int name) {
collapsingToolbarLayout.setTitle(getString(name));
title.setText(getString(name));
}
public void addOnAppBarOffsetChangedListener(
@ -97,11 +104,9 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
setStatusbarColorAuto(view);
getMainActivity().setBottomBarVisibility(View.VISIBLE);
setupToolbar();
inflateFragment();
}
@ -129,12 +134,15 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@SuppressWarnings("ConstantConditions")
private void setupToolbar() {
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
TintHelper.setTintAuto(search, ThemeStore.textColorSecondary(getContext()), false);
int primaryColor = ThemeStore.primaryColor(getContext());
appbar.setBackgroundColor(primaryColor);
toolbar.setBackgroundColor(primaryColor);
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
getMainActivity().setTitle(R.string.app_name);
getMainActivity().setTitle(null);
getMainActivity().setSupportActionBar(toolbar);
}
@ -185,6 +193,11 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
return cab;
}
@OnClick(R.id.search)
void search() {
NavigationUtil.goToSearch(getActivity());
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);

View file

@ -26,6 +26,21 @@ import android.webkit.MimeTypeMap;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;
import com.afollestad.materialcab.MaterialCab;
import com.afollestad.materialdialogs.MaterialDialog;
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
@ -53,18 +68,6 @@ import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroColorUtil;
import code.name.monkey.retromusic.util.ViewUtil;
import code.name.monkey.retromusic.views.BreadCrumbLayout;
import com.afollestad.materialcab.MaterialCab;
import com.afollestad.materialdialogs.MaterialDialog;
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
public class FoldersFragment extends AbsMainActivityFragment implements
MainActivityFragmentCallbacks,
@ -95,7 +98,6 @@ public class FoldersFragment extends AbsMainActivityFragment implements
BreadCrumbLayout breadCrumbs;
@BindView(R.id.appbar)
AppBarLayout appbar;
@BindView(R.id.recycler_view)
FastScrollRecyclerView recyclerView;
@ -226,17 +228,12 @@ public class FoldersFragment extends AbsMainActivityFragment implements
//noinspection ConstantConditions
int primaryColor = ThemeStore.primaryColor(getActivity());
TintHelper.setTintAuto(container, primaryColor, true);
appbar.setBackgroundColor(ColorUtil.darkenColor(primaryColor));
toolbar.setBackgroundColor(ColorUtil.darkenColor(primaryColor));
appbar.setBackgroundColor(primaryColor);
toolbar.setBackgroundColor(primaryColor);
//breadCrumbs.setBackgroundColor(primaryColor);
breadCrumbs.setActivatedContentColor(
ToolbarContentTintHelper
.toolbarTitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
breadCrumbs.setDeactivatedContentColor(
ToolbarContentTintHelper
.toolbarSubtitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> getMainActivity()
.setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
breadCrumbs.setActivatedContentColor(ToolbarContentTintHelper.toolbarTitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
breadCrumbs.setDeactivatedContentColor(ToolbarContentTintHelper.toolbarSubtitleColor(getActivity(), ColorUtil.darkenColor(primaryColor)));
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
}
private void setUpToolbar() {

View file

@ -1,14 +1,11 @@
package code.name.monkey.retromusic.ui.fragments.mainactivity.home;
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
@ -22,13 +19,16 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.io.File;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.util.ATHUtil;
import code.name.monkey.appthemehelper.util.ColorUtil;
import code.name.monkey.appthemehelper.util.TintHelper;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.dialogs.HomeOptionDialog;
@ -56,8 +56,8 @@ import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
import java.io.File;
import java.util.ArrayList;
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
public class BannerHomeFragment extends AbsMainActivityFragment implements
MainActivityFragmentCallbacks,
@ -161,8 +161,8 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements
private void setupToolbar() {
//noinspection ConstantConditions
int primaryColor = ThemeStore.primaryColor(getContext());
appbar.setBackgroundColor(ColorUtil.darkenColor(primaryColor));
toolbar.setBackgroundColor(ColorUtil.darkenColor(primaryColor));
appbar.setBackgroundColor(primaryColor);
toolbar.setBackgroundColor(primaryColor);
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));

View file

@ -71,7 +71,7 @@ import static code.name.monkey.retromusic.Constants.USER_PROFILE;
public class HomeFragment extends AbsMainActivityFragment implements MainActivityFragmentCallbacks,
HomeContract.HomeView {
private static final String TAG = "HomeFragment";
public static final String TAG = "HomeFragment";
Unbinder unbinder;
@BindView(R.id.home_toolbar)
Toolbar toolbar;
@ -412,3 +412,412 @@ public class HomeFragment extends AbsMainActivityFragment implements MainActivit
homePresenter.loadRecentAlbums();
}
}
/*
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Random;
import butterknife.BindView;
import butterknife.BindViews;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.util.ATHUtil;
import code.name.monkey.appthemehelper.util.TintHelper;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.dialogs.HomeOptionDialog;
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
import code.name.monkey.retromusic.loaders.SongLoader;
import code.name.monkey.retromusic.misc.AppBarStateChangeListener;
import code.name.monkey.retromusic.model.Album;
import code.name.monkey.retromusic.model.Artist;
import code.name.monkey.retromusic.model.Genre;
import code.name.monkey.retromusic.model.Home;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
import code.name.monkey.retromusic.mvp.contract.HomeContract;
import code.name.monkey.retromusic.mvp.presenter.HomePresenter;
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter;
import code.name.monkey.retromusic.ui.adapter.GenreAdapter;
import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWithAdapter;
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter;
import code.name.monkey.retromusic.ui.adapter.home.HomeAdapter;
import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
import code.name.monkey.retromusic.util.Compressor;
import code.name.monkey.retromusic.util.NavigationUtil;
import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroUtil;
import code.name.monkey.retromusic.views.CircularImageView;
import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
import static code.name.monkey.retromusic.Constants.USER_BANNER;
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
public class HomeFragment extends AbsMainActivityFragment implements MainActivityFragmentCallbacks,
HomeContract.HomeView {
public static final String TAG = "HomeFragment";
Unbinder unbinder;
@BindView(R.id.home_toolbar)
Toolbar toolbar;
@BindView(R.id.appbar)
AppBarLayout appbar;
@BindView(R.id.image)
ImageView imageView;
@BindView(R.id.user_image)
CircularImageView userImage;
@BindView(R.id.collapsing_toolbar)
CollapsingToolbarLayout toolbarLayout;
@BindView(R.id.container)
View container;
@BindView(R.id.title)
TextView title;
@BindView(R.id.search)
ImageView search;
@BindViews({R.id.recent_artist_container, R.id.recent_albums_container,
R.id.top_artist_container, R.id.top_albums_container,
R.id.genre_container})
List<View> sectionContainers;
@BindViews({R.id.recent_artist_recycler_view, R.id.top_artist_recycler_view,
R.id.genres_recycler_view})
List<RecyclerView> sectionRecyclerViews;
@BindViews({R.id.recent_albums_recycler_view, R.id.top_album_recycler_view})
List<MetalRecyclerViewPager> metalRecyclerViewPagers;
private HomePresenter homePresenter;
private CompositeDisposable disposable;
public static HomeFragment newInstance() {
Bundle args = new Bundle();
HomeFragment fragment = new HomeFragment();
fragment.setArguments(args);
return fragment;
}
private void getTimeOfTheDay() {
Calendar c = Calendar.getInstance();
int timeOfDay = c.get(Calendar.HOUR_OF_DAY);
String[] images = new String[]{};
if (timeOfDay >= 0 && timeOfDay < 6) {
images = getResources().getStringArray(R.array.night);
} else if (timeOfDay >= 6 && timeOfDay < 12) {
images = getResources().getStringArray(R.array.morning);
} else if (timeOfDay >= 12 && timeOfDay < 16) {
images = getResources().getStringArray(R.array.after_noon);
} else if (timeOfDay >= 16 && timeOfDay < 20) {
images = getResources().getStringArray(R.array.evening);
} else if (timeOfDay >= 20 && timeOfDay < 24) {
images = getResources().getStringArray(R.array.night);
}
String day = images[new Random().nextInt(images.length)];
loadTimeImage(day);
}
private void loadTimeImage(String day) {
//noinspection ConstantConditions
if (PreferenceUtil.getInstance(getActivity()).getBannerImage().isEmpty()) {
if (imageView != null) {
Glide.with(getActivity()).load(day)
.asBitmap()
.placeholder(R.drawable.material_design_default)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(imageView);
}
} else {
loadBannerFromStorage();
}
}
private void loadBannerFromStorage() {
//noinspection ConstantConditions
disposable.add(new Compressor(getContext())
.setQuality(100)
.setCompressFormat(Bitmap.CompressFormat.WEBP)
.compressToBitmapAsFlowable(
new File(PreferenceUtil.getInstance(getContext()).getBannerImage(), USER_BANNER))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(imageView::setImageBitmap));
}
private void loadImageFromStorage(ImageView imageView) {
//noinspection ConstantConditions
disposable.add(new Compressor(getContext())
.setMaxHeight(300)
.setMaxWidth(300)
.setQuality(75)
.setCompressFormat(Bitmap.CompressFormat.WEBP)
.compressToBitmapAsFlowable(
new File(PreferenceUtil.getInstance(getContext()).getProfileImage(), USER_PROFILE))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(imageView::setImageBitmap,
throwable -> imageView.setImageDrawable(ContextCompat
.getDrawable(getContext(), R.drawable.ic_person_flat))));
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
disposable = new CompositeDisposable();
homePresenter = new HomePresenter(this);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_home, container, false);
unbinder = ButterKnife.bind(this, view);
setRetainInstance(true);
return view;
}
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getMainActivity().getSlidingUpPanelLayout().setShadowHeight(8);
getMainActivity().setBottomBarVisibility(View.VISIBLE);
setupToolbar();
loadImageFromStorage(userImage);
homePresenter.subscribe();
checkPadding();
getTimeOfTheDay();
}
@SuppressWarnings("ConstantConditions")
private void setupToolbar() {
if (!PreferenceUtil.getInstance(getContext()).getFullScreenMode()) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar
.getLayoutParams();
params.topMargin = RetroUtil.getStatusBarHeight(getContext());
toolbar.setLayoutParams(params);
}
appbar.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override
public void onStateChanged(AppBarLayout appBarLayout, State state) {
int color;
switch (state) {
case COLLAPSED:
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext()));
color = ThemeStore.textColorPrimary(getContext());
break;
default:
case EXPANDED:
case IDLE:
getMainActivity().setLightStatusbar(false);
color = Color.WHITE;
break;
}
TintHelper.setTintAuto(search, color, false);
title.setTextColor(color);
}
});
int primaryColor = ThemeStore.primaryColor(getContext());
TintHelper.setTintAuto(container, primaryColor, true);
toolbarLayout.setStatusBarScrimColor(primaryColor);
toolbarLayout.setContentScrimColor(primaryColor);
toolbar.setTitle(R.string.home);
getMainActivity().setSupportActionBar(toolbar);
}
@Override
public boolean handleBackPress() {
return false;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
disposable.clear();
homePresenter.unsubscribe();
}
@Override
public void loading() {
}
@Override
public void showEmptyView() {
}
@Override
public void completed() {
}
@Override
public void showData(ArrayList<Home> homes) {
HomeAdapter homeAdapter = new HomeAdapter(getMainActivity());
homeAdapter.swapData(homes);
}
@Override
public void onServiceConnected() {
super.onServiceConnected();
checkPadding();
}
@Override
public void onQueueChanged() {
super.onQueueChanged();
checkPadding();
}
private void checkPadding() {
int height = getResources().getDimensionPixelSize(R.dimen.mini_player_height);
container.setPadding(0, 0, 0, MusicPlayerRemote.getPlayingQueue().isEmpty() ? height * 2 : 0);
}
private DisplayMetrics getDisplayMetrics() {
Display display = getMainActivity().getWindowManager().getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
return metrics;
}
@OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle,
R.id.history, R.id.user_image, R.id.search})
void startUserInfo(View view) {
Activity activity = getActivity();
if (activity != null) {
switch (view.getId()) {
case R.id.action_shuffle:
MusicPlayerRemote
.openAndShuffleQueue(SongLoader.getAllSongs(activity).blockingFirst(), true);
break;
case R.id.last_added:
NavigationUtil.goToPlaylistNew(activity, new LastAddedPlaylist(activity));
break;
case R.id.top_played:
NavigationUtil.goToPlaylistNew(activity, new MyTopTracksPlaylist(activity));
break;
case R.id.history:
NavigationUtil.goToPlaylistNew(activity, new HistoryPlaylist(activity));
break;
case R.id.search:
NavigationUtil.goToSearch(activity);
break;
case R.id.user_image:
//noinspection ConstantConditions
new HomeOptionDialog().show(getFragmentManager(), TAG);
break;
}
}
}
@Override
public void showRecentAlbums(ArrayList<Album> albums) {
sectionContainers.get(1).setVisibility(View.VISIBLE);
AlbumFullWithAdapter albumFullWithAdapter = new AlbumFullWithAdapter(getMainActivity(),
getDisplayMetrics());
albumFullWithAdapter.swapData(albums);
MetalRecyclerViewPager recyclerView = metalRecyclerViewPagers.get(0);
recyclerView.setAdapter(albumFullWithAdapter);
}
@Override
public void showTopAlbums(ArrayList<Album> albums) {
sectionContainers.get(3).setVisibility(View.VISIBLE);
AlbumFullWithAdapter albumFullWithAdapter = new AlbumFullWithAdapter(getMainActivity(),
getDisplayMetrics());
albumFullWithAdapter.swapData(albums);
MetalRecyclerViewPager recyclerView = metalRecyclerViewPagers.get(1);
recyclerView.setAdapter(albumFullWithAdapter);
}
@Override
public void showRecentArtist(ArrayList<Artist> artists) {
sectionContainers.get(0).setVisibility(View.VISIBLE);
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 1,
GridLayoutManager.HORIZONTAL, false);
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists, R.layout.item_artist);
RecyclerView recyclerView = sectionRecyclerViews.get(0);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(artistAdapter);
}
@Override
public void showTopArtist(ArrayList<Artist> artists) {
sectionContainers.get(2).setVisibility(View.VISIBLE);
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 1,
GridLayoutManager.HORIZONTAL, false);
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists, R.layout.item_artist);
RecyclerView recyclerView = sectionRecyclerViews.get(1);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(artistAdapter);
}
@Override
public void showGenres(ArrayList<Genre> genres) {
sectionContainers.get(4).setVisibility(View.VISIBLE);
RecyclerView recyclerView = sectionRecyclerViews.get(2);
recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(new GenreAdapter(getMainActivity(), genres, R.layout.item_list));
}
}*/

View file

@ -31,9 +31,9 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper;
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener;
import code.name.monkey.retromusic.model.Song;
import code.name.monkey.retromusic.ui.fragments.VolumeFragment;
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment;
import code.name.monkey.retromusic.util.MusicUtil;
import code.name.monkey.retromusic.util.PreferenceUtil;
/**
* @author Hemanth S (h4h13).
@ -41,21 +41,31 @@ import code.name.monkey.retromusic.util.MusicUtil;
public class LockScreenPlayerControlsFragment extends AbsPlayerControlsFragment {
@BindView(R.id.player_play_pause_button)
AppCompatImageButton playPauseFab;
@BindView(R.id.player_prev_button)
ImageButton prevButton;
@BindView(R.id.player_next_button)
ImageButton nextButton;
@BindView(R.id.player_progress_slider)
AppCompatSeekBar progressSlider;
@BindView(R.id.player_song_total_time)
TextView songTotalTime;
@BindView(R.id.player_song_current_progress)
TextView songCurrentProgress;
@BindView(R.id.title)
AppCompatTextView title;
@BindView(R.id.text)
AppCompatTextView text;
@BindView(R.id.volume_fragment_container)
View volumeContainer;
private Unbinder unbinder;
private MusicProgressViewUpdateHelper progressViewUpdateHelper;
private int lastPlaybackControlsColor;
@ -82,7 +92,9 @@ public class LockScreenPlayerControlsFragment extends AbsPlayerControlsFragment
super.onViewCreated(view, savedInstanceState);
setUpMusicControllers();
VolumeFragment volumeFragment = (VolumeFragment) getChildFragmentManager().findFragmentById(R.id.volume_fragment);
//noinspection ConstantConditions
volumeContainer.setVisibility(PreferenceUtil.getInstance(getContext()).getVolumeToggle()
? View.VISIBLE : View.GONE);
}

View file

@ -2,8 +2,6 @@ package code.name.monkey.retromusic.ui.fragments.player.plain;
import android.animation.ObjectAnimator;
import android.graphics.PorterDuff;
import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@ -16,6 +14,7 @@ import android.view.animation.LinearInterpolator;
import android.widget.ImageButton;
import android.widget.SeekBar;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
@ -59,6 +58,7 @@ public class PlainPlaybackControlsFragment extends AbsPlayerControlsFragment {
TextView songCurrentProgress;
@BindView(R.id.volume_fragment_container)
View volumeContainer;
private Unbinder unbinder;
private PlayPauseDrawable playerFabPlayPauseDrawable;
private int lastPlaybackControlsColor;
@ -285,30 +285,21 @@ public class PlainPlaybackControlsFragment extends AbsPlayerControlsFragment {
MaterialValueHelper.getPrimaryDisabledTextColor(getActivity(), false);
}
if (PreferenceUtil.getInstance(getContext()).getAdaptiveColor()) {
TintHelper.setTintAuto(playPauseFab,
MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(dark)),
false);
TintHelper.setTintAuto(playPauseFab, dark, true);
int finalColor = PreferenceUtil.getInstance(getContext()).getAdaptiveColor()
? dark : ThemeStore.accentColor(getContext());
setProgressBarColor(dark);
} else {
int accentColor = ThemeStore.accentColor(getContext());
setProgressBarColor(accentColor);
TintHelper.setTintAuto(playPauseFab,
MaterialValueHelper
.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(accentColor)),
false);
TintHelper.setTintAuto(playPauseFab, accentColor, true);
}
TintHelper.setTintAuto(playPauseFab, MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(finalColor)), false);
TintHelper.setTintAuto(playPauseFab, finalColor, true);
updateRepeatState();
updateShuffleState();
updatePrevNextColor();
}
public void setProgressBarColor(int newColor) {
LayerDrawable ld = (LayerDrawable) progressSlider.getProgressDrawable();
ClipDrawable clipDrawable = (ClipDrawable) ld.findDrawableByLayerId(android.R.id.progress);
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN);
TintHelper.setTintAuto(progressSlider, newColor, false);
}
private void setUpPlayPauseFab() {

View file

@ -59,18 +59,17 @@ public abstract class AbsSettingsFragment extends ATEPreferenceFragmentCompat {
setDividerHeight(0);
setDivider(new ColorDrawable(Color.TRANSPARENT));
//noinspection ConstantConditions
getListView().setPadding(DensityUtil.dip2px(getContext(), 0), 0, 0, 0);
getListView().addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (getActivity() != null) {
((SettingsActivity) getActivity())
.addAppbarLayoutElevation(recyclerView.canScrollVertically(RecyclerView.NO_POSITION) ? 8f : 0f);
((SettingsActivity) getActivity()).addAppbarLayoutElevation(recyclerView.canScrollVertically(RecyclerView.NO_POSITION) ? 8f : 0f);
}
}
});
//noinspection ConstantConditions
getListView().setBackgroundColor(ThemeStore.primaryColor(getContext()));
getListView().setOverScrollMode(View.OVER_SCROLL_NEVER);
invalidateSettings();

View file

@ -4,6 +4,7 @@ import android.graphics.PorterDuff;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
@ -57,29 +58,29 @@ public class MainSettingsFragment extends Fragment {
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.general_settings:
inflateFragment(new ThemeSettingsFragment());
inflateFragment(new ThemeSettingsFragment(), R.string.general_settings_title);
break;
case R.id.audio_settings:
inflateFragment(new AudioSettings());
inflateFragment(new AudioSettings(), R.string.pref_header_audio);
break;
case R.id.now_playing_settings:
inflateFragment(new NowPlayingSettingsFragment());
inflateFragment(new NowPlayingSettingsFragment(), R.string.personalize);
break;
case R.id.image_settings:
inflateFragment(new ImageSettingFragment());
inflateFragment(new ImageSettingFragment(), R.string.pref_header_images);
break;
case R.id.notification_settings:
inflateFragment(new NotificationSettingsFragment());
inflateFragment(new NotificationSettingsFragment(), R.string.notification);
break;
case R.id.other_settings:
inflateFragment(new OtherSettingsFragment());
inflateFragment(new OtherSettingsFragment(), R.string.others);
break;
}
}
private void inflateFragment(Fragment fragment) {
private void inflateFragment(Fragment fragment, @StringRes int title) {
if (getActivity() != null) {
((SettingsActivity) getActivity()).setupFragment(fragment);
((SettingsActivity) getActivity()).setupFragment(fragment, title);
}
}
}

View file

@ -1,7 +1,5 @@
package code.name.monkey.retromusic.util;
import static code.name.monkey.retromusic.ui.activities.GenreDetailsActivity.EXTRA_GENRE_ID;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
@ -12,6 +10,7 @@ import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.util.Pair;
import android.widget.Toast;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.model.Genre;
@ -31,6 +30,11 @@ import code.name.monkey.retromusic.ui.activities.SettingsActivity;
import code.name.monkey.retromusic.ui.activities.SupportDevelopmentActivity;
import code.name.monkey.retromusic.ui.activities.UserInfoActivity;
import static code.name.monkey.retromusic.Constants.RATE_ON_GOOGLE_PLAY;
import static code.name.monkey.retromusic.ui.activities.GenreDetailsActivity.EXTRA_GENRE_ID;
import static code.name.monkey.retromusic.util.RetroUtil.openUrl;
public class NavigationUtil {
public static void goToAlbum(@NonNull Activity activity, int i,
@ -124,7 +128,10 @@ public class NavigationUtil {
}
public static void goToSupportDevelopment(Activity activity) {
ActivityCompat
.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
ActivityCompat.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
}
public static void goToPlayStore(Activity activity) {
openUrl(activity, RATE_ON_GOOGLE_PLAY);
}
}

View file

@ -137,7 +137,7 @@ public class RetroUtil {
}
public static void openUrl(AppCompatActivity context, String str) {
public static void openUrl(Activity context, String str) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
intent.setFlags(268435456);

View file

@ -92,7 +92,7 @@ public class MetalRecyclerViewPager extends RecyclerView {
}
@Override
public void onBindViewHolder(VH holder, int position) {
public void onBindViewHolder(@NonNull VH holder, int position) {
int currentItemWidth = itemWidth;
if (position == 0) {

View file

@ -1,70 +0,0 @@
package code.name.monkey.retromusic.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Region;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import code.name.monkey.retromusic.R;
/**
* Frame layout that has rounded corners (it clips content too).
*
* @author Anton Chekulaev
*/
public class RoundCornerFrameLayout extends FrameLayout {
private final Path stencilPath = new Path();
private float cornerRadius = 0;
public RoundCornerFrameLayout(Context context) {
this(context, null);
}
public RoundCornerFrameLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public RoundCornerFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray attrArray = context
.obtainStyledAttributes(attrs, R.styleable.RoundCornerFrameLayout, 0, 0);
try {
cornerRadius = attrArray.getDimension(R.styleable.RoundCornerFrameLayout_corner_radius, 0f);
} finally {
attrArray.recycle();
}
}
/*@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// compute the path
stencilPath.reset();
stencilPath.addRoundRect(0, 0, w, h, cornerRadius, cornerRadius, Path.Direction.CW);
stencilPath.close();
}
*/
@Override
protected void dispatchDraw(Canvas canvas) {
final int count = canvas.save();
final Path path = new Path();
final RectF rect = new RectF(0, 0, canvas.getWidth(), canvas.getHeight());
final float[] arrayRadius = {cornerRadius, cornerRadius, cornerRadius, cornerRadius,
cornerRadius, cornerRadius, cornerRadius, cornerRadius};
path.addRoundRect(rect, arrayRadius, Path.Direction.CW);
canvas.clipPath(path, Region.Op.REPLACE);
canvas.clipPath(path);
super.dispatchDraw(canvas);
canvas.restoreToCount(count);
}
}

View file

@ -6,6 +6,9 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetDialog;
import android.support.design.widget.BottomSheetDialogFragment;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.appthemehelper.util.ColorUtil;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.ui.activities.base.AbsThemeActivity;
import code.name.monkey.retromusic.util.PreferenceUtil;
@ -19,9 +22,18 @@ public class RoundedBottomSheetDialogFragment extends BottomSheetDialogFragment
@Override
public int getTheme() {
//noinspection ConstantConditions
return
PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Light
? R.style.BottomSheetDialogTheme : R.style.BottomSheetDialogThemeDark;
if (PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Light) {
return R.style.BottomSheetDialogTheme;
} else if (PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Color) {
int color = ThemeStore.primaryColor(getContext());
if (ColorUtil.isColorLight(color)) {
return R.style.BottomSheetDialogTheme;
} else {
return R.style.BottomSheetDialogThemeDark;
}
} else {
return R.style.BottomSheetDialogTheme;
}
}
@NonNull
@ -30,8 +42,6 @@ public class RoundedBottomSheetDialogFragment extends BottomSheetDialogFragment
AbsThemeActivity absThemeActivity = (AbsThemeActivity) getActivity();
if (absThemeActivity != null) {
absThemeActivity.setLightNavigationBar(true);
Dialog dialog = new BottomSheetDialog(getContext(), getTheme());
}
//noinspection ConstantConditions
return new BottomSheetDialog(getContext(), getTheme());

View file

@ -29,7 +29,7 @@ public class SansFontCollapsingToolbarLayout extends CollapsingToolbarLayout {
}
private void init(Context context) {
Typeface typefaceBold = TypefaceHelper.get(context, getResources().getString(R.string.sans_bold));
Typeface typefaceBold = TypefaceHelper.get(context, getResources().getString(R.string.circular_std_black));
setExpandedTitleTypeface(typefaceBold);
setCollapsedTitleTypeface(typefaceBold);

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="2dp" android:color="?attr/dividerColor" /> <corners android:topLeftRadius="12dp" android:topRightRadius="12dp" /> <solid android:color="@android:color/transparent" /> <padding android:bottom="8dp" /> </shape>

View file

@ -5,4 +5,5 @@
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
<solid android:color="?attr/cardBackgroundColor" />
<padding android:top="8dp" />
</shape>

View file

@ -2,36 +2,43 @@
<android.support.design.widget.CoordinatorLayout 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_height="match_parent">
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/action_settings">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
tools:ignore="UnusedAttribute"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/support_development"/>
app:title="">
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
tools:ignore="MissingPrefix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/action_settings"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout

View file

@ -29,7 +29,7 @@
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_height="wrap_content"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
@ -78,8 +78,8 @@
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_weight="0"
android:layout_marginEnd="16dp"
android:layout_weight="0"
app:civ_border="false" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
@ -99,10 +99,7 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
android:descendantFocusability="blocksDescendants"
android:elevation="@dimen/card_elevation"
android:layout_margin="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">

View file

@ -82,21 +82,20 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="64dp"
android:layout_marginEnd="64dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
android:elevation="@dimen/card_elevation"
app:behavior_overlapTop="96dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="64dp"
android:layout_marginStart="64dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
android:descendantFocusability="blocksDescendants"
android:elevation="@dimen/card_elevation"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">

View file

@ -49,10 +49,10 @@
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingTop="8dp">
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/title"
@ -64,8 +64,6 @@
android:focusableInTouchMode="true"
android:freezesText="true"
android:marqueeRepeatLimit="marquee_forever"
android:paddingLeft="15dip"
android:paddingRight="15dip"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"

View file

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="UnusedAttribute">
<include layout="@layout/status_bar"/>
</FrameLayout>
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
tools:ignore="UnusedAttribute">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<View
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<android.support.v7.widget.Toolbar
android:id="@+id/home_toolbar"
style="@style/Toolbar"
tools:ignore="UnusedAttribute">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="16dp"
android:src="@drawable/ic_search_white_24dp"/>
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:attr/textColorPrimary"
tools:ignore="MissingPrefix"/>
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_weight="0"
android:layout_marginEnd="16dp"
app:civ_border="false"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:behavior_overlapTop="24dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
android:descendantFocusability="blocksDescendants"
android:elevation="@dimen/card_elevation"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<include layout="@layout/abs_playlists"/>
<include layout="@layout/home_section_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>

View file

@ -79,20 +79,19 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="96dp"
android:layout_marginEnd="96dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
app:behavior_overlapTop="112dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:elevation="@dimen/card_elevation"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="64dp"
android:layout_marginStart="64dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
android:background="@drawable/bg_card_line"
android:descendantFocusability="blocksDescendants"
android:focusable="true"
android:focusableInTouchMode="true"

View file

@ -1,36 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/action_settings">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
android:title="@string/action_settings"
app:layout_collapseMode="pin"
app:title="@string/action_settings" />
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
app:title=""
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/action_settings"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout

View file

@ -79,21 +79,20 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="64dp"
android:layout_marginEnd="64dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
app:behavior_overlapTop="96dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="64dp"
android:layout_marginStart="64dp"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
android:background="@drawable/bg_card_line"
android:descendantFocusability="blocksDescendants"
android:elevation="@dimen/card_elevation"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">

View file

@ -21,40 +21,63 @@
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorPrimary"
tools:ignore="UnusedAttribute">
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="62dp"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<View
<FrameLayout
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
android:background="?colorPrimary"
tools:ignore="UnusedAttribute"/>
</android.support.design.widget.CollapsingToolbarLayout>
android:layout_height="wrap_content"
app:layout_collapseMode="pin">
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
android:layout_height="48dp" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:title=""
tools:ignore="UnusedAttribute">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="?roundSelector"
android:padding="12dp"
android:src="@drawable/ic_search_white_24dp" />
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>

View file

@ -8,32 +8,40 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/action_about">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/support_development"/>
app:title=""
tools:ignore="UnusedAttribute">
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/action_about"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"

View file

@ -48,35 +48,32 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:background="@drawable/bg_circular_top_corners"
app:behavior_overlapTop="24dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/content"
android:layout_marginTop="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_circular_top_corners"
android:elevation="@dimen/card_elevation"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:orientation="horizontal">
android:paddingTop="8dp"
android:paddingEnd="8dp">
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/artist_image"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_weight="0"
android:layout_marginStart="8dp"
android:layout_weight="0"
app:civ_border="false"
app:civ_shadow="false" />
@ -84,9 +81,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingEnd="0dp"
android:orientation="vertical">
android:paddingEnd="0dp">
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/title"
@ -102,12 +99,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="4dp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
android:marqueeRepeatLimit="marquee_forever"
android:paddingTop="4dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
@ -122,10 +119,10 @@
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp"
android:text="@string/songs"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" />
@ -141,10 +138,10 @@
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingStart="16dp"
android:paddingTop="12dp"
android:paddingEnd="16dp"
android:paddingBottom="12dp"
android:text="@string/songs"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:visibility="gone"
@ -163,8 +160,8 @@
android:id="@+id/action_shuffle_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:layout_behavior="code.name.monkey.retromusic.misc.ScrollAwareFABBehavior"
app:srcCompat="@drawable/ic_shuffle_white_24dp" />
</android.support.design.widget.CoordinatorLayout>

View file

@ -48,18 +48,17 @@
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_circular_top_corners"
android:overScrollMode="never"
app:behavior_overlapTop="24dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_circular_top_corners"
android:elevation="@dimen/card_elevation"
android:orientation="vertical">
<LinearLayout
@ -72,9 +71,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:paddingStart="16dp"
android:paddingEnd="0dp"
android:orientation="vertical">
android:paddingEnd="0dp">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/title"
@ -109,12 +108,12 @@
android:id="@+id/action_shuffle_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:layout_weight="0"
android:src="@drawable/ic_shuffle_white_24dp" />
</LinearLayout>
@ -134,9 +133,9 @@
android:id="@+id/biography"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:ellipsize="end"
android:maxLines="4"
android:padding="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:visibility="gone" />

View file

@ -9,31 +9,41 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/support_development">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/support_development" />
app:title=""
tools:ignore="UnusedAttribute">
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/support_development"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerColor" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
@ -61,10 +71,10 @@
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:orientation="horizontal"
android:paddingBottom="@dimen/md_content_padding_top"
android:paddingLeft="@dimen/md_dialog_frame_margin"
android:paddingTop="@dimen/md_content_padding_top"
android:paddingRight="@dimen/md_dialog_frame_margin"
android:paddingTop="@dimen/md_content_padding_top">
android:paddingBottom="@dimen/md_content_padding_top">
<ProgressBar
android:id="@+id/progress"
@ -88,8 +98,8 @@
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="6dp"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:scrollbarStyle="outsideOverlay" />
<android.support.v7.widget.CardView
@ -118,11 +128,10 @@
tools:ignore="MissingPrefix" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/paypal_summary"
android:textColor="@color/md_white_1000" />

View file

@ -8,40 +8,49 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp">
app:title=""
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/equalizer"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
<android.support.v7.widget.SwitchCompat
android:id="@+id/equalizer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
</android.support.v7.widget.Toolbar>
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -95,9 +104,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="16dp"
android:max="1000"
android:maxHeight="3dp"
android:padding="16dp"
android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false"
android:thumb="@drawable/switch_thumb_material"
@ -124,9 +133,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="16dp"
android:max="1000"
android:maxHeight="3dp"
android:padding="16dp"
android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false"
android:thumb="@drawable/switch_thumb_material"
@ -137,9 +146,9 @@
android:id="@+id/bands"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:orientation="vertical"/>
android:paddingEnd="8dp" />
<TextView
android:layout_width="match_parent"

View file

@ -7,31 +7,43 @@
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
tools:ignore="UnusedAttribute">
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
tools:ignore="UnusedAttribute" />
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
app:layout_collapseMode="pin"
app:title=""
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/licenses"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout 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"
android:id="@+id/root"
@ -12,39 +11,61 @@
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorPrimary">
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
android:layout_height="48dp" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
tools:ignore="UnusedAttribute"/>
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
app:layout_collapseMode="pin"
app:title=""
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/queue"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
<TextView
android:id="@+id/player_queue_sub_header"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
android:text="@string/up_next"
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerColor" />
</android.support.design.widget.AppBarLayout>
<FrameLayout

View file

@ -23,31 +23,51 @@
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
tools:ignore="UnusedAttribute">
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
tools:ignore="UnusedAttribute" />
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ViewStub
<View
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
app:title=""
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/queue"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerColor" />
</android.support.design.widget.AppBarLayout>
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView

View file

@ -5,61 +5,68 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<android.support.design.widget.CoordinatorLayout 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"
<android.support.design.widget.CoordinatorLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/action_search">
android:layout_height="wrap_content"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/action_search"
tools:ignore="UnusedAttribute"/>
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
app:layout_collapseMode="pin">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/action_search"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.v7.widget.CardView
android:id="@+id/search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
app:cardCornerRadius="25dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:gravity="center_vertical">
android:paddingEnd="8dp">
<code.name.monkey.retromusic.views.IconImageView
android:layout_width="wrap_content"
@ -75,8 +82,7 @@
android:layout_weight="1"
android:background="@null"
android:hint="@string/search_hint"
android:inputType="text|textAutoComplete"
/>
android:inputType="text|textAutoComplete" />
<code.name.monkey.retromusic.views.IconImageView
@ -84,8 +90,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="8dp"
android:background="?roundSelector"
android:padding="8dp"
app:srcCompat="@drawable/ic_mic_white_24dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
@ -102,9 +108,9 @@
android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="48dp"
android:paddingBottom="48dp"
android:gravity="center"
android:text="@string/no_results"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
@ -113,10 +119,10 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:scrollbarStyle="outsideOverlay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</FrameLayout>

View file

@ -1,37 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
app:elevation="0dp"
android:elevation="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/action_settings">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:title="@string/support_development" />
app:title=""
tools:ignore="UnusedAttribute">
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/action_settings"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingRight="16dp"> <WebView android:id="@+id/web_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="none" /> </FrameLayout>

View file

@ -23,24 +23,21 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="62dp"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<View
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<android.support.v7.widget.Toolbar
android:id="@+id/home_toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<LinearLayout
@ -54,6 +51,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="?roundSelector"
android:padding="12dp"
android:src="@drawable/ic_search_white_24dp" />
@ -72,28 +70,29 @@
android:id="@+id/user_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_weight="0"
android:layout_marginEnd="16dp"
android:layout_weight="0"
app:civ_border="false" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerColor" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/overlap_toolbar_height"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:elevation="4dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">

View file

@ -31,7 +31,7 @@
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="62dp"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
@ -43,14 +43,13 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
app:layout_collapseMode="pin">
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
android:layout_height="48dp" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
@ -83,9 +82,6 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/overlap_toolbar_height"
android:background="@drawable/bg_circular_top_corners"
android:elevation="@dimen/card_elevation"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
@ -109,12 +105,17 @@
</android.support.design.widget.CoordinatorLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerColor" />
<code.name.monkey.retromusic.views.BreadCrumbLayout
android:id="@+id/bread_crumbs"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
android:layout_weight="0"
android:elevation="6dp"
android:paddingStart="60dp"
android:paddingEnd="8dp"
android:elevation="6dp"/>
android:paddingEnd="8dp" />
</LinearLayout>

View file

@ -15,13 +15,8 @@
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="228dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
android:layout_height="196dp"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:statusBarScrim="?attr/colorPrimary"
app:titleEnabled="false">
@ -50,7 +45,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="16dp"
android:background="?roundSelector"
android:padding="12dp"
android:src="@drawable/ic_search_white_24dp" />
<TextView

View file

@ -24,28 +24,59 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="96dp"
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
app:expandedTitleGravity="top"
app:expandedTitleMarginStart="16dp"
app:expandedTitleMarginTop="48dp"
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/action_settings">
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<View
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
app:layout_collapseMode="pin">
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"/>
app:title=""
tools:ignore="UnusedAttribute">
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/search"
android:background="?roundSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="12dp"
android:src="@drawable/ic_search_white_24dp" />
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<FrameLayout

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/title" fontPath="@string/circular_std_black" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="12dp" android:text="@string/recent_artists" android:textAppearance="@style/TextAppearance.AppCompat.Title" android:textColor="?android:attr/textColorPrimary" tools:ignore="MissingPrefix" tools:text="@string/rate_app" tools:textColor="@color/md_black_1000" /> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:nestedScrollingEnabled="false" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:layout_margin="12dp" android:background="?attr/dividerColor" /> </LinearLayout>

View file

@ -5,7 +5,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -23,7 +22,7 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -45,10 +44,11 @@
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -66,7 +66,7 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -87,10 +87,11 @@
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -116,7 +117,7 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -135,7 +136,7 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -145,6 +146,7 @@
android:scaleType="centerCrop" />
</android.support.v7.widget.CardView>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -153,7 +155,7 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
@ -176,7 +178,7 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="6dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView

View file

@ -8,8 +8,9 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
app:contentPadding="16dp">
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:contentPadding="12dp">
<LinearLayout
android:layout_width="wrap_content"
@ -29,8 +30,8 @@
tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="40dp"
android:layout_height="40dp">
android:layout_width="36dp"
android:layout_height="36dp">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/image"

View file

@ -19,30 +19,28 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="4dp">
<code.name.monkey.retromusic.views.RoundCornerFrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:corner_radius="200dp"
>
<ImageView
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:civ_border="false"
app:civ_shadow="false"
tools:background="@color/md_red_400"
tools:ignore="ContentDescription" />
</code.name.monkey.retromusic.views.RoundCornerFrameLayout>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:paddingStart="4dp"
android:paddingTop="8dp"
android:paddingEnd="4dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/title"
@ -58,8 +56,8 @@
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:gravity="center"
android:paddingTop="4dp"
android:singleLine="true"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp" />

View file

@ -6,8 +6,8 @@
android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:layout_width="128dp"
android:layout_height="match_parent"
android:layout_width="136dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
@ -15,16 +15,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
app:cardCornerRadius="6dp"
app:cardElevation="4dp"
app:cardCornerRadius="8dp"
app:cardPreventCornerOverlap="true">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
/>
android:scaleType="centerCrop" />
</android.support.v7.widget.CardView>
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
@ -33,8 +31,8 @@
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
android:ellipsize="end"
android:maxLines="1"
android:padding="12dp"
android:textColor="?android:attr/textColorPrimary" />
</LinearLayout>

View file

@ -11,8 +11,7 @@
android:id="@+id/image_container"
android:layout_width="match_parent"
android:layout_height="182dp"
app:cardCornerRadius="8dp"
app:cardElevation="6dp"
app:cardCornerRadius="12dp"
app:cardUseCompatPadding="true">
<android.support.v7.widget.AppCompatImageView
@ -39,9 +38,9 @@
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="8dp"
android:paddingStart="8dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:textColor="?android:attr/textColorSecondary"
tools:ignore="MissingPrefix"
tools:text="My top tracks" />

View file

@ -3,12 +3,6 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context=".DrawerActivity">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/action_search"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_shuffle_all"
android:icon="@drawable/ic_shuffle_white_24dp"
@ -54,8 +48,7 @@
<item
android:id="@+id/action_sort_order"
android:title="@string/action_sort_order">
<menu>
</menu>
<menu></menu>
</item>
<item

View file

@ -5,6 +5,7 @@
<item>@string/only_on_wifi</item>
<item>@string/never</item>
</array>
<string-array name="pref_general_theme_list_titles">
<item>@string/light_theme_name</item>
<item>@string/dark_theme_name</item>
@ -16,19 +17,23 @@
<item>@string/normal_style</item>
<item>@string/card_style</item>
<item>@string/card_color_style</item>
<item>@string/card_circular_style</item>
</string-array>
<string-array name="pref_grid_style_list_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<array name="pref_grid_style_layout">
<item>@layout/item_grid</item>
<item>@layout/item_card</item>
<item>@layout/item_card_color</item>
<item>@layout/item_grid_circle</item>
</array>
<string-array name="pref_general_theme_list_values">
<item>light</item>
<item>dark</item>

View file

@ -12,9 +12,6 @@
<attr format="color" name="iconColor"/>
<attr format="color" name="dividerColor"/>
<declare-styleable name="RoundCornerFrameLayout">
<attr format="dimension" name="corner_radius"/>
</declare-styleable>
<declare-styleable name="BlurLayout">
<attr format="float" name="blk_downscaleFactor"/>
@ -26,6 +23,7 @@
<declare-styleable name="NetworkImageView">
<attr format="string" name="url_link"/>
</declare-styleable>
<declare-styleable name="LyricView">
<attr format="string" name="hint"/>
<attr format="color" name="hintColor"/>

View file

@ -36,8 +36,6 @@
<string name="hosur_india" translatable="false">Hosur, India</string>
<string name="circular_std_black" translatable="false">fonts/circular_std_black.otf</string>
<string name="circular_std_book" translatable="false">fonts/circular_std_book.otf</string>
<string name="sans_regular" translatable="false">fonts/product_sans_regular.ttf</string>
<string name="sans_bold" translatable="false">fonts/product_sans_bold.ttf</string>
<string name="marko_name" translatable="false">Marko Ivanović </string>
<string name="marko_summary" translatable="false">Contributor</string>
<string name="yt_gaming_name" translatable="false">Gaming Inc</string>

View file

@ -120,6 +120,7 @@
<string name="card">Card</string>
<string name="card_color_style">Colored Card</string>
<string name="card_circular_style">Circular</string>
<string name="card_style">Card</string>
<string name="cast">Cast</string>

View file

@ -1,10 +0,0 @@
package code.name.monkey.retromusic.ui.fragments.settings;
import junit.framework.TestCase;
/**
* @author Hemanth S (h4h13).
*/
public class PersonaliseSettingsFragmentTest extends TestCase {
}