예제 #1
0
  @Override
  protected void onStart() {
    super.onStart();
    setActionBarInfo(getString(R.string.scenes_title));
    this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    opzioni.initializePrefs();
    if (!opzioni.isDbConfigured()) {
      AlertDialogHelper.dbNotInitedDialog(this);
    }
    SoulissDBHelper.open();

    // prendo comandi dal DB, setto adapter
    LinkedList<SoulissScene> goer = datasource.getScenes(SoulissClient.getAppContext());
    scenesArray = new SoulissScene[goer.size()];
    scenesArray = goer.toArray(scenesArray);
    progsAdapter = new SceneListAdapter(this, scenesArray, opzioni);
    // Adapter della lista
    listaScenesView.setAdapter(progsAdapter);
    listaScenesView.invalidateViews();
    // ImageView nodeic = (ImageView) findViewById(R.id.scene_icon);
    // nodeic.setAlpha(150);
    mAdapter =
        new NavDrawerAdapter(
            SceneListActivity.this,
            R.layout.drawer_list_item,
            dmh.getStuff(),
            DrawerMenuHelper.SCENES);
    mDrawerList.setAdapter(mAdapter);
  }
예제 #2
0
 @Override
 protected void onStart() {
   super.onStart();
   setActionBarInfo(getString(R.string.tag));
   opzioni.initializePrefs();
   if (!opzioni.isDbConfigured()) {
     AlertDialogHelper.dbNotInitedDialog(this);
   }
   SoulissDBHelper.open();
   this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
   navAdapter =
       new NavDrawerAdapter(
           TagGridActivity.this, R.layout.drawer_list_item, dmh.getStuff(), DrawerMenuHelper.TAGS);
   mDrawerList.setAdapter(navAdapter);
 }
예제 #3
0
  @Override
  protected void onStart() {
    super.onStart();
    setActionBarInfo(getString(R.string.programs_title));
    this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    SoulissDBHelper.open();
    opzioni.initializePrefs();
    if (!opzioni.isDbConfigured()) {
      AlertDialogHelper.dbNotInitedDialog(this);
    }
    if (!opzioni.isDataServiceEnabled()) {
      AlertDialogHelper.serviceNotActiveDialog(this);
    }
    // prendo comandi dal DB, setto adapter
    LinkedList<SoulissCommand> goer = datasource.getUnexecutedCommands(this);
    if (goer.size() == 0) tt.setText(getString(R.string.programs_no));
    programsArray = new SoulissCommand[goer.size()];
    programsArray = goer.toArray(programsArray);
    progsAdapter =
        new ProgramListAdapter(
            this.getApplicationContext(), programsArray, datasource.getTriggerMap(this), opzioni);
    // Adapter della lista
    listaProgrammiView.setAdapter(progsAdapter);
    listaProgrammiView.invalidateViews();
    // forza refresh drawer
    mDrawermAdapter =
        new NavDrawerAdapter(
            ProgramListActivity.this,
            R.layout.drawer_list_item,
            dmh.getStuff(),
            DrawerMenuHelper.PROGRAMS);
    mDrawerList.setAdapter(mDrawermAdapter);

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.attachToListView(listaProgrammiView);
    // ADD NEW PROGRAM Listener
    fab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent myIntentt = new Intent(ProgramListActivity.this, AddProgramActivity.class);
            ProgramListActivity.this.startActivityForResult(myIntentt, 12);
          }
        });
  }