change log dialog added
This commit is contained in:
parent
a7880227fb
commit
18d6c14392
1 changed files with 285 additions and 273 deletions
|
@ -6,6 +6,8 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
|
@ -22,9 +24,16 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
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.SearchQueryHelper;
|
||||
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.HomeFragment;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class MainActivity extends AbsSlidingMusicPanelActivity implements
|
||||
SharedPreferences.OnSharedPreferenceChangeListener,
|
||||
|
@ -104,12 +110,20 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
|
|||
} else {
|
||||
restoreCurrentFragment();
|
||||
}
|
||||
/*if (!RetroApplication.isProVersion() &&
|
||||
!PreferenceManager.getDefaultSharedPreferences(this)
|
||||
.getBoolean("shown", false)) {
|
||||
showPromotionalOffer();
|
||||
}*/
|
||||
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
|
||||
|
@ -317,9 +331,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
|
|||
key.equals(PreferenceUtil.TOGGLE_SEPARATE_LINE) ||
|
||||
key.equals(PreferenceUtil.ALBUM_GRID_STYLE) ||
|
||||
key.equals(PreferenceUtil.ARTIST_GRID_STYLE) ||
|
||||
key.equals(PreferenceUtil.TOGGLE_HOME_BANNER)) {
|
||||
postRecreate();
|
||||
}
|
||||
key.equals(PreferenceUtil.TOGGLE_HOME_BANNER)) postRecreate();
|
||||
}
|
||||
|
||||
private void showPromotionalOffer() {
|
||||
|
|
Loading…
Reference in a new issue