Fix first time dialog

This commit is contained in:
Victor Shcherb 2015-12-22 10:45:58 +01:00
parent e64db571e3
commit 63ef62eea2
3 changed files with 7 additions and 2 deletions

View file

@ -21,6 +21,7 @@ import net.osmand.plus.download.DownloadActivity;
public class FirstUsageFragment extends Fragment {
public static final String TAG = "FirstUsageFragment";
public static boolean SHOW = true;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View file

@ -176,7 +176,9 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents {
mapView = new OsmandMapTileView(this, getWindow().getDecorView().getWidth(),
getWindow().getDecorView().getHeight());
if(app.getAppInitializer().checkAppVersionChanged(this)) {
if(app.getAppInitializer().checkAppVersionChanged(this) &&
WhatsNewDialogFragment.SHOW) {
WhatsNewDialogFragment.SHOW = false;
new WhatsNewDialogFragment().show(getSupportFragmentManager(), null);
}
mapActions = new MapActivityActions(this);
@ -238,7 +240,8 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents {
}
mapView.refreshMap(true);
if (getMyApplication().getAppInitializer().isFirstTime(this)) {
if (getMyApplication().getAppInitializer().isFirstTime(this) && FirstUsageFragment.SHOW) {
FirstUsageFragment.SHOW = false;
getSupportFragmentManager().beginTransaction()
.add(R.id.fragmentContainer, new FirstUsageFragment(),
FirstUsageFragment.TAG).commit();

View file

@ -19,6 +19,7 @@ import org.apache.commons.logging.Log;
public class WhatsNewDialogFragment extends DialogFragment {
private static final Log LOG = PlatformUtil.getLog(WhatsNewDialogFragment.class);
public static boolean SHOW = true;
@NonNull
@Override