Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fragment bug #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions app/src/main/java/com/azzahraa/paboosyar/ScannerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
* {@link MainActivity}, or must be moved to {@link CaptureActivity} and the immediate closing of
* page be removed.
*/
public class ScannerActivity extends AppCompatActivity {
public class ScannerActivity extends AppCompatActivity implements ResultFragment.OnFragmentInteractionListener {
TextView mResultTv;
Button mEnableBtn;

Expand Down Expand Up @@ -189,7 +189,7 @@ public void onResponse(Call<Response> call, retrofit2.Response<Response> respons
FragmentTransaction ft = fm.beginTransaction();
ft.setCustomAnimations(R.anim.slide_up, R.anim.slide_down, R.anim.slide_up, R.anim.slide_down);
ft.addToBackStack(null);
ft.replace(R.id.main_layout, fragment).commit();
ft.replace(R.id.main_layout2, fragment).commit();
fragment.setType(ok);
if (ok) {
acceptSound.start();
Expand Down Expand Up @@ -308,6 +308,15 @@ private String makeStatText(Meal meal) {
return result;
}

@Override
public Response getResponse() {
return resp;
}

@Override
public void onFragmentFinished() {
}


private class InvalidQRCodeException extends Exception {
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_scan_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_layout2"
android:background="@drawable/menu_background">

<Button
Expand Down