Skip to content

Commit

Permalink
remove some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfs committed Feb 7, 2021
1 parent 8692891 commit bd36385
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 51 deletions.
117 changes: 109 additions & 8 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.dmfs.tasks.readdata.TaskContentUri;
import org.dmfs.tasks.utils.DateFormatter;
import org.dmfs.tasks.utils.DateFormatter.DateFormatContext;
import org.dmfs.tasks.widget.ProgressBackgroundView;
import org.dmfs.tasks.widget.SmartView;

import androidx.annotation.NonNull;
Expand Down Expand Up @@ -83,9 +82,6 @@ public void update(Params subtask)

views.opentasksTaskDetailsSubtaskListRibbon.setBackgroundColor(subtask.color().argb());

new ProgressBackgroundView(views.opentasksTaskDetailsSubtaskProgressBackground)
.update(subtask.percentComplete());

views.getRoot().setOnClickListener((v) ->
{
Context ctx = v.getContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ public void inflate()
addField(new FieldDescriptor(context, R.id.task_field_list_and_account_name, R.string.task_list, null, TaskFieldAdapters.LIST_AND_ACCOUNT_NAME)
.setViewLayout(TEXT_VIEW_NO_LINKS).setIcon(R.drawable.ic_detail_list));

setAllowRecurrence(false);
setAllowExceptions(false);

mInflated = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ public void inflate()
addField(new FieldDescriptor(context, R.id.task_field_due, R.string.task_due, TaskFieldAdapters.DUE).setViewLayout(TIME_VIEW_ADD_BUTTON)
.setEditorLayout(TIME_EDIT).setIcon(R.drawable.ic_detail_due));

setAllowRecurrence(false);
setAllowExceptions(false);

mInflated = true;
}
}
41 changes: 8 additions & 33 deletions opentasks/src/main/java/org/dmfs/tasks/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import androidx.collection.SparseArrayCompat;
import android.text.TextUtils;

import org.dmfs.provider.tasks.AuthorityUtil;
Expand All @@ -32,6 +31,8 @@
import java.util.ArrayList;
import java.util.List;

import androidx.collection.SparseArrayCompat;


/**
* An abstract model class.
Expand All @@ -55,8 +56,6 @@ public abstract class Model

boolean mInflated = false;

private boolean mAllowRecurrence = false;
private boolean mAllowExceptions = false;
private int mIconId = -1;
private int mLabelId = -1;
private String mAccountType;
Expand Down Expand Up @@ -112,31 +111,7 @@ public List<FieldDescriptor> getFields()
// TODO Auto-generated catch block
e.printStackTrace();
}
return new ArrayList<FieldDescriptor>(mFields);
}


public boolean getAllowRecurrence()
{
return mAllowRecurrence;
}


void setAllowRecurrence(boolean allowRecurrence)
{
mAllowRecurrence = allowRecurrence;
}


public boolean getAllowExceptions()
{
return mAllowExceptions;
}


void setAllowExceptions(boolean allowExceptions)
{
mAllowExceptions = allowExceptions;
return new ArrayList<>(mFields);
}


Expand Down Expand Up @@ -183,7 +158,7 @@ public void startInsertIntent(Activity activity, Account account)
throw new IllegalStateException("Syncadapter for " + mAccountType + " does not support inserting lists.");
}

activity.startActivity(getListIntent(mContext, Intent.ACTION_INSERT, account));
activity.startActivity(getListIntent(Intent.ACTION_INSERT, account));
}


Expand All @@ -194,7 +169,7 @@ public void startEditIntent(Activity activity, Account account, long listId, Str
throw new IllegalStateException("Syncadapter for " + mAccountType + " does not support editing lists.");
}

Intent intent = getListIntent(mContext, Intent.ACTION_EDIT, account);
Intent intent = getListIntent(Intent.ACTION_EDIT, account);
intent.setData(ContentUris.withAppendedId(TaskLists.getContentUri(mAuthority), listId));
if (nameHint != null)
{
Expand All @@ -212,7 +187,7 @@ public boolean hasEditActivity()
{
if (mSupportsEditListIntent == null)
{
ComponentName editComponent = getListIntent(mContext, Intent.ACTION_EDIT, null).setData(
ComponentName editComponent = getListIntent(Intent.ACTION_EDIT, null).setData(
ContentUris.withAppendedId(TaskLists.getContentUri(mAuthority), 0 /* for pure intent resolution it doesn't matter which id we append */))
.resolveActivity(mContext.getPackageManager());
mSupportsEditListIntent = editComponent != null;
Expand All @@ -226,15 +201,15 @@ public boolean hasInsertActivity()
{
if (mSupportsInsertListIntent == null)
{
ComponentName insertComponent = getListIntent(mContext, Intent.ACTION_INSERT, null).resolveActivity(mContext.getPackageManager());
ComponentName insertComponent = getListIntent(Intent.ACTION_INSERT, null).resolveActivity(mContext.getPackageManager());
mSupportsInsertListIntent = insertComponent != null;
}

return mSupportsInsertListIntent;
}


private Intent getListIntent(Context context, String action, Account account)
private Intent getListIntent(String action, Account account)
{
// insert action
Intent insertIntent = new Intent();
Expand Down

0 comments on commit bd36385

Please sign in to comment.