Search in sources :

Example 1 with BaseStationAdapter

use of com.secupwn.aimsicd.data.adapter.BaseStationAdapter in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class DbViewerFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    DbViewerSpinnerAdapter mSpinnerAdapter = new DbViewerSpinnerAdapter(getActivity(), R.layout.item_spinner_db_viewer);
    tblSpinner.setAdapter(mSpinnerAdapter);
    tblSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> parentView, View selectedItemView, final int position, long id) {
            Object selectedItem = tblSpinner.getSelectedItem();
            if (!(selectedItem instanceof StatesDbViewer)) {
                return;
            }
            mTableSelected = (StatesDbViewer) selectedItem;
            switch(position) {
                case 0:
                    setListAdapter(new BaseStationAdapter(getActivity(), realm.where(BaseTransceiverStation.class).findAll()));
                    break;
                case 1:
                    setListAdapter(new MeasureAdapter(getActivity(), realm.where(Measure.class).findAll()));
                    break;
                case 2:
                    setListAdapter(new ImportAdapter(getActivity(), realm.where(Import.class).findAll()));
                    break;
                case 3:
                    setListAdapter(new DefaultLocationAdapter(getActivity(), realm.where(DefaultLocation.class).findAll()));
                    break;
                case //Silent SMS
                4:
                    setListAdapter(new SmsDataAdapter(getActivity(), realm.where(SmsData.class).findAll()));
                    break;
                case 5:
                    setListAdapter(new MeasuredCellStrengthAdapter(getActivity(), realm.where(Measure.class).findAll()));
                    break;
                case 6:
                    setListAdapter(new EventAdapter(getActivity(), realm.where(Event.class).findAll()));
                    break;
                case 7:
                    setListAdapter(new DetectionStringAdapter(getActivity(), realm.where(SmsDetectionString.class).findAll()));
                    break;
                default:
                    throw new IllegalArgumentException("Unknown type of table");
            }
        }

        @Override
        public void onNothingSelected(AdapterView<?> parentView) {
        }
    });
}
Also used : SmsDataAdapter(com.secupwn.aimsicd.data.adapter.SmsDataAdapter) MeasuredCellStrengthAdapter(com.secupwn.aimsicd.adapters.MeasuredCellStrengthAdapter) ImportAdapter(com.secupwn.aimsicd.data.adapter.ImportAdapter) StatesDbViewer(com.secupwn.aimsicd.enums.StatesDbViewer) MeasureAdapter(com.secupwn.aimsicd.data.adapter.MeasureAdapter) DefaultLocationAdapter(com.secupwn.aimsicd.data.adapter.DefaultLocationAdapter) InjectView(io.freefair.android.injection.annotation.InjectView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) EventAdapter(com.secupwn.aimsicd.data.adapter.EventAdapter) DetectionStringAdapter(com.secupwn.aimsicd.data.adapter.DetectionStringAdapter) DbViewerSpinnerAdapter(com.secupwn.aimsicd.adapters.DbViewerSpinnerAdapter) BaseStationAdapter(com.secupwn.aimsicd.data.adapter.BaseStationAdapter) AdapterView(android.widget.AdapterView)

Aggregations

View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 DbViewerSpinnerAdapter (com.secupwn.aimsicd.adapters.DbViewerSpinnerAdapter)1 MeasuredCellStrengthAdapter (com.secupwn.aimsicd.adapters.MeasuredCellStrengthAdapter)1 BaseStationAdapter (com.secupwn.aimsicd.data.adapter.BaseStationAdapter)1 DefaultLocationAdapter (com.secupwn.aimsicd.data.adapter.DefaultLocationAdapter)1 DetectionStringAdapter (com.secupwn.aimsicd.data.adapter.DetectionStringAdapter)1 EventAdapter (com.secupwn.aimsicd.data.adapter.EventAdapter)1 ImportAdapter (com.secupwn.aimsicd.data.adapter.ImportAdapter)1 MeasureAdapter (com.secupwn.aimsicd.data.adapter.MeasureAdapter)1 SmsDataAdapter (com.secupwn.aimsicd.data.adapter.SmsDataAdapter)1 StatesDbViewer (com.secupwn.aimsicd.enums.StatesDbViewer)1 InjectView (io.freefair.android.injection.annotation.InjectView)1