use of com.ichi2.anki.multimediacard.fields.IControllerFactory in project AnkiChinaAndroid by ankichinateam.
the class MultimediaEditFieldActivity method recreateEditingUi.
private void recreateEditingUi(ChangeUIRequest newUI, @Nullable Bundle savedInstanceState) {
Timber.d("recreateEditingUi()");
// Permissions are checked async, save our current state to allow continuation
mCurrentChangeRequest = newUI;
// As we only get here a second time if we have the required permissions
if (newUI.getRequiresPermissionCheck() && performPermissionRequest(newUI.getField())) {
newUI.markAsPermissionRequested();
return;
}
IControllerFactory controllerFactory = BasicControllerFactory.getInstance(getCol().getTime());
IFieldController fieldController = controllerFactory.createControllerForField(newUI.getField());
if (fieldController == null) {
Timber.w("Field controller creation failed");
UIRecreationHandler.onControllerCreationFailed(newUI, this);
return;
}
UIRecreationHandler.onPreFieldControllerReplacement(mFieldController);
mFieldController = fieldController;
mField = newUI.getField();
setupUIController(mFieldController, savedInstanceState);
LinearLayout linearLayout = findViewById(R.id.LinearLayoutInScrollViewFieldEdit);
linearLayout.removeAllViews();
mFieldController.createUI(this, linearLayout);
UIRecreationHandler.onPostUICreation(newUI, this);
}
use of com.ichi2.anki.multimediacard.fields.IControllerFactory in project Anki-Android by Ramblurr.
the class EditFieldActivity method recreateEditingUi.
private void recreateEditingUi() {
IControllerFactory controllerFactory = BasicControllerFactory.getInstance();
mFieldController = controllerFactory.createControllerForField(mField);
if (mFieldController == null) {
// Log.d(AnkiDroidApp.TAG, "Field controller creation failed");
return;
}
mFieldController.setField(mField);
mFieldController.setFieldIndex(mFieldIndex);
mFieldController.setNote(mNote);
mFieldController.setEditingActivity(this);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.LinearLayoutInScrollViewFieldEdit);
linearLayout.removeAllViews();
mFieldController.createUI(linearLayout);
}
use of com.ichi2.anki.multimediacard.fields.IControllerFactory in project Anki-Android by ankidroid.
the class MultimediaEditFieldActivity method recreateEditingUi.
private void recreateEditingUi(ChangeUIRequest newUI, @Nullable Bundle savedInstanceState) {
Timber.d("recreateEditingUi()");
// Permissions are checked async, save our current state to allow continuation
mCurrentChangeRequest = newUI;
// As we only get here a second time if we have the required permissions
if (newUI.getRequiresPermissionCheck() && performPermissionRequest(newUI.getField())) {
newUI.markAsPermissionRequested();
return;
}
IControllerFactory controllerFactory = BasicControllerFactory.getInstance();
IFieldController fieldController = controllerFactory.createControllerForField(newUI.getField());
if (fieldController == null) {
Timber.w("Field controller creation failed");
UIRecreationHandler.onControllerCreationFailed(newUI, this);
return;
}
UIRecreationHandler.onPreFieldControllerReplacement(mFieldController);
mFieldController = fieldController;
mField = newUI.getField();
setupUIController(mFieldController, savedInstanceState);
LinearLayout linearLayout = findViewById(R.id.LinearLayoutInScrollViewFieldEdit);
linearLayout.removeAllViews();
mFieldController.createUI(this, linearLayout);
UIRecreationHandler.onPostUICreation(newUI, this);
}
Aggregations