Skip to content

Commit

Permalink
Fix crash with SimpleView
Browse files Browse the repository at this point in the history
  • Loading branch information
North101 committed Sep 2, 2017
1 parent 87a65ad commit 70e43a0
Showing 1 changed file with 21 additions and 39 deletions.
60 changes: 21 additions & 39 deletions app/src/main/java/com/hiddenramblings/tagmo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ public void onResourceReady(Bitmap resource, Transition transition) {
}
};

void afterViews() {
isAfterViews = true;

txtTagInfo = this.getView().findViewById(R.id.txtTagInfo);
txtTagId = this.getView().findViewById(R.id.txtTagId);
txtName = this.getView().findViewById(R.id.txtName);
txtGameSeries = this.getView().findViewById(R.id.txtGameSeries);
txtCharacter = this.getView().findViewById(R.id.txtCharacter);
txtAmiiboType = this.getView().findViewById(R.id.txtAmiiboType);
txtAmiiboSeries = this.getView().findViewById(R.id.txtAmiiboSeries);
imageAmiibo = this.getView().findViewById(R.id.imageAmiibo);
if (imageAmiibo != null) {
imageAmiibo.setOnClickListener(this);
}

updateView();
}

public void setAmiiboManager(AmiiboManager amiiboManager) {
this.amiiboManager = amiiboManager;
}
Expand Down Expand Up @@ -234,19 +252,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

@AfterViews
void afterViews() {
isAfterViews = true;

txtTagInfo = this.getView().findViewById(R.id.txtTagInfo);
txtTagId = this.getView().findViewById(R.id.txtTagId);
txtName = this.getView().findViewById(R.id.txtName);
txtGameSeries = this.getView().findViewById(R.id.txtGameSeries);
txtCharacter = this.getView().findViewById(R.id.txtCharacter);
txtAmiiboType = this.getView().findViewById(R.id.txtAmiiboType);
txtAmiiboSeries = this.getView().findViewById(R.id.txtAmiiboSeries);
imageAmiibo = this.getView().findViewById(R.id.imageAmiibo);
imageAmiibo.setOnClickListener(this);

updateView();
super.afterViews();
}
}

Expand All @@ -259,19 +265,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

@AfterViews
void afterViews() {
isAfterViews = true;

txtTagInfo = this.getView().findViewById(R.id.txtTagInfo);
txtTagId = this.getView().findViewById(R.id.txtTagId);
txtName = this.getView().findViewById(R.id.txtName);
txtGameSeries = this.getView().findViewById(R.id.txtGameSeries);
txtCharacter = this.getView().findViewById(R.id.txtCharacter);
txtAmiiboType = this.getView().findViewById(R.id.txtAmiiboType);
txtAmiiboSeries = this.getView().findViewById(R.id.txtAmiiboSeries);
imageAmiibo = this.getView().findViewById(R.id.imageAmiibo);
imageAmiibo.setOnClickListener(this);

updateView();
super.afterViews();
}
}

Expand All @@ -284,19 +278,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

@AfterViews
void afterViews() {
isAfterViews = true;

txtTagInfo = this.getView().findViewById(R.id.txtTagInfo);
txtTagId = this.getView().findViewById(R.id.txtTagId);
txtName = this.getView().findViewById(R.id.txtName);
txtGameSeries = this.getView().findViewById(R.id.txtGameSeries);
txtCharacter = this.getView().findViewById(R.id.txtCharacter);
txtAmiiboType = this.getView().findViewById(R.id.txtAmiiboType);
txtAmiiboSeries = this.getView().findViewById(R.id.txtAmiiboSeries);
imageAmiibo = this.getView().findViewById(R.id.imageAmiibo);
imageAmiibo.setOnClickListener(this);

updateView();
super.afterViews();
}
}

Expand Down

0 comments on commit 70e43a0

Please sign in to comment.