Search in sources :

Example 1 with CaseAdapter

use of com.bluestacks.bugzy.ui.common.CaseAdapter in project bugzy by cpunq.

the class MyCasesFragment method onActivityCreated.

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setupSortingView();
    mViewModel = ViewModelProviders.of(this, mViewModelFactory).get(MyCasesViewModel.class);
    if (mHomeActivityCallbacks != null) {
        mHomeActivityCallbacks.onFragmentsActivityCreated(this, mFilterText, getTag());
    }
    this.subscribeToViewModel();
    LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(getActivity());
    mRecyclerView.setLayoutManager(mLinearLayoutManager);
    mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity().getApplicationContext(), DividerItemDecoration.VERTICAL));
    mAdapter = new CaseAdapter(mCases, this);
    mRecyclerView.setAdapter(mAdapter);
    // Load cases
    mViewModel.loadCases(mFilter);
}
Also used : CaseAdapter(com.bluestacks.bugzy.ui.common.CaseAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration)

Example 2 with CaseAdapter

use of com.bluestacks.bugzy.ui.common.CaseAdapter in project bugzy by cpunq.

the class SearchActivity method setupViews.

private void setupViews() {
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    prepareSearchEditText();
    mSearchSuggestionAdapter = new SearchSuggestionAdapter(position -> {
        if (mSearchSuggestions == null) {
            return;
        }
        mViewModel.searchSuggestionSelected(mSearchSuggestions.get(position));
    });
    mSearchSuggestionView.setLayoutManager(new LinearLayoutManager(this));
    mSearchSuggestionView.setAdapter(mSearchSuggestionAdapter);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.addItemDecoration(new DividerItemDecoration(getApplicationContext(), DividerItemDecoration.VERTICAL));
    mAdapter = new CaseAdapter(mCases, this);
    mRecyclerView.setAdapter(mAdapter);
    prepareSearchHistoryRecyclerView();
}
Also used : Bundle(android.os.Bundle) KeyEvent(android.view.KeyEvent) ButterKnife(butterknife.ButterKnife) OnItemClickListener(com.bluestacks.bugzy.utils.OnItemClickListener) CaseAdapter(com.bluestacks.bugzy.ui.common.CaseAdapter) Intent(android.content.Intent) CaseDetailsActivity(com.bluestacks.bugzy.ui.casedetails.CaseDetailsActivity) BaseActivity(com.bluestacks.bugzy.ui.BaseActivity) IBinder(android.os.IBinder) Editable(android.text.Editable) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) MenuItem(android.view.MenuItem) InputMethodManager(android.view.inputmethod.InputMethodManager) BindView(butterknife.BindView) Inject(javax.inject.Inject) Resource(com.bluestacks.bugzy.data.model.Resource) Menu(android.view.Menu) R(com.bluestacks.bugzy.R) View(android.view.View) SearchSuggestion(com.bluestacks.bugzy.data.model.SearchSuggestion) Status(com.bluestacks.bugzy.data.model.Status) RecentSearch(com.bluestacks.bugzy.data.model.RecentSearch) ViewModelProvider(android.arch.lifecycle.ViewModelProvider) Case(com.bluestacks.bugzy.data.model.Case) UiThread(android.support.annotation.UiThread) InputType(android.text.InputType) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ErrorView(com.bluestacks.bugzy.ui.common.ErrorView) ViewModelProviders(android.arch.lifecycle.ViewModelProviders) RecyclerView(android.support.v7.widget.RecyclerView) List(java.util.List) TextView(android.widget.TextView) Toolbar(android.support.v7.widget.Toolbar) Nullable(android.support.annotation.Nullable) EditorInfo(android.view.inputmethod.EditorInfo) EditText(android.widget.EditText) TextWatcher(android.text.TextWatcher) CaseAdapter(com.bluestacks.bugzy.ui.common.CaseAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration)

Aggregations

DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 CaseAdapter (com.bluestacks.bugzy.ui.common.CaseAdapter)2 ViewModelProvider (android.arch.lifecycle.ViewModelProvider)1 ViewModelProviders (android.arch.lifecycle.ViewModelProviders)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 IBinder (android.os.IBinder)1 Nullable (android.support.annotation.Nullable)1 UiThread (android.support.annotation.UiThread)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Toolbar (android.support.v7.widget.Toolbar)1 Editable (android.text.Editable)1 InputType (android.text.InputType)1 TextWatcher (android.text.TextWatcher)1 KeyEvent (android.view.KeyEvent)1 Menu (android.view.Menu)1 MenuItem (android.view.MenuItem)1 View (android.view.View)1 EditorInfo (android.view.inputmethod.EditorInfo)1