Browse Source

f-droid trial, fix #61, polish #65, fix invisible icon issue

legacy
Austin Huang 4 years ago
parent
commit
37cfba3666
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 3
      app/src/main/java/awais/instagrabber/MainHelper.java
  2. 2
      app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.java
  3. 22
      app/src/main/java/awais/instagrabber/activities/ProfileViewer.java
  4. 2
      app/src/main/java/awais/instagrabber/activities/SavedViewer.java
  5. 5
      app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectMessageStoryShareViewHolder.java
  6. 2
      app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java
  7. 4
      app/src/main/java/awais/instagrabber/utils/Utils.java
  8. 2
      app/src/main/res/drawable-anydpi/ic_like.xml
  9. 10
      app/src/main/res/drawable-anydpi/ic_not_liked.xml
  10. BIN
      app/src/main/res/drawable-hdpi/ic_not_liked.png
  11. BIN
      app/src/main/res/drawable-mdpi/ic_not_liked.png
  12. BIN
      app/src/main/res/drawable-xhdpi/ic_not_liked.png
  13. BIN
      app/src/main/res/drawable-xxhdpi/ic_not_liked.png
  14. 1
      app/src/main/res/layout/layout_dm_story_share.xml
  15. 5
      app/src/main/res/menu/saved.xml
  16. 0
      fastlane/metadata/android/en-US/changelogs/32.txt
  17. 0
      fastlane/metadata/android/en-US/changelogs/33.txt
  18. 0
      fastlane/metadata/android/en-US/changelogs/36.txt
  19. 0
      fastlane/metadata/android/en-US/changelogs/37.txt
  20. 0
      fastlane/metadata/android/en-US/changelogs/38.txt
  21. 0
      fastlane/metadata/android/en-US/changelogs/39.txt
  22. 0
      fastlane/metadata/android/en-US/changelogs/40.txt
  23. 0
      fastlane/metadata/android/en-US/changelogs/41.txt
  24. 0
      fastlane/metadata/android/en-US/changelogs/42.txt
  25. 0
      fastlane/metadata/android/en-US/changelogs/43.txt
  26. 0
      fastlane/metadata/android/en-US/changelogs/44.txt
  27. 0
      fastlane/metadata/android/en-US/changelogs/45.txt
  28. 0
      fastlane/metadata/android/en-US/full_description.txt
  29. 0
      fastlane/metadata/android/en-US/images/icon.png
  30. 0
      fastlane/metadata/android/en-US/images/phoneScreenshots/1.jpg
  31. 0
      fastlane/metadata/android/en-US/images/phoneScreenshots/2.jpg
  32. 0
      fastlane/metadata/android/en-US/images/phoneScreenshots/3.jpg
  33. 0
      fastlane/metadata/android/en-US/images/phoneScreenshots/4.jpg
  34. 0
      fastlane/metadata/android/en-US/images/phoneScreenshots/5.jpg
  35. 0
      fastlane/metadata/android/en-US/images/phoneScreenshots/6.jpg
  36. 0
      fastlane/metadata/android/en-US/short_description.txt
  37. 1
      fastlane/metadata/android/title.txt

3
app/src/main/java/awais/instagrabber/MainHelper.java

@ -345,7 +345,8 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
ImageViewCompat.setImageTintList(iconFeed, colorStateList.withAlpha(otherIconAlpha));
} else {
// this changes toolbar title
main.mainBinding.toolbar.toolbar.setTitle(slideOffset >= 0.466 ? titleDiscover : main.userQuery);
main.mainBinding.toolbar.toolbar.setTitle(slideOffset >= 0.466 ? titleDiscover :
(main.userQuery == null ? resources.getString(R.string.app_name) : main.userQuery));
imageTintList = ImageViewCompat.getImageTintList(iconFeed);
alpha = imageTintList != null ? (imageTintList.getDefaultColor() & 0xFF_000000) >> 24 : 0;

2
app/src/main/java/awais/instagrabber/activities/BaseLanguageActivity.java

@ -15,7 +15,7 @@ public abstract class BaseLanguageActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Utils.changeTheme(this);
super.onCreate(savedInstanceState);
}
}

22
app/src/main/java/awais/instagrabber/activities/ProfileViewer.java

