Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 707e5cf0 authored by Marten Gajda's avatar Marten Gajda
Browse files

don't update editor view if values have not been loaded yet

parent 11bcbd3b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -354,12 +354,12 @@ public class EditTaskFragment extends SupportFragment implements LoaderManager.L

	private void updateView()
	{
		/**
		/*
		 * If the model loads very slowly then this function may be called after onDetach. In this case check if Activity is <code>null</code> and return if
		 * <code>true</code>.
		 * <code>true</code>. Also return if we don't have values or the values are still loading.
		 */
		Activity activity = getActivity();
		if (activity == null)
		if (activity == null || mValues == null || mValues.isLoading())
		{
			return;
		}
+18 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ public final class ContentSet implements OnContentLoadedListener, Parcelable
	 */
	private Set<String> mAfterKeys;

	/**
	 * Indicates that loading is in process.
	 */
	private boolean mLoading = false;


	/**
	 * Private constructor that is used when creating a ContentSet form a parcel.
@@ -131,6 +136,7 @@ public final class ContentSet implements OnContentLoadedListener, Parcelable
		String itemType = context.getContentResolver().getType(mUri);
		if (itemType != null && !itemType.startsWith(ContentResolver.CURSOR_DIR_BASE_TYPE))
		{
			mLoading = true;
			new AsyncContentLoader(context, this, mapper).execute(mUri);
		}
		else
@@ -144,10 +150,22 @@ public final class ContentSet implements OnContentLoadedListener, Parcelable
	public void onContentLoaded(ContentValues values)
	{
		mBeforeContentValues = values;
		mLoading = false;
		notifyLoadedListeners();
	}


	/**
	 * Returns whether this {@link ContentSet} is currently loading values.
	 * 
	 * @return <code>true</code> is an asynchronous loading operation is in progress, <code>false</code> otherwise.
	 */
	public boolean isLoading()
	{
		return mLoading;
	}


	/**
	 * Delete this content. This ContentSet can no longer be used after this method has been called!
	 *