code refactor

This commit is contained in:
h4h13 2018-07-30 22:51:53 +05:30
parent e98fbb3b41
commit 4910b3fdc6

View file

@ -25,12 +25,6 @@ import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.Locale;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
@ -60,6 +54,9 @@ import code.name.monkey.retromusic.util.DensityUtil;
import code.name.monkey.retromusic.util.MusicUtil; import code.name.monkey.retromusic.util.MusicUtil;
import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroUtil; 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.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
@ -158,14 +155,13 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
//noinspection ConstantConditions //noinspection ConstantConditions
getSupportActionBar().setTitle(null); getSupportActionBar().setTitle(null);
if (toolbar != null && !PreferenceUtil.getInstance(this).getFullScreenMode()) { if (toolbar != null && !PreferenceUtil.getInstance(this).getFullScreenMode()) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams(); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar
.getLayoutParams();
params.topMargin = RetroUtil.getStatusBarHeight(this); params.topMargin = RetroUtil.getStatusBarHeight(this);
toolbar.setLayoutParams(params); toolbar.setLayoutParams(params);
} }
int primaryColor = ThemeStore.primaryColor(this); int primaryColor = ThemeStore.primaryColor(this);
TintHelper.setTintAuto(contentContainer, primaryColor, true); TintHelper.setTintAuto(contentContainer, primaryColor, true);
@ -173,7 +169,8 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
appBarLayout.setBackgroundColor(primaryColor); appBarLayout.setBackgroundColor(primaryColor);
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() { appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
@Override @Override
public void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state) { public void onStateChanged(AppBarLayout appBarLayout,
AppBarStateChangeListener.State state) {
int color; int color;
switch (state) { switch (state) {
case COLLAPSED: case COLLAPSED:
@ -312,7 +309,6 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
// If the "lang" parameter is set and no biography is given, retry with default language // If the "lang" parameter is set and no biography is given, retry with default language
if (biography == null && lang != null) { if (biography == null && lang != null) {
loadBiography(null); loadBiography(null);
return;
} }
} }