change log dialog added

This commit is contained in:
h4h13 2018-08-06 16:18:17 +05:30
parent a7880227fb
commit 18d6c14392

View file

@ -6,6 +6,8 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -22,9 +24,16 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.afollestad.materialdialogs.MaterialDialog;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.dialogs.ChangelogDialog;
import code.name.monkey.retromusic.helper.MusicPlayerRemote; import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.helper.SearchQueryHelper; import code.name.monkey.retromusic.helper.SearchQueryHelper;
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks; import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
@ -38,11 +47,8 @@ import code.name.monkey.retromusic.ui.fragments.mainactivity.LibraryFragment;
import code.name.monkey.retromusic.ui.fragments.mainactivity.home.BannerHomeFragment; import code.name.monkey.retromusic.ui.fragments.mainactivity.home.BannerHomeFragment;
import code.name.monkey.retromusic.ui.fragments.mainactivity.home.HomeFragment; import code.name.monkey.retromusic.ui.fragments.mainactivity.home.HomeFragment;
import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.PreferenceUtil;
import com.afollestad.materialdialogs.MaterialDialog;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.CompositeDisposable;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
public class MainActivity extends AbsSlidingMusicPanelActivity implements public class MainActivity extends AbsSlidingMusicPanelActivity implements
SharedPreferences.OnSharedPreferenceChangeListener, SharedPreferences.OnSharedPreferenceChangeListener,
@ -104,12 +110,20 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
} else { } else {
restoreCurrentFragment(); restoreCurrentFragment();
} }
/*if (!RetroApplication.isProVersion() &&
!PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean("shown", false)) {
showPromotionalOffer();
}*/
getBottomNavigationView().setOnNavigationItemSelectedListener(this); getBottomNavigationView().setOnNavigationItemSelectedListener(this);
checkShowChangelog();
}
private void checkShowChangelog() {
try {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
int currentVersion = pInfo.versionCode;
if (currentVersion != PreferenceUtil.getInstance(this).getLastChangelogVersion()) {
ChangelogDialog.create().show(getSupportFragmentManager(), "CHANGE_LOG_DIALOG");
}
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
} }
@Override @Override
@ -317,9 +331,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
key.equals(PreferenceUtil.TOGGLE_SEPARATE_LINE) || key.equals(PreferenceUtil.TOGGLE_SEPARATE_LINE) ||
key.equals(PreferenceUtil.ALBUM_GRID_STYLE) || key.equals(PreferenceUtil.ALBUM_GRID_STYLE) ||
key.equals(PreferenceUtil.ARTIST_GRID_STYLE) || key.equals(PreferenceUtil.ARTIST_GRID_STYLE) ||
key.equals(PreferenceUtil.TOGGLE_HOME_BANNER)) { key.equals(PreferenceUtil.TOGGLE_HOME_BANNER)) postRecreate();
postRecreate();
}
} }
private void showPromotionalOffer() { private void showPromotionalOffer() {