Skip to content

Commit

Permalink
Increment app version
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Alves committed Sep 17, 2020
1 parent eda28ae commit 45d7e20
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.gutotech.narutogame"
minSdkVersion 16
targetSdkVersion 30
versionCode 7
versionName "2.3.2"
versionCode 8
versionName "3.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
android.defaultConfig.vectorDrawables.useSupportLibrary = true
multiDexEnabled true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Map;

public class GameStatusRepository {
public static String VERSION_NAME = "2.3.2";
public static String VERSION_NAME = "3.0";

private static final GameStatusRepository sInstance = new GameStatusRepository();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.gutotech.narutogame.data.model.NinjaStatistics;
import com.gutotech.narutogame.data.model.Player;
import com.gutotech.narutogame.data.repository.AuthRepository;
import com.gutotech.narutogame.data.repository.GameStatusRepository;
import com.gutotech.narutogame.data.repository.KageRepository;
import com.gutotech.narutogame.data.repository.NewsRepository;
import com.gutotech.narutogame.data.repository.NinjaStatisticsRepository;
Expand Down Expand Up @@ -80,18 +81,17 @@ public void onPlayButtonPressed() {
@Override
public void onComplete() {
mPlayerRepository.setSignedIn(true, signInResult -> {
// TODO descomentar
if (signInResult) {
// GameStatusRepository.getInstance().getStatus(status -> {
// if (status.equals(GameStatusRepository.VERSION_NAME)) {
mAuthListener.onSuccess();
// } else {
// mPlayerRepository.setSignedIn(false, null);
// mAuthRepository.signOut();
// mAuthListener.onFailure(0);
// mStartMaintenanceActivityEvent.call();
// }
// });
GameStatusRepository.getInstance().getStatus(status -> {
if (status.equals(GameStatusRepository.VERSION_NAME)) {
mAuthListener.onSuccess();
} else {
mPlayerRepository.setSignedIn(false, null);
mAuthRepository.signOut();
mAuthListener.onFailure(0);
mStartMaintenanceActivityEvent.call();
}
});
} else {
mAuthRepository.signOut();
mAuthListener.onFailure(R.string.error_multiple_logins);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gutotech.narutogame.ui.loggedin;

import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.DisplayMetrics;
Expand All @@ -20,6 +21,10 @@
import com.google.android.material.navigation.NavigationView;
import com.gutotech.narutogame.R;
import com.gutotech.narutogame.data.network.NetworkUtils;
import com.gutotech.narutogame.data.repository.AuthRepository;
import com.gutotech.narutogame.data.repository.GameStatusRepository;
import com.gutotech.narutogame.data.repository.PlayerRepository;
import com.gutotech.narutogame.ui.MaintenanceActivity;
import com.gutotech.narutogame.ui.WarningDialogFragment;
import com.gutotech.narutogame.ui.adapter.ExpandableListAdapter;
import com.gutotech.narutogame.utils.BgMusicUtils;
Expand Down Expand Up @@ -83,16 +88,15 @@ protected void onCreate(Bundle savedInstanceState) {
}
});

// TODO descomentar isso
// GameStatusRepository.getInstance().registerGameStatusListener(status -> {
// if (!status.equals(GameStatusRepository.VERSION_NAME)) {
// GameStatusRepository.getInstance().removeGameStatusListener();
// PlayerRepository.getInstance().setSignedIn(false, null);
// AuthRepository.getInstance().signOut();
// finish();
// startActivity(new Intent(this, MaintenanceActivity.class));
// }
// });
GameStatusRepository.getInstance().registerGameStatusListener(status -> {
if (!status.equals(GameStatusRepository.VERSION_NAME)) {
GameStatusRepository.getInstance().removeGameStatusListener();
PlayerRepository.getInstance().setSignedIn(false, null);
AuthRepository.getInstance().signOut();
finish();
startActivity(new Intent(this, MaintenanceActivity.class));
}
});

mDrawer = findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
Expand Down

0 comments on commit 45d7e20

Please sign in to comment.