> expandableListDetail) {
- this.context = context;
- this.expandableListTitle = expandableListTitle;
- this.expandableListDetail = expandableListDetail;
- }
-
- @Override
- public Object getChild(int listPosition, int expandedListPosition) {
- return this.expandableListDetail.get(this.expandableListTitle.get(listPosition))
- .get(expandedListPosition);
- }
-
- @Override
- public long getChildId(int listPosition, int expandedListPosition) {
- return expandedListPosition;
- }
-
- @Override
- public View getChildView(int listPosition, final int expandedListPosition,
- boolean isLastChild, View convertView, ViewGroup parent) {
- final String expandedListText = (String) getChild(listPosition, expandedListPosition);
- if (convertView == null) {
- LayoutInflater layoutInflater = (LayoutInflater) this.context
- .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- convertView = layoutInflater.inflate(R.layout.list_item, null);
- }
- TextView expandedListTextView = (TextView) convertView
- .findViewById(R.id.expandedListItem);
- expandedListTextView.setText(expandedListText);
- return convertView;
- }
-
- @Override
- public int getChildrenCount(int listPosition) {
- return this.expandableListDetail.get(this.expandableListTitle.get(listPosition))
- .size();
- }
-
- @Override
- public Object getGroup(int listPosition) {
- return this.expandableListTitle.get(listPosition);
- }
-
- @Override
- public int getGroupCount() {
- return this.expandableListTitle.size();
- }
-
- @Override
- public long getGroupId(int listPosition) {
- return listPosition;
- }
-
- @Override
- public View getGroupView(int listPosition, boolean isExpanded,
- View convertView, ViewGroup parent) {
- String listTitle = (String) getGroup(listPosition);
- if (convertView == null) {
- LayoutInflater layoutInflater = (LayoutInflater) this.context.
- getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- convertView = layoutInflater.inflate(R.layout.list_group, null);
- }
- TextView listTitleTextView = (TextView) convertView
- .findViewById(R.id.listTitle);
- listTitleTextView.setTypeface(null, Typeface.BOLD);
- listTitleTextView.setText(listTitle);
- return convertView;
- }
-
- @Override
- public boolean hasStableIds() {
- return false;
- }
-
- @Override
- public boolean isChildSelectable(int listPosition, int expandedListPosition) {
- return true;
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/AppCompatPreferenceActivity.java b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/AppCompatPreferenceActivity.java
deleted file mode 100644
index 355d99a..0000000
--- a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/AppCompatPreferenceActivity.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- This file is part of Privacy Friendly 2048. This app implements the functions of the
- game 2048 in a privacy friendly version.
-
- Privacy Friendly 2048 is free software:
- you can redistribute it and/or modify it under the terms of the
- GNU General Public License as published by the Free Software Foundation,
- either version 3 of the License, or any later version.
-
- Privacy Friendly App Example is distributed in the hope
- that it will be useful, but WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Privacy Friendly App Example. If not, see .
- */
-
-package org.secuso.privacyfriendly2048.activities.helper;
-
-import android.content.res.Configuration;
-import android.os.Bundle;
-import android.preference.PreferenceActivity;
-import android.view.MenuInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import androidx.annotation.LayoutRes;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.ActionBar;
-import androidx.appcompat.app.AppCompatDelegate;
-import androidx.appcompat.widget.Toolbar;
-
-/**
- * A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
- * to be used with AppCompat.
- */
-public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
-
- private AppCompatDelegate mDelegate;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- getDelegate().installViewFactory();
- getDelegate().onCreate(savedInstanceState);
- super.onCreate(savedInstanceState);
- }
-
- @Override
- protected void onPostCreate(Bundle savedInstanceState) {
- super.onPostCreate(savedInstanceState);
- getDelegate().onPostCreate(savedInstanceState);
- }
-
- public ActionBar getSupportActionBar() {
- return getDelegate().getSupportActionBar();
- }
-
- public void setSupportActionBar(@Nullable Toolbar toolbar) {
- getDelegate().setSupportActionBar(toolbar);
- }
-
- @Override
- public MenuInflater getMenuInflater() {
- return getDelegate().getMenuInflater();
- }
-
- @Override
- public void setContentView(@LayoutRes int layoutResID) {
- getDelegate().setContentView(layoutResID);
- }
-
- @Override
- public void setContentView(View view) {
- getDelegate().setContentView(view);
- }
-
- @Override
- public void setContentView(View view, ViewGroup.LayoutParams params) {
- getDelegate().setContentView(view, params);
- }
-
- @Override
- public void addContentView(View view, ViewGroup.LayoutParams params) {
- getDelegate().addContentView(view, params);
- }
-
- @Override
- protected void onPostResume() {
- super.onPostResume();
- getDelegate().onPostResume();
- }
-
- @Override
- protected void onTitleChanged(CharSequence title, int color) {
- super.onTitleChanged(title, color);
- getDelegate().setTitle(title);
- }
-
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- getDelegate().onConfigurationChanged(newConfig);
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- getDelegate().onStop();
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- getDelegate().onDestroy();
- }
-
- public void invalidateOptionsMenu() {
- getDelegate().invalidateOptionsMenu();
- }
-
- private AppCompatDelegate getDelegate() {
- if (mDelegate == null) {
- mDelegate = AppCompatDelegate.create(this, null);
- }
- return mDelegate;
- }
-}
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivity.java b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivity.java
deleted file mode 100644
index 9170670..0000000
--- a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivity.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- This file is part of Privacy Friendly 2048. This app implements the functions of the
- game 2048 in a privacy friendly version.
-
- Privacy Friendly 2048 is free software:
- you can redistribute it and/or modify it under the terms of the
- GNU General Public License as published by the Free Software Foundation,
- either version 3 of the License, or any later version.
-
- Privacy Friendly App Example is distributed in the hope
- that it will be useful, but WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Privacy Friendly App Example. If not, see .
- */
-
-package org.secuso.privacyfriendly2048.activities.helper;
-
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.preference.PreferenceActivity;
-import android.preference.PreferenceManager;
-import android.view.MenuItem;
-import android.view.View;
-
-import androidx.appcompat.app.ActionBarDrawerToggle;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.widget.Toolbar;
-import androidx.core.app.TaskStackBuilder;
-import androidx.core.view.GravityCompat;
-import androidx.drawerlayout.widget.DrawerLayout;
-
-import com.google.android.material.navigation.NavigationView;
-import com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener;
-
-import org.secuso.privacyfriendly2048.R;
-import org.secuso.privacyfriendly2048.activities.AboutActivity;
-import org.secuso.privacyfriendly2048.activities.HelpActivity;
-import org.secuso.privacyfriendly2048.activities.MainActivity;
-import org.secuso.privacyfriendly2048.activities.SettingsActivity;
-import org.secuso.privacyfriendly2048.activities.StatsActivity;
-import org.secuso.privacyfriendly2048.activities.TutorialActivity;
-
-/**
- * @author Christopher Beckmann, Karola Marky
- * @version 20171017
- * This class is a parent class of all activities that can be accessed from the
- * Navigation Drawer (example see MainActivity.java)
- *
- * The default NavigationDrawer functionality is implemented in this class. If you wish to inherit
- * the default behaviour, make sure the content view has a NavigationDrawer with the id 'nav_view',
- * the header should point to 'nav_header_main' and the menu should be loaded from 'main_drawer'.
- *
- * Also the main layout that holds the content of the activity should have the id 'main_content'.
- * This way it will automatically fade in and out every time a transition is happening.
- */
-public abstract class BaseActivity extends AppCompatActivity implements OnNavigationItemSelectedListener {
-
- // delay to launch nav drawer item, to allow close animation to play
- public static final int NAVDRAWER_LAUNCH_DELAY = 250;
- // fade in and fade out durations for the main content when switching between
- // different Activities of the app through the Nav Drawer
- public static final int MAIN_CONTENT_FADEOUT_DURATION = 150;
- public static final int MAIN_CONTENT_FADEIN_DURATION = 250;
-
- // Navigation drawer:
- public DrawerLayout mDrawerLayout;
- private NavigationView mNavigationView;
-
- // Helper
- private Handler mHandler;
- protected SharedPreferences mSharedPreferences;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- mHandler = new Handler();
-
- overridePendingTransition(0, 0);
- }
-
- @Override
- public void onBackPressed() {
- DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
- if (drawer.isDrawerOpen(GravityCompat.START)) {
- drawer.closeDrawer(GravityCompat.START);
- } else {
- super.onBackPressed();
- }
- }
-
- protected abstract int getNavigationDrawerID();
-
- @Override
- public boolean onNavigationItemSelected(MenuItem item) {
- final int itemId = item.getItemId();
-
- return goToNavigationItem(itemId);
- }
-
-
- protected boolean goToNavigationItem(final int itemId) {
-
- if (itemId == getNavigationDrawerID()) {
- // just close drawer because we are already in this activity
- mDrawerLayout.closeDrawer(GravityCompat.START);
- return true;
- }
-
- // delay transition so the drawer can close
- mHandler.postDelayed(new Runnable() {
- @Override
- public void run() {
- callDrawerItem(itemId);
- }
- }, NAVDRAWER_LAUNCH_DELAY);
-
- mDrawerLayout.closeDrawer(GravityCompat.START);
-
- selectNavigationItem(itemId);
-
- // fade out the active activity
- View mainContent = findViewById(R.id.main_content);
- if (mainContent != null) {
- mainContent.animate().alpha(0).setDuration(MAIN_CONTENT_FADEOUT_DURATION);
- }
- return true;
- }
-
- // set active navigation item
- private void selectNavigationItem(int itemId) {
- for (int i = 0; i < mNavigationView.getMenu().size(); i++) {
- boolean b = itemId == mNavigationView.getMenu().getItem(i).getItemId();
- mNavigationView.getMenu().getItem(i).setChecked(b);
- }
- }
-
- /**
- * Enables back navigation for activities that are launched from the NavBar. See
- * {@code AndroidManifest.xml} to find out the parent activity names for each activity.
- *
- * @param intent
- */
- private void createBackStack(Intent intent) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- TaskStackBuilder builder = TaskStackBuilder.create(this);
- builder.addNextIntentWithParentStack(intent);
- builder.startActivities();
- } else {
- startActivity(intent);
- finish();
- }
- }
-
- /**
- * This method manages the behaviour of the navigation drawer
- * Add your menu items (ids) to res/menu/activity_main_drawer.xml
- *
- * @param itemId Item that has been clicked by the user
- */
- private void callDrawerItem(final int itemId) {
- Intent intent;
-
- switch (itemId) {
- case R.id.nav_example:
-
- intent = new Intent(this, MainActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- break;
- case R.id.nav_tutorial:
- intent = new Intent(this, TutorialActivity.class);
- createBackStack(intent);
- break;
- case R.id.nav_about:
- intent = new Intent(this, AboutActivity.class);
- createBackStack(intent);
- break;
- case R.id.nav_help:
- intent = new Intent(this, HelpActivity.class);
- createBackStack(intent);
- break;
- case R.id.nav_statistics:
- intent = new Intent(this, StatsActivity.class);
- createBackStack(intent);
- break;
- case R.id.nav_settings:
- intent = new Intent(this, SettingsActivity.class);
- intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName());
- intent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true);
- createBackStack(intent);
- break;
- default:
- }
- }
-
- @Override
- protected void onPostCreate(Bundle savedInstanceState) {
- super.onPostCreate(savedInstanceState);
-
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
- if (getSupportActionBar() == null) {
- setSupportActionBar(toolbar);
- }
-
- mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
- ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
- this, mDrawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
- mDrawerLayout.addDrawerListener(toggle);
-
- toggle.syncState();
-
- mNavigationView = (NavigationView) findViewById(R.id.nav_view);
- mNavigationView.setNavigationItemSelectedListener(this);
-
- selectNavigationItem(getNavigationDrawerID());
-
- View mainContent = findViewById(R.id.main_content);
- if (mainContent != null) {
- mainContent.setAlpha(0);
- mainContent.animate().alpha(1).setDuration(MAIN_CONTENT_FADEIN_DURATION);
- }
- }
-
-
-}
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivity.kt b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivity.kt
new file mode 100644
index 0000000..da0b516
--- /dev/null
+++ b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivity.kt
@@ -0,0 +1,63 @@
+/*
+ This file is part of Privacy Friendly 2048. This app implements the functions of the
+ game 2048 in a privacy friendly version.
+
+ Privacy Friendly 2048 is free software:
+ you can redistribute it and/or modify it under the terms of the
+ GNU General Public License as published by the Free Software Foundation,
+ either version 3 of the License, or any later version.
+
+ Privacy Friendly App Example is distributed in the hope
+ that it will be useful, but WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Privacy Friendly App Example. If not, see .
+ */
+package org.secuso.privacyfriendly2048.activities.helper
+
+import android.view.View
+import androidx.core.content.ContextCompat
+import org.secuso.pfacore.model.DrawerMenu
+import org.secuso.pfacore.ui.activities.DrawerActivity
+import org.secuso.privacyfriendly2048.R
+import org.secuso.privacyfriendly2048.activities.MainActivity
+import org.secuso.privacyfriendly2048.activities.StatsActivity
+
+/**
+ * @author Christopher Beckmann, Karola Marky, Patrick Schneider
+ * @version 20241028
+ * This class is a parent class of all activities that can be accessed from the
+ * Navigation Drawer (example see MainActivity.kt)
+ *
+ * The default NavigationDrawer functionality is implemented in this class.
+ */
+abstract class BaseActivity : DrawerActivity() {
+
+ override fun setContentView(layoutResID: Int) {
+ super.setContent(layoutResID)
+ }
+
+ override fun setContentView(view: View?) {
+ super.setContent(view!!)
+ }
+
+ override fun drawer() = DrawerMenu.build {
+ name = getString(R.string.app_name_long)
+ icon = R.mipmap.ic_logo
+ section {
+ activity {
+ name = ContextCompat.getString(this@BaseActivity, R.string.action_main)
+ icon = R.drawable.ic_menu_home
+ clazz = MainActivity::class.java
+ }
+ activity {
+ name = ContextCompat.getString(this@BaseActivity, R.string.action_stat)
+ icon = R.drawable.ic_menu_stat
+ clazz = StatsActivity::class.java
+ }
+ }
+ defaultDrawerSection(this)
+ }
+}
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivityWithoutNavBar.java b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivityWithoutNavBar.java
deleted file mode 100644
index db23755..0000000
--- a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/BaseActivityWithoutNavBar.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- This file is part of Privacy Friendly 2048. This app implements the functions of the
- game 2048 in a privacy friendly version.
-
- Privacy Friendly 2048 is free software:
- you can redistribute it and/or modify it under the terms of the
- GNU General Public License as published by the Free Software Foundation,
- either version 3 of the License, or any later version.
-
- Privacy Friendly App Example is distributed in the hope
- that it will be useful, but WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Privacy Friendly App Example. If not, see .
- */
-
-package org.secuso.privacyfriendly2048.activities.helper;
-
-import android.os.Bundle;
-import android.os.Handler;
-import android.view.KeyEvent;
-import android.view.View;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-import org.secuso.privacyfriendly2048.R;
-
-/**
- * @author Christopher Beckmann, Karola Marky
- * @version 20171017
- * This class is a parent class of all activities that can be accessed from the
- * Navigation Drawer (example see MainActivity.java)
- *
- * The default NavigationDrawer functionality is implemented in this class. If you wish to inherit
- * the default behaviour, make sure the content view has a NavigationDrawer with the id 'nav_view',
- * the header should point to 'nav_header_main' and the menu should be loaded from 'main_drawer'.
- *
- * Also the main layout that holds the content of the activity should have the id 'main_content'.
- * This way it will automatically fade in and out every time a transition is happening.
- */
-public abstract class BaseActivityWithoutNavBar extends AppCompatActivity {
-
-
- static final int NAVDRAWER_LAUNCH_DELAY = 250;
- static final int MAIN_CONTENT_FADEOUT_DURATION = 150;
- static final int MAIN_CONTENT_FADEIN_DURATION = 250;
-
- protected Handler mHandler;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mHandler = new Handler();
-
- overridePendingTransition(0, 0);
- }
-
- @Override
- public void onResume() {
- super.onResume();
-
- View mainContent = findViewById(R.id.main_content);
- if (mainContent != null) {
- mainContent.animate().alpha(1).setDuration(MAIN_CONTENT_FADEIN_DURATION);
- }
- }
-
- @Override
- protected void onPostCreate(Bundle savedInstanceState) {
- super.onPostCreate(savedInstanceState);
-
- View mainContent = findViewById(R.id.main_content);
- if (mainContent != null) {
- mainContent.setAlpha(0);
- mainContent.animate().alpha(1).setDuration(MAIN_CONTENT_FADEIN_DURATION);
- }
- }
-
- @Override
- public boolean onKeyDown(int keyCode, KeyEvent event) {
- return super.onKeyDown(keyCode, event);
- }
-
-}
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GameState.java b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GameState.java
index 3de5a90..a5e1490 100644
--- a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GameState.java
+++ b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GameState.java
@@ -20,11 +20,10 @@
package org.secuso.privacyfriendly2048.activities.helper;
-import org.secuso.privacyfriendly2048.activities.Element;
-
import java.io.Serializable;
/**
+ * This class just exists to restore old play states
* @author Julian Wadephul and Saskia Jacob
* @version 20180807
*/
@@ -57,36 +56,6 @@ public GameState(int[][] e) {
last_numbers = numbers;
}
- public GameState(Element[][] e, Element[][] e2) {
- int length = 1;
- for (int i = 0; i < e.length; i++) {
- if (e[i].length > length)
- length = e[i].length;
- }
- this.n = e.length;
- numbers = new int[e.length * e.length];
- int c = 0;
- for (int i = 0; i < e.length; i++) {
- for (int j = 0; j < e[i].length; j++) {
-
- numbers[c++] = e[i][j].number;
- }
- }
- length = 1;
- for (int i = 0; i < e2.length; i++) {
- if (e2[i].length > length)
- length = e2[i].length;
- }
- last_numbers = new int[e2.length * e2.length];
- c = 0;
- for (int i = 0; i < e2.length; i++) {
- for (int j = 0; j < e2[i].length; j++) {
-
- last_numbers[c++] = e2[i][j].number;
- }
- }
- }
-
public int getNumber(int i, int j) {
try {
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GridRecyclerView.kt b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GridRecyclerView.kt
index fa39c05..8d02223 100644
--- a/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GridRecyclerView.kt
+++ b/app/src/main/java/org/secuso/privacyfriendly2048/activities/helper/GridRecyclerView.kt
@@ -2,21 +2,23 @@ package org.secuso.privacyfriendly2048.activities.helper
import android.content.Context
import android.util.AttributeSet
-import android.util.Log
import android.view.MotionEvent
-import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.RecyclerView
-import org.secuso.privacyfriendly2048.activities.adapter.Grid2048Adapter
class GridRecyclerView(context: Context, attr: AttributeSet?, defStyleAttr: Int): RecyclerView(context, attr, defStyleAttr) {
+ companion object {
+ val MOVE_DURATION = 100L
+ val MERGE_DURATION = 100L
+ val CHANGE_DURATION = 1000L
+ }
+
constructor(context: Context) : this(context, null, 0)
constructor(context: Context, attr: AttributeSet?) : this(context, attr, 0)
init {
-// itemAnimator = GridItemAnimator()
- itemAnimator?.changeDuration = 100
- itemAnimator?.moveDuration = 150
+ itemAnimator?.changeDuration = CHANGE_DURATION
+ itemAnimator?.moveDuration = MOVE_DURATION
}
lateinit var gestures: Gestures
@@ -29,36 +31,4 @@ class GridRecyclerView(context: Context, attr: AttributeSet?, defStyleAttr: Int)
super.onTouchEvent(e)
}
}
-
- class GridItemAnimator: DefaultItemAnimator() {
- override fun animateChange(oldHolder: ViewHolder, newHolder: ViewHolder, preInfo: ItemHolderInfo, postInfo: ItemHolderInfo): Boolean {
- if (newHolder == oldHolder) {
- dispatchChangeFinished(oldHolder, true)
- return false
- }
-
- Log.d("GridAnimator", "${oldHolder::class.java.name}, ${newHolder::class.java.name}")
- if (oldHolder is Grid2048Adapter.GridCellViewHolder && newHolder is Grid2048Adapter.GridCellViewHolder) {
- Log.d("GridAnimator", "${oldHolder.btn.text}, ${newHolder.btn.text}, ${oldHolder.btn.text == ""}, ${newHolder.btn.text != ""}")
- val delay = moveDuration;
- if (oldHolder.btn.text == "" && newHolder.btn.text != "") {
- newHolder.itemView.setAlpha(0f)
- newHolder.itemView.postDelayed({
- newHolder.itemView.setAlpha(1f)
- super.animateChange(oldHolder, newHolder, preInfo, postInfo)
- }, 100)
- return true
- } else {
- return super.animateChange(oldHolder, newHolder, preInfo, postInfo)
- }
- } else {
- return super.animateChange(oldHolder, newHolder, preInfo, postInfo)
- }
- }
-
- override fun endAnimation(item: ViewHolder) {
- super.endAnimation(item)
- item.itemView.setAlpha(1f)
- }
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/backup/BackupCreator.kt b/app/src/main/java/org/secuso/privacyfriendly2048/backup/BackupCreator.kt
deleted file mode 100644
index 0e0bc8c..0000000
--- a/app/src/main/java/org/secuso/privacyfriendly2048/backup/BackupCreator.kt
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.secuso.privacyfriendly2048.backup
-
-
-import android.content.Context
-import android.preference.PreferenceManager
-import android.util.JsonWriter
-import android.util.Log
-import org.secuso.privacyfriendly2048.database.PFASQLiteHelper
-import org.secuso.privacyfriendlybackup.api.backup.DatabaseUtil.getSupportSQLiteOpenHelper
-import org.secuso.privacyfriendlybackup.api.backup.DatabaseUtil.writeDatabase
-import org.secuso.privacyfriendlybackup.api.backup.PreferenceUtil.writePreferences
-import org.secuso.privacyfriendlybackup.api.pfa.IBackupCreator
-import java.io.OutputStream
-import java.io.OutputStreamWriter
-
-class BackupCreator : IBackupCreator {
- override fun writeBackup(context: Context, outputStream: OutputStream): Boolean {
- Log.d(TAG, "createBackup() started")
- val outputStreamWriter = OutputStreamWriter(outputStream, Charsets.UTF_8)
- val writer = JsonWriter(outputStreamWriter)
- writer.setIndent("")
-
- try {
- writer.beginObject()
-
- Log.d(TAG, "Writing database")
- writer.name("database")
-
- val database = getSupportSQLiteOpenHelper(context, PFASQLiteHelper.DATABASE_NAME).readableDatabase
-
- writeDatabase(writer, database)
- database.close()
-
- Log.d(TAG, "Writing preferences")
- writer.name("preferences")
-
- val pref = PreferenceManager.getDefaultSharedPreferences(context.applicationContext)
- writePreferences(writer, pref)
-
- writer.endObject()
- writer.close()
- } catch (e: Exception) {
- Log.e(TAG, "Error occurred", e)
- e.printStackTrace()
- return false
- }
-
- Log.d(TAG, "Backup created successfully")
- return true
- }
-
- companion object {
- const val TAG = "PFABackupCreator"
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/backup/BackupRestorer.kt b/app/src/main/java/org/secuso/privacyfriendly2048/backup/BackupRestorer.kt
deleted file mode 100644
index 7ad5098..0000000
--- a/app/src/main/java/org/secuso/privacyfriendly2048/backup/BackupRestorer.kt
+++ /dev/null
@@ -1,137 +0,0 @@
-package org.secuso.privacyfriendly2048.backup
-
-import android.content.Context
-import android.content.SharedPreferences
-import android.preference.PreferenceManager
-import android.util.JsonReader
-import android.util.Log
-import org.secuso.privacyfriendly2048.database.PFASQLiteHelper
-import org.secuso.privacyfriendlybackup.api.backup.DatabaseUtil
-import org.secuso.privacyfriendlybackup.api.backup.FileUtil
-import org.secuso.privacyfriendlybackup.api.pfa.IBackupRestorer
-import java.io.IOException
-import java.io.InputStream
-import java.io.InputStreamReader
-import kotlin.system.exitProcess
-
-
-class BackupRestorer : IBackupRestorer {
- @Throws(IOException::class)
- private fun readDatabase(reader: JsonReader, context: Context) {
- reader.beginObject()
- val n1: String = reader.nextName()
- if (n1 != "version") {
- throw RuntimeException("Unknown value $n1")
- }
- val version: Int = reader.nextInt()
- val n2: String = reader.nextName()
- if (n2 != "content") {
- throw RuntimeException("Unknown value $n2")
- }
-
- Log.d(TAG, "Restoring database...")
- val restoreDatabaseName = "restoreDatabase"
-
- // delete if file already exists
- val restoreDatabaseFile = context.getDatabasePath(restoreDatabaseName)
- if (restoreDatabaseFile.exists()) {
- DatabaseUtil.deleteRoomDatabase(context, restoreDatabaseName)
- }
-
- // create new restore database
- val db = DatabaseUtil.getSupportSQLiteOpenHelper(context, restoreDatabaseName, version).writableDatabase
-
- db.beginTransaction()
- db.version = version
-
- Log.d(TAG, "Copying database contents...")
- DatabaseUtil.readDatabaseContent(reader, db)
- Log.d(TAG, "succesfully read database")
- db.setTransactionSuccessful()
- db.endTransaction()
- db.close()
-
- reader.endObject()
-
- // copy file to correct location
- val actualDatabaseFile = context.getDatabasePath(PFASQLiteHelper.DATABASE_NAME)
-
- DatabaseUtil.deleteRoomDatabase(context, PFASQLiteHelper.DATABASE_NAME)
-
- FileUtil.copyFile(restoreDatabaseFile, actualDatabaseFile)
- Log.d(TAG, "Database Restored")
-
- // delete restore database
- DatabaseUtil.deleteRoomDatabase(context, restoreDatabaseName)
- }
-
- @Throws(IOException::class)
- private fun readPreferences(reader: JsonReader, preferences: SharedPreferences.Editor) {
- reader.beginObject()
- while (reader.hasNext()) {
- val name: String = reader.nextName()
- Log.d("preference", name)
- when (name) {
- "switch_preference_1",
- "pref_animationActivated" -> preferences.putBoolean(name, reader.nextBoolean())
-
- "pref_color" -> preferences.putString(name, reader.nextString())
- "FirstLaunchManager.PREF_PICKER_SECONDS",
- "FirstLaunchManager.PREF_PICKER_MINUTES",
- "FirstLaunchManager.PREF_BREAK_PICKER_SECONDS",
- "FirstLaunchManager.PREF_PICKER_HOURS",
- "FirstLaunchManager.PREF_BREAK_PICKER_MINUTES" -> preferences.putInt(name, reader.nextInt())
-
- "pref_schedule_exercise_days" -> preferences.putStringSet(name, readPreferenceSet(reader))
- "WORK_TIME",
- "PAUSE TIME",
- "pref_schedule_exercise_time",
- "DEFAULT_EXERCISE_SET" -> preferences.putLong(name, reader.nextLong())
-
- else -> throw RuntimeException("Unknown preference $name")
- }
- }
- reader.endObject()
- }
-
- private fun readPreferenceSet(reader: JsonReader): Set {
- val preferenceSet = mutableSetOf()
-
- reader.beginArray()
- while (reader.hasNext()) {
- preferenceSet.add(reader.nextString());
- }
- reader.endArray()
- return preferenceSet
- }
-
- override fun restoreBackup(context: Context, restoreData: InputStream): Boolean {
- return try {
- val isReader = InputStreamReader(restoreData)
- val reader = JsonReader(isReader)
- val preferences = PreferenceManager.getDefaultSharedPreferences(context).edit()
-
- // START
- reader.beginObject()
- while (reader.hasNext()) {
- val type: String = reader.nextName()
- when (type) {
- "database" -> readDatabase(reader, context)
- "preferences" -> readPreferences(reader, preferences)
- else -> throw RuntimeException("Can not parse type $type")
- }
- }
- reader.endObject()
- preferences.commit()
-
- exitProcess(0)
- } catch (e: Exception) {
- e.printStackTrace()
- false
- }
- }
-
- companion object {
- const val TAG = "PFABackupRestorer"
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/backup/PFABackupService.kt b/app/src/main/java/org/secuso/privacyfriendly2048/backup/PFABackupService.kt
deleted file mode 100644
index c33f994..0000000
--- a/app/src/main/java/org/secuso/privacyfriendly2048/backup/PFABackupService.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.secuso.privacyfriendly2048.backup
-
-import org.secuso.privacyfriendlybackup.api.pfa.PFAAuthService
-
-class PFABackupService : PFAAuthService()
\ No newline at end of file
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/model/Game2048.kt b/app/src/main/java/org/secuso/privacyfriendly2048/model/Game2048.kt
index 19c9439..9fce314 100644
--- a/app/src/main/java/org/secuso/privacyfriendly2048/model/Game2048.kt
+++ b/app/src/main/java/org/secuso/privacyfriendly2048/model/Game2048.kt
@@ -1,5 +1,6 @@
package org.secuso.privacyfriendly2048.model
+import java.io.EOFException
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.ObjectInputStream
@@ -110,8 +111,8 @@ class Game2048(val config: GameConfig, boardState: Board? = null): IGame2048 {
if (it is GameBoard.BoardChangeEvent.MergeEvent) {
val value = board.data[it.target.first][it.target.second]
points += value
- stats.setHighestNumber(value.toLong())
- stats.setRecord(points)
+ stats.highestNumber = value.toLong()
+ stats.record = points
}
}
events += board.fillRandomCell(config.cellsToFill, config.distribution)
@@ -155,7 +156,9 @@ class Game2048(val config: GameConfig, boardState: Board? = null): IGame2048 {
writeObject(config)
writeObject(board)
writeLong(points)
- writeObject(boardHistory.last())
+ if (boardHistory.isNotEmpty()) {
+ writeObject(boardHistory.last())
+ }
}
}
@@ -170,7 +173,9 @@ class Game2048(val config: GameConfig, boardState: Board? = null): IGame2048 {
val board = readObject() as GameBoard
val game = Game2048(obj, board.data)
game.points = readLong()
- game.boardHistory.add(readObject() as SingleGameState)
+ try {
+ game.boardHistory.add(readObject() as SingleGameState)
+ } catch (_: EOFException) {}
return game
}
else -> throw IllegalStateException("class ${obj::class.java} can not be serialized into a Game2048 instance.")
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/model/GameBoard.kt b/app/src/main/java/org/secuso/privacyfriendly2048/model/GameBoard.kt
index a9f3e28..16a81d4 100644
--- a/app/src/main/java/org/secuso/privacyfriendly2048/model/GameBoard.kt
+++ b/app/src/main/java/org/secuso/privacyfriendly2048/model/GameBoard.kt
@@ -126,17 +126,16 @@ class GameBoard(private val size: Int, data: Array>? = null): Parcela
}
fun fillRandomCell(amount: Int, distribution: SpawnProbabilityDistribution): List {
- val possibleCells = freeCells.mapIndexed { index, pair -> index to pair }.toMutableList()
- return if (possibleCells.size <= amount) {
- possibleCells.map { (_,boardIndex) ->
+ return if (freeCells.size <= amount) {
+ freeCells.map { boardIndex ->
data[boardIndex.first][boardIndex.second] = distribution.generate()
BoardChangeEvent.SpawnEvent(boardIndex)
}
} else {
- (0 until amount).map { _ ->
- val (cellIndex, boardIndex) = possibleCells.random()
+ val possibleCells = freeCells.shuffled()
+ (0 until amount).map {
+ val boardIndex = possibleCells[it]
data[boardIndex.first][boardIndex.second] = distribution.generate()
- possibleCells.removeAt(cellIndex)
BoardChangeEvent.SpawnEvent(boardIndex)
}
}
diff --git a/app/src/main/java/org/secuso/privacyfriendly2048/model/GameStatistics.kt b/app/src/main/java/org/secuso/privacyfriendly2048/model/GameStatistics.kt
index 01d1bd0..93d733d 100644
--- a/app/src/main/java/org/secuso/privacyfriendly2048/model/GameStatistics.kt
+++ b/app/src/main/java/org/secuso/privacyfriendly2048/model/GameStatistics.kt
@@ -18,6 +18,7 @@
package org.secuso.privacyfriendly2048.model
import java.io.Serializable
+import kotlin.math.max
/**
* The current statistics in each modes is defined in this class.
@@ -32,12 +33,17 @@ class GameStatistics(n: Int) : Serializable {
get() = moves_d.toLong() + moves_t + moves_l + moves_r
var timePlayed: Long = 0
private set
- private var highestNumber: Long = 2
+ var highestNumber: Long = 2
+ set(value) {
+ field = max(value, field)
+ }
private var n = 4
@JvmField
var filename: String = "statistics$n.txt"
- @JvmField
var record: Long = 0
+ set(value) {
+ field = max(value, field)
+ }
var undo: Int = 0
private set
var moves_l: Int = 0
@@ -54,19 +60,6 @@ class GameStatistics(n: Int) : Serializable {
filename = "statistics$n.txt"
}
-
- fun getHighestNumber(): Long {
- return highestNumber
- }
-
- fun setHighestNumber(highestNumber: Long) {
- if (this.highestNumber < highestNumber) this.highestNumber = highestNumber
- }
-
- fun setRecord(record: Long) {
- if (this.record < record) this.record = record
- }
-
fun addTimePlayed(timePlayed: Long) {
this.timePlayed += timePlayed
}
diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml
index f1dd0f8..1e2ad50 100644
--- a/app/src/main/res/layout-land/activity_main.xml
+++ b/app/src/main/res/layout-land/activity_main.xml
@@ -1,228 +1,193 @@
-
+ android:orientation="vertical"
+ android:weightSum="10"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
+ android:layout_height="0dp"
+ android:layout_weight="5">
-
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="@dimen/activity_horizontal_margin"
+ android:layout_marginStart="@dimen/activity_horizontal_margin"
+ android:layout_weight="1"
+ android:background="?attr/selectableItemBackgroundBorderless"
+ android:padding="@dimen/activity_horizontal_margin"
+ android:src="@drawable/ic_keyboard_arrow_left_black_24dp" />
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
+
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout-land/tutorial_slide1.xml b/app/src/main/res/layout-land/tutorial_slide1.xml
deleted file mode 100644
index 637ec52..0000000
--- a/app/src/main/res/layout-land/tutorial_slide1.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout-land/tutorial_slide2.xml b/app/src/main/res/layout-land/tutorial_slide2.xml
deleted file mode 100644
index b823b9d..0000000
--- a/app/src/main/res/layout-land/tutorial_slide2.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout-land/tutorial_slide3.xml b/app/src/main/res/layout-land/tutorial_slide3.xml
deleted file mode 100644
index 6c44a1d..0000000
--- a/app/src/main/res/layout-land/tutorial_slide3.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout-land/tutorial_slide4.xml b/app/src/main/res/layout-land/tutorial_slide4.xml
deleted file mode 100644
index 30d4577..0000000
--- a/app/src/main/res/layout-land/tutorial_slide4.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
deleted file mode 100644
index edf8cfd..0000000
--- a/app/src/main/res/layout/activity_about.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_help.xml b/app/src/main/res/layout/activity_help.xml
deleted file mode 100644
index 1b7d3c5..0000000
--- a/app/src/main/res/layout/activity_help.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 71853c9..0a67393 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,229 +1,194 @@
-
+ android:orientation="vertical"
+ android:weightSum="10"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
-
+ android:layout_height="0dp"
+ android:layout_weight="6">
-
+
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
-
-
-
+
+
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
deleted file mode 100644
index eb3f8b3..0000000
--- a/app/src/main/res/layout/activity_settings.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_stats.xml b/app/src/main/res/layout/activity_stats.xml
index ae68031..d648000 100644
--- a/app/src/main/res/layout/activity_stats.xml
+++ b/app/src/main/res/layout/activity_stats.xml
@@ -1,58 +1,24 @@
-
+ android:orientation="vertical">
-
-
-
-
-
-
-
-
-
+ android:layout_height="wrap_content"
+ />
-
-
-
-
-
-
-
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
-
+
diff --git a/app/src/main/res/layout/activity_tutorial.xml b/app/src/main/res/layout/activity_tutorial.xml
deleted file mode 100644
index 0fe516e..0000000
--- a/app/src/main/res/layout/activity_tutorial.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_group.xml b/app/src/main/res/layout/list_group.xml
deleted file mode 100644
index 966b2b3..0000000
--- a/app/src/main/res/layout/list_group.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item.xml b/app/src/main/res/layout/list_item.xml
deleted file mode 100644
index 1e18dfa..0000000
--- a/app/src/main/res/layout/list_item.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/toolbar.xml b/app/src/main/res/layout/toolbar.xml
deleted file mode 100644
index ec8df46..0000000
--- a/app/src/main/res/layout/toolbar.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide1.xml b/app/src/main/res/layout/tutorial_slide1.xml
deleted file mode 100644
index 28e0f50..0000000
--- a/app/src/main/res/layout/tutorial_slide1.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide2.xml b/app/src/main/res/layout/tutorial_slide2.xml
deleted file mode 100644
index 8337a8b..0000000
--- a/app/src/main/res/layout/tutorial_slide2.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide3.xml b/app/src/main/res/layout/tutorial_slide3.xml
deleted file mode 100644
index 22c582b..0000000
--- a/app/src/main/res/layout/tutorial_slide3.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/tutorial_slide4.xml b/app/src/main/res/layout/tutorial_slide4.xml
deleted file mode 100644
index 733bfe2..0000000
--- a/app/src/main/res/layout/tutorial_slide4.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 9c48cf1..bc1cc9e 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -53,12 +53,8 @@
Einstellungen
- Animationen aktivieren
Displaysperre aktivieren
Auswahl Farbschema
- System
- Hell
- Dunkel
Standard
Original
@@ -104,6 +100,10 @@
Gesamtspieldauer
Zeit pro Wischer
Statistik zurücksetzem
+ Appearance
+ Animationen aktivieren
+ Blöcke bewegen und verschmelzen sich augenblicklich wenn deaktiviert.
+ Fehlerbericht
Streiche Oben
@@ -111,5 +111,8 @@
Streiche Links
Streiche Rechts
Rückgängig
+ Animationen aktivieren
+ Aktivieren Sie diese Einstellung, wenn Sie die Rückgängig-Funktion mehrfach verwenden wollen.
+ Mehrfach Rückgängig machen
diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml
index 7ded64b..8c66597 100644
--- a/app/src/main/res/values-gl/strings.xml
+++ b/app/src/main/res/values-gl/strings.xml
@@ -39,9 +39,6 @@
Tes máis información en:
Activar animación
Escoller esquema de cores
- Sistema
- Claro
- Escuro
Predeterminado
Orixinal
Comezar a xogar
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 222efe3..ca75e37 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -8,15 +8,4 @@
- 1
- 2
-
-
- - @string/settings_color_system
- - @string/settings_color_light
- - @string/settings_color_dark
-
-
- - system
- - light
- - dark
-
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 64f867f..6157a26 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -54,19 +54,14 @@
In affiliation with
This application belongs to the group of Privacy Friendly Apps developed by Karlsruhe Institute of Technology (KIT). Sourcecode licensed under GPLv3. Images copyright KIT and Google Inc.
More information can be found on:
- Github-Repo
+ https://github.com/SecUSo/privacy-friendly-2048
SECUSO-Website
Settings
- Activate Animation
Activate Screen Lock
Select Color Scheme
- System
- Light
- Dark
- Default
- Original
+
Start New Game
@@ -104,11 +99,21 @@
Time per Swipe
Reset Statistics
+ Appearance
+ Activate Animation
+ Blocks will move and merge instantaneous if deactivated.
+ Error Report
+
Swipe Up
Swipe Down
Swipe Left
Swipe Right
Undo
+ Standard
+ Original
+ Activate Animation
+ Activate if you want to use the undo feature multiple times in a row
+ Multiple undos
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
deleted file mode 100644
index fd3054b..0000000
--- a/app/src/main/res/xml/pref_general.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build.gradle b/build.gradle
index fa034b1..1673086 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,7 +8,7 @@ buildscript {
ext.kotlin_version = "2.0.21"
dependencies {
- classpath 'com.android.tools.build:gradle:8.1.4'
+ classpath 'com.android.tools.build:gradle:8.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1af9e09..68e8e16 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
+validateDistributionUrl=true
\ No newline at end of file
diff --git a/libs/pfa-core b/libs/pfa-core
new file mode 160000
index 0000000..ce2da38
--- /dev/null
+++ b/libs/pfa-core
@@ -0,0 +1 @@
+Subproject commit ce2da387e692938f8598bc74590d63fa15bb78e8
diff --git a/libs/privacy-friendly-backup-api b/libs/privacy-friendly-backup-api
deleted file mode 160000
index 8687a8d..0000000
--- a/libs/privacy-friendly-backup-api
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 8687a8dbd170866707dc41bcb879375400ef697a
diff --git a/settings.gradle b/settings.gradle
index 7264140..8da6e5c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,2 @@
include ':app'
-include ':backup-api'
-project(':backup-api').projectDir = new File('libs/privacy-friendly-backup-api/BackupAPI')
\ No newline at end of file
+includeBuild("libs/pfa-core")
\ No newline at end of file