Skip to content

Commit

Permalink
fix: Change keyword and constant name for Activities
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Veuiller committed Nov 26, 2015
1 parent 9fb9125 commit ec0b4c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -12,7 +12,7 @@
* {@link FormWithAppCompatActivity}
*/
public abstract class FormActivity extends FragmentActivity {
private static final String MODEL_KW = "model";
private static final String MODEL_BUNDLE_KEY = "nd_model";
private FormController formController;

@Override
Expand All @@ -26,11 +26,11 @@ public void onCreate(Bundle savedInstanceState) {
initForm();

FragmentManager fm = getSupportFragmentManager();
FormModel retainedModel = (FormModel) fm.findFragmentByTag(MODEL_KW);
FormModel retainedModel = (FormModel) fm.findFragmentByTag(MODEL_BUNDLE_KEY);

if (retainedModel == null) {
retainedModel = formController.getModel();
fm.beginTransaction().add(retainedModel, MODEL_KW).commit();
fm.beginTransaction().add(retainedModel, MODEL_BUNDLE_KEY).commit();
}
formController.setModel(retainedModel);
recreateViews();
Expand Down
Expand Up @@ -11,7 +11,7 @@
* like the Activity to be based on the standard Android <code>Activity</code>, you can use {@link FormActivity}
*/
public abstract class FormWithAppCompatActivity extends AppCompatActivity {
private static final String MODEL_KW = "model";
private static final String MODEL_BUNDLE_KEY = "nd_model";
private FormController formController;

@Override
Expand All @@ -25,11 +25,11 @@ public void onCreate(Bundle savedInstanceState) {
initForm();

FragmentManager fm = getSupportFragmentManager();
FormModel retainedModel = (FormModel) fm.findFragmentByTag(MODEL_KW);
FormModel retainedModel = (FormModel) fm.findFragmentByTag(MODEL_BUNDLE_KEY);

if (retainedModel == null) {
retainedModel = formController.getModel();
fm.beginTransaction().add(retainedModel, MODEL_KW).commit();
fm.beginTransaction().add(retainedModel, MODEL_BUNDLE_KEY).commit();
}
formController.setModel(retainedModel);
recreateViews();
Expand Down

0 comments on commit ec0b4c4

Please sign in to comment.