Search in sources :

Example 1 with ListDecoration

use of wangdaye.com.geometricweather.ui.decotarion.ListDecoration in project GeometricWeather by WangDaYeeeeee.

the class AlertActivity method initWidget.

private void initWidget() {
    this.container = (CoordinatorLayout) findViewById(R.id.activity_alert_container);
    Toolbar toolbar = (Toolbar) findViewById(R.id.activity_alert_toolbar);
    toolbar.setNavigationIcon(R.drawable.ic_toolbar_back);
    toolbar.setNavigationOnClickListener(this);
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.activity_alert_recyclerView);
    recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.addItemDecoration(new ListDecoration(this));
    recyclerView.setAdapter(new AlertAdapter(alarmList));
}
Also used : AlertAdapter(wangdaye.com.geometricweather.ui.adapter.AlertAdapter) RecyclerView(android.support.v7.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ListDecoration(wangdaye.com.geometricweather.ui.decotarion.ListDecoration) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with ListDecoration

use of wangdaye.com.geometricweather.ui.decotarion.ListDecoration in project GeometricWeather by WangDaYeeeeee.

the class ManageActivity method initWidget.

private void initWidget() {
    this.container = findViewById(R.id.activity_manage_container);
    this.cardView = findViewById(R.id.activity_manage_searchBar);
    cardView.setOnClickListener(this);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        cardView.setTransitionName(getString(R.string.transition_activity_search_bar));
    }
    this.recyclerView = findViewById(R.id.activity_manage_recyclerView);
    recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.addItemDecoration(new ListDecoration(this));
    recyclerView.setAdapter(adapter);
    ItemTouchHelper itemTouchHelper = new ItemTouchHelper(new LocationSwipeCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT));
    itemTouchHelper.attachToRecyclerView(recyclerView);
}
Also used : ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ListDecoration(wangdaye.com.geometricweather.ui.decotarion.ListDecoration)

Example 3 with ListDecoration

use of wangdaye.com.geometricweather.ui.decotarion.ListDecoration in project GeometricWeather by WangDaYeeeeee.

the class SearcActivity method initWidget.

private void initWidget() {
    this.container = findViewById(R.id.activity_search_container);
    findViewById(R.id.activity_search_searchBar).setOnClickListener(this);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        findViewById(R.id.activity_search_searchBar).setTransitionName(getString(R.string.transition_activity_search_bar));
    }
    this.searchContainer = findViewById(R.id.activity_search_searchContainer);
    findViewById(R.id.activity_search_backBtn).setOnClickListener(this);
    findViewById(R.id.activity_search_clearBtn).setOnClickListener(this);
    this.editText = findViewById(R.id.activity_search_editText);
    editText.setOnEditorActionListener(this);
    this.recyclerView = findViewById(R.id.activity_search_recyclerView);
    recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.addItemDecoration(new ListDecoration(this));
    recyclerView.setAdapter(adapter);
    this.progressView = findViewById(R.id.activity_search_progress);
    progressView.setAlpha(0);
    AnimatorSet animationSet = (AnimatorSet) AnimatorInflater.loadAnimator(this, R.animator.search_container_in);
    animationSet.setStartDelay(350);
    animationSet.setTarget(searchContainer);
    animationSet.start();
}
Also used : AnimatorSet(android.animation.AnimatorSet) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ListDecoration(wangdaye.com.geometricweather.ui.decotarion.ListDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 ListDecoration (wangdaye.com.geometricweather.ui.decotarion.ListDecoration)3 AnimatorSet (android.animation.AnimatorSet)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Toolbar (android.support.v7.widget.Toolbar)1 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)1 AlertAdapter (wangdaye.com.geometricweather.ui.adapter.AlertAdapter)1