When creating new card jump straight to dev mode.

This commit is contained in:
kenkeiras 2018-01-24 21:58:41 +01:00
parent 42e67dc6a6
commit 4d8cdcb82d
2 changed files with 14 additions and 2 deletions

View File

@ -16,6 +16,9 @@ public class CardActivity extends AppCompatActivity {
public final static String INTENT = "com.codigoparallevar.minicards.CARD";
public static final String CARD_PATH_KEY = "CARD_PATH";
public static final String VISUALIZATION_MODE_KEY = "VISUALIZATION_MODE";
public static final String DEVELOPER_VISUALIZATION_MODE = "DEVELOPER_VISUALIZATION_MODE";
CanvasView canvasView;
com.getbase.floatingactionbutton.AddFloatingActionButton AddPartButton;
@ -117,6 +120,11 @@ public class CardActivity extends AppCompatActivity {
CardActivity.this.setDevMode(false);
}
});
String visualization_mode = this.getIntent().getStringExtra(VISUALIZATION_MODE_KEY);
if ((visualization_mode != null) && (visualization_mode.equals(DEVELOPER_VISUALIZATION_MODE))) {
devMode = true;
}
}
@Override
@ -194,9 +202,12 @@ public class CardActivity extends AppCompatActivity {
}
}
public static void openCard(Context context, CardFile cardfile) {
public static void openCard(Context context, CardFile cardfile, String visualizationMode) {
Intent i = new Intent(INTENT);
i.putExtra(CARD_PATH_KEY, cardfile.getPath());
if (visualizationMode != null) {
i.putExtra(VISUALIZATION_MODE_KEY, visualizationMode);
}
context.startActivity(i);
}
}

View File

@ -87,7 +87,8 @@ public class DeckPreviewActivity extends ReloadableAppCompatActivity {
return;
}
CardActivity.openCard(DeckPreviewActivity.this, cardfile);
CardActivity.openCard(DeckPreviewActivity.this, cardfile,
CardActivity.DEVELOPER_VISUALIZATION_MODE);
}
});