Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonjuni committed Dec 22, 2017
2 parents 0e074d1 + 6ec5395 commit f838023
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.secuso.privacyfriendlyrockpaperscissorsboardgame"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import android.view.View;

import org.secuso.privacyfriendlyrockpaperscissorsboardgame.R;
import org.secuso.privacyfriendlyrockpaperscissorsboardgame.tutorial.TutorialActivity;

import static org.secuso.privacyfriendlyrockpaperscissorsboardgame.tutorial.TutorialActivity.ACTION_SHOW_ANYWAYS;

/**
* Created by Chris on 04.07.2016.
Expand Down Expand Up @@ -149,6 +152,11 @@ private void callDrawerItem(final int itemId) {
intent = new Intent(this, HelpActivity.class);
createBackStack(intent);
break;
case R.id.nav_tutorial:
intent = new Intent(this, TutorialActivity.class);
intent.setAction(ACTION_SHOW_ANYWAYS);
createBackStack(intent);
break;
case R.id.nav_settings:
intent = new Intent(this, SettingsActivity.class);
intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

int index = mSharedPreferences.getInt("lastChosenPage", 0);
boolean welcomeScreenShown = mSharedPreferences.getBoolean("welcomeScreen",false);
if(!welcomeScreenShown){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.sWelcomeTitle);
builder.setMessage(R.string.sWelcome);
builder.setPositiveButton(R.string.sDialogHandOverOkButton, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
mSharedPreferences.edit().putBoolean("welcomeScreen",true).apply();
}
});
builder.setIcon(R.mipmap.ic_drawer);
builder.setNegativeButton(R.string.sHelp, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
goToNavigationItem(R.id.nav_help);
}
});
Dialog dialog=builder.create();
dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
mSharedPreferences.edit().putBoolean("welcomeScreen",true).apply();
}
});
dialog.show();
}

mViewPager.setCurrentItem(index);
mArrowLeft = (ImageView) findViewById(R.id.arrow_left);
mArrowRight = (ImageView) findViewById(R.id.arrow_right);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ protected void onCreate(Bundle savedInstanceState) {

// Making notification bar transparent
if(Build.VERSION.SDK_INT >=21)

{
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/menu/activity_main_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
android:id="@+id/nav_home"
android:icon="@drawable/ic_home_black_24px"
android:title="@string/sHome" />
<item
android:id="@+id/nav_tutorial"
android:icon="@drawable/ic_tutorial"
android:title="@string/tutorial" />
</group>
<group
android:id="@+id/nav_group_add"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@
<string name="main_button_welcomedialog">Show Welcome</string>
<string name="next">Next</string>
<string name="skip">Skip</string>
<string name="tutorial">Tutorial</string>
</resources>

0 comments on commit f838023

Please sign in to comment.