Search in sources :

Example 1 with SensorProvider

use of adapter.SensorProvider in project GwellDemo by dxsdyhm.

the class SensorActivity method initRC.

private void initRC() {
    rcSensor.setLayoutManager(new GridLayoutManager(this, 8));
    items = new Items();
    adapter = new MultiTypeAdapter(items);
    SensorProvider provider = new SensorProvider();
    adapter.register(Integer.class, provider);
    provider.setOnItemClickListner(new SensorProvider.OnItemClickListner() {

        @Override
        public void onItemClick(int position, Integer integer) {
            if (integer == 1) {
                //学习配对
                P2PHandler.getInstance().setDefenceAreaState(deviceId, devicePass, position / 8, position % 8, 0);
                Toast.makeText(SensorActivity.this, R.string.start_pair, Toast.LENGTH_SHORT).show();
                currentPositon = position;
            }
        }
    });
    rcSensor.setAdapter(adapter);
}
Also used : SensorProvider(adapter.SensorProvider) GridLayoutManager(android.support.v7.widget.GridLayoutManager) Items(me.drakeet.multitype.Items) MultiTypeAdapter(me.drakeet.multitype.MultiTypeAdapter)

Aggregations

SensorProvider (adapter.SensorProvider)1 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 Items (me.drakeet.multitype.Items)1 MultiTypeAdapter (me.drakeet.multitype.MultiTypeAdapter)1