0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 03:52:15 +02:00

Revert "Display study options properly on start on tablet (#8756)"

This reverts commit 6a0b1d38e5.
This commit is contained in:
Mike Hardy 2021-06-02 15:09:48 -05:00
parent 6a0b1d38e5
commit b559521a06
No known key found for this signature in database
GPG Key ID: 2FB9315A0E38FF42
2 changed files with 4 additions and 23 deletions

View File

@ -224,9 +224,6 @@ public class DeckPicker extends NavigationDrawerActivity implements
// flag keeping track of when the app has been paused
private boolean mActivityPaused = false;
// Flag to keep track of startup error
private boolean mStartupError = false;
private String mExportFileName;
@Nullable private CollectionTask<?, ?> mEmptyCardTask = null;
@ -471,11 +468,6 @@ public class DeckPicker extends NavigationDrawerActivity implements
// set protected variable from NavigationDrawerActivity
mFragmented = mStudyoptionsFrame != null && mStudyoptionsFrame.getVisibility() == View.VISIBLE;
// Open StudyOptionsFragment if in fragmented mode
if (mFragmented && !mStartupError) {
loadStudyOptionsFragment(false);
}
registerExternalStorageListener();
// create inherited navigation drawer layout here so that it can be used by parent class
@ -550,12 +542,10 @@ public class DeckPicker extends NavigationDrawerActivity implements
// Show any necessary dialogs (e.g. changelog, special messages, etc)
SharedPreferences sharedPrefs = AnkiDroidApp.getSharedPrefs(this);
showStartupScreensAndDialogs(sharedPrefs, 0);
mStartupError = false;
} else {
// Show error dialogs
StartupFailure failure = InitialActivity.getStartupFailureType(this);
handleStartupFailure(failure);
mStartupError = true;
}
} else {
requestStoragePermission();
@ -1140,7 +1130,10 @@ public class DeckPicker extends NavigationDrawerActivity implements
getDialogHandler().sendMessage(handlerMessage);
}
}
// Open StudyOptionsFragment if in fragmented mode
if (mFragmented) {
loadStudyOptionsFragment(false);
}
automaticSync();
}

View File

@ -5,8 +5,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageManager;
import android.database.SQLException;
import android.os.Bundle;
import android.view.Menu;
import com.ichi2.anki.dialogs.DatabaseErrorDialog;
@ -23,7 +21,6 @@ import com.ichi2.utils.ResourceLoader;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.annotation.Config;
import java.io.File;
import java.util.HashMap;
@ -410,15 +407,6 @@ public class DeckPickerTest extends RobolectricTest {
}
}
@Test
@Config(qualifiers = "xlarge-port")
public void checkDisplayOfStudyOptionsOnTablet() {
DeckPickerEx deckPickerEx = super.startActivityNormallyOpenCollectionWithIntent(DeckPickerEx.class, new Intent());
StudyOptionsFragment studyOptionsFragment = (StudyOptionsFragment) deckPickerEx.getSupportFragmentManager().findFragmentById(R.id.studyoptions_fragment);
assertThat("Study options should show on start on tablet", studyOptionsFragment, notNullValue());
}
private void useCollection(@SuppressWarnings("SameParameterValue") CollectionType collectionType) {
// load asset into temp