use of in.bugzy.data.model.Case in project bugzy by cpunq.
the class CaseDao method upsertCases.
/**
* It does a partial UPDATE in case the case is already present
* @param cases
*/
@Transaction
public void upsertCases(List<Case> cases) {
long[] ids = insertCases(cases);
int i = 0;
for (long id : ids) {
if (id == -1) {
// cautiously update
Case kase = cases.get(i);
updatePartial(kase.getTitle(), kase.getPriority(), kase.getFixFor(), kase.getProjectName(), kase.getProjectArea(), kase.getStatus(), kase.getPersonAssignedTo(), kase.getPersonOpenedBy(), kase.isFavorite(), kase.getIxBug(), kase.getProjectId(), kase.getFixForId(), kase.getPersonAssignedToId(), kase.getPersonOpenedById(), kase.getProjectAreaId(), kase.getCategoryId());
}
i++;
}
}
use of in.bugzy.data.model.Case in project bugzy by cpunq.
the class CaseAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof HeaderHolder) {
((HeaderHolder) holder).bind(mHeaderText);
}
if (holder instanceof CaseHolder) {
Case bug = mBugs.get(getBugPosition(position));
((CaseHolder) holder).bindData(bug);
}
}
use of in.bugzy.data.model.Case in project bugzy by cpunq.
the class SearchActivity method onItemClick.
@Override
public void onItemClick(int position) {
Case cas = mCases.get(position);
Intent i = new Intent(this, CaseDetailsActivity.class);
Bundle arg = new Bundle();
arg.putString("bug_id", String.valueOf(cas.getIxBug()));
arg.putSerializable("bug", cas);
i.putExtras(arg);
this.startActivity(i);
}
use of in.bugzy.data.model.Case in project bugzy by cpunq.
the class CaseDetailsActivity method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setAppliedTheme();
setContentView(R.layout.activity_case_details);
ButterKnife.bind(this);
// Parse arguments
Bundle extras = getIntent().getExtras();
mFogBugzId = extras.getString("bug_id");
Case aCase = (Case) extras.getSerializable("bug");
setupToolbar();
setupViews();
if (savedInstanceState == null) {
CaseDetailsFragment fragment = CaseDetailsFragment.getInstance(mFogBugzId, aCase);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction().replace(R.id.container_frame, fragment);
ft.commit();
}
}
use of in.bugzy.data.model.Case in project bugzy by cpunq.
the class CaseDetailsFragment method showCaseDetails.
@UiThread
protected void showCaseDetails(Case aCase) {
mCase = aCase;
showContent();
showActionButtons(mCase);
List<CaseEvent> evs = mCase.getCaseevents();
if (evs != null) {
mAdapter.setData(evs);
mAdapter.notifyDataSetChanged();
}
mBugId.setText(String.valueOf(mCase.getIxBug()));
mBugTitle.setText(String.valueOf(mCase.getTitle()));
mAssignedTo.setText(String.valueOf(mCase.getPersonAssignedTo()));
mProjectView.setText(mCase.getProjectName());
if (!TextUtils.isEmpty(mCase.getFixFor())) {
mMileStone.setText(String.valueOf(mCase.getFixFor()));
}
mActiveStatus.setText(String.valueOf(mCase.getStatus()));
Case bug = mCase;
if (bug.getPriority() <= 3) {
mPriorityIndicator.setBackgroundColor(getResources().getColor(R.color.p3));
} else if (bug.getPriority() == 4) {
mPriorityIndicator.setBackgroundColor(getResources().getColor(R.color.p4));
} else if (bug.getPriority() == 5) {
mPriorityIndicator.setBackgroundColor(getResources().getColor(R.color.p5));
} else if (bug.getPriority() <= 6) {
mPriorityIndicator.setBackgroundColor(getResources().getColor(R.color.p6));
}
}
Aggregations