diff --git a/app/src/main/java/awais/instagrabber/adapters/SuggestionsAdapter.java b/app/src/main/java/awais/instagrabber/adapters/SuggestionsAdapter.java
index 19412e37..154e83f2 100755
--- a/app/src/main/java/awais/instagrabber/adapters/SuggestionsAdapter.java
+++ b/app/src/main/java/awais/instagrabber/adapters/SuggestionsAdapter.java
@@ -10,6 +10,7 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.cursoradapter.widget.CursorAdapter;
+import awais.instagrabber.R;
import awais.instagrabber.databinding.ItemSuggestionBinding;
import awais.instagrabber.models.enums.SuggestionType;
@@ -38,7 +39,7 @@ public final class SuggestionsAdapter extends CursorAdapter {
// 0, 1 , 2 , 3 , 4 , 5
final String fullName = cursor.getString(2);
String username = cursor.getString(1);
- final String picUrl = cursor.getString(4);
+ String picUrl = cursor.getString(4);
final boolean verified = cursor.getString(5).charAt(0) == 't';
final String type = cursor.getString(3);
@@ -61,6 +62,7 @@ public final class SuggestionsAdapter extends CursorAdapter {
break;
case TYPE_LOCATION:
query = fullName;
+ picUrl = "res:/" + R.drawable.ic_location;
break;
default:
return; // will never come here
diff --git a/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java b/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java
index 89941cfe..9eab384e 100644
--- a/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java
+++ b/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java
@@ -233,7 +233,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
if (postModels == null || postModels.size() == 0) return;
if (postModels.get(0) == null) return;
final String postId = postModels.get(0).getPostId();
- final boolean isId = postId != null;
+ final boolean isId = postId != null && isLoggedIn;
final String[] idsOrShortCodes = new String[postModels.size()];
for (int i = 0; i < postModels.size(); i++) {
idsOrShortCodes[i] = isId ? postModels.get(i).getPostId()
diff --git a/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java b/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java
index e7190977..c8837682 100644
--- a/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java
+++ b/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java
@@ -236,7 +236,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
if (postModels == null || postModels.size() == 0) return;
if (postModels.get(0) == null) return;
final String postId = postModels.get(0).getPostId();
- final boolean isId = postId != null;
+ final boolean isId = postId != null && isLoggedIn;
final String[] idsOrShortCodes = new String[postModels.size()];
for (int i = 0; i < postModels.size(); i++) {
idsOrShortCodes[i] = isId ? postModels.get(i).getPostId()
diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java
index d2b2ef87..fda589f5 100644
--- a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java
+++ b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java
@@ -168,8 +168,7 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment {
if (context == null) return null;
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(context);
preference.setKey(Constants.DOWNLOAD_USER_FOLDER);
- preference.setTitle("Download to username folder");
- preference.setSummary(R.string.download_user_folder);
+ preference.setTitle(R.string.download_user_folder);
preference.setIconSpaceReserved(false);
return preference;
}
diff --git a/app/src/main/java/awais/instagrabber/utils/CookieUtils.java b/app/src/main/java/awais/instagrabber/utils/CookieUtils.java
index a9421372..918dcf38 100644
--- a/app/src/main/java/awais/instagrabber/utils/CookieUtils.java
+++ b/app/src/main/java/awais/instagrabber/utils/CookieUtils.java
@@ -69,6 +69,7 @@ public final class CookieUtils {
@Nullable
private static String getCookieValue(final String cookies, final String name) {
+ if (cookies == null) return null;
final Pattern pattern = Pattern.compile(name + "=(.+?);");
final Matcher matcher = pattern.matcher(cookies);
if (matcher.find()) {
diff --git a/app/src/main/java/awais/instagrabber/utils/NavigationExtensions.java b/app/src/main/java/awais/instagrabber/utils/NavigationExtensions.java
index 9af64d87..4343a103 100644
--- a/app/src/main/java/awais/instagrabber/utils/NavigationExtensions.java
+++ b/app/src/main/java/awais/instagrabber/utils/NavigationExtensions.java
@@ -66,7 +66,7 @@ public class NavigationExtensions {
// throw new RuntimeException("null cannot be cast to non-null NavHostFragment");
}
final NavHostFragment selectedFragment = (NavHostFragment) fragment;
- if (!firstFragmentTag.equals(newlySelectedItemTag)) {
+ if (firstFragmentTag != null && !firstFragmentTag.equals(newlySelectedItemTag)) {
FragmentTransaction fragmentTransaction = fragmentManager
.beginTransaction()
.setCustomAnimations(
diff --git a/app/src/main/res/drawable/ic_location.png b/app/src/main/res/drawable/ic_location.png
new file mode 100644
index 00000000..5d4d03e1
Binary files /dev/null and b/app/src/main/res/drawable/ic_location.png differ
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index f84c980a..426d57a6 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -34,7 +34,7 @@
Changelog
Show toolbar at bottom
Check for updates at startup
- Download posts to username folder in Downloads
+ Download posts to username folders
Auto-load all posts from user
Mark stories as seen after viewing
Story author will know you viewed it