コード例 #1
0
  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {

    in_ogl_anim = false;

    if (pos == 0 || pos > 2) {
      rid1 = MyApplication.space.split(rid_arr_loc[pos])[0];

      tdwr_s = UtilityNexrad.GetTDWRFromRID(rid1);

      if (tdwr_s.equals("")) tdwr.setVisible(false);
      else tdwr.setVisible(true);

      if (tilt_option) tilt_menu.setVisible(true);
      else tilt_menu.setVisible(false);

      old_state = state;
      old_sector = sector;
      old_onek = onek;
      state =
          MyApplication.comma.split(MyApplication.preferences.getString("RID_LOC_" + rid1, ""))[0];
      sector = MyApplication.preferences.getString("COD_SECTOR_" + state, "");
      state = MyApplication.preferences.getString("STATE_CODE_" + state, "");
      onek = MyApplication.preferences.getString("COD_1KM_" + rid1, "");

      if (prod.equals("2k")) {
        img_url = img_url.replace(old_sector, sector);
        img_url = img_url.replace(old_state, state);
        img_url = img_url.replace(old_onek, onek);
      }
      if (!restarted && !(MyApplication.wxogl_remember_location && first_run)) {
        img.resetZoom();
        img.setZoom(init_zoom);
        OGLR.setZoom(((float) MyApplication.wxogl_size) / 10.0f);
        glview.mScaleFactor = ((float) MyApplication.wxogl_size / 10.0f);

        OGLR.mPositionX = 0.0f;
        OGLR.mPositionY = 0.0f;
      }
      restarted = false;
      rid_changed = true;
      new GetContent().execute();
    } else if (pos == 1) {
      Intent dtx_srm = new Intent(getApplicationContext(), RIDAddFavActivity.class);
      startActivity(dtx_srm);
    } else if (pos == 2) {
      Intent dtx_srm2 = new Intent(getApplicationContext(), RIDRemoveFavActivity.class);
      startActivity(dtx_srm2);
    }

    if (first_time) {
      UtilityToolbar.FullScreenMode(toolbar, toolbar_bottom);
      first_time = false;
    }
  }
コード例 #2
0
  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {

    if (first_time) {
      UtilityToolbar.FullScreenMode(toolbar);
      first_time = false;
    }

    if (pos == (UtilityUSImgNWSMosaic.nws_sectors.length - 1)) {
      nws_radar_mosaic_sector_current = "latest";
      nws_radar_mosaic_sector_label_current = "CONUS";
    } else {
      nws_radar_mosaic_sector_current = UtilityUSImgNWSMosaic.nws_sectors[pos];
      nws_radar_mosaic_sector_label_current = UtilityUSImgNWSMosaic.nws_sectors_labels[pos];
    }
    img.resetZoom();
    new GetContent().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
コード例 #3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {

    setTheme(MyApplication.theme_int);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nwsmosaic);

    toolbar = (Toolbar) findViewById(R.id.toolbar_top);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    toolbar_bottom = (Toolbar) findViewById(R.id.toolbar_bottom);

    if (MyApplication.icons_even_spaced)
      UtilityToolbar.setupEvenlyDistributedToolbar(this, toolbar_bottom, R.menu.nwsmosaic);
    else toolbar_bottom.inflateMenu(R.menu.nwsmosaic);

    toolbar_bottom.setOnMenuItemClickListener(this);
    UtilityToolbar.FullScreenMode(toolbar, toolbar_bottom);

    img = (TouchImageView2) findViewById(R.id.iv);
    img.setOnClickListener(this);
    img.setMaxZoom(max_zoom);

    turl = getIntent().getStringArrayExtra(URL);
    img_url = turl[1];

    nws_radar_mosaic_sector_label_current =
        MyApplication.preferences.getString(
            "NWS_RADAR_MOSAIC_SECTOR_CURRENT", "Central Great Lakes");

    spinner1 = (Spinner) findViewById(R.id.spinner1);
    dataAdapter =
        new ArrayAdapter<>(
            this, android.R.layout.simple_spinner_item, UtilityUSImgNWSMosaic.nws_sectors_labels);
    dataAdapter.setDropDownViewResource(MyApplication.spinner_layout);
    spinner1.setAdapter(dataAdapter);
    spinner1.setOnItemSelectedListener(this);
    spinner1.setSelection(findPosition(nws_radar_mosaic_sector_label_current));
  }