Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1010 from farkam135/AutoShutdownGoIVOnRecalibrati…
Browse files Browse the repository at this point in the history
…onV2

Automatically shuts down and goes to mainscreen on calibration save
  • Loading branch information
nahojjjen authored Nov 12, 2018
2 parents 9001cc2 + bf16946 commit c812f12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.google.common.base.Strings;
import com.kamron.pogoiv.BuildConfig;
import com.kamron.pogoiv.GoIVSettings;
import com.kamron.pogoiv.Pokefly;
import com.kamron.pogoiv.R;
import com.kamron.pogoiv.pokeflycomponents.ocrhelper.ScanArea;
import com.kamron.pogoiv.pokeflycomponents.ocrhelper.ScanFieldAutomaticLocator;
Expand Down Expand Up @@ -78,8 +79,6 @@ public class OcrCalibrationResultActivity extends AppCompatActivity {
Button saveCalibrationButton;
@BindView(R.id.ocr_result_image)
ImageView resultImageView;
@BindView(R.id.backToGoivButton)
Button backToGoivButton;
@BindView(R.id.backButton)
Button backButton;
@BindView(R.id.errorField)
Expand Down Expand Up @@ -144,12 +143,16 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View v) {
saveCalibrationButton.setVisibility(View.GONE);
backToGoivButton.setVisibility(View.VISIBLE);
if (results != null && results.isCompleteCalibration()) {
GoIVSettings settings = GoIVSettings.getInstance(OcrCalibrationResultActivity.this);
settings.saveScreenCalibrationResults(results);
Toast.makeText(OcrCalibrationResultActivity.this,
R.string.ocr_calibration_saved, Toast.LENGTH_LONG).show();
Intent stopIntent = Pokefly.createStopIntent(OcrCalibrationResultActivity.this);
startService(stopIntent);
Intent intent = new Intent(OcrCalibrationResultActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}
}
});
Expand Down Expand Up @@ -229,12 +232,6 @@ void goToPoGO() {
}
}

@OnClick(R.id.backToGoivButton)
void goToGoIV() {
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
}



Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/layout/activity_ocr_calibration_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
android:enabled="false"
android:text="@string/ocr_calibration_save" />

<Button
android:id="@+id/backToGoivButton"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/go_back_to_goiv"
android:visibility="gone" />

</LinearLayout>

Expand Down

0 comments on commit c812f12

Please sign in to comment.