From a2beae6ba18cb35d8f8bb65298084b520ab1f47c Mon Sep 17 00:00:00 2001 From: timo Date: Sun, 4 Aug 2019 17:15:03 +0200 Subject: [PATCH] replaced support library with androidX. versionCode 26, versionName 1.1.0c --- sudoq-app/.idea/modules.xml | 1 - sudoq-app/Playaround/Playaround.iml | 1 - .../sudoq/playaround/GenerateSomeSudokus.java | 3 - sudoq-app/settings.gradle | 2 +- sudoq-app/sudoqapp/build.gradle | 8 +-- .../sudoqapp/src/main/AndroidManifest.xml | 6 +- .../controller/AppBarLayoutBehavior.java | 4 +- .../sudoq/controller/SudoqCompatActivity.java | 2 +- .../sudoq/controller/SudoqListActivity.java | 2 +- .../sudoq/controller/menus/MainActivity.java | 4 +- .../controller/menus/NewSudokuActivity.java | 4 +- .../controller/menus/SplashActivity.java | 2 +- .../controller/menus/StatisticsActivity.java | 4 +- .../menus/SudokuLoadingActivity.java | 10 +-- .../AdvancedPreferencesActivity.java | 4 +- .../NewSudokuPreferencesActivity.java | 4 +- .../PlayerPreferencesActivity.java | 4 +- .../preferences/RestrictTypesActivity.java | 4 +- .../sudoku/AssistancesDialogFragment.java | 8 +-- .../sudoku/ControlPanelFragment.java | 8 +-- .../controller/sudoku/SudokuActivity.java | 8 +-- .../sudoku/hints/HintFormulator.java | 33 +++++++-- .../tutorial/FragmentActionTree.java | 2 +- .../tutorial/FragmentAssistances.java | 2 +- .../controller/tutorial/FragmentSudoku.java | 2 +- .../controller/tutorial/TutorialActivity.java | 18 ++--- .../src/main/res/layout/activity_detail.xml | 30 ++++---- .../src/main/res/layout/activity_main.xml | 6 +- .../res/layout/include_list_viewpager.xml | 16 ++--- .../res/layout/include_list_viewpager2.xml | 14 ++-- .../src/main/res/layout/sudokuloading.xml | 2 +- .../sudoqapp/src/main/res/layout/toolbar.xml | 2 +- .../res/layouts/tutorial/layout/tutorial2.xml | 4 +- .../src/main/res/values-de/strings.xml | 6 +- sudoq-app/sudoqapp/sudoqapp.iml | 71 +++++++++---------- .../solution/LastDigitDerivation.java | 1 - .../solution/LeftoverNoteDerivation.java | 7 ++ 37 files changed, 165 insertions(+), 144 deletions(-) diff --git a/sudoq-app/.idea/modules.xml b/sudoq-app/.idea/modules.xml index e974445f..fcf10cd0 100644 --- a/sudoq-app/.idea/modules.xml +++ b/sudoq-app/.idea/modules.xml @@ -4,7 +4,6 @@ - diff --git a/sudoq-app/Playaround/Playaround.iml b/sudoq-app/Playaround/Playaround.iml index 452225ed..339cbba8 100644 --- a/sudoq-app/Playaround/Playaround.iml +++ b/sudoq-app/Playaround/Playaround.iml @@ -28,6 +28,5 @@ - \ No newline at end of file diff --git a/sudoq-app/Playaround/src/main/java/de/sudoq/playaround/GenerateSomeSudokus.java b/sudoq-app/Playaround/src/main/java/de/sudoq/playaround/GenerateSomeSudokus.java index 8fbfe759..4d479c68 100644 --- a/sudoq-app/Playaround/src/main/java/de/sudoq/playaround/GenerateSomeSudokus.java +++ b/sudoq-app/Playaround/src/main/java/de/sudoq/playaround/GenerateSomeSudokus.java @@ -109,9 +109,6 @@ public Sudoku getSudoku() { public List getSolutions(){ return solutions; } - public void printDebugMsg() { - (new Generator()).printDebugMsg(); - } public Random getRandom() { return random; diff --git a/sudoq-app/settings.gradle b/sudoq-app/settings.gradle index 9e74194c..5c0ba149 100644 --- a/sudoq-app/settings.gradle +++ b/sudoq-app/settings.gradle @@ -1,2 +1,2 @@ -include ':sudoqmodel', ':ExperimentsOnPC', ':Playaround', ':external' +include ':sudoqmodel', ':Playaround' include ':sudoqapp' diff --git a/sudoq-app/sudoqapp/build.gradle b/sudoq-app/sudoqapp/build.gradle index 33bcaf65..333b911b 100644 --- a/sudoq-app/sudoqapp/build.gradle +++ b/sudoq-app/sudoqapp/build.gradle @@ -37,10 +37,10 @@ android { dependencies { implementation project(':sudoqmodel') - implementation 'com.android.support:design:28.0.0' - implementation 'com.android.support:cardview-v7:28.0.0' - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:recyclerview-v7:28.0.0' + implementation 'com.google.android.material:material:1.0.0' + //implementation 'androidx.cardview:cardview:1.0.0' + //implementation 'androidx.appcompat:appcompat:1.0.0' + //implementation 'androidx.recyclerview:recyclerview:1.0.0' //compile 'com.android.support:support-v4:21.0.0' diff --git a/sudoq-app/sudoqapp/src/main/AndroidManifest.xml b/sudoq-app/sudoqapp/src/main/AndroidManifest.xml index 942a344d..d50931bc 100644 --- a/sudoq-app/sudoqapp/src/main/AndroidManifest.xml +++ b/sudoq-app/sudoqapp/src/main/AndroidManifest.xml @@ -5,8 +5,8 @@ diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/AppBarLayoutBehavior.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/AppBarLayoutBehavior.java index 8b7bf03b..394d8739 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/AppBarLayoutBehavior.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/AppBarLayoutBehavior.java @@ -1,7 +1,7 @@ package de.sudoq.controller; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.CoordinatorLayout; +import com.google.android.material.appbar.AppBarLayout; +import androidx.coordinatorlayout.widget.CoordinatorLayout; import android.view.MotionEvent; /** diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqCompatActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqCompatActivity.java index f1e05b95..f71e58b5 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqCompatActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqCompatActivity.java @@ -10,7 +10,7 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqListActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqListActivity.java index e907462c..499ad766 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqListActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/SudoqListActivity.java @@ -10,7 +10,7 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/MainActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/MainActivity.java index 35c10066..2574c642 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/MainActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/MainActivity.java @@ -9,8 +9,8 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.Button; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/NewSudokuActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/NewSudokuActivity.java index 3734f8a2..322b3c29 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/NewSudokuActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/NewSudokuActivity.java @@ -9,8 +9,8 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.View; import android.widget.AdapterView; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SplashActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SplashActivity.java index cf1311ad..aa3c82ec 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SplashActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SplashActivity.java @@ -81,7 +81,7 @@ public class SplashActivity extends SudoqCompatActivity { private final static String VERSION_TAG = "version"; private final static String NO_VERSION_YET = "0.0.0"; - protected final static String NEWEST_ASSET_VERSION = "1.1.0a"; + protected final static String NEWEST_ASSET_VERSION = "1.1.0b"; private static String currentVersionName = ""; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/StatisticsActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/StatisticsActivity.java index f006d8ec..c63a04f5 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/StatisticsActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/StatisticsActivity.java @@ -8,8 +8,8 @@ package de.sudoq.controller.menus; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.widget.TextView; import de.sudoq.R; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SudokuLoadingActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SudokuLoadingActivity.java index ea3f8871..adc1e5c6 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SudokuLoadingActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/SudokuLoadingActivity.java @@ -15,11 +15,11 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.content.ContextCompat; -import android.support.v4.content.FileProvider; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import androidx.core.content.ContextCompat; +import androidx.core.content.FileProvider; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/AdvancedPreferencesActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/AdvancedPreferencesActivity.java index d74fe69c..6d74bbc3 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/AdvancedPreferencesActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/AdvancedPreferencesActivity.java @@ -11,8 +11,8 @@ import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/NewSudokuPreferencesActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/NewSudokuPreferencesActivity.java index 123f8829..07976bea 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/NewSudokuPreferencesActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/NewSudokuPreferencesActivity.java @@ -9,8 +9,8 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.view.View; import android.widget.CheckBox; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/PlayerPreferencesActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/PlayerPreferencesActivity.java index 6e54b634..f2e30123 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/PlayerPreferencesActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/PlayerPreferencesActivity.java @@ -9,8 +9,8 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/RestrictTypesActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/RestrictTypesActivity.java index 95a639cf..651bb320 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/RestrictTypesActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/menus/preferences/RestrictTypesActivity.java @@ -9,8 +9,8 @@ import android.content.res.Configuration; import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/AssistancesDialogFragment.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/AssistancesDialogFragment.java index db78df42..e662b9fa 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/AssistancesDialogFragment.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/AssistancesDialogFragment.java @@ -3,8 +3,8 @@ import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; +import androidx.fragment.app.DialogFragment; +import androidx.appcompat.app.AlertDialog; import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -16,14 +16,10 @@ import de.sudoq.R; import de.sudoq.controller.sudoku.hints.HintFormulator; import de.sudoq.model.actionTree.Action; -import de.sudoq.model.game.Assistances; import de.sudoq.model.game.Game; import de.sudoq.model.profile.Profile; import de.sudoq.model.solverGenerator.solution.SolveDerivation; import de.sudoq.model.solvingAssistant.SolvingAssistant; -import de.sudoq.model.sudoku.Constraint; -import de.sudoq.model.sudoku.Field; -import de.sudoq.model.sudoku.sudokuTypes.SudokuType; import de.sudoq.view.SudokuFieldView; import de.sudoq.view.SudokuLayout; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/ControlPanelFragment.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/ControlPanelFragment.java index fa988d16..ce1ef094 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/ControlPanelFragment.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/ControlPanelFragment.java @@ -2,10 +2,10 @@ import android.content.res.Configuration; import android.os.Bundle; -import android.support.annotation.LayoutRes; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.util.Log; +import androidx.annotation.LayoutRes; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/SudokuActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/SudokuActivity.java index d3031d8f..b027af69 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/SudokuActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/SudokuActivity.java @@ -16,10 +16,10 @@ import android.graphics.Color; import android.os.Bundle; import android.os.Handler; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.FragmentManager; -import android.support.v7.app.ActionBar; -import android.support.v7.widget.Toolbar; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.FragmentManager; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.Gravity; import android.view.Menu; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/hints/HintFormulator.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/hints/HintFormulator.java index 057a6dc9..e6c5fba5 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/hints/HintFormulator.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/sudoku/hints/HintFormulator.java @@ -1,6 +1,8 @@ package de.sudoq.controller.sudoku.hints; import android.content.Context; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; import android.util.Log; import java.util.BitSet; @@ -19,11 +21,15 @@ import de.sudoq.model.sudoku.Field; import de.sudoq.model.sudoku.Sudoku; import de.sudoq.model.sudoku.Utils; +import de.sudoq.model.sudoku.Utils.ConstraintShape; /** * Created by timo on 04.10.16. */ public class HintFormulator { + + private static final String LOG_TAG = "HintFormulator"; + public static String getText(Context context, SolveDerivation sd){ String text; Log.d("HintForm",sd.getType().toString()); @@ -97,8 +103,10 @@ private static boolean aFieldIsEmpty(SudokuActivity sActivity){ private static String lastDigitText(Context context, SolveDerivation sd){ LastDigitDerivation d = (LastDigitDerivation) sd; - String shapeString = Utility.constraintShapeAccDet2string(context, d.getConstraintShape()); - String shapeGender = Utility.getGender(context,d.getConstraintShape()); + ConstraintShape cs = d.getConstraintShape(); + + String shapeString = Utility.constraintShapeAccDet2string(context, cs); + String shapeGender = Utility.getGender(context, cs); String shapeDeterminer = Utility.gender2AccDeterminer(context, shapeGender); String highlightSuffix = Utility.gender2AccSufix(context, shapeGender); return context.getString(R.string.hint_lastdigit).replace("{shape}" ,shapeString) @@ -114,11 +122,28 @@ private static String lastCandidateText(Context context, SolveDerivation sd){ private static String leftoverNoteText(Context context, SolveDerivation sd){ LeftoverNoteDerivation d = (LeftoverNoteDerivation) sd; + ConstraintShape cs = d.getConstraintShape(); - String shapeString = Utility.constraintShapeAccDet2string(context, Utils.getGroupShape(d.getConstraint())); + String shapeString = Utility.constraintShapeAccDet2string(context, cs); + String shapeGender = Utility.getGender(context,cs); + String shapeDeterminer = Utility.gender2AccDeterminer(context, shapeGender); + String highlightSuffix = Utility.gender2AccSufix(context, shapeGender); + + + int versionNumber = -1; + try { + PackageInfo pinfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); + versionNumber = pinfo.versionCode; + + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + Log.d(LOG_TAG, "leftovernotetext is called. and versionNumber is: " + versionNumber); return context.getString(R.string.hint_leftovernote).replace("{note}", d.getNote()+1+"") - .replace("{shape}", shapeString) ; + .replace("{shape}", shapeString) + .replace("{determiner}" ,shapeDeterminer) + .replace("{suffix}" ,highlightSuffix); } private static String nakedSingleText(Context context, SolveDerivation sd){ diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentActionTree.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentActionTree.java index 6a6f748a..afc176e9 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentActionTree.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentActionTree.java @@ -1,7 +1,7 @@ package de.sudoq.controller.tutorial; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentAssistances.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentAssistances.java index 482d664e..e4e03f7e 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentAssistances.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentAssistances.java @@ -1,7 +1,7 @@ package de.sudoq.controller.tutorial; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentSudoku.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentSudoku.java index 78aedae5..279dc754 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentSudoku.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/FragmentSudoku.java @@ -1,7 +1,7 @@ package de.sudoq.controller.tutorial; import android.os.Bundle; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/TutorialActivity.java b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/TutorialActivity.java index 350aee45..79b7c806 100644 --- a/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/TutorialActivity.java +++ b/sudoq-app/sudoqapp/src/main/java/de/sudoq/controller/tutorial/TutorialActivity.java @@ -8,15 +8,15 @@ package de.sudoq.controller.tutorial; import android.os.Bundle; -import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import com.google.android.material.tabs.TabLayout; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MotionEvent; import android.view.View; diff --git a/sudoq-app/sudoqapp/src/main/res/layout/activity_detail.xml b/sudoq-app/sudoqapp/src/main/res/layout/activity_detail.xml index 30352812..114dcc18 100644 --- a/sudoq-app/sudoqapp/src/main/res/layout/activity_detail.xml +++ b/sudoq-app/sudoqapp/src/main/res/layout/activity_detail.xml @@ -15,21 +15,21 @@ ~ limitations under the License. --> - - - - + - + - @@ -64,7 +64,7 @@ android:orientation="vertical" android:paddingTop="24dp"> - @@ -87,9 +87,9 @@ - + - - + - - + - + - - \ No newline at end of file + \ No newline at end of file diff --git a/sudoq-app/sudoqapp/src/main/res/layout/activity_main.xml b/sudoq-app/sudoqapp/src/main/res/layout/activity_main.xml index c6328acd..5ffc23c7 100644 --- a/sudoq-app/sudoqapp/src/main/res/layout/activity_main.xml +++ b/sudoq-app/sudoqapp/src/main/res/layout/activity_main.xml @@ -15,7 +15,7 @@ ~ limitations under the License. --> - - - \ No newline at end of file + \ No newline at end of file diff --git a/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager.xml b/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager.xml index aa03bfdb..ab121819 100644 --- a/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager.xml +++ b/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager.xml @@ -15,19 +15,19 @@ ~ limitations under the License. --> - - - - - + - - - \ No newline at end of file + \ No newline at end of file diff --git a/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager2.xml b/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager2.xml index 18edd13e..a452b3b9 100644 --- a/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager2.xml +++ b/sudoq-app/sudoqapp/src/main/res/layout/include_list_viewpager2.xml @@ -15,19 +15,19 @@ ~ limitations under the License. --> - - - - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/sudoq-app/sudoqapp/src/main/res/layout/sudokuloading.xml b/sudoq-app/sudoqapp/src/main/res/layout/sudokuloading.xml index f933af7e..0f16befd 100644 --- a/sudoq-app/sudoqapp/src/main/res/layout/sudokuloading.xml +++ b/sudoq-app/sudoqapp/src/main/res/layout/sudokuloading.xml @@ -21,7 +21,7 @@ android:cacheColorHint="#00000000"> - - - \ No newline at end of file + \ No newline at end of file diff --git a/sudoq-app/sudoqapp/src/main/res/values-de/strings.xml b/sudoq-app/sudoqapp/src/main/res/values-de/strings.xml index 99008c25..d4009a58 100644 --- a/sudoq-app/sudoqapp/src/main/res/values-de/strings.xml +++ b/sudoq-app/sudoqapp/src/main/res/values-de/strings.xml @@ -157,10 +157,10 @@ Schau dir mal {determiner} hervorgehoben{suffix} {shape} an! Da ist nur noch ein Feld übrig. - Zeile + Zeile Spalte Diagonale - Block + Block Gruppe Zeile @@ -186,7 +186,7 @@ Schau dir mal das hervorgehobene Feld an. Dort ist nur noch ein Kandidat übrig. - Schau dir mal {determiner} hervorgehoben{suffix} {shape} an! Da {note} gesetzt ist können alle Notizen dazu entfernt werden. + Schau dir mal {determiner} hervorgehoben{suffix} {shape} an! Weil {note} gesetzt ist können alle Notizen dazu entfernt werden. Es gibt ein „naked single“! Im hervorgehobenen Feld is nur noch {note} übrig. diff --git a/sudoq-app/sudoqapp/sudoqapp.iml b/sudoq-app/sudoqapp/sudoqapp.iml index d2a2650c..a99c8f7f 100644 --- a/sudoq-app/sudoqapp/sudoqapp.iml +++ b/sudoq-app/sudoqapp/sudoqapp.iml @@ -17,7 +17,7 @@ \ No newline at end of file diff --git a/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LastDigitDerivation.java b/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LastDigitDerivation.java index cc8581dd..79ef1928 100644 --- a/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LastDigitDerivation.java +++ b/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LastDigitDerivation.java @@ -1,6 +1,5 @@ package de.sudoq.model.solverGenerator.solution; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LeftoverNoteDerivation.java b/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LeftoverNoteDerivation.java index 3977739e..bb15f399 100644 --- a/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LeftoverNoteDerivation.java +++ b/sudoq-app/sudoqmodel/src/main/java/de/sudoq/model/solverGenerator/solution/LeftoverNoteDerivation.java @@ -10,6 +10,8 @@ import de.sudoq.model.sudoku.Field; import de.sudoq.model.sudoku.Position; import de.sudoq.model.sudoku.Sudoku; +import de.sudoq.model.sudoku.Utils; +import de.sudoq.model.sudoku.Utils.ConstraintShape; /** * Created by timo on 04.10.16. @@ -34,6 +36,11 @@ public LeftoverNoteDerivation(Constraint c, int note) { public Constraint getConstraint(){ return constraint; } public int getNote(){ return note; } + public ConstraintShape getConstraintShape(){ + return Utils.getGroupShape(constraint); + } + + @Override public List getActionList(Sudoku sudoku){ NoteActionFactory af = new NoteActionFactory();