From e692f6c7a78af70cd6fc551002a37268627949f5 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 20 Mar 2021 21:30:27 +0530 Subject: [PATCH 01/22] Implemented FloatingActionMenu Without External Dependency --- .../main/java/com/ichi2/anki/DeckPicker.java | 168 +++++++++++++----- .../com/ichi2/anki/widgets/FabBehavior.java | 9 +- .../main/res/layout/floating_add_button.xml | 140 +++++++++++---- AnkiDroid/src/main/res/values/dimens.xml | 12 ++ 4 files changed, 238 insertions(+), 91 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index cd9c5ce11fa5..e8c336b636a9 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -22,6 +22,7 @@ package com.ichi2.anki; import android.Manifest; +import android.animation.Animator; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; @@ -42,6 +43,7 @@ import android.provider.Settings; import com.afollestad.materialdialogs.GravityEnum; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import androidx.annotation.NonNull; @@ -82,8 +84,6 @@ import android.widget.Toast; import com.afollestad.materialdialogs.MaterialDialog; -import com.getbase.floatingactionbutton.FloatingActionButton; -import com.getbase.floatingactionbutton.FloatingActionsMenu; import com.ichi2.anki.CollectionHelper.CollectionIntegrityStorageCheck; import com.ichi2.anki.StudyOptionsFragment.StudyOptionsListener; import com.ichi2.anki.analytics.UsageAnalytics; @@ -201,7 +201,13 @@ public class DeckPicker extends NavigationDrawerActivity implements private RecyclerView mRecyclerView; private LinearLayoutManager mRecyclerViewLayoutManager; private DeckAdapter mDeckListAdapter; - private FloatingActionsMenu mActionsMenu; + + // private FloatingActionsMenu mActionsMenu; + private FloatingActionButton addDeckButton,addNoteButton,addSharedButton,fabMain; + private LinearLayout addNoteLayout, addSharedLayout, addDeckLayout; + private View fabBGLayout; + private boolean isFABOpen = false; + private final Snackbar.Callback mSnackbarShowHideCallback = new Snackbar.Callback(); private LinearLayout mNoDecksPlaceholder; @@ -218,6 +224,9 @@ public class DeckPicker extends NavigationDrawerActivity implements // flag asking user to do a full sync which is used in upgrade path private boolean mRecommendFullSync = false; + + // flag to track +// private boolean isFABOpen = false; // flag keeping track of when the app has been paused private boolean mActivityPaused = false; @@ -269,8 +278,8 @@ public class DeckPicker extends NavigationDrawerActivity implements private void onDeckClick(View v, DeckSelectionType selectionType) { long deckId = (long) v.getTag(); Timber.i("DeckPicker:: Selected deck with id %d", deckId); - if (mActionsMenu != null && mActionsMenu.isExpanded()) { - mActionsMenu.collapse(); + if (isFABOpen) { + closeFloatingActionMenu(); } boolean collectionIsOpen = false; @@ -516,8 +525,6 @@ protected void onCreate(Bundle savedInstanceState) throws SQLException { mPullToSyncWrapper.setEnabled(mRecyclerViewLayoutManager.findFirstCompletelyVisibleItemPosition() == 0)); // Setup the FloatingActionButtons, should work everywhere with min API >= 15 - mActionsMenu = findViewById(R.id.add_content_menu); - mActionsMenu.findViewById(R.id.fab_expand_menu_button).setContentDescription(getString(R.string.menu_add)); configureFloatingActionsMenu(); mReviewSummaryTextView = findViewById(R.id.today_stats_text_view); @@ -627,49 +634,114 @@ private boolean firstCollectionOpen() { return false; } } + + private void showFloatingActionMenu() { + isFABOpen = true; + addNoteLayout.setVisibility(View.VISIBLE); + addSharedLayout.setVisibility(View.VISIBLE); + addDeckLayout.setVisibility(View.VISIBLE); + fabBGLayout.setVisibility(View.VISIBLE); + + fabMain.animate().rotationBy(140); + addNoteLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); + addSharedLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_100)); + addDeckLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_145)); + } + + private void closeFloatingActionMenu() { + isFABOpen = false; + fabBGLayout.setVisibility(View.GONE); + fabMain.animate().rotation(0); + addNoteLayout.animate().translationY(0); + addSharedLayout.animate().translationY(0); + addDeckLayout.animate().translationY(0); + addDeckLayout.animate().translationY(0).setListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animator) { } + @Override + public void onAnimationEnd(Animator animator) { + if (!isFABOpen) { + addNoteLayout.setVisibility(View.GONE); + addSharedLayout.setVisibility(View.GONE); + addDeckLayout.setVisibility(View.GONE); + } + } + @Override + public void onAnimationCancel(Animator animator) { } + + @Override + public void onAnimationRepeat(Animator animator) { } + }); + } + private void configureFloatingActionsMenu() { - final FloatingActionButton addDeckButton = findViewById(R.id.add_deck_action); - final FloatingActionButton addSharedButton = findViewById(R.id.add_shared_action); - final FloatingActionButton addNoteButton = findViewById(R.id.add_note_action); - addDeckButton.setOnClickListener(view -> { - if (mActionsMenu == null) { - return; + addNoteLayout = (LinearLayout) findViewById(R.id.add_note_layout); + addSharedLayout = (LinearLayout) findViewById(R.id.add_shared_layout); + addDeckLayout = (LinearLayout) findViewById(R.id.add_deck_layout); + fabMain = (FloatingActionButton) findViewById(R.id.fab_main); + addNoteButton = (FloatingActionButton) findViewById(R.id.add_note_action); + addSharedButton = (FloatingActionButton) findViewById(R.id.add_shared_action); + addDeckButton = (FloatingActionButton) findViewById(R.id.add_deck_action); + fabBGLayout = findViewById(R.id.fabBGLayout); + + fabMain.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (!isFABOpen) { + showFloatingActionMenu(); + } else { + closeFloatingActionMenu(); + } } - mActionsMenu.collapse(); - mDialogEditText = new FixedEditText(DeckPicker.this); - mDialogEditText.setSingleLine(true); - // mDialogEditText.setFilters(new InputFilter[] { mDeckNameFilter }); - new MaterialDialog.Builder(DeckPicker.this) - .title(R.string.new_deck) - .positiveText(R.string.dialog_ok) - .customView(mDialogEditText, true) - .onPositive((dialog, which) -> { - String deckName = mDialogEditText.getText().toString(); - if (Decks.isValidDeckName(deckName)) { - boolean creation_succeed = createNewDeck(deckName); - if (!creation_succeed) { - return; - } - } else { - Timber.i("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); - UIUtils.showThemedToast(this, getString(R.string.invalid_deck_name), false); - } - }) - .negativeText(R.string.dialog_cancel) - .show(); - }); - addSharedButton.setOnClickListener(view -> { - Timber.i("Adding Shared Deck"); - mActionsMenu.collapse(); - addSharedDeck(); }); - addNoteButton.setOnClickListener(view -> { - Timber.i("Adding Note"); - mActionsMenu.collapse(); - addNote(); + + fabBGLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + closeFloatingActionMenu(); + } }); - } + + addDeckButton.setOnClickListener(view -> { + if (isFABOpen) { + closeFloatingActionMenu(); + mDialogEditText = new FixedEditText(DeckPicker.this); + mDialogEditText.setSingleLine(true); + // mDialogEditText.setFilters(new InputFilter[] { mDeckNameFilter }); + new MaterialDialog.Builder(DeckPicker.this) + .title(R.string.new_deck) + .positiveText(R.string.dialog_ok) + .customView(mDialogEditText, true) + .onPositive((dialog, which) -> { + String deckName = mDialogEditText.getText().toString(); + if (Decks.isValidDeckName(deckName)) { + boolean creation_succeed = createNewDeck(deckName); + if (!creation_succeed) { + return; + } + } else { + Timber.i("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); + UIUtils.showThemedToast(this, getString(R.string.invalid_deck_name), false); + } + }) + .negativeText(R.string.dialog_cancel) + .show(); + } + }); + + addSharedButton.setOnClickListener(view -> { + Timber.i("Adding Shared Deck"); + closeFloatingActionMenu(); + addSharedDeck(); + }); + + addNoteButton.setOnClickListener(view -> { + Timber.i("Adding Note"); + closeFloatingActionMenu(); + addNote(); + }); + } /** @@ -1079,8 +1151,8 @@ public void onBackPressed() { super.onBackPressed(); } else { Timber.i("Back key pressed"); - if (mActionsMenu != null && mActionsMenu.isExpanded()) { - mActionsMenu.collapse(); + if (isFABOpen) { + closeFloatingActionMenu(); } else { automaticSync(); finishWithAnimation(); @@ -3024,4 +3096,4 @@ private enum DeckSelectionType { /** Always open reviewer (keyboard shortcut) */ SKIP_STUDY_OPTIONS } -} +} \ No newline at end of file diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java b/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java index 64484f9dc79b..87a1ed104b7d 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java @@ -24,7 +24,6 @@ import android.util.AttributeSet; import android.view.View; -import com.getbase.floatingactionbutton.FloatingActionsMenu; import java.util.List; @@ -33,7 +32,7 @@ * Defines the behavior for the floating action button. If the dependency is a Snackbar, move the * fab up. */ -public class FabBehavior extends CoordinatorLayout.Behavior { +public class FabBehavior extends CoordinatorLayout.Behavior { private float mTranslationY; @@ -45,7 +44,7 @@ public FabBehavior(Context context, AttributeSet attrs) { super(context, attrs); } - private static float getFabTranslationYForSnackbar(CoordinatorLayout parent, FloatingActionsMenu fab) { + private static float getFabTranslationYForSnackbar(CoordinatorLayout parent, View fab) { float minOffset = 0.0F; List dependencies = parent.getDependencies(fab); int i = 0; @@ -61,12 +60,12 @@ private static float getFabTranslationYForSnackbar(CoordinatorLayout parent, Flo } @Override - public boolean layoutDependsOn(@NonNull CoordinatorLayout parent, @NonNull FloatingActionsMenu child, @NonNull View dependency) { + public boolean layoutDependsOn(@NonNull CoordinatorLayout parent, @NonNull View child, @NonNull View dependency) { return dependency instanceof Snackbar.SnackbarLayout; } @Override - public boolean onDependentViewChanged(@NonNull CoordinatorLayout parent, @NonNull FloatingActionsMenu fab, @NonNull View dependency) { + public boolean onDependentViewChanged(@NonNull CoordinatorLayout parent, @NonNull View fab, @NonNull View dependency) { if (dependency instanceof Snackbar.SnackbarLayout && fab.getVisibility() == View.VISIBLE) { float translationY = getFabTranslationYForSnackbar(parent, fab); if (translationY != this.mTranslationY) { diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index 4934e78017c8..3505974d8bf5 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -1,48 +1,112 @@ - - - + + + - + - + + + + + + - + + + + + + + + + - - \ No newline at end of file + android:layout_gravity="bottom|end" + app:fab_colorNormal="?attr/fab_normal" + android:gravity="center_vertical" + app:srcCompat="@drawable/ic_add_white_24dp" + app:backgroundTint="@color/material_blue_500" + app:fabSize="normal"/> + + + \ No newline at end of file diff --git a/AnkiDroid/src/main/res/values/dimens.xml b/AnkiDroid/src/main/res/values/dimens.xml index aca37ffeaf2e..bc7631492974 100644 --- a/AnkiDroid/src/main/res/values/dimens.xml +++ b/AnkiDroid/src/main/res/values/dimens.xml @@ -28,4 +28,16 @@ 24dp 4dp 28dp + + + 16dp + 16dp + 16dp + + 12dp + 23dp + 60dp + 110dp + 160dp + \ No newline at end of file From 6955e8f3daa560cf4008d019e8a1d3309b31f527 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 21 Mar 2021 11:33:13 +0530 Subject: [PATCH 02/22] small fixes --- .../main/java/com/ichi2/anki/DeckPicker.java | 63 ++++++++++-------- .../res/drawable-hdpi/ic_add_white_24dp.png | Bin 223 -> 0 bytes .../ic_file_download_white_24dp.png | Bin 163 -> 0 bytes .../drawable-hdpi/ic_folder_white_24dp.png | Bin 135 -> 0 bytes .../res/drawable-mdpi/ic_add_white_24dp.png | Bin 174 -> 0 bytes .../ic_file_download_white_24dp.png | Bin 116 -> 0 bytes .../drawable-mdpi/ic_folder_white_24dp.png | Bin 122 -> 0 bytes .../res/drawable-xhdpi/ic_add_white_24dp.png | Bin 198 -> 0 bytes .../ic_file_download_white_24dp.png | Bin 157 -> 0 bytes .../drawable-xhdpi/ic_folder_white_24dp.png | Bin 181 -> 0 bytes .../res/drawable-xxhdpi/ic_add_white_24dp.png | Bin 222 -> 0 bytes .../ic_file_download_white_24dp.png | Bin 197 -> 0 bytes .../drawable-xxhdpi/ic_folder_white_24dp.png | Bin 245 -> 0 bytes .../ic_file_download_white_24dp.png | Bin 233 -> 0 bytes .../drawable-xxxhdpi/ic_folder_white_24dp.png | Bin 325 -> 0 bytes .../src/main/res/drawable/ic_add_white.xml | 9 +++ .../res/drawable/ic_file_download_white.xml | 9 +++ .../src/main/res/drawable/ic_folder_white.xml | 9 +++ .../main/res/layout/floating_add_button.xml | 8 +-- .../src/main/res/menu-television/reviewer.xml | 2 +- AnkiDroid/src/main/res/menu/card_browser.xml | 2 +- AnkiDroid/src/main/res/menu/model_browser.xml | 2 +- AnkiDroid/src/main/res/menu/model_editor.xml | 2 +- AnkiDroid/src/main/res/menu/reviewer.xml | 2 +- .../src/main/res/menu/tags_dialog_menu.xml | 2 +- 25 files changed, 72 insertions(+), 38 deletions(-) delete mode 100644 AnkiDroid/src/main/res/drawable-hdpi/ic_add_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-hdpi/ic_file_download_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-hdpi/ic_folder_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-mdpi/ic_add_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-mdpi/ic_file_download_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-mdpi/ic_folder_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xhdpi/ic_add_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xhdpi/ic_file_download_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xxhdpi/ic_add_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xxhdpi/ic_file_download_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xxhdpi/ic_folder_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xxxhdpi/ic_file_download_white_24dp.png delete mode 100644 AnkiDroid/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png create mode 100644 AnkiDroid/src/main/res/drawable/ic_add_white.xml create mode 100644 AnkiDroid/src/main/res/drawable/ic_file_download_white.xml create mode 100644 AnkiDroid/src/main/res/drawable/ic_folder_white.xml diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index e8c336b636a9..e35d9a9f03f4 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -202,11 +202,15 @@ public class DeckPicker extends NavigationDrawerActivity implements private LinearLayoutManager mRecyclerViewLayoutManager; private DeckAdapter mDeckListAdapter; - // private FloatingActionsMenu mActionsMenu; - private FloatingActionButton addDeckButton,addNoteButton,addSharedButton,fabMain; - private LinearLayout addNoteLayout, addSharedLayout, addDeckLayout; + private FloatingActionButton addDeckButton; + private FloatingActionButton addNoteButton; + private FloatingActionButton addSharedButton; + private FloatingActionButton fabMain; + private LinearLayout addNoteLayout; + private LinearLayout addSharedLayout; + private LinearLayout addDeckLayout; private View fabBGLayout; - private boolean isFABOpen = false; + private boolean mIsFABOpen = false; private final Snackbar.Callback mSnackbarShowHideCallback = new Snackbar.Callback(); @@ -224,9 +228,6 @@ public class DeckPicker extends NavigationDrawerActivity implements // flag asking user to do a full sync which is used in upgrade path private boolean mRecommendFullSync = false; - - // flag to track -// private boolean isFABOpen = false; // flag keeping track of when the app has been paused private boolean mActivityPaused = false; @@ -278,7 +279,7 @@ public class DeckPicker extends NavigationDrawerActivity implements private void onDeckClick(View v, DeckSelectionType selectionType) { long deckId = (long) v.getTag(); Timber.i("DeckPicker:: Selected deck with id %d", deckId); - if (isFABOpen) { + if (mIsFABOpen) { closeFloatingActionMenu(); } @@ -635,23 +636,28 @@ private boolean firstCollectionOpen() { } } + private void showFloatingActionMenu() { - isFABOpen = true; + mIsFABOpen = true; addNoteLayout.setVisibility(View.VISIBLE); addSharedLayout.setVisibility(View.VISIBLE); addDeckLayout.setVisibility(View.VISIBLE); fabBGLayout.setVisibility(View.VISIBLE); - - fabMain.animate().rotationBy(140); - addNoteLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); - addSharedLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_100)); - addDeckLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_145)); + // get preference of animation from AnkiActivity + if(animationEnabled()) { + fabMain.animate().rotationBy(140); + } + addNoteLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); + addSharedLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_100)); + addDeckLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_145)); } private void closeFloatingActionMenu() { - isFABOpen = false; + mIsFABOpen = false; fabBGLayout.setVisibility(View.GONE); - fabMain.animate().rotation(0); + if(animationEnabled()) { + fabMain.animate().rotation(0); + } addNoteLayout.animate().translationY(0); addSharedLayout.animate().translationY(0); addDeckLayout.animate().translationY(0); @@ -660,7 +666,7 @@ private void closeFloatingActionMenu() { public void onAnimationStart(Animator animator) { } @Override public void onAnimationEnd(Animator animator) { - if (!isFABOpen) { + if (!mIsFABOpen) { addNoteLayout.setVisibility(View.GONE); addSharedLayout.setVisibility(View.GONE); addDeckLayout.setVisibility(View.GONE); @@ -676,19 +682,19 @@ public void onAnimationRepeat(Animator animator) { } } private void configureFloatingActionsMenu() { - addNoteLayout = (LinearLayout) findViewById(R.id.add_note_layout); - addSharedLayout = (LinearLayout) findViewById(R.id.add_shared_layout); - addDeckLayout = (LinearLayout) findViewById(R.id.add_deck_layout); - fabMain = (FloatingActionButton) findViewById(R.id.fab_main); - addNoteButton = (FloatingActionButton) findViewById(R.id.add_note_action); - addSharedButton = (FloatingActionButton) findViewById(R.id.add_shared_action); - addDeckButton = (FloatingActionButton) findViewById(R.id.add_deck_action); + addNoteLayout = (LinearLayout)findViewById(R.id.add_note_layout); + addSharedLayout = (LinearLayout)findViewById(R.id.add_shared_layout); + addDeckLayout = (LinearLayout)findViewById(R.id.add_deck_layout); + fabMain = (FloatingActionButton)findViewById(R.id.fab_main); + addNoteButton = (FloatingActionButton)findViewById(R.id.add_note_action); + addSharedButton = (FloatingActionButton)findViewById(R.id.add_shared_action); + addDeckButton = (FloatingActionButton)findViewById(R.id.add_deck_action); fabBGLayout = findViewById(R.id.fabBGLayout); fabMain.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (!isFABOpen) { + if (!mIsFABOpen) { showFloatingActionMenu(); } else { closeFloatingActionMenu(); @@ -704,11 +710,10 @@ public void onClick(View view) { }); addDeckButton.setOnClickListener(view -> { - if (isFABOpen) { + if (mIsFABOpen) { closeFloatingActionMenu(); mDialogEditText = new FixedEditText(DeckPicker.this); mDialogEditText.setSingleLine(true); - // mDialogEditText.setFilters(new InputFilter[] { mDeckNameFilter }); new MaterialDialog.Builder(DeckPicker.this) .title(R.string.new_deck) .positiveText(R.string.dialog_ok) @@ -1088,6 +1093,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); savedInstanceState.putLong("mContextMenuDid", mContextMenuDid); savedInstanceState.putBoolean("mClosedWelcomeMessage", mClosedWelcomeMessage); + savedInstanceState.putBoolean("mIsFABOpen", mIsFABOpen); } @@ -1095,6 +1101,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); mContextMenuDid = savedInstanceState.getLong("mContextMenuDid"); + mIsFABOpen = savedInstanceState.getBoolean("mIsFABOpen"); } @@ -1151,7 +1158,7 @@ public void onBackPressed() { super.onBackPressed(); } else { Timber.i("Back key pressed"); - if (isFABOpen) { + if (mIsFABOpen) { closeFloatingActionMenu(); } else { automaticSync(); diff --git a/AnkiDroid/src/main/res/drawable-hdpi/ic_add_white_24dp.png b/AnkiDroid/src/main/res/drawable-hdpi/ic_add_white_24dp.png deleted file mode 100644 index 481643ecd5e5c361bdf5440f80b6ead58c015a87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZK3>dAqwX{BQ3+vmeOgEbxddW?|m)`b<0N2FLh>sBaz zbNHm-*5u;7=mneO8+En?J13^G1)j}b{4(Q;!Yv7xt%vHjER#LP#>jBmH-z#3;kA!} PRxo(F`njxgN@xNAMifE{ diff --git a/AnkiDroid/src/main/res/drawable-hdpi/ic_file_download_white_24dp.png b/AnkiDroid/src/main/res/drawable-hdpi/ic_file_download_white_24dp.png deleted file mode 100644 index c8a2039c583803eab552eb2ad15248ad4f306b14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8mZytjh{y4_Q*ZMgP~c#YJsK$U z)~(q1m-m)lF^^vy&zFBx;@>#sNTW$[{bH;=%sZG7QZ>uQBcw?@Ce|ClF7G156^ z#Rt_}Q9HRs{l8sYa>)1&$3+cMLFMTJXY2PZ*sH$V@BeR?lj;@>g(qYZ*L3k@0BvRP MboFyt=akR{0D4_J0ssI2 diff --git a/AnkiDroid/src/main/res/drawable-hdpi/ic_folder_white_24dp.png b/AnkiDroid/src/main/res/drawable-hdpi/ic_folder_white_24dp.png deleted file mode 100644 index 02ea533a8d662e512843bf218e372653e95d843b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;pQnpsh{y4_S5I>?DDbdcG|@O=~G=WkLM z=IP=XVsSe8&v^%_1es$}4u^UcOKr$FAbzMPnm+mvS-{o;0&fnzA@EQ^BmzWWo}eRZ9~msAiWq$nrXiF)+AFy^vQr>(2u; OhQZU-&t;ucLK6V({vp)> diff --git a/AnkiDroid/src/main/res/drawable-mdpi/ic_folder_white_24dp.png b/AnkiDroid/src/main/res/drawable-mdpi/ic_folder_white_24dp.png deleted file mode 100644 index 831d723ba9659a44186c1fd08752902f59669429..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1M^6{W5R22v2@+}#>L2`{{(qt) zvm)<`Q=Hj9{dp?B-k)#6`~UxbmC(cg19_d}4r?#Evfm-&!|_RRhEx83m({x|$*?rj VKUyK^_-~+L44$rjF6*2Ung9auEG+;4 diff --git a/AnkiDroid/src/main/res/drawable-xhdpi/ic_add_white_24dp.png b/AnkiDroid/src/main/res/drawable-xhdpi/ic_add_white_24dp.png deleted file mode 100644 index 67042105d29bc5676206dbdb1cdc9359e58bd63d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tg=CK)Uj~LMH3o);76yi2K%s^g z3=E|}g|8AA7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^+;1OBOz`!jG!i)^F=12eq z?L1u^Ln02py|$5)K|z4oVe|hBQ9Bz}EZMQ1`FhKTnUCMHGB9jmw3Y!X{lPFtFM;7Y kgDFtxY{Pe1h8HYi&yV;pzTM$H6)4T%>FVdQ&MBb@0Q4<48~^|S diff --git a/AnkiDroid/src/main/res/drawable-xhdpi/ic_file_download_white_24dp.png b/AnkiDroid/src/main/res/drawable-xhdpi/ic_file_download_white_24dp.png deleted file mode 100644 index f53cc0c62c228828d73c90f681eda0835179b0b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0D6i*k&kch)?FYe|&V8Fv1*n95m zR5e$DAHp{l&A!8XfIV8!#r>2YP$7e#!c^^(-Y0%@RoZ*qi`F<)`EKq{{v+@Hw5*sR zFA(}!c2Utj$B^^;IgbBnE;xI?rFh=CsojiM7+vgNGclA;TJ|n(&Igb&p00i_>zopr E0CTxJ1ONa4 diff --git a/AnkiDroid/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png b/AnkiDroid/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png deleted file mode 100644 index 71a5a137c463dfd97dfad592c86b7eac773664c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0D8c!F;kch)?uX*!1I0(1~u3k7j z(@|)CtD?lCSzab=p|%h2vhJCDWr_9aDM8CMGG^>pz2)3<9-DOK6&2^5E;t7@iOv_Z za^ku1A-hLl9mAHDjh3bd#2aH97>pYj7@1i1Fnhmp-(Sr7N?SnU?z8GoH}30QFuL9E fEIT*+)p6OLF7v?Cmm9c&?qKkA^>bP0l+XkK)+RzI diff --git a/AnkiDroid/src/main/res/drawable-xxhdpi/ic_add_white_24dp.png b/AnkiDroid/src/main/res/drawable-xxhdpi/ic_add_white_24dp.png deleted file mode 100644 index 72cedcad4f1bcedad5e0b69728dd893c52edf322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhaw6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W>XMsm#F#`j)FbFd;%$g$s z6b$opaSX}0_x9RGP6h=5W{1uHFWkCy^H1}O)P{mkk7qly8JQr!Ds4T702EwEU(nYs qt)QS_%>n}^QsrM(T z{K~l&Yj@SA9If=c^vXIaY>wlkMR7)vg;t&u=kNuYJa3$GaHnEwp`ORgIc%D)jV%O+J|}OmjAiz^vX--1bb;NmdKI;Vst0GcUV@&Et; diff --git a/AnkiDroid/src/main/res/drawable-xxxhdpi/ic_file_download_white_24dp.png b/AnkiDroid/src/main/res/drawable-xxxhdpi/ic_file_download_white_24dp.png deleted file mode 100644 index ded5652e406a8bb0788402b1ea2034968a241ead..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeG3?%1&o4*=J@dWsUxB}__Fko@OdIgZrQWE4B z%@VZ8#xa<@HhnOS1viNAnEC})a|0sJS72xJ-2)f?&QaR z?3aFfZT$|bN3Ya!ZWwgOIdJDMXyKo5=w(d|$6F^2ai?7ZNyM@uS}y1~X^1JRa37T8 i%D!pbm~%M(0r%^vOJ5j@by@-4#Ng@b=d#Wzp$Pz$!&MXj diff --git a/AnkiDroid/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png b/AnkiDroid/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png deleted file mode 100644 index a1afbe9daf5a5e3945f33915f8817be26b539148..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 325 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7z{un2;uunK>+P+xzK0zI93I~B z(C26sy3FL&q}$ba<$&VE(+|=Gi?KQ4VXb{{b%I@HcvNQkRwH8&_$~OogvaO4 zw%oRd*KGoKY|H)oF+L(JmZ@K7yH~M)rTJtXSd}W-{epFln3^$y#Qw2YO4`4lFD^P$~Ceo|M5hK8FSd#^MHkMkW@H6#Nv%Xop z`uOoFkL` + + diff --git a/AnkiDroid/src/main/res/drawable/ic_file_download_white.xml b/AnkiDroid/src/main/res/drawable/ic_file_download_white.xml new file mode 100644 index 000000000000..3e991ef3ade8 --- /dev/null +++ b/AnkiDroid/src/main/res/drawable/ic_file_download_white.xml @@ -0,0 +1,9 @@ + + + diff --git a/AnkiDroid/src/main/res/drawable/ic_folder_white.xml b/AnkiDroid/src/main/res/drawable/ic_folder_white.xml new file mode 100644 index 000000000000..2d57ce7f266c --- /dev/null +++ b/AnkiDroid/src/main/res/drawable/ic_folder_white.xml @@ -0,0 +1,9 @@ + + + diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index 3505974d8bf5..d07850a5a067 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -34,7 +34,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="10dp" app:backgroundTint="@color/material_blue_500" - android:src="@drawable/ic_add_white_24dp" + android:src="@drawable/ic_add_white" app:fabSize="mini"/> @@ -59,7 +59,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="10dp" app:backgroundTint="@color/material_blue_500" - android:src="@drawable/ic_file_download_white_24dp" + android:src="@drawable/ic_file_download_white" app:fabSize="mini"/> @@ -84,7 +84,7 @@ android:layout_height="wrap_content" app:backgroundTint="@color/material_blue_500" android:layout_marginLeft="10dp" - android:src="@drawable/ic_folder_white_24dp" + android:src="@drawable/ic_folder_white" app:fabSize="mini"/> @@ -104,7 +104,7 @@ android:layout_gravity="bottom|end" app:fab_colorNormal="?attr/fab_normal" android:gravity="center_vertical" - app:srcCompat="@drawable/ic_add_white_24dp" + app:srcCompat="@drawable/ic_add_white" app:backgroundTint="@color/material_blue_500" app:fabSize="normal"/> diff --git a/AnkiDroid/src/main/res/menu-television/reviewer.xml b/AnkiDroid/src/main/res/menu-television/reviewer.xml index 922d16a08c99..395deaee9a71 100644 --- a/AnkiDroid/src/main/res/menu-television/reviewer.xml +++ b/AnkiDroid/src/main/res/menu-television/reviewer.xml @@ -78,7 +78,7 @@ diff --git a/AnkiDroid/src/main/res/menu/model_browser.xml b/AnkiDroid/src/main/res/menu/model_browser.xml index 33139e5a2a0c..06b232e8abb8 100644 --- a/AnkiDroid/src/main/res/menu/model_browser.xml +++ b/AnkiDroid/src/main/res/menu/model_browser.xml @@ -4,6 +4,6 @@ \ No newline at end of file diff --git a/AnkiDroid/src/main/res/menu/model_editor.xml b/AnkiDroid/src/main/res/menu/model_editor.xml index 2015da16f3f4..5be3dd0b30d0 100644 --- a/AnkiDroid/src/main/res/menu/model_editor.xml +++ b/AnkiDroid/src/main/res/menu/model_editor.xml @@ -4,6 +4,6 @@ \ No newline at end of file diff --git a/AnkiDroid/src/main/res/menu/reviewer.xml b/AnkiDroid/src/main/res/menu/reviewer.xml index 4002baadb4c6..82685b11bd58 100644 --- a/AnkiDroid/src/main/res/menu/reviewer.xml +++ b/AnkiDroid/src/main/res/menu/reviewer.xml @@ -70,7 +70,7 @@ From 6a7110444f168a90144e78d9ff875afd26f0a465 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 21 Mar 2021 15:50:06 +0530 Subject: [PATCH 03/22] spaces fixes --- .../main/java/com/ichi2/anki/DeckPicker.java | 65 +++++++++---------- .../main/res/layout/floating_add_button.xml | 26 ++++---- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index e35d9a9f03f4..40304f1f9dfc 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -206,9 +206,9 @@ public class DeckPicker extends NavigationDrawerActivity implements private FloatingActionButton addNoteButton; private FloatingActionButton addSharedButton; private FloatingActionButton fabMain; - private LinearLayout addNoteLayout; private LinearLayout addSharedLayout; private LinearLayout addDeckLayout; + private LinearLayout addNoteLayout; private View fabBGLayout; private boolean mIsFABOpen = false; @@ -635,32 +635,29 @@ private boolean firstCollectionOpen() { return false; } } - - private void showFloatingActionMenu() { + private void showFloatingActionMenu() { mIsFABOpen = true; addNoteLayout.setVisibility(View.VISIBLE); addSharedLayout.setVisibility(View.VISIBLE); addDeckLayout.setVisibility(View.VISIBLE); fabBGLayout.setVisibility(View.VISIBLE); - // get preference of animation from AnkiActivity - if(animationEnabled()) { - fabMain.animate().rotationBy(140); - } - addNoteLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); - addSharedLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_100)); - addDeckLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_145)); + if (animationEnabled()) { + fabMain.animate().rotationBy(140); + } + addNoteLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); + addSharedLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_100)); + addDeckLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_145)); } private void closeFloatingActionMenu() { mIsFABOpen = false; fabBGLayout.setVisibility(View.GONE); - if(animationEnabled()) { - fabMain.animate().rotation(0); - } + if (animationEnabled()) { + fabMain.animate().rotation(0); + } addNoteLayout.animate().translationY(0); addSharedLayout.animate().translationY(0); - addDeckLayout.animate().translationY(0); addDeckLayout.animate().translationY(0).setListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animator) { } @@ -682,7 +679,7 @@ public void onAnimationRepeat(Animator animator) { } } private void configureFloatingActionsMenu() { - addNoteLayout = (LinearLayout)findViewById(R.id.add_note_layout); + addNoteLayout = (LinearLayout)findViewById(R.id.add_note_layout); addSharedLayout = (LinearLayout)findViewById(R.id.add_shared_layout); addDeckLayout = (LinearLayout)findViewById(R.id.add_deck_layout); fabMain = (FloatingActionButton)findViewById(R.id.fab_main); @@ -708,8 +705,8 @@ public void onClick(View view) { closeFloatingActionMenu(); } }); - - addDeckButton.setOnClickListener(view -> { + + addDeckButton.setOnClickListener(view -> { if (mIsFABOpen) { closeFloatingActionMenu(); mDialogEditText = new FixedEditText(DeckPicker.this); @@ -732,21 +729,21 @@ public void onClick(View view) { }) .negativeText(R.string.dialog_cancel) .show(); - } - }); - - addSharedButton.setOnClickListener(view -> { - Timber.i("Adding Shared Deck"); - closeFloatingActionMenu(); - addSharedDeck(); - }); - - addNoteButton.setOnClickListener(view -> { - Timber.i("Adding Note"); - closeFloatingActionMenu(); - addNote(); - }); - } + } + }); + + addSharedButton.setOnClickListener(view -> { + Timber.i("Adding Shared Deck"); + closeFloatingActionMenu(); + addSharedDeck(); + }); + + addNoteButton.setOnClickListener(view -> { + Timber.i("Adding Note"); + closeFloatingActionMenu(); + addNote(); + }); + } /** @@ -1093,7 +1090,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); savedInstanceState.putLong("mContextMenuDid", mContextMenuDid); savedInstanceState.putBoolean("mClosedWelcomeMessage", mClosedWelcomeMessage); - savedInstanceState.putBoolean("mIsFABOpen", mIsFABOpen); + savedInstanceState.putBoolean("mIsFABOpen", mIsFABOpen); } @@ -1101,7 +1098,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); mContextMenuDid = savedInstanceState.getLong("mContextMenuDid"); - mIsFABOpen = savedInstanceState.getBoolean("mIsFABOpen"); + mIsFABOpen = savedInstanceState.getBoolean("mIsFABOpen"); } diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index d07850a5a067..21022d72d97f 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -17,12 +17,13 @@ android:id="@+id/add_note_layout" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginRight="@dimen/standard_23" - android:padding="@dimen/standard_12" + android:layout_marginRight="23dp" + android:padding="12dp" android:clipToPadding="false" android:gravity="center_vertical" - android:layout_marginBottom="@dimen/standard_23" + android:layout_marginBottom="23dp" android:layout_gravity="bottom|end" + android:orientation="horizontal" android:visibility="gone"> Date: Sun, 21 Mar 2021 15:53:31 +0530 Subject: [PATCH 04/22] spaces fixes --- .../src/main/java/com/ichi2/anki/DeckPicker.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index 40304f1f9dfc..df80e77b0f0d 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -202,13 +202,13 @@ public class DeckPicker extends NavigationDrawerActivity implements private LinearLayoutManager mRecyclerViewLayoutManager; private DeckAdapter mDeckListAdapter; - private FloatingActionButton addDeckButton; - private FloatingActionButton addNoteButton; - private FloatingActionButton addSharedButton; - private FloatingActionButton fabMain; - private LinearLayout addSharedLayout; - private LinearLayout addDeckLayout; - private LinearLayout addNoteLayout; + private FloatingActionButton addDeckButton; + private FloatingActionButton addNoteButton; + private FloatingActionButton addSharedButton; + private FloatingActionButton fabMain; + private LinearLayout addSharedLayout; + private LinearLayout addDeckLayout; + private LinearLayout addNoteLayout; private View fabBGLayout; private boolean mIsFABOpen = false; @@ -3100,4 +3100,4 @@ private enum DeckSelectionType { /** Always open reviewer (keyboard shortcut) */ SKIP_STUDY_OPTIONS } -} \ No newline at end of file +} From dc5d5c0dcaa58d8e165bf28601b92405a836a613 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 22 Mar 2021 09:15:51 +0530 Subject: [PATCH 05/22] Fabs with animation and without animation --- .../main/java/com/ichi2/anki/DeckPicker.java | 66 ++++--- .../main/res/layout/floating_add_button.xml | 169 +++++++++--------- AnkiDroid/src/main/res/values/dimens.xml | 12 +- 3 files changed, 131 insertions(+), 116 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index df80e77b0f0d..d7441bedc310 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -638,44 +638,58 @@ private boolean firstCollectionOpen() { private void showFloatingActionMenu() { mIsFABOpen = true; - addNoteLayout.setVisibility(View.VISIBLE); - addSharedLayout.setVisibility(View.VISIBLE); - addDeckLayout.setVisibility(View.VISIBLE); - fabBGLayout.setVisibility(View.VISIBLE); if (animationEnabled()) { + // Show with animation + addNoteLayout.setVisibility(View.VISIBLE); + addSharedLayout.setVisibility(View.VISIBLE); + addDeckLayout.setVisibility(View.VISIBLE); + fabBGLayout.setVisibility(View.VISIBLE); fabMain.animate().rotationBy(140); + addNoteLayout.animate().translationY(0); + addSharedLayout.animate().translationY(0); + addDeckLayout.animate().translationY(0); + } else { + // Show without animation + addNoteLayout.setVisibility(View.VISIBLE); + addSharedLayout.setVisibility(View.VISIBLE); + addDeckLayout.setVisibility(View.VISIBLE); + fabBGLayout.setVisibility(View.VISIBLE); } - addNoteLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_55)); - addSharedLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_100)); - addDeckLayout.animate().translationY(-getResources().getDimension(R.dimen.standard_145)); } private void closeFloatingActionMenu() { mIsFABOpen = false; fabBGLayout.setVisibility(View.GONE); if (animationEnabled()) { + // Close with animation fabMain.animate().rotation(0); - } - addNoteLayout.animate().translationY(0); - addSharedLayout.animate().translationY(0); - addDeckLayout.animate().translationY(0).setListener(new Animator.AnimatorListener() { - @Override - public void onAnimationStart(Animator animator) { } - @Override - public void onAnimationEnd(Animator animator) { - if (!mIsFABOpen) { - addNoteLayout.setVisibility(View.GONE); - addSharedLayout.setVisibility(View.GONE); - addDeckLayout.setVisibility(View.GONE); + addDeckLayout.animate().translationY(getResources().getDimension(R.dimen.standard_60)); + addSharedLayout.animate().translationY(getResources().getDimension(R.dimen.standard_110)); + addNoteLayout.animate().translationY(getResources().getDimension(R.dimen.standard_160)).setListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animator) { } + + @Override + public void onAnimationEnd(Animator animator) { + if (!mIsFABOpen) { + addNoteLayout.setVisibility(View.GONE); + addSharedLayout.setVisibility(View.GONE); + addDeckLayout.setVisibility(View.GONE); + } } - } - @Override - public void onAnimationCancel(Animator animator) { } + @Override + public void onAnimationCancel(Animator animator) { } - @Override - public void onAnimationRepeat(Animator animator) { } - }); + @Override + public void onAnimationRepeat(Animator animator) { } + }); + } else { + // Close without animation + addNoteLayout.setVisibility(View.GONE); + addSharedLayout.setVisibility(View.GONE); + addDeckLayout.setVisibility(View.GONE); + } } private void configureFloatingActionsMenu() { @@ -687,7 +701,7 @@ private void configureFloatingActionsMenu() { addSharedButton = (FloatingActionButton)findViewById(R.id.add_shared_action); addDeckButton = (FloatingActionButton)findViewById(R.id.add_deck_action); fabBGLayout = findViewById(R.id.fabBGLayout); - + fabMain.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index 21022d72d97f..1b15df785714 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -13,104 +13,111 @@ android:layout_height="match_parent" android:background="@color/transparent" android:visibility="gone"/> - - - - - - + + - + android:padding="5dp" + android:clipToPadding="false" + android:gravity="center_vertical" + android:layout_marginBottom="23dp" + android:layout_gravity="bottom|end" + android:orientation="horizontal" + android:visibility="gone"> + + + - - - + + + + + - + android:padding="5dp" + android:clipToPadding="false" + android:gravity="center_vertical" + android:layout_marginBottom="23dp" + android:orientation="horizontal" + android:layout_gravity="bottom|end" + android:visibility="gone"> + + + - - + android:clipToPadding="false" + android:orientation="horizontal" + android:layout_gravity="bottom|end"> + + + + \ No newline at end of file diff --git a/AnkiDroid/src/main/res/values/dimens.xml b/AnkiDroid/src/main/res/values/dimens.xml index bc7631492974..aaf65c2a3acd 100644 --- a/AnkiDroid/src/main/res/values/dimens.xml +++ b/AnkiDroid/src/main/res/values/dimens.xml @@ -30,14 +30,8 @@ 28dp - 16dp - 16dp - 16dp - - 12dp - 23dp - 60dp - 110dp - 160dp + 60dp + 110dp + 160dp \ No newline at end of file From 87136f69f992e8f908b52f4e7a07e733bf017de9 Mon Sep 17 00:00:00 2001 From: Akshay Vilas Jadhav <52353967+Akshay0701@users.noreply.github.com> Date: Mon, 22 Mar 2021 09:28:52 +0530 Subject: [PATCH 06/22] spaces --- AnkiDroid/src/main/res/layout/floating_add_button.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index 1b15df785714..f52d5dcedaed 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -119,5 +119,4 @@ - - \ No newline at end of file + From 1c10aacc6cbff91851c2681f0608c47a598d4d64 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 27 Mar 2021 15:46:31 +0530 Subject: [PATCH 07/22] layout fixes --- .../main/java/com/ichi2/anki/DeckPicker.java | 18 ++- .../main/res/layout/floating_add_button.xml | 107 ++++++++++++------ 2 files changed, 83 insertions(+), 42 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index d7441bedc310..22ef6c4d7d3e 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -645,9 +645,12 @@ private void showFloatingActionMenu() { addDeckLayout.setVisibility(View.VISIBLE); fabBGLayout.setVisibility(View.VISIBLE); fabMain.animate().rotationBy(140); - addNoteLayout.animate().translationY(0); - addSharedLayout.animate().translationY(0); - addDeckLayout.animate().translationY(0); + addNoteLayout.animate().translationY(0).setDuration(70); + addSharedLayout.animate().translationY(0).setDuration(150); + addDeckLayout.animate().translationY(0).setDuration(300); + addDeckLayout.animate().alpha(1f).setDuration(300); + addSharedLayout.animate().alpha(1f).setDuration(150); + addNoteLayout.animate().alpha(1f).setDuration(70); } else { // Show without animation addNoteLayout.setVisibility(View.VISIBLE); @@ -663,9 +666,12 @@ private void closeFloatingActionMenu() { if (animationEnabled()) { // Close with animation fabMain.animate().rotation(0); - addDeckLayout.animate().translationY(getResources().getDimension(R.dimen.standard_60)); - addSharedLayout.animate().translationY(getResources().getDimension(R.dimen.standard_110)); - addNoteLayout.animate().translationY(getResources().getDimension(R.dimen.standard_160)).setListener(new Animator.AnimatorListener() { + addNoteLayout.animate().translationY(getResources().getDimension(R.dimen.standard_60)).setDuration(70); + addSharedLayout.animate().translationY(getResources().getDimension(R.dimen.standard_110)).setDuration(150); + addDeckLayout.animate().alpha(0f).setDuration(300); + addSharedLayout.animate().alpha(0f).setDuration(150); + addNoteLayout.animate().alpha(0f).setDuration(70); + addDeckLayout.animate().translationY(getResources().getDimension(R.dimen.standard_160)).setDuration(300).setListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animator) { } diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index f52d5dcedaed..d79ed5e5c00c 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -5,47 +5,59 @@ android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="com.ichi2.anki.widgets.FabBehavior" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + > + android:visibility="gone" + /> + android:layout_height="wrap_content" + > + android:layout_gravity="bottom|end" + android:visibility="gone" + > + android:text="@string/new_deck" + /> + android:layout_margin="10dp" + app:fab_colorNormal="?attr/fab_normal" + app:fab_colorPressed="?attr/fab_pressed" + android:src="@drawable/ic_folder_white" + app:fabSize="mini" + /> + android:visibility="gone" + > + android:text="@string/menu_get_shared_decks" + /> + app:fabSize="mini" + /> + android:orientation="horizontal" + android:visibility="gone" + > + android:text="@string/menu_add_note" + /> + android:layout_margin="10dp" + app:fab_colorNormal="?attr/fab_normal" + app:fab_colorPressed="?attr/fab_pressed" + android:src="@drawable/ic_add_white" + app:fabSize="mini" + /> + android:layout_gravity="bottom|end" > + app:fab_colorNormal="?attr/fab_normal" + app:fab_colorPressed="?attr/fab_pressed" + app:fabSize="normal" + /> From 3190bc24d147b5c37e294a75047dc97c076f61fd Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 27 Mar 2021 18:51:36 +0530 Subject: [PATCH 08/22] Created FloatingActionMenu Class --- .../main/java/com/ichi2/anki/DeckPicker.java | 140 +------------ .../com/ichi2/anki/FloatingActionMenu.java | 187 ++++++++++++++++++ AnkiDroid/src/main/res/values/dimens.xml | 5 - 3 files changed, 193 insertions(+), 139 deletions(-) create mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index 22ef6c4d7d3e..d30ef71feea8 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -226,6 +226,8 @@ public class DeckPicker extends NavigationDrawerActivity implements private EditText mDialogEditText; + private FloatingActionMenu mFloatingActionMenu; + // flag asking user to do a full sync which is used in upgrade path private boolean mRecommendFullSync = false; @@ -280,7 +282,7 @@ private void onDeckClick(View v, DeckSelectionType selectionType) { long deckId = (long) v.getTag(); Timber.i("DeckPicker:: Selected deck with id %d", deckId); if (mIsFABOpen) { - closeFloatingActionMenu(); + mFloatingActionMenu.closeFloatingActionMenu(); } boolean collectionIsOpen = false; @@ -526,7 +528,7 @@ protected void onCreate(Bundle savedInstanceState) throws SQLException { mPullToSyncWrapper.setEnabled(mRecyclerViewLayoutManager.findFirstCompletelyVisibleItemPosition() == 0)); // Setup the FloatingActionButtons, should work everywhere with min API >= 15 - configureFloatingActionsMenu(); + mFloatingActionMenu = new FloatingActionMenu(this,view,this); mReviewSummaryTextView = findViewById(R.id.today_stats_text_view); @@ -636,136 +638,6 @@ private boolean firstCollectionOpen() { } } - private void showFloatingActionMenu() { - mIsFABOpen = true; - if (animationEnabled()) { - // Show with animation - addNoteLayout.setVisibility(View.VISIBLE); - addSharedLayout.setVisibility(View.VISIBLE); - addDeckLayout.setVisibility(View.VISIBLE); - fabBGLayout.setVisibility(View.VISIBLE); - fabMain.animate().rotationBy(140); - addNoteLayout.animate().translationY(0).setDuration(70); - addSharedLayout.animate().translationY(0).setDuration(150); - addDeckLayout.animate().translationY(0).setDuration(300); - addDeckLayout.animate().alpha(1f).setDuration(300); - addSharedLayout.animate().alpha(1f).setDuration(150); - addNoteLayout.animate().alpha(1f).setDuration(70); - } else { - // Show without animation - addNoteLayout.setVisibility(View.VISIBLE); - addSharedLayout.setVisibility(View.VISIBLE); - addDeckLayout.setVisibility(View.VISIBLE); - fabBGLayout.setVisibility(View.VISIBLE); - } - } - - private void closeFloatingActionMenu() { - mIsFABOpen = false; - fabBGLayout.setVisibility(View.GONE); - if (animationEnabled()) { - // Close with animation - fabMain.animate().rotation(0); - addNoteLayout.animate().translationY(getResources().getDimension(R.dimen.standard_60)).setDuration(70); - addSharedLayout.animate().translationY(getResources().getDimension(R.dimen.standard_110)).setDuration(150); - addDeckLayout.animate().alpha(0f).setDuration(300); - addSharedLayout.animate().alpha(0f).setDuration(150); - addNoteLayout.animate().alpha(0f).setDuration(70); - addDeckLayout.animate().translationY(getResources().getDimension(R.dimen.standard_160)).setDuration(300).setListener(new Animator.AnimatorListener() { - @Override - public void onAnimationStart(Animator animator) { } - - @Override - public void onAnimationEnd(Animator animator) { - if (!mIsFABOpen) { - addNoteLayout.setVisibility(View.GONE); - addSharedLayout.setVisibility(View.GONE); - addDeckLayout.setVisibility(View.GONE); - } - } - - @Override - public void onAnimationCancel(Animator animator) { } - - @Override - public void onAnimationRepeat(Animator animator) { } - }); - } else { - // Close without animation - addNoteLayout.setVisibility(View.GONE); - addSharedLayout.setVisibility(View.GONE); - addDeckLayout.setVisibility(View.GONE); - } - } - - private void configureFloatingActionsMenu() { - addNoteLayout = (LinearLayout)findViewById(R.id.add_note_layout); - addSharedLayout = (LinearLayout)findViewById(R.id.add_shared_layout); - addDeckLayout = (LinearLayout)findViewById(R.id.add_deck_layout); - fabMain = (FloatingActionButton)findViewById(R.id.fab_main); - addNoteButton = (FloatingActionButton)findViewById(R.id.add_note_action); - addSharedButton = (FloatingActionButton)findViewById(R.id.add_shared_action); - addDeckButton = (FloatingActionButton)findViewById(R.id.add_deck_action); - fabBGLayout = findViewById(R.id.fabBGLayout); - - fabMain.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (!mIsFABOpen) { - showFloatingActionMenu(); - } else { - closeFloatingActionMenu(); - } - } - }); - - fabBGLayout.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - closeFloatingActionMenu(); - } - }); - - addDeckButton.setOnClickListener(view -> { - if (mIsFABOpen) { - closeFloatingActionMenu(); - mDialogEditText = new FixedEditText(DeckPicker.this); - mDialogEditText.setSingleLine(true); - new MaterialDialog.Builder(DeckPicker.this) - .title(R.string.new_deck) - .positiveText(R.string.dialog_ok) - .customView(mDialogEditText, true) - .onPositive((dialog, which) -> { - String deckName = mDialogEditText.getText().toString(); - if (Decks.isValidDeckName(deckName)) { - boolean creation_succeed = createNewDeck(deckName); - if (!creation_succeed) { - return; - } - } else { - Timber.i("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); - UIUtils.showThemedToast(this, getString(R.string.invalid_deck_name), false); - } - }) - .negativeText(R.string.dialog_cancel) - .show(); - } - }); - - addSharedButton.setOnClickListener(view -> { - Timber.i("Adding Shared Deck"); - closeFloatingActionMenu(); - addSharedDeck(); - }); - - addNoteButton.setOnClickListener(view -> { - Timber.i("Adding Note"); - closeFloatingActionMenu(); - addNote(); - }); - } - - /** * It can fail if an ancestor is a filtered deck. * @param deckName Create a deck with this name. @@ -1176,7 +1048,7 @@ public void onBackPressed() { } else { Timber.i("Back key pressed"); if (mIsFABOpen) { - closeFloatingActionMenu(); + mFloatingActionMenu.closeFloatingActionMenu(); } else { automaticSync(); finishWithAnimation(); @@ -2515,7 +2387,7 @@ public void actualOnPostExecute(@NonNull DeckPicker deckPicker, List dueTree) * * This method also triggers an update for the widget to reflect the newly calculated counts. */ - private void updateDeckList() { + protected void updateDeckList() { updateDeckList(false); } diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java new file mode 100644 index 000000000000..b490bb4bdf62 --- /dev/null +++ b/AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java @@ -0,0 +1,187 @@ +package com.ichi2.anki; + +import android.animation.Animator; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.view.View; +import android.widget.EditText; +import android.widget.LinearLayout; + +import com.afollestad.materialdialogs.MaterialDialog; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.ichi2.anki.exception.FilteredAncestor; +import com.ichi2.libanki.Deck; +import com.ichi2.libanki.Decks; +import com.ichi2.ui.FixedEditText; + +import timber.log.Timber; + +import static com.ichi2.anim.ActivityTransitionAnimation.Direction.LEFT; + +public class FloatingActionMenu { + + private FloatingActionButton addDeckButton,addNoteButton,addSharedButton,fabMain; + private LinearLayout addNoteLayout, addSharedLayout, addDeckLayout; + private View fabBGLayout; + private boolean mIsFABOpen = false; + + private Context mContext; + private AnkiActivity ankiActivity; + private DeckPicker deckPicker; + + public FloatingActionMenu(Context mContext, View mView, DeckPicker deckPicker) { + this.mContext = mContext; + this.ankiActivity = new AnkiActivity(); + this.deckPicker = deckPicker; + addNoteLayout = (LinearLayout)mView.findViewById(R.id.add_note_layout); + addSharedLayout = (LinearLayout)mView.findViewById(R.id.add_shared_layout); + addDeckLayout = (LinearLayout)mView.findViewById(R.id.add_deck_layout); + fabMain = (FloatingActionButton)mView.findViewById(R.id.fab_main); + addNoteButton = (FloatingActionButton)mView.findViewById(R.id.add_note_action); + addSharedButton = (FloatingActionButton)mView.findViewById(R.id.add_shared_action); + addDeckButton = (FloatingActionButton)mView.findViewById(R.id.add_deck_action); + fabBGLayout = mView.findViewById(R.id.fabBGLayout); + + fabMain.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (!mIsFABOpen) { + showFloatingActionMenu(); + } else { + closeFloatingActionMenu(); + } + } + }); + + fabBGLayout.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + closeFloatingActionMenu(); + } + }); + + addDeckButton.setOnClickListener(view -> { + if (mIsFABOpen) { + closeFloatingActionMenu(); + EditText mDialogEditText = new FixedEditText(mContext); + mDialogEditText.setSingleLine(true); + new MaterialDialog.Builder(mContext) + .title(R.string.new_deck) + .positiveText(R.string.dialog_ok) + .customView(mDialogEditText, true) + .onPositive((dialog, which) -> { + String deckName = mDialogEditText.getText().toString(); + if (Decks.isValidDeckName(deckName)) { + boolean creation_succeed = createNewDeck(deckName); + if (!creation_succeed) { + return; + } + } else { + Timber.i("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); + UIUtils.showThemedToast(mContext, mContext.getString(R.string.invalid_deck_name), false); + } + }) + .negativeText(R.string.dialog_cancel) + .show(); + } + }); + + addSharedButton.setOnClickListener(view -> { + Timber.i("Adding Shared Deck"); + closeFloatingActionMenu(); + deckPicker.addSharedDeck(); + }); + + addNoteButton.setOnClickListener(view -> { + Timber.i("Adding Note"); + closeFloatingActionMenu(); + deckPicker.addNote(); + }); + } + + + /** + * It can fail if an ancestor is a filtered deck. + * @param deckName Create a deck with this name. + * @return Whether creation succeeded. + */ + private boolean createNewDeck(String deckName) { + Timber.i("DeckPicker:: Creating new deck..."); + try { + ankiActivity.getCol().getDecks().id(deckName); + } catch (FilteredAncestor filteredAncestor) { + UIUtils.showThemedToast(mContext, mContext.getString(R.string.decks_rename_filtered_nosubdecks), false); + return false; + } + deckPicker.updateDeckList(); + return true; + } + + private boolean animationDisabled(){ + SharedPreferences preferences = AnkiDroidApp.getSharedPrefs(mContext); + return preferences.getBoolean("safeDisplay", false); + } + + private void showFloatingActionMenu() { + mIsFABOpen = true; + if (!animationDisabled()) { + // Show with animation + addNoteLayout.setVisibility(View.VISIBLE); + addSharedLayout.setVisibility(View.VISIBLE); + addDeckLayout.setVisibility(View.VISIBLE); + fabBGLayout.setVisibility(View.VISIBLE); + fabMain.animate().rotationBy(140); + addNoteLayout.animate().translationY(0).setDuration(30); + addSharedLayout.animate().translationY(0).setDuration(50); + addDeckLayout.animate().translationY(0).setDuration(100); + addDeckLayout.animate().alpha(1f).setDuration(100); + addSharedLayout.animate().alpha(1f).setDuration(50); + addNoteLayout.animate().alpha(1f).setDuration(30); + } else { + // Show without animation + addNoteLayout.setVisibility(View.VISIBLE); + addSharedLayout.setVisibility(View.VISIBLE); + addDeckLayout.setVisibility(View.VISIBLE); + fabBGLayout.setVisibility(View.VISIBLE); + } + } + + protected void closeFloatingActionMenu() { + mIsFABOpen = false; + fabBGLayout.setVisibility(View.GONE); + if (!animationDisabled()) { + // Close with animation + fabMain.animate().rotation(0); + addNoteLayout.animate().translationY(200f).setDuration(30); + addSharedLayout.animate().translationY(400f).setDuration(50); + addDeckLayout.animate().alpha(0f).setDuration(100); + addSharedLayout.animate().alpha(0f).setDuration(50); + addNoteLayout.animate().alpha(0f).setDuration(30); + addDeckLayout.animate().translationY(600f).setDuration(100).setListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animator) { } + + @Override + public void onAnimationEnd(Animator animator) { + if (!mIsFABOpen) { + addNoteLayout.setVisibility(View.GONE); + addSharedLayout.setVisibility(View.GONE); + addDeckLayout.setVisibility(View.GONE); + } + } + + @Override + public void onAnimationCancel(Animator animator) { } + + @Override + public void onAnimationRepeat(Animator animator) { } + }); + } else { + // Close without animation + addNoteLayout.setVisibility(View.GONE); + addSharedLayout.setVisibility(View.GONE); + addDeckLayout.setVisibility(View.GONE); + } + } +} diff --git a/AnkiDroid/src/main/res/values/dimens.xml b/AnkiDroid/src/main/res/values/dimens.xml index aaf65c2a3acd..eefec27f5117 100644 --- a/AnkiDroid/src/main/res/values/dimens.xml +++ b/AnkiDroid/src/main/res/values/dimens.xml @@ -29,9 +29,4 @@ 4dp 28dp - - 60dp - 110dp - 160dp - \ No newline at end of file From 5caa1823cce3682b7a47b6c5fbbbd2788e5d0d71 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 27 Mar 2021 22:59:19 +0530 Subject: [PATCH 09/22] names fixes --- .../main/java/com/ichi2/anki/DeckPicker.java | 6 +- ...java => DeckPickerFloatingActionMenu.java} | 64 ++++++------------- 2 files changed, 24 insertions(+), 46 deletions(-) rename AnkiDroid/src/main/java/com/ichi2/anki/{FloatingActionMenu.java => DeckPickerFloatingActionMenu.java} (72%) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index d30ef71feea8..46c35208d85f 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -226,7 +226,7 @@ public class DeckPicker extends NavigationDrawerActivity implements private EditText mDialogEditText; - private FloatingActionMenu mFloatingActionMenu; + private DeckPickerFloatingActionMenu mFloatingActionMenu; // flag asking user to do a full sync which is used in upgrade path private boolean mRecommendFullSync = false; @@ -528,7 +528,7 @@ protected void onCreate(Bundle savedInstanceState) throws SQLException { mPullToSyncWrapper.setEnabled(mRecyclerViewLayoutManager.findFirstCompletelyVisibleItemPosition() == 0)); // Setup the FloatingActionButtons, should work everywhere with min API >= 15 - mFloatingActionMenu = new FloatingActionMenu(this,view,this); + mFloatingActionMenu = new DeckPickerFloatingActionMenu(view,this); mReviewSummaryTextView = findViewById(R.id.today_stats_text_view); @@ -643,7 +643,7 @@ private boolean firstCollectionOpen() { * @param deckName Create a deck with this name. * @return Whether creation succeeded. */ - private boolean createNewDeck(String deckName) { + protected boolean createNewDeck(String deckName) { Timber.i("DeckPicker:: Creating new deck..."); try { getCol().getDecks().id(deckName); diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java similarity index 72% rename from AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java rename to AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index b490bb4bdf62..4b5f125b4740 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/FloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -19,29 +19,25 @@ import static com.ichi2.anim.ActivityTransitionAnimation.Direction.LEFT; -public class FloatingActionMenu { +public class DeckPickerFloatingActionMenu { private FloatingActionButton addDeckButton,addNoteButton,addSharedButton,fabMain; private LinearLayout addNoteLayout, addSharedLayout, addDeckLayout; private View fabBGLayout; private boolean mIsFABOpen = false; - private Context mContext; - private AnkiActivity ankiActivity; - private DeckPicker deckPicker; - - public FloatingActionMenu(Context mContext, View mView, DeckPicker deckPicker) { - this.mContext = mContext; - this.ankiActivity = new AnkiActivity(); - this.deckPicker = deckPicker; - addNoteLayout = (LinearLayout)mView.findViewById(R.id.add_note_layout); - addSharedLayout = (LinearLayout)mView.findViewById(R.id.add_shared_layout); - addDeckLayout = (LinearLayout)mView.findViewById(R.id.add_deck_layout); - fabMain = (FloatingActionButton)mView.findViewById(R.id.fab_main); - addNoteButton = (FloatingActionButton)mView.findViewById(R.id.add_note_action); - addSharedButton = (FloatingActionButton)mView.findViewById(R.id.add_shared_action); - addDeckButton = (FloatingActionButton)mView.findViewById(R.id.add_deck_action); - fabBGLayout = mView.findViewById(R.id.fabBGLayout); + private DeckPicker mDeckPicker; + + public DeckPickerFloatingActionMenu(View view, DeckPicker deckPicker) { + this.mDeckPicker = deckPicker; + addNoteLayout = (LinearLayout)view.findViewById(R.id.add_note_layout); + addSharedLayout = (LinearLayout)view.findViewById(R.id.add_shared_layout); + addDeckLayout = (LinearLayout)view.findViewById(R.id.add_deck_layout); + fabMain = (FloatingActionButton)view.findViewById(R.id.fab_main); + addNoteButton = (FloatingActionButton)view.findViewById(R.id.add_note_action); + addSharedButton = (FloatingActionButton)view.findViewById(R.id.add_shared_action); + addDeckButton = (FloatingActionButton)view.findViewById(R.id.add_deck_action); + fabBGLayout = view.findViewById(R.id.fabBGLayout); fabMain.setOnClickListener(new View.OnClickListener() { @Override @@ -61,25 +57,25 @@ public void onClick(View view) { } }); - addDeckButton.setOnClickListener(view -> { + addDeckButton.setOnClickListener(addDeckButtonView -> { if (mIsFABOpen) { closeFloatingActionMenu(); - EditText mDialogEditText = new FixedEditText(mContext); + EditText mDialogEditText = new FixedEditText(mDeckPicker); mDialogEditText.setSingleLine(true); - new MaterialDialog.Builder(mContext) + new MaterialDialog.Builder(mDeckPicker) .title(R.string.new_deck) .positiveText(R.string.dialog_ok) .customView(mDialogEditText, true) .onPositive((dialog, which) -> { String deckName = mDialogEditText.getText().toString(); if (Decks.isValidDeckName(deckName)) { - boolean creation_succeed = createNewDeck(deckName); + boolean creation_succeed = deckPicker.createNewDeck(deckName); if (!creation_succeed) { return; } } else { Timber.i("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); - UIUtils.showThemedToast(mContext, mContext.getString(R.string.invalid_deck_name), false); + UIUtils.showThemedToast(mDeckPicker, mDeckPicker.getString(R.string.invalid_deck_name), false); } }) .negativeText(R.string.dialog_cancel) @@ -87,39 +83,21 @@ public void onClick(View view) { } }); - addSharedButton.setOnClickListener(view -> { + addSharedButton.setOnClickListener(addSharedButtonView -> { Timber.i("Adding Shared Deck"); closeFloatingActionMenu(); deckPicker.addSharedDeck(); }); - addNoteButton.setOnClickListener(view -> { + addNoteButton.setOnClickListener(addNoteButtonView -> { Timber.i("Adding Note"); closeFloatingActionMenu(); deckPicker.addNote(); }); } - - /** - * It can fail if an ancestor is a filtered deck. - * @param deckName Create a deck with this name. - * @return Whether creation succeeded. - */ - private boolean createNewDeck(String deckName) { - Timber.i("DeckPicker:: Creating new deck..."); - try { - ankiActivity.getCol().getDecks().id(deckName); - } catch (FilteredAncestor filteredAncestor) { - UIUtils.showThemedToast(mContext, mContext.getString(R.string.decks_rename_filtered_nosubdecks), false); - return false; - } - deckPicker.updateDeckList(); - return true; - } - private boolean animationDisabled(){ - SharedPreferences preferences = AnkiDroidApp.getSharedPrefs(mContext); + SharedPreferences preferences = AnkiDroidApp.getSharedPrefs(mDeckPicker); return preferences.getBoolean("safeDisplay", false); } From 9443efe5ec07cca0280e4b4857b13c12389d826b Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 27 Mar 2021 23:33:37 +0530 Subject: [PATCH 10/22] color fixes --- .../src/main/res/layout/floating_add_button.xml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/AnkiDroid/src/main/res/layout/floating_add_button.xml b/AnkiDroid/src/main/res/layout/floating_add_button.xml index d79ed5e5c00c..dec109616731 100644 --- a/AnkiDroid/src/main/res/layout/floating_add_button.xml +++ b/AnkiDroid/src/main/res/layout/floating_add_button.xml @@ -53,8 +53,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" - app:fab_colorNormal="?attr/fab_normal" - app:fab_colorPressed="?attr/fab_pressed" + app:backgroundTint="?attr/fab_normal" android:src="@drawable/ic_folder_white" app:fabSize="mini" /> @@ -88,8 +87,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" - app:fab_colorNormal="?attr/fab_normal" - app:fab_colorPressed="?attr/fab_pressed" + app:backgroundTint="?attr/fab_normal" android:src="@drawable/ic_file_download_white" app:fabSize="mini" /> @@ -123,8 +121,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" - app:fab_colorNormal="?attr/fab_normal" - app:fab_colorPressed="?attr/fab_pressed" + app:backgroundTint="?attr/fab_normal" android:src="@drawable/ic_add_white" app:fabSize="mini" /> @@ -146,8 +143,7 @@ android:layout_marginBottom="17dp" android:gravity="center_vertical" app:srcCompat="@drawable/ic_add_white" - app:fab_colorNormal="?attr/fab_normal" - app:fab_colorPressed="?attr/fab_pressed" + app:backgroundTint="?attr/fab_normal" app:fabSize="normal" /> From a197600dcb3e126dd319da38ff337f2435d2bb02 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 28 Mar 2021 11:14:40 +0530 Subject: [PATCH 11/22] names fixes --- .../main/java/com/ichi2/anki/DeckPicker.java | 18 +-- .../anki/DeckPickerFloatingActionMenu.java | 105 +++++++++--------- AnkiDroid/src/main/res/values/dimens.xml | 1 - 3 files changed, 56 insertions(+), 68 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index 46c35208d85f..49ab3b42aaef 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -202,16 +202,6 @@ public class DeckPicker extends NavigationDrawerActivity implements private LinearLayoutManager mRecyclerViewLayoutManager; private DeckAdapter mDeckListAdapter; - private FloatingActionButton addDeckButton; - private FloatingActionButton addNoteButton; - private FloatingActionButton addSharedButton; - private FloatingActionButton fabMain; - private LinearLayout addSharedLayout; - private LinearLayout addDeckLayout; - private LinearLayout addNoteLayout; - private View fabBGLayout; - private boolean mIsFABOpen = false; - private final Snackbar.Callback mSnackbarShowHideCallback = new Snackbar.Callback(); private LinearLayout mNoDecksPlaceholder; @@ -281,7 +271,7 @@ public class DeckPicker extends NavigationDrawerActivity implements private void onDeckClick(View v, DeckSelectionType selectionType) { long deckId = (long) v.getTag(); Timber.i("DeckPicker:: Selected deck with id %d", deckId); - if (mIsFABOpen) { + if (mFloatingActionMenu.mIsFABOpen) { mFloatingActionMenu.closeFloatingActionMenu(); } @@ -982,7 +972,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); savedInstanceState.putLong("mContextMenuDid", mContextMenuDid); savedInstanceState.putBoolean("mClosedWelcomeMessage", mClosedWelcomeMessage); - savedInstanceState.putBoolean("mIsFABOpen", mIsFABOpen); + savedInstanceState.putBoolean("mIsFABOpen", mFloatingActionMenu.mIsFABOpen); } @@ -990,7 +980,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); mContextMenuDid = savedInstanceState.getLong("mContextMenuDid"); - mIsFABOpen = savedInstanceState.getBoolean("mIsFABOpen"); + mFloatingActionMenu.mIsFABOpen = savedInstanceState.getBoolean("mIsFABOpen"); } @@ -1047,7 +1037,7 @@ public void onBackPressed() { super.onBackPressed(); } else { Timber.i("Back key pressed"); - if (mIsFABOpen) { + if (mFloatingActionMenu.mIsFABOpen) { mFloatingActionMenu.closeFloatingActionMenu(); } else { automaticSync(); diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index 4b5f125b4740..fdba10646e4a 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -1,8 +1,6 @@ package com.ichi2.anki; import android.animation.Animator; -import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.view.View; import android.widget.EditText; @@ -10,36 +8,37 @@ import com.afollestad.materialdialogs.MaterialDialog; import com.google.android.material.floatingactionbutton.FloatingActionButton; -import com.ichi2.anki.exception.FilteredAncestor; -import com.ichi2.libanki.Deck; import com.ichi2.libanki.Decks; import com.ichi2.ui.FixedEditText; import timber.log.Timber; -import static com.ichi2.anim.ActivityTransitionAnimation.Direction.LEFT; - public class DeckPickerFloatingActionMenu { - private FloatingActionButton addDeckButton,addNoteButton,addSharedButton,fabMain; - private LinearLayout addNoteLayout, addSharedLayout, addDeckLayout; - private View fabBGLayout; - private boolean mIsFABOpen = false; + private FloatingActionButton mAddDeckButton; + private FloatingActionButton mAddNoteButton; + private FloatingActionButton mAddSharedButton; + private FloatingActionButton mFabMain; + private LinearLayout mAddSharedLayout; + private LinearLayout mAddDeckLayout; + private LinearLayout mAddNoteLayout; + private View mFabBGLayout; + protected boolean mIsFABOpen = false; private DeckPicker mDeckPicker; public DeckPickerFloatingActionMenu(View view, DeckPicker deckPicker) { this.mDeckPicker = deckPicker; - addNoteLayout = (LinearLayout)view.findViewById(R.id.add_note_layout); - addSharedLayout = (LinearLayout)view.findViewById(R.id.add_shared_layout); - addDeckLayout = (LinearLayout)view.findViewById(R.id.add_deck_layout); - fabMain = (FloatingActionButton)view.findViewById(R.id.fab_main); - addNoteButton = (FloatingActionButton)view.findViewById(R.id.add_note_action); - addSharedButton = (FloatingActionButton)view.findViewById(R.id.add_shared_action); - addDeckButton = (FloatingActionButton)view.findViewById(R.id.add_deck_action); - fabBGLayout = view.findViewById(R.id.fabBGLayout); - - fabMain.setOnClickListener(new View.OnClickListener() { + mAddNoteLayout = (LinearLayout)view.findViewById(R.id.add_note_layout); + mAddSharedLayout = (LinearLayout)view.findViewById(R.id.add_shared_layout); + mAddDeckLayout = (LinearLayout)view.findViewById(R.id.add_deck_layout); + mFabMain = (FloatingActionButton)view.findViewById(R.id.fab_main); + mAddNoteButton = (FloatingActionButton)view.findViewById(R.id.add_note_action); + mAddSharedButton = (FloatingActionButton)view.findViewById(R.id.add_shared_action); + mAddDeckButton = (FloatingActionButton)view.findViewById(R.id.add_deck_action); + mFabBGLayout = view.findViewById(R.id.fabBGLayout); + + mFabMain.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (!mIsFABOpen) { @@ -50,14 +49,14 @@ public void onClick(View view) { } }); - fabBGLayout.setOnClickListener(new View.OnClickListener() { + mFabBGLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { closeFloatingActionMenu(); } }); - addDeckButton.setOnClickListener(addDeckButtonView -> { + mAddDeckButton.setOnClickListener(addDeckButtonView -> { if (mIsFABOpen) { closeFloatingActionMenu(); EditText mDialogEditText = new FixedEditText(mDeckPicker); @@ -83,13 +82,13 @@ public void onClick(View view) { } }); - addSharedButton.setOnClickListener(addSharedButtonView -> { + mAddSharedButton.setOnClickListener(addSharedButtonView -> { Timber.i("Adding Shared Deck"); closeFloatingActionMenu(); deckPicker.addSharedDeck(); }); - addNoteButton.setOnClickListener(addNoteButtonView -> { + mAddNoteButton.setOnClickListener(addNoteButtonView -> { Timber.i("Adding Note"); closeFloatingActionMenu(); deckPicker.addNote(); @@ -105,47 +104,47 @@ private void showFloatingActionMenu() { mIsFABOpen = true; if (!animationDisabled()) { // Show with animation - addNoteLayout.setVisibility(View.VISIBLE); - addSharedLayout.setVisibility(View.VISIBLE); - addDeckLayout.setVisibility(View.VISIBLE); - fabBGLayout.setVisibility(View.VISIBLE); - fabMain.animate().rotationBy(140); - addNoteLayout.animate().translationY(0).setDuration(30); - addSharedLayout.animate().translationY(0).setDuration(50); - addDeckLayout.animate().translationY(0).setDuration(100); - addDeckLayout.animate().alpha(1f).setDuration(100); - addSharedLayout.animate().alpha(1f).setDuration(50); - addNoteLayout.animate().alpha(1f).setDuration(30); + mAddNoteLayout.setVisibility(View.VISIBLE); + mAddSharedLayout.setVisibility(View.VISIBLE); + mAddDeckLayout.setVisibility(View.VISIBLE); + mFabBGLayout.setVisibility(View.VISIBLE); + mFabMain.animate().rotationBy(140); + mAddNoteLayout.animate().translationY(0).setDuration(30); + mAddSharedLayout.animate().translationY(0).setDuration(50); + mAddDeckLayout.animate().translationY(0).setDuration(100); + mAddDeckLayout.animate().alpha(1f).setDuration(100); + mAddSharedLayout.animate().alpha(1f).setDuration(50); + mAddNoteLayout.animate().alpha(1f).setDuration(30); } else { // Show without animation - addNoteLayout.setVisibility(View.VISIBLE); - addSharedLayout.setVisibility(View.VISIBLE); - addDeckLayout.setVisibility(View.VISIBLE); - fabBGLayout.setVisibility(View.VISIBLE); + mAddNoteLayout.setVisibility(View.VISIBLE); + mAddSharedLayout.setVisibility(View.VISIBLE); + mAddDeckLayout.setVisibility(View.VISIBLE); + mFabBGLayout.setVisibility(View.VISIBLE); } } protected void closeFloatingActionMenu() { mIsFABOpen = false; - fabBGLayout.setVisibility(View.GONE); + mFabBGLayout.setVisibility(View.GONE); if (!animationDisabled()) { // Close with animation - fabMain.animate().rotation(0); - addNoteLayout.animate().translationY(200f).setDuration(30); - addSharedLayout.animate().translationY(400f).setDuration(50); - addDeckLayout.animate().alpha(0f).setDuration(100); - addSharedLayout.animate().alpha(0f).setDuration(50); - addNoteLayout.animate().alpha(0f).setDuration(30); - addDeckLayout.animate().translationY(600f).setDuration(100).setListener(new Animator.AnimatorListener() { + mFabMain.animate().rotation(0); + mAddNoteLayout.animate().translationY(200f).setDuration(30); + mAddSharedLayout.animate().translationY(400f).setDuration(50); + mAddDeckLayout.animate().alpha(0f).setDuration(100); + mAddSharedLayout.animate().alpha(0f).setDuration(50); + mAddNoteLayout.animate().alpha(0f).setDuration(30); + mAddDeckLayout.animate().translationY(600f).setDuration(100).setListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animator) { } @Override public void onAnimationEnd(Animator animator) { if (!mIsFABOpen) { - addNoteLayout.setVisibility(View.GONE); - addSharedLayout.setVisibility(View.GONE); - addDeckLayout.setVisibility(View.GONE); + mAddNoteLayout.setVisibility(View.GONE); + mAddSharedLayout.setVisibility(View.GONE); + mAddDeckLayout.setVisibility(View.GONE); } } @@ -157,9 +156,9 @@ public void onAnimationRepeat(Animator animator) { } }); } else { // Close without animation - addNoteLayout.setVisibility(View.GONE); - addSharedLayout.setVisibility(View.GONE); - addDeckLayout.setVisibility(View.GONE); + mAddNoteLayout.setVisibility(View.GONE); + mAddSharedLayout.setVisibility(View.GONE); + mAddDeckLayout.setVisibility(View.GONE); } } } diff --git a/AnkiDroid/src/main/res/values/dimens.xml b/AnkiDroid/src/main/res/values/dimens.xml index eefec27f5117..aca37ffeaf2e 100644 --- a/AnkiDroid/src/main/res/values/dimens.xml +++ b/AnkiDroid/src/main/res/values/dimens.xml @@ -28,5 +28,4 @@ 24dp 4dp 28dp - \ No newline at end of file From 0379304769e4f824066fafc22d083cf0e5549d70 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 28 Mar 2021 20:06:04 +0530 Subject: [PATCH 12/22] getter ,setter for mIsFabOpen --- .../main/java/com/ichi2/anki/DeckPicker.java | 8 ++--- .../anki/DeckPickerFloatingActionMenu.java | 29 +++++++++++++------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index 49ab3b42aaef..a37b0de63471 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -271,7 +271,7 @@ public class DeckPicker extends NavigationDrawerActivity implements private void onDeckClick(View v, DeckSelectionType selectionType) { long deckId = (long) v.getTag(); Timber.i("DeckPicker:: Selected deck with id %d", deckId); - if (mFloatingActionMenu.mIsFABOpen) { + if (mFloatingActionMenu.isFABOpen()) { mFloatingActionMenu.closeFloatingActionMenu(); } @@ -518,7 +518,7 @@ protected void onCreate(Bundle savedInstanceState) throws SQLException { mPullToSyncWrapper.setEnabled(mRecyclerViewLayoutManager.findFirstCompletelyVisibleItemPosition() == 0)); // Setup the FloatingActionButtons, should work everywhere with min API >= 15 - mFloatingActionMenu = new DeckPickerFloatingActionMenu(view,this); + mFloatingActionMenu = new DeckPickerFloatingActionMenu(view, this); mReviewSummaryTextView = findViewById(R.id.today_stats_text_view); @@ -972,7 +972,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); savedInstanceState.putLong("mContextMenuDid", mContextMenuDid); savedInstanceState.putBoolean("mClosedWelcomeMessage", mClosedWelcomeMessage); - savedInstanceState.putBoolean("mIsFABOpen", mFloatingActionMenu.mIsFABOpen); + savedInstanceState.putBoolean("mIsFABOpen", mFloatingActionMenu.isFABOpen()); } @@ -980,7 +980,7 @@ public void onSaveInstanceState(@NonNull Bundle savedInstanceState) { public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); mContextMenuDid = savedInstanceState.getLong("mContextMenuDid"); - mFloatingActionMenu.mIsFABOpen = savedInstanceState.getBoolean("mIsFABOpen"); + mFloatingActionMenu.setIsFABOpen(savedInstanceState.getBoolean("mIsFABOpen")); } diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index fdba10646e4a..fb359ec76536 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -15,17 +15,17 @@ public class DeckPickerFloatingActionMenu { - private FloatingActionButton mAddDeckButton; - private FloatingActionButton mAddNoteButton; - private FloatingActionButton mAddSharedButton; - private FloatingActionButton mFabMain; - private LinearLayout mAddSharedLayout; - private LinearLayout mAddDeckLayout; - private LinearLayout mAddNoteLayout; - private View mFabBGLayout; + private final FloatingActionButton mAddDeckButton; + private final FloatingActionButton mAddNoteButton; + private final FloatingActionButton mAddSharedButton; + private final FloatingActionButton mFabMain; + private final LinearLayout mAddSharedLayout; + private final LinearLayout mAddDeckLayout; + private final LinearLayout mAddNoteLayout; + private final View mFabBGLayout; protected boolean mIsFABOpen = false; - private DeckPicker mDeckPicker; + private final DeckPicker mDeckPicker; public DeckPickerFloatingActionMenu(View view, DeckPicker deckPicker) { this.mDeckPicker = deckPicker; @@ -100,6 +100,17 @@ private boolean animationDisabled(){ return preferences.getBoolean("safeDisplay", false); } + + public boolean isFABOpen() { + return mIsFABOpen; + } + + + public void setIsFABOpen(boolean mIsFABOpen) { + this.mIsFABOpen = mIsFABOpen; + } + + private void showFloatingActionMenu() { mIsFABOpen = true; if (!animationDisabled()) { From e9b0346aff19394b109fb0b643eae875f33995c4 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 28 Mar 2021 20:33:21 +0530 Subject: [PATCH 13/22] copyright comment added --- .../ichi2/anki/DeckPickerFloatingActionMenu.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index fb359ec76536..25d6c97419c9 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -1,3 +1,19 @@ +/**************************************************************************************** + * Copyright (c) 2021 Akshay Jadhav * + * * + * This program 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 (at your option) any later * + * version. * + * * + * This program 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 * + * this program. If not, see . * + ****************************************************************************************/ + package com.ichi2.anki; import android.animation.Animator; From 1600bf332011b3ed1b20c09e7046c2c4c85d4372 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 28 Mar 2021 20:55:49 +0530 Subject: [PATCH 14/22] small change --- AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java | 2 +- .../main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java index a37b0de63471..bb6af9f13739 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.java @@ -1037,7 +1037,7 @@ public void onBackPressed() { super.onBackPressed(); } else { Timber.i("Back key pressed"); - if (mFloatingActionMenu.mIsFABOpen) { + if (mFloatingActionMenu.isFABOpen()) { mFloatingActionMenu.closeFloatingActionMenu(); } else { automaticSync(); diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index 25d6c97419c9..df2b6ee3835b 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -39,7 +39,7 @@ public class DeckPickerFloatingActionMenu { private final LinearLayout mAddDeckLayout; private final LinearLayout mAddNoteLayout; private final View mFabBGLayout; - protected boolean mIsFABOpen = false; + private boolean mIsFABOpen = false; private final DeckPicker mDeckPicker; From 1c1f91949a9f76c2a83be15d66dfb678c2bb7d2a Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 30 Mar 2021 11:12:53 -0500 Subject: [PATCH 15/22] Update AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java --- .../main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index df2b6ee3835b..a25c1a22fa4c 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -89,7 +89,7 @@ public void onClick(View view) { return; } } else { - Timber.i("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); + Timber.d("configureFloatingActionsMenu::addDeckButton::onPositiveListener - Not creating invalid deck name '%s'", deckName); UIUtils.showThemedToast(mDeckPicker, mDeckPicker.getString(R.string.invalid_deck_name), false); } }) From 6acbb7c3339b793e1d3720c774d968308daa155f Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 30 Mar 2021 11:13:01 -0500 Subject: [PATCH 16/22] Update AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java --- .../main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index a25c1a22fa4c..1b8d87cec496 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -99,7 +99,7 @@ public void onClick(View view) { }); mAddSharedButton.setOnClickListener(addSharedButtonView -> { - Timber.i("Adding Shared Deck"); + Timber.d("configureFloatingActionsMenu::addSharedButton::onClickListener - Adding Shared Deck"); closeFloatingActionMenu(); deckPicker.addSharedDeck(); }); From 6a5fa2d09cde3760cdbefbdd21992cdb4339159a Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 30 Mar 2021 11:13:11 -0500 Subject: [PATCH 17/22] Update AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java --- .../main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index 1b8d87cec496..54c1b835750a 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -105,7 +105,7 @@ public void onClick(View view) { }); mAddNoteButton.setOnClickListener(addNoteButtonView -> { - Timber.i("Adding Note"); + Timber.d("configureFloatingActionsMenu::addNoteButton::onClickListener - Adding Note"); closeFloatingActionMenu(); deckPicker.addNote(); }); From f2f172d3c6204016c27c0df58daad8081b120b6a Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 30 Mar 2021 11:13:20 -0500 Subject: [PATCH 18/22] Update AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java --- .../main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java index 54c1b835750a..f5e434f0b1de 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/DeckPickerFloatingActionMenu.java @@ -111,7 +111,7 @@ public void onClick(View view) { }); } - private boolean animationDisabled(){ + private boolean animationDisabled() { SharedPreferences preferences = AnkiDroidApp.getSharedPrefs(mDeckPicker); return preferences.getBoolean("safeDisplay", false); } From df4a7522a6479ab53e0c70edc95745fdb39f7246 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 31 Mar 2021 20:10:15 +0530 Subject: [PATCH 19/22] handled onDependentViewRemoved state in FabBehavior --- .../java/com/ichi2/anki/widgets/FabBehavior.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java b/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java index 87a1ed104b7d..fc981c5b04db 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java +++ b/AnkiDroid/src/main/java/com/ichi2/anki/widgets/FabBehavior.java @@ -76,4 +76,17 @@ public boolean onDependentViewChanged(@NonNull CoordinatorLayout parent, @NonNul } return false; } + + @Override + public void onDependentViewRemoved(@NonNull CoordinatorLayout parent, @NonNull View fab, @NonNull View dependency) { + super.onDependentViewRemoved(parent, fab, dependency); + if (dependency instanceof Snackbar.SnackbarLayout && fab.getVisibility() == View.VISIBLE) { + float translationY = getFabTranslationYForSnackbar(parent, fab); + if (translationY == this.mTranslationY) { + ViewCompat.animate(fab).cancel(); + fab.setTranslationY(0); + this.mTranslationY = 0; + } + } + } } \ No newline at end of file From 5c538b5b1282f3245617e707c9314352ae383daa Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 15 Apr 2021 18:15:18 +0530 Subject: [PATCH 20/22] Revert "Merge remote-tracking branch 'upstream/master'" This reverts commit b67ace6f6122234e34838f9f4ca73dbef34f3e38, reversing changes made to df4a7522a6479ab53e0c70edc95745fdb39f7246. --- .idea/codeStyles/Project.xml | 1 - .travis.yml | 163 ++++ AnkiDroid/build.gradle | 22 +- AnkiDroid/jacoco.gradle | 65 +- .../anki/reviewer/PeripheralKeymapTest.java | 1 - .../ichi2/anki/tests/ContentProviderTest.java | 8 +- .../anim/ActivityTransitionAnimation.java | 27 +- .../ichi2/anki/AbstractFlashcardViewer.java | 177 ++-- .../java/com/ichi2/anki/AnkiActivity.java | 4 +- .../java/com/ichi2/anki/AnkiDroidApp.java | 24 +- .../main/java/com/ichi2/anki/AnkiFont.java | 5 +- .../java/com/ichi2/anki/BackupManager.java | 2 +- .../main/java/com/ichi2/anki/CardBrowser.java | 29 +- .../com/ichi2/anki/CardTemplateEditor.java | 52 +- .../com/ichi2/anki/CardTemplatePreviewer.java | 23 +- .../java/com/ichi2/anki/CollectionHelper.java | 11 - .../main/java/com/ichi2/anki/DeckOptions.java | 10 +- .../main/java/com/ichi2/anki/DeckPicker.java | 227 ++--- .../anki/DeckPickerFloatingActionMenu.java | 8 +- .../com/ichi2/anki/FilteredDeckOptions.java | 5 +- .../src/main/java/com/ichi2/anki/Info.java | 7 +- .../java/com/ichi2/anki/InitialActivity.java | 71 -- .../ichi2/anki/MaterialEditTextDialog.java | 61 -- .../java/com/ichi2/anki/ModelBrowser.java | 46 +- .../java/com/ichi2/anki/ModelFieldEditor.java | 10 +- .../main/java/com/ichi2/anki/MyAccount.java | 62 +- .../ichi2/anki/NavigationDrawerActivity.java | 48 +- .../main/java/com/ichi2/anki/NoteEditor.java | 68 +- .../main/java/com/ichi2/anki/Preferences.java | 148 +--- .../main/java/com/ichi2/anki/ReadText.java | 15 +- .../main/java/com/ichi2/anki/Reviewer.java | 102 +-- .../main/java/com/ichi2/anki/Statistics.java | 8 +- .../com/ichi2/anki/StudyOptionsActivity.java | 10 +- .../com/ichi2/anki/StudyOptionsFragment.java | 105 ++- .../src/main/java/com/ichi2/anki/UIUtils.java | 7 - .../main/java/com/ichi2/anki/Whiteboard.java | 12 +- .../anki/analytics/AnalyticsConstant.java | 29 - .../ichi2/anki/analytics/UsageAnalytics.java | 30 - .../ichi2/anki/cardviewer/TypedAnswer.java | 2 +- .../{customstudy => }/CustomStudyDialog.java | 217 +++-- .../anki/dialogs/DatabaseErrorDialog.java | 4 +- .../anki/dialogs/DeckPickerContextMenu.java | 12 +- .../anki/dialogs/DeckSelectionDialog.java | 24 +- .../com/ichi2/anki/dialogs/DialogHandler.java | 4 +- .../com/ichi2/anki/dialogs/ExportDialog.java | 6 +- .../com/ichi2/anki/dialogs/HelpDialog.java | 48 +- .../com/ichi2/anki/dialogs/IntegerDialog.java | 6 +- .../anki/dialogs/LocaleSelectionDialog.java | 17 +- .../anki/dialogs/RecursivePictureMenu.java | 11 +- .../com/ichi2/anki/dialogs/TagsDialog.java | 1 + .../CreateCustomStudySessionListener.java | 35 - .../customstudy/CustomStudyDialogFactory.java | 35 - .../anki/multimediacard/AudioPlayer.java | 94 -- .../anki/multimediacard/AudioRecorder.java | 103 --- .../ichi2/anki/multimediacard/AudioView.java | 187 ++-- .../activity/LoadPronounciationActivity.java | 32 +- .../activity/MultimediaEditFieldActivity.java | 23 +- .../activity/TranslationActivity.java | 26 +- .../fields/BasicAudioClipFieldController.java | 6 +- .../BasicAudioRecordingFieldController.java | 10 +- .../fields/BasicTextFieldController.java | 6 +- .../multimediacard/glosbe/json/Meaning.java | 12 +- .../multimediacard/glosbe/json/Phrase.java | 12 +- .../multimediacard/glosbe/json/Response.java | 30 +- .../anki/multimediacard/glosbe/json/Tuc.java | 24 +- .../com/ichi2/anki/noteeditor/FieldState.java | 22 +- .../com/ichi2/anki/noteeditor/Toolbar.java | 9 - .../anki/provider/CardContentProvider.java | 4 +- .../anki/reviewer/ActionButtonStatus.java | 6 - .../com/ichi2/anki/reviewer/CardMarker.java | 20 +- .../anki/reviewer/PeripheralCommand.java | 8 +- .../ichi2/anki/reviewer/PeripheralKeymap.java | 10 +- .../ichi2/anki/servicelayer/NoteService.java | 2 +- .../com/ichi2/anki/services/BootService.java | 24 +- .../ichi2/anki/services/ReminderService.java | 4 +- .../anki/stats/AnkiStatsTaskHandler.java | 126 +-- .../com/ichi2/anki/stats/StatsMetaInfo.java | 12 +- .../anki/widgets/DeckDropDownAdapter.java | 31 +- .../java/com/ichi2/async/CollectionTask.java | 831 ++++++++---------- .../main/java/com/ichi2/async/Connection.java | 10 +- .../java/com/ichi2/async/ProgressSender.java | 8 - .../com/ichi2/async/SingleTaskManager.java | 166 ---- .../java/com/ichi2/async/TaskManager.java | 149 ++-- .../ichi2/libanki/AnkiPackageExporter.java | 8 +- .../src/main/java/com/ichi2/libanki/Card.java | 50 +- .../java/com/ichi2/libanki/Collection.java | 133 ++- .../com/ichi2/libanki/CollectionGetter.java | 5 - .../main/java/com/ichi2/libanki/Decks.java | 72 +- .../main/java/com/ichi2/libanki/Finder.java | 24 +- .../main/java/com/ichi2/libanki/LaTeX.java | 15 +- .../main/java/com/ichi2/libanki/Media.java | 8 +- .../main/java/com/ichi2/libanki/Models.java | 28 +- .../src/main/java/com/ichi2/libanki/Note.java | 42 +- .../main/java/com/ichi2/libanki/Sound.java | 14 +- .../java/com/ichi2/libanki/StdModels.java | 40 +- .../main/java/com/ichi2/libanki/Storage.java | 12 +- .../{UndoAction.java => Undoable.java} | 27 +- .../main/java/com/ichi2/libanki/Utils.java | 8 +- .../ichi2/libanki/backend/DroidBackend.java | 9 - .../libanki/backend/DroidBackendFactory.java | 14 - .../ichi2/libanki/importer/Anki2Importer.java | 2 +- .../ichi2/libanki/importer/NoteImporter.java | 14 +- .../ichi2/libanki/importer/TextImporter.java | 70 +- .../libanki/importer/python/CsvDialect.java | 3 - .../libanki/importer/python/CsvReader.java | 3 - .../importer/python/CsvReaderIterator.java | 3 - .../libanki/importer/python/CsvSniffer.java | 3 - .../ichi2/libanki/sched/AbstractSched.java | 5 +- .../java/com/ichi2/libanki/sched/Sched.java | 2 +- .../java/com/ichi2/libanki/sched/SchedV2.java | 4 +- .../libanki/stats/AdvancedStatistics.java | 576 ++++++------ .../java/com/ichi2/libanki/stats/Stats.java | 11 +- .../libanki/sync/CountingFileRequestBody.java | 20 +- .../libanki/sync/Tls12SocketFactory.java | 18 +- .../libanki/sync/UnifiedTrustManager.java | 20 +- .../ichi2/libanki/template/ParsedNode.java | 13 +- .../libanki/template/TemplateFilters.java | 10 +- .../com/ichi2/libanki/template/Tokenizer.java | 32 +- .../preferences/CustomDialogPreference.java | 6 +- .../IncrementerNumberRangePreference.java | 4 +- .../com/ichi2/preferences/TimePreference.java | 24 +- .../java/com/ichi2/ui/ButtonItemAdapter.java | 44 +- .../com/ichi2/ui/ConfirmationPreference.java | 12 +- .../main/java/com/ichi2/ui/FixedEditText.java | 11 +- .../java/com/ichi2/utils/AndroidUiUtils.java | 29 - .../java/com/ichi2/utils/BooleanGetter.java | 4 +- .../ichi2/utils/DatabaseChangeDecorator.java | 86 +- .../java/com/ichi2/utils/DeckComparator.java | 7 +- .../com/ichi2/utils/DeckNameComparator.java | 2 +- .../main/java/com/ichi2/utils/DiffEngine.java | 4 +- .../ichi2/utils/ExtendedFragmentFactory.java | 83 -- .../com/ichi2/utils/FragmentFactoryUtils.java | 32 - .../main/java/com/ichi2/utils/JSONArray.java | 32 +- .../java/com/ichi2/utils/JSONException.java | 8 +- .../com/ichi2/utils/NamedJSONComparator.java | 2 +- .../java/com/ichi2/utils/TextViewUtil.java | 5 +- .../java/com/ichi2/utils/UniqueArrayList.java | 187 ---- .../java/com/ichi2/utils/ViewGroupUtils.java | 32 - .../ichi2/widget/AnkiDroidWidgetSmall.java | 16 +- .../com/wildplot/android/parsing/Atom.java | 11 +- .../parsing/AtomTypes/FunctionXAtom.java | 9 +- .../parsing/AtomTypes/FunctionXYAtom.java | 9 +- .../parsing/AtomTypes/MathFunctionAtom.java | 3 - .../android/parsing/AtomTypes/NumberAtom.java | 3 - .../parsing/AtomTypes/VariableAtom.java | 3 - .../parsing/AtomTypes/XVariableAtom.java | 3 - .../parsing/AtomTypes/YVariableAtom.java | 3 - .../wildplot/android/parsing/Expression.java | 3 - .../com/wildplot/android/parsing/Factor.java | 3 - .../com/wildplot/android/parsing/Pow.java | 3 - .../com/wildplot/android/parsing/Term.java | 3 - .../android/parsing/TopLevelParser.java | 3 - .../wildplot/android/rendering/BarGraph.java | 3 - .../android/rendering/DrawableContainer.java | 3 - .../android/rendering/LegendDrawable.java | 3 - .../com/wildplot/android/rendering/Lines.java | 9 +- .../android/rendering/MultiScreenPart.java | 3 - .../wildplot/android/rendering/PieChart.java | 3 - .../wildplot/android/rendering/PlotSheet.java | 7 +- .../com/wildplot/android/rendering/XAxis.java | 3 - .../com/wildplot/android/rendering/XGrid.java | 3 - .../com/wildplot/android/rendering/YAxis.java | 3 - .../com/wildplot/android/rendering/YGrid.java | 3 - .../rendering/graphics/wrapper/ColorWrap.java | 3 - .../graphics/wrapper/FontMetricsWrap.java | 3 - .../graphics/wrapper/GraphicsWrap.java | 2 - .../graphics/wrapper/StrokeWrap.java | 3 - .../res/drawable-v21/fab_label_background.xml | 8 +- .../drawable-v24/ic_launcher_foreground.xml | 4 +- AnkiDroid/src/main/res/drawable/discord.xml | 32 - .../fab_label_background_black_pre21.xml | 8 +- .../drawable/fab_label_background_pre21.xml | 8 +- AnkiDroid/src/main/res/drawable/facebook.xml | 32 - .../main/res/drawable/ic_heart_black_24dp.xml | 10 + .../main/res/drawable/ic_link_black_24dp.xml | 10 + .../drawable/ic_mail_outline_black_24dp.xml | 10 + .../res/drawable/ic_message_black_24dp.xml | 10 + .../res/drawable/ic_support_ankidroid.xml | 10 - AnkiDroid/src/main/res/drawable/reddit.xml | 32 - AnkiDroid/src/main/res/drawable/twitter.xml | 32 - .../src/main/res/layout/card_browser.xml | 12 +- AnkiDroid/src/main/res/layout/feedback.xml | 3 +- AnkiDroid/src/main/res/layout/homescreen.xml | 1 - AnkiDroid/src/main/res/layout/note_editor.xml | 1 + .../src/main/res/menu/navigation_drawer.xml | 4 - AnkiDroid/src/main/res/menu/reviewer.xml | 4 +- AnkiDroid/src/main/res/values-af/01-core.xml | 2 - .../src/main/res/values-af/02-strings.xml | 2 - .../src/main/res/values-af/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-am/01-core.xml | 2 - .../src/main/res/values-am/02-strings.xml | 2 - .../src/main/res/values-am/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ar/01-core.xml | 2 - .../src/main/res/values-ar/02-strings.xml | 2 - .../src/main/res/values-ar/10-preferences.xml | 6 +- AnkiDroid/src/main/res/values-az/01-core.xml | 2 - .../src/main/res/values-az/02-strings.xml | 2 - .../src/main/res/values-az/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-be/01-core.xml | 2 - .../src/main/res/values-be/02-strings.xml | 2 - .../src/main/res/values-be/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-bg/01-core.xml | 2 - .../src/main/res/values-bg/02-strings.xml | 2 - .../src/main/res/values-bg/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-bn/01-core.xml | 2 - .../src/main/res/values-bn/02-strings.xml | 2 - .../src/main/res/values-bn/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ca/01-core.xml | 2 - .../src/main/res/values-ca/02-strings.xml | 2 - .../src/main/res/values-ca/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ckb/01-core.xml | 2 - .../src/main/res/values-ckb/02-strings.xml | 2 - .../main/res/values-ckb/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-cs/01-core.xml | 2 - .../src/main/res/values-cs/02-strings.xml | 2 - .../src/main/res/values-cs/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-da/01-core.xml | 2 - .../src/main/res/values-da/02-strings.xml | 2 - .../src/main/res/values-da/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-de/01-core.xml | 2 - .../src/main/res/values-de/02-strings.xml | 8 +- .../src/main/res/values-de/03-dialogs.xml | 4 +- .../src/main/res/values-de/10-preferences.xml | 8 +- AnkiDroid/src/main/res/values-el/01-core.xml | 2 - .../src/main/res/values-el/02-strings.xml | 2 - .../src/main/res/values-el/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-eo/01-core.xml | 2 - .../src/main/res/values-eo/02-strings.xml | 6 +- .../src/main/res/values-eo/03-dialogs.xml | 4 +- .../src/main/res/values-eo/10-preferences.xml | 8 +- .../src/main/res/values-es-rAR/01-core.xml | 4 +- .../src/main/res/values-es-rAR/02-strings.xml | 6 +- .../main/res/values-es-rAR/10-preferences.xml | 4 - .../src/main/res/values-es-rES/01-core.xml | 4 +- .../src/main/res/values-es-rES/02-strings.xml | 6 +- .../main/res/values-es-rES/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-et/01-core.xml | 2 - .../src/main/res/values-et/02-strings.xml | 2 - .../src/main/res/values-et/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-eu/01-core.xml | 2 - .../src/main/res/values-eu/02-strings.xml | 2 - .../src/main/res/values-eu/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-fa/01-core.xml | 18 +- .../src/main/res/values-fa/02-strings.xml | 46 +- .../src/main/res/values-fa/03-dialogs.xml | 56 +- .../src/main/res/values-fa/04-network.xml | 2 +- .../src/main/res/values-fa/10-preferences.xml | 4 - .../res/values-fa/16-multimedia-editor.xml | 2 +- AnkiDroid/src/main/res/values-fi/01-core.xml | 2 - .../src/main/res/values-fi/02-strings.xml | 2 - .../src/main/res/values-fi/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-fil/01-core.xml | 2 - .../src/main/res/values-fil/02-strings.xml | 2 - .../main/res/values-fil/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-fr/01-core.xml | 4 +- .../src/main/res/values-fr/02-strings.xml | 6 +- .../src/main/res/values-fr/10-preferences.xml | 8 +- AnkiDroid/src/main/res/values-fy/01-core.xml | 2 - .../src/main/res/values-fy/02-strings.xml | 2 - .../src/main/res/values-fy/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ga/01-core.xml | 2 - .../src/main/res/values-ga/02-strings.xml | 2 - .../src/main/res/values-ga/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-gl/01-core.xml | 2 - .../src/main/res/values-gl/02-strings.xml | 2 - .../src/main/res/values-gl/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-got/01-core.xml | 2 - .../src/main/res/values-got/02-strings.xml | 2 - .../main/res/values-got/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-gu/01-core.xml | 2 - .../src/main/res/values-gu/02-strings.xml | 2 - .../src/main/res/values-gu/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-heb/01-core.xml | 2 - .../src/main/res/values-heb/02-strings.xml | 2 - .../main/res/values-heb/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-hi/01-core.xml | 2 - .../src/main/res/values-hi/02-strings.xml | 2 - .../src/main/res/values-hi/03-dialogs.xml | 2 +- .../src/main/res/values-hi/07-cardbrowser.xml | 26 +- .../src/main/res/values-hi/10-preferences.xml | 6 +- AnkiDroid/src/main/res/values-hr/01-core.xml | 2 - .../src/main/res/values-hr/02-strings.xml | 2 - .../src/main/res/values-hr/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-hu/01-core.xml | 2 - .../src/main/res/values-hu/02-strings.xml | 2 - .../src/main/res/values-hu/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-hy/01-core.xml | 2 - .../src/main/res/values-hy/02-strings.xml | 2 - .../src/main/res/values-hy/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ind/01-core.xml | 2 - .../src/main/res/values-ind/02-strings.xml | 2 - .../main/res/values-ind/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-is/01-core.xml | 2 - .../src/main/res/values-is/02-strings.xml | 2 - .../src/main/res/values-is/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-it/01-core.xml | 6 +- .../src/main/res/values-it/02-strings.xml | 8 +- .../src/main/res/values-it/03-dialogs.xml | 6 +- .../src/main/res/values-it/04-network.xml | 2 +- .../src/main/res/values-it/10-preferences.xml | 8 +- .../main/res/values-it/18-standard-models.xml | 4 +- AnkiDroid/src/main/res/values-ja/01-core.xml | 2 - .../src/main/res/values-ja/02-strings.xml | 2 - .../src/main/res/values-ja/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-jv/01-core.xml | 2 - .../src/main/res/values-jv/02-strings.xml | 2 - .../src/main/res/values-jv/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ka/01-core.xml | 2 - .../src/main/res/values-ka/02-strings.xml | 2 - .../src/main/res/values-ka/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-kk/01-core.xml | 2 - .../src/main/res/values-kk/02-strings.xml | 2 - .../src/main/res/values-kk/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-km/01-core.xml | 2 - .../src/main/res/values-km/02-strings.xml | 2 - .../src/main/res/values-km/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ko/01-core.xml | 2 - .../src/main/res/values-ko/02-strings.xml | 2 - .../src/main/res/values-ko/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ku/01-core.xml | 2 - .../src/main/res/values-ku/02-strings.xml | 2 - .../src/main/res/values-ku/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ky/01-core.xml | 2 - .../src/main/res/values-ky/02-strings.xml | 2 - .../src/main/res/values-ky/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-lt/01-core.xml | 2 - .../src/main/res/values-lt/02-strings.xml | 2 - .../src/main/res/values-lt/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-lv/01-core.xml | 2 - .../src/main/res/values-lv/02-strings.xml | 2 - .../src/main/res/values-lv/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-mk/01-core.xml | 2 - .../src/main/res/values-mk/02-strings.xml | 2 - .../src/main/res/values-mk/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-mn/01-core.xml | 2 - .../src/main/res/values-mn/02-strings.xml | 2 - .../src/main/res/values-mn/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-mr/01-core.xml | 2 - .../src/main/res/values-mr/02-strings.xml | 2 - .../src/main/res/values-mr/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ms/01-core.xml | 2 - .../src/main/res/values-ms/02-strings.xml | 2 - .../src/main/res/values-ms/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-my/01-core.xml | 2 - .../src/main/res/values-my/02-strings.xml | 2 - .../src/main/res/values-my/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-nl/01-core.xml | 2 - .../src/main/res/values-nl/02-strings.xml | 8 +- .../src/main/res/values-nl/03-dialogs.xml | 4 +- .../src/main/res/values-nl/07-cardbrowser.xml | 8 +- .../src/main/res/values-nl/10-preferences.xml | 10 +- AnkiDroid/src/main/res/values-nn/01-core.xml | 2 - .../src/main/res/values-nn/02-strings.xml | 2 - .../src/main/res/values-nn/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-no/01-core.xml | 2 - .../src/main/res/values-no/02-strings.xml | 2 - .../src/main/res/values-no/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-or/01-core.xml | 4 +- .../src/main/res/values-or/02-strings.xml | 16 +- .../src/main/res/values-or/03-dialogs.xml | 43 +- .../src/main/res/values-or/04-network.xml | 34 +- .../src/main/res/values-or/06-statistics.xml | 8 +- .../src/main/res/values-or/09-backup.xml | 2 +- .../src/main/res/values-or/10-preferences.xml | 24 +- .../src/main/res/values-or/11-arrays.xml | 4 +- .../res/values-or/16-multimedia-editor.xml | 10 +- .../main/res/values-or/17-model-manager.xml | 2 +- AnkiDroid/src/main/res/values-pa/01-core.xml | 2 - .../src/main/res/values-pa/02-strings.xml | 2 - .../src/main/res/values-pa/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-pl/01-core.xml | 2 - .../src/main/res/values-pl/02-strings.xml | 6 +- .../src/main/res/values-pl/03-dialogs.xml | 4 +- .../src/main/res/values-pl/10-preferences.xml | 8 +- .../src/main/res/values-pt-rBR/01-core.xml | 2 - .../src/main/res/values-pt-rBR/02-strings.xml | 2 - .../main/res/values-pt-rBR/10-preferences.xml | 4 - .../src/main/res/values-pt-rPT/01-core.xml | 2 - .../src/main/res/values-pt-rPT/02-strings.xml | 2 - .../main/res/values-pt-rPT/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ro/01-core.xml | 2 - .../src/main/res/values-ro/02-strings.xml | 2 - .../src/main/res/values-ro/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ru/01-core.xml | 4 +- .../src/main/res/values-ru/02-strings.xml | 6 +- .../src/main/res/values-ru/03-dialogs.xml | 4 +- .../src/main/res/values-ru/10-preferences.xml | 6 +- AnkiDroid/src/main/res/values-sat/01-core.xml | 2 - .../src/main/res/values-sat/02-strings.xml | 2 - .../main/res/values-sat/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-sk/01-core.xml | 2 - .../src/main/res/values-sk/02-strings.xml | 2 - .../src/main/res/values-sk/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-sl/01-core.xml | 2 - .../src/main/res/values-sl/02-strings.xml | 2 - .../src/main/res/values-sl/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-sq/01-core.xml | 2 - .../src/main/res/values-sq/02-strings.xml | 2 - .../src/main/res/values-sq/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-sr/01-core.xml | 2 - .../src/main/res/values-sr/02-strings.xml | 2 - .../src/main/res/values-sr/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ss/01-core.xml | 2 - .../src/main/res/values-ss/02-strings.xml | 2 - .../src/main/res/values-ss/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-sv/01-core.xml | 52 +- .../src/main/res/values-sv/02-strings.xml | 2 - .../src/main/res/values-sv/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-sw/01-core.xml | 2 - .../src/main/res/values-sw/02-strings.xml | 2 - .../src/main/res/values-sw/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ta/01-core.xml | 2 - .../src/main/res/values-ta/02-strings.xml | 2 - .../src/main/res/values-ta/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-te/01-core.xml | 2 - .../src/main/res/values-te/02-strings.xml | 2 - .../src/main/res/values-te/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-tg/01-core.xml | 2 - .../src/main/res/values-tg/02-strings.xml | 2 - .../src/main/res/values-tg/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-tgl/01-core.xml | 2 - .../src/main/res/values-tgl/02-strings.xml | 2 - .../main/res/values-tgl/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-th/01-core.xml | 2 - .../src/main/res/values-th/02-strings.xml | 2 - .../src/main/res/values-th/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ti/01-core.xml | 2 - .../src/main/res/values-ti/02-strings.xml | 2 - .../src/main/res/values-ti/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-tn/01-core.xml | 2 - .../src/main/res/values-tn/02-strings.xml | 2 - .../src/main/res/values-tn/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-tr/01-core.xml | 10 +- .../src/main/res/values-tr/02-strings.xml | 86 +- .../src/main/res/values-tr/03-dialogs.xml | 72 +- .../src/main/res/values-tr/04-network.xml | 2 +- .../src/main/res/values-tr/05-feedback.xml | 2 +- .../src/main/res/values-tr/07-cardbrowser.xml | 68 +- .../src/main/res/values-tr/10-preferences.xml | 6 +- .../src/main/res/values-tr/11-arrays.xml | 58 +- .../main/res/values-tr/18-standard-models.xml | 4 +- AnkiDroid/src/main/res/values-ts/01-core.xml | 2 - .../src/main/res/values-ts/02-strings.xml | 2 - .../src/main/res/values-ts/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-tt/01-core.xml | 14 +- .../src/main/res/values-tt/02-strings.xml | 28 +- .../src/main/res/values-tt/03-dialogs.xml | 30 +- .../src/main/res/values-tt/04-network.xml | 12 +- .../src/main/res/values-tt/06-statistics.xml | 58 +- .../src/main/res/values-tt/07-cardbrowser.xml | 12 +- .../src/main/res/values-tt/08-widget.xml | 2 +- .../src/main/res/values-tt/09-backup.xml | 2 +- .../src/main/res/values-tt/10-preferences.xml | 54 +- .../src/main/res/values-tt/11-arrays.xml | 8 +- .../res/values-tt/16-multimedia-editor.xml | 20 +- .../main/res/values-tt/17-model-manager.xml | 4 +- .../main/res/values-tt/18-standard-models.xml | 6 +- AnkiDroid/src/main/res/values-uk/01-core.xml | 4 +- .../src/main/res/values-uk/02-strings.xml | 6 +- .../src/main/res/values-uk/03-dialogs.xml | 4 +- .../src/main/res/values-uk/10-preferences.xml | 6 +- AnkiDroid/src/main/res/values-ur/01-core.xml | 2 - .../src/main/res/values-ur/02-strings.xml | 2 - .../src/main/res/values-ur/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-uz/01-core.xml | 2 - .../src/main/res/values-uz/02-strings.xml | 2 - .../src/main/res/values-uz/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-ve/01-core.xml | 2 - .../src/main/res/values-ve/02-strings.xml | 2 - .../src/main/res/values-ve/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-vi/01-core.xml | 2 - .../src/main/res/values-vi/02-strings.xml | 8 +- .../src/main/res/values-vi/03-dialogs.xml | 4 +- .../src/main/res/values-vi/10-preferences.xml | 10 +- AnkiDroid/src/main/res/values-wo/01-core.xml | 2 - .../src/main/res/values-wo/02-strings.xml | 2 - .../src/main/res/values-wo/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-xh/01-core.xml | 2 - .../src/main/res/values-xh/02-strings.xml | 2 - .../src/main/res/values-xh/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-yue/01-core.xml | 2 - .../src/main/res/values-yue/02-strings.xml | 2 - .../main/res/values-yue/10-preferences.xml | 4 - .../src/main/res/values-zh-rCN/01-core.xml | 2 - .../src/main/res/values-zh-rCN/02-strings.xml | 2 - .../main/res/values-zh-rCN/10-preferences.xml | 6 +- .../src/main/res/values-zh-rTW/01-core.xml | 2 - .../src/main/res/values-zh-rTW/02-strings.xml | 2 - .../main/res/values-zh-rTW/10-preferences.xml | 4 - AnkiDroid/src/main/res/values-zu/01-core.xml | 2 - .../src/main/res/values-zu/02-strings.xml | 2 - .../src/main/res/values-zu/10-preferences.xml | 4 - AnkiDroid/src/main/res/values/01-core.xml | 2 - AnkiDroid/src/main/res/values/02-strings.xml | 3 - .../src/main/res/values/10-preferences.xml | 5 - AnkiDroid/src/main/res/values/attrs.xml | 5 +- AnkiDroid/src/main/res/values/colors.xml | 2 - AnkiDroid/src/main/res/values/styles.xml | 5 - AnkiDroid/src/main/res/values/theme_black.xml | 3 +- AnkiDroid/src/main/res/values/theme_dark.xml | 3 +- AnkiDroid/src/main/res/values/theme_light.xml | 3 +- AnkiDroid/src/main/res/values/theme_plain.xml | 3 +- .../src/main/res/xml/preferences_advanced.xml | 17 - .../res/xml/preferences_custom_buttons.xml | 6 - .../src/main/res/xml/preferences_general.xml | 1 - .../anki/AbstractFlashcardViewerTest.java | 2 +- .../anki/ActivityStartupUnderBackupTest.java | 7 +- .../anki/BackupManagerIntegrationTest.java | 14 +- .../java/com/ichi2/anki/CardBrowserTest.java | 53 -- .../java/com/ichi2/anki/DeckPickerTest.java | 102 +-- .../com/ichi2/anki/InitialActivityTest.java | 91 -- .../java/com/ichi2/anki/PreferencesTest.java | 72 -- .../ichi2/anki/ReviewerKeyboardInputTest.java | 13 +- .../java/com/ichi2/anki/ReviewerTest.java | 21 - .../java/com/ichi2/anki/RobolectricTest.java | 37 +- .../analytics/AnalyticsConstantsTest.java | 162 ---- .../anki/dialogs/CustomStudyDialogTest.java | 105 +-- .../anki/dialogs/utils/HelpDialogTest.java | 13 +- .../anki/reviewer/ActionButtonStatusTest.java | 1 - .../KeyboardShortcutIntegrationTest.java | 227 ----- .../anki/reviewer/PeripheralKeymapTest.java | 2 +- .../anki/services/ReminderServiceTest.java | 27 - .../ichi2/async/ForegroundTaskManager.java | 111 --- .../com/ichi2/libanki/CollectionTest.java | 4 +- .../java/com/ichi2/libanki/DecksTest.java | 24 +- .../java/com/ichi2/libanki/ModelTest.java | 109 ++- .../test/java/com/ichi2/libanki/TagsTest.java | 83 -- .../ichi2/libanki/TextCardExporterTest.java | 90 -- .../test/java/com/ichi2/libanki/UndoTest.java | 4 +- .../com/ichi2/libanki/sched/SchedV2Test.java | 4 +- .../ichi2/libanki/template/TokenizerTest.java | 96 +- .../ichi2/preferences/TimePreferenceTest.java | 56 -- .../java/com/ichi2/testutils/AnkiAssert.java | 5 +- .../BackendEmulatingOpenConflict.java | 60 -- .../BackendEmulatingOpenConflictTest.java | 55 -- .../testutils/BackupManagerTestUtilities.java | 44 - .../java/com/ichi2/utils/ArrayUtilTest.java | 38 - .../java/com/ichi2/utils/AssetHelperTest.java | 32 - .../com/ichi2/utils/ClipboardUtilTest.java | 25 - .../com/ichi2/utils/CollectionUtilsTest.java | 54 -- .../ichi2/utils/DeckNameComparatorTest.java | 27 - .../utils/ExtendedFragmentFactoryTest.java | 78 -- .../ichi2/utils/FragmentFactoryUtilsTest.java | 54 -- .../java/com/ichi2/utils/JSONObjectTest.java | 139 --- .../test/java/com/ichi2/utils/ListUtil.java | 80 -- .../ichi2/utils/NamedJSONComparatorTest.java | 53 -- .../java/com/ichi2/utils/StringUtilTest.java | 5 - .../com/ichi2/utils/UniqueArrayListTest.java | 566 ------------ README.md | 2 +- .../marketdescription-ar.txt | 2 +- .../marketdescription-fr.txt | 4 +- .../marketdescription-it.txt | 2 +- .../marketdescription-tr.txt | 6 +- .../marketdescription-tt-RU.txt | 2 +- lint-rules/build.gradle | 1 - .../com/ichi2/anki/lint/IssueRegistry.java | 15 +- .../lint/rules/ConstantFieldDetector.java | 100 --- .../lint/rules/DirectToastMakeTextUsage.java | 90 -- .../rules/FieldNamingPatternDetector.java | 91 -- .../NonPublicNonStaticFieldDetector.java | 90 -- .../anki/lint/rules/PrintStackTraceUsage.java | 92 -- .../com/ichi2/anki/lint/utils/Constants.java | 16 - .../lint/rules/ConstantFieldDetectorTest.java | 59 -- .../rules/DirectToastMakeTextUsageTest.java | 92 -- .../NonPublicNonStaticFieldDetectorTest.java | 59 -- .../lint/rules/PrintStackTraceUsageTest.java | 79 -- 566 files changed, 3254 insertions(+), 8622 deletions(-) create mode 100644 .travis.yml delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/InitialActivity.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/MaterialEditTextDialog.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/analytics/AnalyticsConstant.java rename AnkiDroid/src/main/java/com/ichi2/anki/dialogs/{customstudy => }/CustomStudyDialog.java (74%) delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CreateCustomStudySessionListener.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/dialogs/customstudy/CustomStudyDialogFactory.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/AudioPlayer.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/AudioRecorder.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/async/SingleTaskManager.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/libanki/CollectionGetter.java rename AnkiDroid/src/main/java/com/ichi2/libanki/{UndoAction.java => Undoable.java} (63%) delete mode 100644 AnkiDroid/src/main/java/com/ichi2/utils/ExtendedFragmentFactory.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/utils/FragmentFactoryUtils.java delete mode 100644 AnkiDroid/src/main/java/com/ichi2/utils/UniqueArrayList.java delete mode 100644 AnkiDroid/src/main/res/drawable/discord.xml delete mode 100644 AnkiDroid/src/main/res/drawable/facebook.xml create mode 100644 AnkiDroid/src/main/res/drawable/ic_heart_black_24dp.xml create mode 100644 AnkiDroid/src/main/res/drawable/ic_link_black_24dp.xml create mode 100644 AnkiDroid/src/main/res/drawable/ic_mail_outline_black_24dp.xml create mode 100644 AnkiDroid/src/main/res/drawable/ic_message_black_24dp.xml delete mode 100644 AnkiDroid/src/main/res/drawable/ic_support_ankidroid.xml delete mode 100644 AnkiDroid/src/main/res/drawable/reddit.xml delete mode 100644 AnkiDroid/src/main/res/drawable/twitter.xml delete mode 100644 AnkiDroid/src/test/java/com/ichi2/anki/InitialActivityTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/anki/PreferencesTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/anki/analytics/AnalyticsConstantsTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/anki/reviewer/KeyboardShortcutIntegrationTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/async/ForegroundTaskManager.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/libanki/TagsTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/libanki/TextCardExporterTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/preferences/TimePreferenceTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/testutils/BackendEmulatingOpenConflict.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/testutils/BackendEmulatingOpenConflictTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/testutils/BackupManagerTestUtilities.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/ArrayUtilTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/AssetHelperTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/ClipboardUtilTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/CollectionUtilsTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/DeckNameComparatorTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/ExtendedFragmentFactoryTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/FragmentFactoryUtilsTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/ListUtil.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/NamedJSONComparatorTest.java delete mode 100644 AnkiDroid/src/test/java/com/ichi2/utils/UniqueArrayListTest.java delete mode 100644 lint-rules/src/main/java/com/ichi2/anki/lint/rules/ConstantFieldDetector.java delete mode 100644 lint-rules/src/main/java/com/ichi2/anki/lint/rules/DirectToastMakeTextUsage.java delete mode 100644 lint-rules/src/main/java/com/ichi2/anki/lint/rules/FieldNamingPatternDetector.java delete mode 100644 lint-rules/src/main/java/com/ichi2/anki/lint/rules/NonPublicNonStaticFieldDetector.java delete mode 100644 lint-rules/src/main/java/com/ichi2/anki/lint/rules/PrintStackTraceUsage.java delete mode 100644 lint-rules/src/test/java/com/ichi2/anki/lint/rules/ConstantFieldDetectorTest.java delete mode 100644 lint-rules/src/test/java/com/ichi2/anki/lint/rules/DirectToastMakeTextUsageTest.java delete mode 100644 lint-rules/src/test/java/com/ichi2/anki/lint/rules/NonPublicNonStaticFieldDetectorTest.java delete mode 100644 lint-rules/src/test/java/com/ichi2/anki/lint/rules/PrintStackTraceUsageTest.java diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 99b56059e7c0..c5b11df4c01f 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -25,7 +25,6 @@ - +