diff --git a/app/build.gradle b/app/build.gradle index 66c1b07..6d2b6ee 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,8 +1,7 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion '26.0.3' + compileSdkVersion 29 testOptions { unitTests.returnDefaultValues = true @@ -11,9 +10,10 @@ android { defaultConfig { applicationId "org.secuso.privacyfriendlysudoku" minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 29 versionCode 6 versionName "2.1.2" + vectorDrawables.useSupportLibrary = true } buildTypes { release { @@ -22,19 +22,19 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - testCompile 'junit:junit:4.12' - compile 'com.android.support:support-compat:25.3.1' - compile 'com.android.support:support-v4:25.3.1' - compile 'com.android.support:support-v13:25.3.1' - compile 'com.android.support:appcompat-v7:25.3.1' - compile 'com.android.support:design:25.3.1' - compile 'com.android.support:support-core-ui:25.3.1' - compile 'com.android.support:support-core-utils:25.3.1' + implementation fileTree(include: ['*.jar'], dir: 'libs') + testImplementation 'junit:junit:4.12' + implementation 'androidx.core:core:1.2.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.legacy:legacy-support-v13:1.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.legacy:legacy-support-core-ui:1.0.0' + implementation 'androidx.legacy:legacy-support-core-utils:1.0.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 290ca0e..9d32955 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,12 +2,15 @@ + + + android:theme="@style/AppTheme" + android:name="org.secuso.privacyfriendlysudoku.SudokuApp"> diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/SudokuApp.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/SudokuApp.java new file mode 100644 index 0000000..cd98737 --- /dev/null +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/SudokuApp.java @@ -0,0 +1,32 @@ +package org.secuso.privacyfriendlysudoku; + +import android.app.Application; +import android.app.NotificationChannel; +import android.app.NotificationChannelGroup; +import android.app.NotificationManager; +import android.content.Context; +import android.os.Build; + +import androidx.appcompat.app.AppCompatDelegate; + +public class SudokuApp extends Application { + + public static final String CHANNEL_ID = "sudoku.0"; + + @Override + public void onCreate() { + super.onCreate(); + AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + // channels + NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "Default", NotificationManager.IMPORTANCE_LOW); + + NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + if (notificationManager != null) { + notificationManager.createNotificationChannel(channel); + } + } + } + +} diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GeneratorService.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GeneratorService.java index 32f78df..f6dbead 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GeneratorService.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GeneratorService.java @@ -2,32 +2,25 @@ package org.secuso.privacyfriendlysudoku.controller; import android.app.IntentService; import android.app.PendingIntent; -import android.app.Service; import android.content.Intent; -import android.os.Handler; -import android.os.IBinder; -import android.os.Looper; -import android.support.annotation.IntDef; -import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.NotificationCompat; +import androidx.annotation.Nullable; +import androidx.core.app.NotificationCompat; +import androidx.core.content.ContextCompat; import android.util.Log; import android.util.Pair; +import org.secuso.privacyfriendlysudoku.SudokuApp; import org.secuso.privacyfriendlysudoku.controller.database.DatabaseHelper; import org.secuso.privacyfriendlysudoku.controller.database.model.Level; import org.secuso.privacyfriendlysudoku.controller.qqwing.Action; import org.secuso.privacyfriendlysudoku.controller.qqwing.PrintStyle; import org.secuso.privacyfriendlysudoku.controller.qqwing.QQWing; import org.secuso.privacyfriendlysudoku.controller.qqwing.Symmetry; -import org.secuso.privacyfriendlysudoku.game.GameBoard; import org.secuso.privacyfriendlysudoku.game.GameDifficulty; import org.secuso.privacyfriendlysudoku.game.GameType; import org.secuso.privacyfriendlysudoku.ui.MainActivity; import org.secuso.privacyfriendlysudoku.ui.view.R; -import java.util.Date; -import java.util.IllegalFormatCodePointException; import java.util.LinkedList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; @@ -255,7 +248,7 @@ public class GeneratorService extends IntentService { } private void showNotification(GameType gameType, GameDifficulty gameDifficulty) { - NotificationCompat.Builder builder = new NotificationCompat.Builder(this); + NotificationCompat.Builder builder = new NotificationCompat.Builder(this, SudokuApp.CHANNEL_ID); builder.setContentTitle(getString(R.string.app_name)); builder.setContentText(getString(R.string.generating)); builder.setSubText(getString(gameType.getStringResID()) + ", " + getString(gameDifficulty.getStringResID())); diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/DatabaseHelper.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/DatabaseHelper.java index 59fdae0..85dd131 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/DatabaseHelper.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/database/DatabaseHelper.java @@ -39,7 +39,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { onUpgrade(db, oldVersion, newVersion); } - public List getLevels(GameDifficulty difficulty, GameType gameType) { + public synchronized List getLevels(GameDifficulty difficulty, GameType gameType) { if(difficulty == null || gameType == null) { throw new IllegalArgumentException("Arguments may not be null"); } @@ -72,7 +72,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { return levelList; } - public Level getLevel(GameDifficulty difficulty, GameType gameType) { + public synchronized Level getLevel(GameDifficulty difficulty, GameType gameType) { List levelList = getLevels(difficulty, gameType); if(levelList.size() == 0) { throw new IllegalArgumentException("There is no level"); @@ -80,7 +80,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { return levelList.get(0); } - public void deleteLevel(int id) { + public synchronized void deleteLevel(int id) { SQLiteDatabase database = getWritableDatabase(); String selection = LevelColumns._ID + " = ?"; @@ -89,7 +89,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { database.delete(LevelColumns.TABLE_NAME, selection, selectionArgs); } - public long addLevel(Level level) { + public synchronized long addLevel(Level level) { SQLiteDatabase database = getWritableDatabase(); return database.insert(LevelColumns.TABLE_NAME, null, LevelColumns.getValues(level)); } diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameCell.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameCell.java index 62dbcc4..de2a4f0 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameCell.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameCell.java @@ -2,14 +2,11 @@ package org.secuso.privacyfriendlysudoku.game; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.ListIterator; import org.secuso.privacyfriendlysudoku.game.listener.IModelChangedListener; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameDifficulty.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameDifficulty.java index fbf9f9c..f296149 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameDifficulty.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/game/GameDifficulty.java @@ -2,7 +2,7 @@ package org.secuso.privacyfriendlysudoku.game; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.StringRes; +import androidx.annotation.StringRes; import java.util.LinkedList; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AboutActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AboutActivity.java index 065edf9..e42d898 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AboutActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AboutActivity.java @@ -2,7 +2,7 @@ package org.secuso.privacyfriendlysudoku.ui; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.text.method.LinkMovementMethod; import android.view.MenuItem; @@ -22,7 +22,7 @@ public class AboutActivity extends BaseActivity { ((TextView)findViewById(R.id.githubURL)).setMovementMethod(LinkMovementMethod.getInstance()); ((TextView)findViewById(R.id.textFieldVersionName)).setText(BuildConfig.VERSION_NAME); - android.support.v7.app.ActionBar actionBar = getSupportActionBar(); + androidx.appcompat.app.ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(R.string.menu_about); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#024265"))); diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AppCompatPreferenceActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AppCompatPreferenceActivity.java index ac22c1a..4133998 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AppCompatPreferenceActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/AppCompatPreferenceActivity.java @@ -3,11 +3,11 @@ package org.secuso.privacyfriendlysudoku.ui; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceActivity; -import android.support.annotation.LayoutRes; -import android.support.annotation.Nullable; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatDelegate; -import android.support.v7.widget.Toolbar; +import androidx.annotation.LayoutRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.appcompat.widget.Toolbar; import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/BaseActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/BaseActivity.java index 02d9ea9..38750a5 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/BaseActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/BaseActivity.java @@ -2,8 +2,8 @@ package org.secuso.privacyfriendlysudoku.ui; import android.os.Bundle; import android.os.Handler; -import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; + +import androidx.appcompat.app.AppCompatActivity; import android.view.View; import org.secuso.privacyfriendlysudoku.ui.view.R; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java index 402a652..ece965e 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java @@ -12,12 +12,12 @@ import android.graphics.Point; import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; -import android.support.design.widget.NavigationView; -import android.support.v4.view.GravityCompat; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBarDrawerToggle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import com.google.android.material.navigation.NavigationView; +import androidx.core.view.GravityCompat; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; @@ -27,7 +27,6 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.RatingBar; import android.widget.TextView; -import android.widget.Toast; import org.secuso.privacyfriendlysudoku.controller.GameController; import org.secuso.privacyfriendlysudoku.controller.GameStateManager; @@ -46,10 +45,8 @@ import org.secuso.privacyfriendlysudoku.ui.view.SudokuKeyboardLayout; import org.secuso.privacyfriendlysudoku.ui.view.SudokuSpecialButtonLayout; import org.secuso.privacyfriendlysudoku.ui.view.WinDialog; -import java.util.IllegalFormatCodePointException; import java.util.LinkedList; import java.util.List; -import java.util.concurrent.RunnableFuture; public class GameActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener, IGameSolvedListener ,ITimerListener, IHintDialogFragmentListener, IResetDialogFragmentListener { diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/HelpActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/HelpActivity.java index 161005d..d731b12 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/HelpActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/HelpActivity.java @@ -2,29 +2,18 @@ package org.secuso.privacyfriendlysudoku.ui; import android.annotation.TargetApi; -import android.content.Context; -import android.content.Intent; -import android.content.res.Configuration; -import android.media.Ringtone; -import android.media.RingtoneManager; -import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceActivity; -import android.support.v7.app.ActionBar; +import androidx.appcompat.app.ActionBar; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; -import android.preference.RingtonePreference; -import android.text.TextUtils; import android.view.MenuItem; -import android.view.View; import org.secuso.privacyfriendlysudoku.ui.view.R; -import java.util.List; - /** * A {@link PreferenceActivity} that presents a set of application settings. On * handset devices, settings are presented as a single list. On tablets, diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java index 0ead53c..f04fa0b 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java @@ -45,7 +45,7 @@ public class LoadGameActivity extends BaseActivity implements IDeleteDialogFragm setContentView(R.layout.activity_load_game); - android.support.v7.app.ActionBar actionBar = getSupportActionBar(); + androidx.appcompat.app.ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(R.string.menu_continue_game); actionBar.setDisplayHomeAsUpEnabled(true); diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java index 6aa6527..70878d3 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java @@ -1,25 +1,20 @@ package org.secuso.privacyfriendlysudoku.ui; -import android.app.Activity; -import android.app.AlertDialog; -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; -import android.support.design.widget.NavigationView; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.GravityCompat; -import android.support.v4.view.ViewPager; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBarDrawerToggle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import com.google.android.material.navigation.NavigationView; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.core.view.GravityCompat; +import androidx.viewpager.widget.ViewPager; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -37,7 +32,6 @@ import org.secuso.privacyfriendlysudoku.game.GameDifficulty; import org.secuso.privacyfriendlysudoku.game.GameType; import org.secuso.privacyfriendlysudoku.ui.view.R; -import java.io.Serializable; import java.util.LinkedList; import java.util.List; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SettingsActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SettingsActivity.java index e3a80c1..448b560 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SettingsActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SettingsActivity.java @@ -9,7 +9,7 @@ import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceActivity; -import android.support.v7.app.ActionBar; +import androidx.appcompat.app.ActionBar; import android.preference.PreferenceFragment; import android.preference.PreferenceManager; import android.view.MenuItem; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SplashActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SplashActivity.java index c1df161..032fc39 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SplashActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/SplashActivity.java @@ -2,7 +2,7 @@ package org.secuso.privacyfriendlysudoku.ui; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatActivity; /** * Created by yonjuni on 22.10.16. diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/StatsActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/StatsActivity.java index fe29654..1119d5a 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/StatsActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/StatsActivity.java @@ -4,12 +4,16 @@ import android.content.Context; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; -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.widget.Toolbar; +import com.google.android.material.tabs.TabLayout; + +import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.PagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.appcompat.widget.Toolbar; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -30,12 +34,12 @@ import java.util.List; public class StatsActivity extends BaseActivity { /** - * The {@link android.support.v4.view.PagerAdapter} that will provide + * The {@link PagerAdapter} that will provide * fragments for each of the sections. We use a * {@link FragmentPagerAdapter} derivative, which will keep every * loaded fragment in memory. If this becomes too memory intensive, it * may be best to switch to a - * {@link android.support.v4.app.FragmentStatePagerAdapter}. + * {@link FragmentStatePagerAdapter}. */ private SectionsPagerAdapter mSectionsPagerAdapter; @@ -52,10 +56,10 @@ public class StatsActivity extends BaseActivity { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); - android.support.v7.app.ActionBar actionBar = getSupportActionBar(); + androidx.appcompat.app.ActionBar actionBar = getSupportActionBar(); actionBar.setTitle(R.string.menu_highscore); actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#024265"))); + //actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(this, R.color.colorPrimary))); // Create the adapter that will return a fragment for each of the three // primary sections of the activity. diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/TutorialActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/TutorialActivity.java index 9516aea..20b16b6 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/TutorialActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/TutorialActivity.java @@ -5,9 +5,9 @@ import android.content.Intent; import android.graphics.Color; import android.os.Build; import android.os.Bundle; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; +import androidx.viewpager.widget.PagerAdapter; +import androidx.viewpager.widget.ViewPager; +import androidx.appcompat.app.AppCompatActivity; import android.text.Html; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuButtonType.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuButtonType.java index ae27f9a..5fb3854 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuButtonType.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuButtonType.java @@ -1,6 +1,6 @@ package org.secuso.privacyfriendlysudoku.ui.view; -import android.support.annotation.DrawableRes; +import androidx.annotation.DrawableRes; import java.util.ArrayList; import java.util.List; diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuCellView.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuCellView.java index 6f7fa62..06b9a0a 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuCellView.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuCellView.java @@ -53,6 +53,21 @@ public class SudokuCellView extends View { mRow = gameCell.getRow(); mCol = gameCell.getCol(); this.size = size; + + initLayoutParams(); + } + + private void initLayoutParams() { + if(this.params == null) { + params = new RelativeLayout.LayoutParams(mWidth, mHeight); + } + + // Set Layout + params.width = mWidth; + params.height = mHeight; + params.topMargin = mRow*mHeight; + params.leftMargin = mCol*mWidth; + this.setLayoutParams(params); } public void setSymbols(Symbol s) { @@ -74,21 +89,17 @@ public class SudokuCellView extends View { return true; }*/ + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + super.onLayout(changed, left, top, right, bottom); + + + } + @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); - if(this.params == null) { - params = new RelativeLayout.LayoutParams(mWidth, mHeight); - } - - // Set Layout - params.width = mWidth; - params.height = mHeight; - params.topMargin = mRow*mHeight; - params.leftMargin = mCol*mWidth; - this.setLayoutParams(params); - // Draw single Field drawInfo(canvas); } diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuFieldLayout.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuFieldLayout.java index a52e044..0a4fac8 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuFieldLayout.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuFieldLayout.java @@ -5,7 +5,6 @@ import android.content.SharedPreferences; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -134,7 +133,6 @@ public class SudokuFieldLayout extends RelativeLayout implements IHighlightChang @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed,l,t,r,b); - isWidthLimiting = r-l == Math.min(r-l, b-t); if(changed && gameController != null) { diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..4457f4c --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground_shadow.xml b/app/src/main/res/drawable/ic_launcher_foreground_shadow.xml new file mode 100644 index 0000000..4a5b108 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground_shadow.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout-land/activity_main_menu.xml b/app/src/main/res/layout-land/activity_main_menu.xml index 34926fe..bc24413 100644 --- a/app/src/main/res/layout-land/activity_main_menu.xml +++ b/app/src/main/res/layout-land/activity_main_menu.xml @@ -1,5 +1,5 @@ - - - - - + - + - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout-small/activity_main_menu.xml b/app/src/main/res/layout-small/activity_main_menu.xml index 63f98e8..d989504 100644 --- a/app/src/main/res/layout-small/activity_main_menu.xml +++ b/app/src/main/res/layout-small/activity_main_menu.xml @@ -1,5 +1,5 @@ - - - - - + - + - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/activity_main_menu.xml b/app/src/main/res/layout-xlarge/activity_main_menu.xml index cb60e93..1f21a39 100644 --- a/app/src/main/res/layout-xlarge/activity_main_menu.xml +++ b/app/src/main/res/layout-xlarge/activity_main_menu.xml @@ -1,5 +1,5 @@ - - - - - + - + - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_game_view.xml b/app/src/main/res/layout/activity_game_view.xml index 25f58e3..a7c23f5 100644 --- a/app/src/main/res/layout/activity_game_view.xml +++ b/app/src/main/res/layout/activity_game_view.xml @@ -1,29 +1,25 @@ - - - - - - + - + - + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main_menu.xml b/app/src/main/res/layout/activity_main_menu.xml index dc332c2..8c6299b 100644 --- a/app/src/main/res/layout/activity_main_menu.xml +++ b/app/src/main/res/layout/activity_main_menu.xml @@ -1,5 +1,5 @@ - - - - - + - + - - + - - + diff --git a/app/src/main/res/layout/activity_stats.xml b/app/src/main/res/layout/activity_stats.xml index bb5ca10..a0bbb0a 100644 --- a/app/src/main/res/layout/activity_stats.xml +++ b/app/src/main/res/layout/activity_stats.xml @@ -1,30 +1,43 @@ - - - - + - + - + - - + diff --git a/app/src/main/res/layout/activity_tutorial.xml b/app/src/main/res/layout/activity_tutorial.xml index 78a7d05..51a6287 100644 --- a/app/src/main/res/layout/activity_tutorial.xml +++ b/app/src/main/res/layout/activity_tutorial.xml @@ -7,7 +7,7 @@ tools:showIn="@layout/activity_tutorial"> - diff --git a/app/src/main/res/layout/nav_header.xml b/app/src/main/res/layout/nav_header.xml index 7d6b302..f4105c1 100644 --- a/app/src/main/res/layout/nav_header.xml +++ b/app/src/main/res/layout/nav_header.xml @@ -23,7 +23,7 @@ android:contentDescription="App Logo" android:paddingEnd="@dimen/activity_horizontal_margin" android:paddingStart="@dimen/activity_horizontal_margin" - android:src="@mipmap/ic_launcher_nopfa"/> + android:src="@mipmap/ic_drawer"/> - - diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..bb326ba --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_nopfa.png b/app/src/main/res/mipmap-hdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/mipmap-hdpi/ic_launcher_nopfa.png rename to app/src/main/res/mipmap-hdpi/ic_drawer.png diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index 8232e9b..7d45a25 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-ldpi/ic_launcher_nopfa.png b/app/src/main/res/mipmap-ldpi/ic_drawer.png similarity index 100% rename from app/src/main/res/mipmap-ldpi/ic_launcher_nopfa.png rename to app/src/main/res/mipmap-ldpi/ic_drawer.png diff --git a/app/src/main/res/mipmap-ldpi/ic_launcher.png b/app/src/main/res/mipmap-ldpi/ic_launcher.png new file mode 100644 index 0000000..d0d4ef6 Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_nopfa.png b/app/src/main/res/mipmap-mdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/mipmap-mdpi/ic_launcher_nopfa.png rename to app/src/main/res/mipmap-mdpi/ic_drawer.png diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index b1ee90f..67f7df5 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_nopfa.png b/app/src/main/res/mipmap-xhdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/mipmap-xhdpi/ic_launcher_nopfa.png rename to app/src/main/res/mipmap-xhdpi/ic_drawer.png diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index f22ff3c..96dfb02 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_nopfa.png b/app/src/main/res/mipmap-xxhdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/mipmap-xxhdpi/ic_launcher_nopfa.png rename to app/src/main/res/mipmap-xxhdpi/ic_drawer.png diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 70f4941..b26abd4 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_nopfa.png b/app/src/main/res/mipmap-xxxhdpi/ic_drawer.png similarity index 100% rename from app/src/main/res/mipmap-xxxhdpi/ic_launcher_nopfa.png rename to app/src/main/res/mipmap-xxxhdpi/ic_drawer.png diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 2ebc86d..0b52777 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4f3641a..3ab7520 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -28,4 +28,6 @@ @color/dot_dark_screen @color/dot_dark_screen + + #3680BB diff --git a/build.gradle b/build.gradle index c068560..db1fb47 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.6.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,6 +16,7 @@ buildscript { allprojects { repositories { jcenter() + google() } } diff --git a/gradle.properties b/gradle.properties index 1d3591c..915f0e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,6 @@ # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# org.gradle.parallel=true +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9dfcc65..44bb974 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jan 19 17:45:21 CET 2018 +#Wed Oct 23 12:21:08 CEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip