Search in sources :

Example 1 with Case

use of com.bluestacks.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);
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent) Case(com.bluestacks.bugzy.data.model.Case)

Example 2 with Case

use of com.bluestacks.bugzy.data.model.Case in project bugzy by cpunq.

the class CaseDetailsActivity method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    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();
    }
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Bundle(android.os.Bundle) Case(com.bluestacks.bugzy.data.model.Case)

Example 3 with Case

use of com.bluestacks.bugzy.data.model.Case in project bugzy by cpunq.

the class CaseAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(CaseHolder holder, int position) {
    Case bug = mBugs.get(position);
    holder.bindData(bug);
}
Also used : Case(com.bluestacks.bugzy.data.model.Case)

Example 4 with Case

use of com.bluestacks.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());
        }
        i++;
    }
}
Also used : Case(com.bluestacks.bugzy.data.model.Case) Transaction(android.arch.persistence.room.Transaction)

Example 5 with Case

use of com.bluestacks.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()));
    mRequiredMerge.setText(mCase.getRequiredMergeIn());
    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(Color.parseColor("#e74c3c"));
    } else if (bug.getPriority() == 4) {
        mPriorityIndicator.setBackgroundColor(Color.parseColor("#95a5a6"));
    } else if (bug.getPriority() == 5) {
        mPriorityIndicator.setBackgroundColor(Color.parseColor("#ddb65b"));
    } else if (bug.getPriority() <= 7) {
        mPriorityIndicator.setBackgroundColor(Color.parseColor("#bdc3c7"));
    } else {
        mPriorityIndicator.setBackgroundColor(Color.parseColor("#ecf0f1"));
    }
}
Also used : CaseEvent(com.bluestacks.bugzy.data.model.CaseEvent) Case(com.bluestacks.bugzy.data.model.Case) UiThread(android.support.annotation.UiThread)

Aggregations

Case (com.bluestacks.bugzy.data.model.Case)6 Bundle (android.os.Bundle)2 LiveData (android.arch.lifecycle.LiveData)1 MutableLiveData (android.arch.lifecycle.MutableLiveData)1 Transaction (android.arch.persistence.room.Transaction)1 Intent (android.content.Intent)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 UiThread (android.support.annotation.UiThread)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 CaseEvent (com.bluestacks.bugzy.data.model.CaseEvent)1 SearchResultsResource (com.bluestacks.bugzy.data.model.SearchResultsResource)1 ApiResponse (com.bluestacks.bugzy.data.remote.ApiResponse)1 NetworkBoundResource (com.bluestacks.bugzy.data.remote.NetworkBoundResource)1 ListCasesData (com.bluestacks.bugzy.data.remote.model.ListCasesData)1 Response (com.bluestacks.bugzy.data.remote.model.Response)1 SearchCasesRequest (com.bluestacks.bugzy.data.remote.model.SearchCasesRequest)1 AbsentLiveData (com.bluestacks.bugzy.ui.search.AbsentLiveData)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1