Skip to content

Commit

Permalink
Removed limitation to three overlays in trial period
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisfeld committed Nov 27, 2018
1 parent fb5f527 commit abc6801
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Kamera benutzen. Bitte informieren Sie mich, wenn solche Probleme auftreten.</p>
<item>Fehlerkorrekturen</item>
<item>Fehlerkorrekturen</item>
<item>Fehlerkorrekturen</item>
<item>Fehlerkorrekturen. Jensen-Overlay in Französisch und Polnisch hinzugefügt</item>
<item>Overlays in Französisch und Polnisch hinzugefügt</item>
</string-array>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ primera vez con un nuevo dispositivo o con una nueva cámara. Por favor, me info
<item>Corrección de errores</item>
<item>Corrección de errores</item>
<item>Corrección de errores</item>
<item>Corrección de errores. Superposición de Jensen añadida en francés y polaco</item>
<item>Superposiciónes añadida en francés y polaco</item>
</string-array>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ Primeira vez com um novo dispositivo ou com uma nova câmera. Por favor, informe
<item>Correções de bugs</item>
<item>Correções de bugs</item>
<item>Correções de bugs</item>
<item>Correções de bugs. Adicionado sobreposição de Jensen em francês e polonês</item>
<item>Adicionado sobreposiçãos em francês e polonês</item>
</string-array>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ when using the app for the first time with a new device or with a new camera. Pl
<item>Bugfixes</item>
<item>Bugfixes</item>
<item>Bugfixes</item>
<item>Bugfixes. Added Jensen overlay in French and Polish</item>
<item>Added overlays in French and Polish</item>
</string-array>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import java.util.ArrayList;

import de.jeisfeld.augendiagnoselib.Application;
import de.jeisfeld.augendiagnoselib.Application.AuthorizationLevel;
import de.jeisfeld.augendiagnoselib.R;
import de.jeisfeld.augendiagnoselib.activities.DisplayHtmlActivity;
import de.jeisfeld.augendiagnoselib.activities.DisplayImageActivity;
Expand Down Expand Up @@ -770,13 +769,6 @@ private void onToggleOverlayClicked(final int position) {

int overlayPosition = PreferenceUtil.getIndexedSharedPreferenceIntString(R.string.key_indexed_overlaytype, position, -1);

if (Application.getAuthorizationLevel() == AuthorizationLevel.TRIAL_ACCESS && isChecked
&& overlayPosition > Integer.parseInt(Application.getResourceString(R.string.overlay_trial_count))) {
DialogUtil.displayAuthorizationError(getActivity(), R.string.message_dialog_trial_overlays);
mToggleOverlayButtons[position].setChecked(false);
return;
}

for (int i = 0; i < OVERLAY_BUTTON_COUNT; i++) {
if (position != i) {
if (mToggleOverlayButtons[i].isChecked()) {
Expand Down Expand Up @@ -879,12 +871,6 @@ public boolean onMenuItemClick(final MenuItem item) {
menuItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(final MenuItem item) {
if (Application.getAuthorizationLevel() == AuthorizationLevel.TRIAL_ACCESS
&& index > Integer.parseInt(Application.getResourceString(R.string.overlay_trial_count))) {
DialogUtil.displayAuthorizationError(getActivity(), R.string.message_dialog_trial_overlays);
return true;
}

if (oldButtonPosition != null && oldButtonPosition != position) {
// If the same overlay is already used, switch overlays
int currentOverlay = PreferenceUtil.getIndexedSharedPreferenceIntString(R.string.key_indexed_overlaytype, position, -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.List;

import de.jeisfeld.augendiagnoselib.Application;
import de.jeisfeld.augendiagnoselib.Application.AuthorizationLevel;
import de.jeisfeld.augendiagnoselib.R;
import de.jeisfeld.augendiagnoselib.components.DirectorySelectionPreference;
import de.jeisfeld.augendiagnoselib.components.DirectorySelectionPreference.OnDialogClosedListener;
Expand Down Expand Up @@ -629,12 +628,6 @@ else if (preference.getKey().startsWith(getString(R.string.key_indexed_overlayty
PreferenceUtil.getIndexedSharedPreferenceIntString(R.string.key_indexed_overlaytype, buttonPosition, -1);

if (oldOverlayIndex != overlayIndex) {
if (Application.getAuthorizationLevel() == AuthorizationLevel.TRIAL_ACCESS
&& overlayIndex >= Integer.parseInt(Application.getResourceString(R.string.overlay_trial_count))) {
DialogUtil.displayAuthorizationError(getActivity(), R.string.message_dialog_trial_overlays);
return false;
}

if (oldButtonPosition != null && !oldButtonPosition.equals(buttonPosition)) {
// If the same overlay is already used, switch overlays
PreferenceUtil.setIndexedSharedPreferenceIntString(R.string.key_indexed_overlaytype, oldButtonPosition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<string name="button_purchased_item">%1$s (bought)</string>
<string name="button_rate">Rate the app</string>
<string name="button_external_flash">External flash</string>
<string name="overlay_trial_count" translatable="false">3</string>
<string name="content_description_right_eye">Right Eye</string>
<string name="content_description_left_eye">Left Eye</string>
<string name="text_initializing">Initializing&#8230;</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<item>Fehlerkorrekturen</item>
<item>Fehlerkorrekturen</item>
<item>Fehlerkorrekturen</item>
<item>Fehlerkorrekturen. Jensen-Overlay in Französisch und Polnisch hinzugefügt</item>
<item>Overlays in Französisch und Polnisch hinzugefügt</item>
</string-array>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<item>Corrección de errores</item>
<item>Corrección de errores</item>
<item>Corrección de errores</item>
<item>Corrección de errores. Superposición de Jensen añadida en francés y polaco</item>
<item>Superposiciónes añadida en francés y polaco</item>
</string-array>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@
<item>Correções de bugs</item>
<item>Correções de bugs</item>
<item>Correções de bugs</item>
<item>Correções de bugs. Adicionado sobreposição de Jensen em francês e polonês</item>
<item>Adicionado sobreposiçãos em francês e polonês</item>
</string-array>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<item>Bugfixes</item>
<item>Bugfixes</item>
<item>Bugfixes</item>
<item>Bugfixes. Added Jensen overlay in French and Polish</item>
<item>Added overlays in French and Polish</item>
</string-array>

</resources>

0 comments on commit abc6801

Please sign in to comment.