// load from settings/instanceState
    private void loadSettingsAndInstanceState(Activity context, Bundle savedInstanceState) {
      SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
      this.mCurrentPath = sharedPref.getString(STATE_CurrentPath, this.mCurrentPath);
      this.mDirQueryID = sharedPref.getInt(STATE_DirQueryID, this.getDirQueryID());
      this.mSortID = sharedPref.getInt(STATE_SortID, this.mSortID);
      this.mSortAscending = sharedPref.getBoolean(STATE_SortAscending, this.mSortAscending);
      this.mCurrentLatLon.get(
          DirectoryFormatter.parseLatLon(sharedPref.getString(STATE_LAT_LON, null)));

      // instance state overrides settings
      if (savedInstanceState != null) {
        this.mCurrentPath = savedInstanceState.getString(STATE_CurrentPath, this.mCurrentPath);
        this.mDirQueryID = savedInstanceState.getInt(STATE_DirQueryID, this.getDirQueryID());
        this.mSortID = savedInstanceState.getInt(STATE_SortID, this.mSortID);
        this.mSortAscending =
            savedInstanceState.getBoolean(STATE_SortAscending, this.mSortAscending);
        this.mFilter = savedInstanceState.getParcelable(STATE_Filter);
        this.mCurrentLatLon.get(
            DirectoryFormatter.parseLatLon(savedInstanceState.getString(STATE_LAT_LON)));

        this.mUseLatLon = savedInstanceState.getBoolean(STATE_LAT_LON_ACTIVE, this.mUseLatLon);
      }

      if (this.mFilter == null) {
        this.mFilter = new GalleryFilterParameterParcelable();
        mFilter.loadSettings(sharedPref);
      }
      // extra parameter
      this.mGalleryContentQuery = context.getIntent().getParcelableExtra(EXTRA_QUERY);
      if (this.mGalleryContentQuery == null)
        this.mGalleryContentQuery = FotoSql.getQuery(FotoSql.QUERY_TYPE_DEFAULT);
    }
  private void navigateTo(String selectedAbsolutePath, int queryTypeId) {

    if (selectedAbsolutePath != null) {
      if (mGalleryQueryParameter.mUseLatLon) {
        Log.d(
            Global.LOG_CONTEXT,
            "FotoGalleryActivity.navigateTo "
                + selectedAbsolutePath
                + " from "
                + mGalleryQueryParameter.mCurrentLatLon);
        this.mGalleryQueryParameter.mCurrentLatLon.get(
            DirectoryFormatter.parseLatLon(selectedAbsolutePath));

        reloadGui();
      } else { //  if (this.mGalleryQueryParameter.mCurrentPath.compareTo(selectedAbsolutePath) !=
               // 0) {
        Log.d(
            Global.LOG_CONTEXT,
            "FotoGalleryActivity.navigateTo "
                + selectedAbsolutePath
                + " from "
                + this.mGalleryQueryParameter.mCurrentPath);
        this.mGalleryQueryParameter.mCurrentPath = selectedAbsolutePath;
        this.mGalleryQueryParameter.mDirQueryID = queryTypeId;
        setTitle();

        reloadGui();
      }
    }
  }
Пример #3
0
 /** *********** local helper **************** */
 private String convertLL(double latLon) {
   if (Double.isNaN(latLon)) return "";
   return DirectoryFormatter.parseLatLon(latLon);
 }