added more options
This commit is contained in:
parent
7c2d662a19
commit
47ea1d6b8b
1 changed files with 104 additions and 92 deletions
|
@ -1,7 +1,5 @@
|
|||
package code.name.monkey.retromusic.dialogs;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
|
@ -11,11 +9,16 @@ import android.support.v7.widget.AppCompatTextView;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.Unbinder;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.RetroApplication;
|
||||
import code.name.monkey.retromusic.ui.activities.MainActivity;
|
||||
import code.name.monkey.retromusic.ui.fragments.mainactivity.folders.FoldersFragment;
|
||||
import code.name.monkey.retromusic.util.Compressor;
|
||||
|
@ -26,8 +29,8 @@ import code.name.monkey.retromusic.views.RoundedBottomSheetDialogFragment;
|
|||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
||||
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||
|
||||
/**
|
||||
* @author Hemanth S (h4h13).
|
||||
|
@ -36,10 +39,13 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
|
|||
|
||||
private static final String TAG = "HomeOptionDialog";
|
||||
Unbinder mUnbinder;
|
||||
|
||||
@BindView(R.id.user_image_bottom)
|
||||
CircularImageView userImageBottom;
|
||||
|
||||
@BindView(R.id.title_welcome)
|
||||
AppCompatTextView titleWelcome;
|
||||
|
||||
private CompositeDisposable disposable = new CompositeDisposable();
|
||||
|
||||
@Nullable
|
||||
|
@ -48,6 +54,8 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View layout = inflater.inflate(R.layout.user_action_details, container, false);
|
||||
mUnbinder = ButterKnife.bind(this, layout);
|
||||
layout.findViewById(R.id.action_buy_pro).setVisibility(RetroApplication.isProVersion() ? View
|
||||
.GONE : View.VISIBLE);
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
@ -56,6 +64,7 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
|
|||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
loadImageFromStorage();
|
||||
//noinspection ConstantConditions
|
||||
titleWelcome.setText(String.format("%s, %s!", getTimeOfTheDay(),
|
||||
PreferenceUtil.getInstance(getContext()).getUserName()));
|
||||
}
|
||||
|
@ -87,8 +96,8 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
|
|||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
@OnClick({R.id.action_about, R.id.user_info_container, R.id.action_folder, R.id.action_settings,
|
||||
R.id.action_sleep_timer})
|
||||
@OnClick({R.id.action_about, R.id.user_info_container, R.id.action_buy_pro, R.id.action_folder,
|
||||
R.id.action_settings, R.id.action_sleep_timer})
|
||||
public void onViewClicked(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.user_info_container:
|
||||
|
@ -107,6 +116,9 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
|
|||
case R.id.action_about:
|
||||
NavigationUtil.goToAbout(getActivity());
|
||||
break;
|
||||
case R.id.action_buy_pro:
|
||||
NavigationUtil.goToProVersion(getActivity());
|
||||
break;
|
||||
case R.id.action_sleep_timer:
|
||||
if (getFragmentManager() != null) {
|
||||
new SleepTimerDialog().show(getFragmentManager(), TAG);
|
||||
|
|
Loading…
Reference in a new issue