@ -92,7 +92,7 @@ public final class ProfileViewer extends BaseLanguageActivity implements SwipeRe
private HashtagModel hashtagModel;
private LocationModel locationModel;
private StoryModel[] storyModels;
private MenuItem downloadAction;
private MenuItem downloadAction, favouriteAction;
private final FetchListener<PostModel[]> postsFetchListener = new FetchListener<PostModel[]>() {
@Override
public void onResult(final PostModel[] result) {
@ -755,12 +755,32 @@ public final class ProfileViewer extends BaseLanguageActivity implements SwipeRe
downloadAction = menu.findItem(R.id.downloadAction);
downloadAction.setVisible(false);
favouriteAction = menu.findItem(R.id.favouriteAction);
favouriteAction.setVisible(!Utils.isEmpty(cookie));
favouriteAction.setIcon(Utils.dataBox.getFavorite(userQuery) == null ? R.drawable.ic_not_liked : R.drawable.ic_like);
downloadAction.setOnMenuItemClickListener(item -> {
if (selectedItems.size() > 0) {
Utils.batchDownload(this, userQuery, DownloadMethod.DOWNLOAD_MAIN, selectedItems);
}
return true;
});
favouriteAction.setOnMenuItemClickListener(item -> {
if (Utils.dataBox.getFavorite(userQuery) == null) {
Utils.dataBox.addFavorite(new DataBox.FavoriteModel(userQuery, System.currentTimeMillis(),
locationModel != null ? locationModel.getName() : userQuery.replaceAll("^@", "")));
favouriteAction.setIcon(R.drawable.ic_like);
}
else {
Utils.dataBox.delFavorite(new DataBox.FavoriteModel(userQuery,
Long.parseLong(Utils.dataBox.getFavorite(userQuery).split("/")[1]),
locationModel != null ? locationModel.getName() : userQuery.replaceAll("^@", "")));
favouriteAction.setIcon(R.drawable.ic_not_liked);
}
return true;
});
return true;
}

2
app/src/main/java/awais/instagrabber/activities/SavedViewer.java

@ -172,6 +172,8 @@ public final class SavedViewer extends BaseLanguageActivity implements SwipeRefr
downloadAction = menu.findItem(R.id.downloadAction);
downloadAction.setVisible(false);
menu.findItem(R.id.favouriteAction).setVisible(false);
downloadAction.setOnMenuItemClickListener(item -> {
if (selectedItems.size() > 0) {
Utils.batchDownload(this, null, DownloadMethod.DOWNLOAD_SAVED, selectedItems);

5
app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectMessageStoryShareViewHolder.java

@ -38,11 +38,12 @@ public class DirectMessageStoryShareViewHolder extends DirectMessageItemViewHold
binding.tvMessage.setText(text);
binding.tvMessage.setVisibility(View.VISIBLE);
}
else {
final DirectItemModel.DirectItemMediaModel reelShareMedia = reelShare.getMedia();
final MediaItemType mediaType = reelShareMedia.getMediaType();
binding.typeIcon.setVisibility(mediaType == MediaItemType.MEDIA_TYPE_VIDEO ||
mediaType == MediaItemType.MEDIA_TYPE_SLIDER ? View.VISIBLE : View.GONE);
binding.typeIcon.setVisibility(mediaType == MediaItemType.MEDIA_TYPE_VIDEO ? View.VISIBLE : View.GONE);
getGlideRequestManager().load(reelShareMedia.getThumbUrl()).into(binding.ivMediaPreview);
}
}
}
}

2
app/src/main/java/awais/instagrabber/fragments/directmessages/DirectMessageThreadFragment.java

@ -299,9 +299,7 @@ public class DirectMessageThreadFragment extends Fragment {
dialogAdapter = new ArrayAdapter<>(requireContext(), android.R.layout.simple_list_item_1, dialogList);
new AlertDialog.Builder(requireContext())
//.setTitle(title)
.setAdapter(dialogAdapter, onDialogListener)
// .setNeutralButton(R.string.cancel, null)
.show();
}
};

4
app/src/main/java/awais/instagrabber/utils/Utils.java

