Skip to content

Commit

Permalink
#1308 / #1309 - hidden media for your own observations, when viewed f…
Browse files Browse the repository at this point in the history
…rom explore
  • Loading branch information
budowski committed Nov 13, 2023
1 parent c5463ba commit dfe5f41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions iNaturalist/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="org.inaturalist.android"
android:installLocation="auto"
android:versionCode="593"
android:versionName="1.30.0">
android:versionCode="594"
android:versionName="1.30.1">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,19 +452,29 @@ public Object instantiateItem(ViewGroup container, final int position) {
if (!mReadOnly) {
if (position >= mImageCursor.getCount()) {
// Sound
mSoundCursor.moveToPosition(position - mImageCursor.getCount());
int realPosition = position - mImageCursor.getCount();
mSoundCursor.moveToPosition(realPosition);

sound = new ObservationSound(mSoundCursor);

Logger.tag(TAG).info("Observation: " + mObservation);
Logger.tag(TAG).info("Sound: " + sound);

if (mObservation.sounds != null && mObservation.sounds.size() > realPosition) {
isHidden = mObservation.sounds.get(realPosition).hidden;
}

} else {
// Photo
mImageCursor.moveToPosition(position);

imageUrl = mImageCursor.getString(mImageCursor.getColumnIndexOrThrow(ObservationPhoto.PHOTO_URL));
photoFilename = mImageCursor.getString(mImageCursor.getColumnIndexOrThrow(ObservationPhoto.PHOTO_FILENAME));

if (mObservation.photos != null && mObservation.photos.size() > position) {
isHidden = mObservation.photos.get(position).hidden;
}

}

} else {
Expand Down

0 comments on commit dfe5f41

Please sign in to comment.