@ -690,7 +690,7 @@ public final class Utils {
JSONObject boldItem = bold.getJSONObject(q);
desc = desc.substring(0, boldItem.getInt("start") + q*7) + "<b>"
+ desc.substring(boldItem.getInt("start") + q*7, boldItem.getInt("end") + q*7)
+ "</b>" + desc.substring(boldItem.getInt("end") + q*7, desc.length());
+ "</b>" + desc.substring(boldItem.getInt("end") + q*7);
}
actionLogModel = new DirectItemActionLogModel(desc);
break;
@ -810,6 +810,7 @@ public final class Utils {
if (settingsHelper != null) {
isAmoledEnabled = settingsHelper.getBoolean(Constants.AMOLED_THEME);
}
AppCompatDelegate.setDefaultNightMode(themeCode);
// use amoled theme only if enabled in settings
if (isAmoledEnabled) {
// check if setting is set to 'Dark'
@ -827,7 +828,6 @@ public final class Utils {
return;
}
}
AppCompatDelegate.setDefaultNightMode(themeCode);
}
public static void setTooltipText(final View view, @StringRes final int tooltipTextRes) {

2
app/src/main/res/drawable-anydpi/ic_like.xml

@ -3,7 +3,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333">
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/>

10
app/src/main/res/drawable-anydpi/ic_not_liked.xml

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z"/>
</vector>

BIN
app/src/main/res/drawable-hdpi/ic_not_liked.png

After

Width: 36  |  Height: 36  |  Size: 435 B

BIN
app/src/main/res/drawable-mdpi/ic_not_liked.png

After

Width: 24  |  Height: 24  |  Size: 311 B

BIN
app/src/main/res/drawable-xhdpi/ic_not_liked.png

After

Width: 48  |  Height: 48  |  Size: 560 B

BIN
app/src/main/res/drawable-xxhdpi/ic_not_liked.png

After

Width: 72  |  Height: 72  |  Size: 815 B

1
app/src/main/res/layout/layout_dm_story_share.xml

@ -22,6 +22,7 @@
android:layout_height="24dp"
android:layout_gravity="end|top"
android:layout_margin="8dp"
android:visibility="gone"
app:srcCompat="@drawable/video" />
</FrameLayout>

5
app/src/main/res/menu/saved.xml

@ -6,4 +6,9 @@
android:id="@+id/downloadAction"
android:icon="@drawable/ic_download"
app:showAsAction="always|collapseActionView" />
<item
android:id="@+id/favouriteAction"
android:icon="@drawable/ic_not_liked"
app:showAsAction="always|collapseActionView" />
</menu>

0
fastlane/metadata/android/changelogs/32.txt → fastlane/metadata/android/en-US/changelogs/32.txt

0
fastlane/metadata/android/changelogs/33.txt → fastlane/metadata/android/en-US/changelogs/33.txt

0
fastlane/metadata/android/changelogs/36.txt → fastlane/metadata/android/en-US/changelogs/36.txt

0
fastlane/metadata/android/changelogs/37.txt → fastlane/metadata/android/en-US/changelogs/37.txt

0
fastlane/metadata/android/changelogs/38.txt → fastlane/metadata/android/en-US/changelogs/38.txt

0
fastlane/metadata/android/changelogs/39.txt → fastlane/metadata/android/en-US/changelogs/39.txt

0
fastlane/metadata/android/changelogs/40.txt → fastlane/metadata/android/en-US/changelogs/40.txt

0
fastlane/metadata/android/changelogs/41.txt → fastlane/metadata/android/en-US/changelogs/41.txt

0
fastlane/metadata/android/changelogs/42.txt → fastlane/metadata/android/en-US/changelogs/42.txt

0
fastlane/metadata/android/changelogs/43.txt → fastlane/metadata/android/en-US/changelogs/43.txt

0
fastlane/metadata/android/changelogs/44.txt → fastlane/metadata/android/en-US/changelogs/44.txt

0
fastlane/metadata/android/changelogs/45.txt → fastlane/metadata/android/en-US/changelogs/45.txt

0
fastlane/metadata/android/full_description.txt → fastlane/metadata/android/en-US/full_description.txt

0
fastlane/metadata/android/images/icon.png → fastlane/metadata/android/en-US/images/icon.png

Before

Width: 192  |  Height: 192  |  Size: 27 KiB

After

Width: 192  |  Height: 192  |  Size: 27 KiB

0
fastlane/metadata/android/images/phoneScreenshots/1.jpg → fastlane/metadata/android/en-US/images/phoneScreenshots/1.jpg

Before

Width: 720  |  Height: 1280  |  Size: 122 KiB

After

Width: 720  |  Height: 1280  |  Size: 122 KiB

0
fastlane/metadata/android/images/phoneScreenshots/2.jpg → fastlane/metadata/android/en-US/images/phoneScreenshots/2.jpg

Before

Width: 720  |  Height: 1280  |  Size: 144 KiB

After

Width: 720  |  Height: 1280  |  Size: 144 KiB

0
fastlane/metadata/android/images/phoneScreenshots/3.jpg → fastlane/metadata/android/en-US/images/phoneScreenshots/3.jpg

Before

Width: 720  |  Height: 1280  |  Size: 88 KiB

After

Width: 720  |  Height: 1280  |  Size: 88 KiB

0
fastlane/metadata/android/images/phoneScreenshots/4.jpg → fastlane/metadata/android/en-US/images/phoneScreenshots/4.jpg

Before

Width: 720  |  Height: 1280  |  Size: 81 KiB

After

Width: 720  |  Height: 1280  |  Size: 81 KiB

0
fastlane/metadata/android/images/phoneScreenshots/5.jpg → fastlane/metadata/android/en-US/images/phoneScreenshots/5.jpg

Before

Width: 720  |  Height: 1280  |  Size: 152 KiB

After

Width: 720  |  Height: 1280  |  Size: 152 KiB

0
fastlane/metadata/android/images/phoneScreenshots/6.jpg → fastlane/metadata/android/en-US/images/phoneScreenshots/6.jpg

Before

Width: 720  |  Height: 1280  |  Size: 157 KiB

After

Width: 720  |  Height: 1280  |  Size: 157 KiB

0
fastlane/metadata/android/short_description.txt → fastlane/metadata/android/en-US/short_description.txt

1
fastlane/metadata/android/title.txt

@ -1 +0,0 @@
InstaGrabber Revived
Loading…
Cancel
Save