From efd5f618892a088fc9bc14530bbc1b80d0d9b561 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sun, 17 Oct 2021 22:24:30 +0800 Subject: Version 5.1.0-beta1. Update translation. New languages: Czech and Romanian. Fix anonymous multireddit cannot be loaded in MainActivity. Fix database migration issue. Fix some subreddits cannot be shown in SubscribedSubredditsRecyclerViewAdapter. Fix anonymous subscribed subreddits cannot be shown in SubscribedSubredditsRecyclerViewAdapter in SubredditSelectionActivity. --- .../infinityforreddit/RedditDataRoomDatabase.java | 3 +- .../infinityforreddit/activities/MainActivity.java | 4 +-- .../SubscribedSubredditsRecyclerViewAdapter.java | 16 ++++++--- .../SubscribedSubredditsListingFragment.java | 2 +- .../settings/AcknowledgementFragment.java | 3 ++ .../infinityforreddit/settings/Translation.java | 41 ++++++++++++---------- 6 files changed, 41 insertions(+), 28 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java index 0f7cbe75..eda22c35 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java @@ -349,8 +349,7 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase { public void migrate(@NonNull SupportSQLiteDatabase database) { database.execSQL("CREATE TABLE anonymous_multireddit_subreddits (path TEXT NOT NULL, " + "username TEXT NOT NULL, subreddit_name TEXT NOT NULL, " + - "PRIMARY KEY(path, username, subreddit_name), FOREIGN KEY(path) REFERENCES multi_reddits(path) ON DELETE CASCADE ON UPDATE CASCADE, " + - "FOREIGN KEY(username) REFERENCES multi_reddits(username) ON DELETE CASCADE ON UPDATE CASCADE)"); + "PRIMARY KEY(path, username, subreddit_name), FOREIGN KEY(path, username) REFERENCES multi_reddits(path, username) ON DELETE CASCADE ON UPDATE CASCADE)"); database.execSQL("ALTER TABLE recent_search_queries ADD COLUMN time INTEGER DEFAULT 0 NOT NULL"); database.execSQL("ALTER TABLE custom_themes ADD COLUMN media_indicator_icon_color INTEGER DEFAULT " + Color.parseColor("#FFFFFF") + " NOT NULL"); database.execSQL("ALTER TABLE custom_themes ADD COLUMN media_indicator_background_color INTEGER DEFAULT " + Color.parseColor("#000000") + " NOT NULL"); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 10d15340..0697ec04 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -1612,7 +1612,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb if (postType == SharedPreferencesUtils.MAIN_PAGE_TAB_POST_TYPE_HOME) { PostFragment fragment = new PostFragment(); Bundle bundle = new Bundle(); - bundle.putInt(PostFragment.EXTRA_POST_TYPE, mAccountName == null ? PostPagingSource.TYPE_ANONYMOUS_FRONT_PAGE : PostPagingSource.TYPE_FRONT_PAGE); + bundle.putInt(PostFragment.EXTRA_POST_TYPE, mAccessToken == null ? PostPagingSource.TYPE_ANONYMOUS_FRONT_PAGE : PostPagingSource.TYPE_FRONT_PAGE); bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken); bundle.putString(PostFragment.EXTRA_ACCOUNT_NAME, mAccountName); fragment.setArguments(bundle); @@ -1639,7 +1639,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb PostFragment fragment = new PostFragment(); Bundle bundle = new Bundle(); bundle.putString(PostFragment.EXTRA_NAME, name); - bundle.putInt(PostFragment.EXTRA_POST_TYPE, PostPagingSource.TYPE_MULTI_REDDIT); + bundle.putInt(PostFragment.EXTRA_POST_TYPE, mAccessToken == null ? PostPagingSource.TYPE_ANONYMOUS_MULTIREDDIT : PostPagingSource.TYPE_MULTI_REDDIT); bundle.putString(PostFragment.EXTRA_ACCESS_TOKEN, mAccessToken); bundle.putString(PostFragment.EXTRA_ACCOUNT_NAME, mAccountName); fragment.setArguments(bundle); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubscribedSubredditsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubscribedSubredditsRecyclerViewAdapter.java index d6e13a37..9be81b60 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubscribedSubredditsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/SubscribedSubredditsRecyclerViewAdapter.java @@ -24,11 +24,11 @@ import butterknife.BindView; import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import me.zhanghai.android.fastscroll.PopupTextProvider; -import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; -import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.FavoriteThing; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; +import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.subscribedsubreddit.SubscribedSubredditData; import pl.droidsonroids.gif.GifImageView; import retrofit2.Retrofit; @@ -172,10 +172,10 @@ public class SubscribedSubredditsRecyclerViewAdapter extends RecyclerView.Adapte if (itemClickListener != null) { if (hasClearSelectionRow) { offset = (mFavoriteSubscribedSubredditData != null && mFavoriteSubscribedSubredditData.size() > 0) ? - mFavoriteSubscribedSubredditData.size() + 4 : 0; + mFavoriteSubscribedSubredditData.size() + 4 : 2; } else { offset = (mFavoriteSubscribedSubredditData != null && mFavoriteSubscribedSubredditData.size() > 0) ? - mFavoriteSubscribedSubredditData.size() + 3 : 0; + mFavoriteSubscribedSubredditData.size() + 3 : 1; } } else { offset = (mFavoriteSubscribedSubredditData != null && mFavoriteSubscribedSubredditData.size() > 0) ? @@ -385,6 +385,14 @@ public class SubscribedSubredditsRecyclerViewAdapter extends RecyclerView.Adapte mFavoriteSubscribedSubredditData.size() + mSubscribedSubredditData.size() + 2 : 0; } + if (itemClickListener != null) { + if (hasClearSelectionRow) { + return mSubscribedSubredditData.size() > 0 ? mSubscribedSubredditData.size() + 2 : 0; + } else { + return mSubscribedSubredditData.size() > 0 ? mSubscribedSubredditData.size() + 1 : 0; + } + } + return mSubscribedSubredditData.size(); } return 0; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java index 26425941..11d902fb 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/SubscribedSubredditsListingFragment.java @@ -110,7 +110,7 @@ public class SubscribedSubredditsListingFragment extends Fragment implements Fra } } - String accountName = getArguments().getString(EXTRA_ACCOUNT_NAME); + String accountName = getArguments().getString(EXTRA_ACCOUNT_NAME, "-"); String accessToken = getArguments().getString(EXTRA_ACCESS_TOKEN); if (accessToken == null) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java index c5a3690d..5a9ec266 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AcknowledgementFragment.java @@ -119,6 +119,9 @@ public class AcknowledgementFragment extends Fragment { acknowledgements.add(new Acknowledgement("BetterLinkMovementMethod", "Attempts to improve how clickable links are detected, highlighted and handled in TextView.", Uri.parse("https://github.com/saket/Better-Link-Movement-Method"))); + acknowledgements.add(new Acknowledgement("ZoomLayout", + "2D zoom and pan behavior for View hierarchies, images, video streams, and much more, written in Kotlin for Android.", + Uri.parse("https://github.com/natario1/ZoomLayout"))); AcknowledgementRecyclerViewAdapter adapter = new AcknowledgementRecyclerViewAdapter(activity, acknowledgements); recyclerView.setLayoutManager(new LinearLayoutManagerBugFixed(activity)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/Translation.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/Translation.java index 53ca6735..0ca73341 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/Translation.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/Translation.java @@ -17,32 +17,35 @@ public class Translation { public static ArrayList getTranslationContributors() { ArrayList translationContributors = new ArrayList<>(); - translationContributors.add(new Translation("български", "Iliqiliev373, zerw, Кристиян", R.drawable.flag_bulgaria)); - translationContributors.add(new Translation("简体中文", "1, 3273676671, AaronFeng, Angela Thayer, Bitlabwzh, cdggqa, deluxghost, Dwhite, Gloria, gzwoyikythba, History_exe, Justin, Ray, Steps, Tunicar, wert", R.drawable.flag_china)); + translationContributors.add(new Translation("български", "Ana patriciaaguayogomez, Iliqiliev373, zerw, Кристиян", R.drawable.flag_bulgaria)); + translationContributors.add(new Translation("简体中文", "1, 3273676671, AaronFeng, Angela Thayer, Bitlabwzh, cdggqa, deluxghost, Dwhite, Gloria, gzwoyikythba, History_exe, hyl, Initial_Reading_197, Justin, Kerim Demirkaynak, Ray, Steps, Tunicar, wert", R.drawable.flag_china)); translationContributors.add(new Translation("繁體中文", "1, Angela Thayer, Hbhuh, Ray", R.drawable.flag_china)); translationContributors.add(new Translation("Hrvatski", "Andrej Ivanusec, Josip", R.drawable.flag_croatia)); - translationContributors.add(new Translation("Nederlands", "KevinHF, Khawkfist, Mert", R.drawable.flag_netherlands)); - translationContributors.add(new Translation("Esperanto", "AnimatorzPolski", -1)); - translationContributors.add(new Translation("Française", "367, Darlene Sonalder, escatrag, Finn Olmsted, Imperator, Johan, Kerim Demirkaynak, oursonbleu, Owen, pinembour", R.drawable.flag_france)); - translationContributors.add(new Translation("Deutsche", "adth03, ducc1, Jan, Joe, Jorge, Kerim Demirkaynak, Lm41, Netto Hikari, Nikodiamond3, NotABot34, Tischleindeckdich, translatewingman, translatorwiz", R.drawable.flag_germany)); + translationContributors.add(new Translation("čeština", "Fjuro", R.drawable.flag_czech)); + translationContributors.add(new Translation("Nederlands", "Anthony, Heimen Stoffels, KevinHF, Knnf, Khawkfist, Losms67, Mert, Viktor", R.drawable.flag_netherlands)); + translationContributors.add(new Translation("Esperanto", "Ana patriciaaguayogomez, AnimatorzPolski", -1)); + translationContributors.add(new Translation("Française", "367, Clement. wawszczyk, Darkempire78, Darlene Sonalder, escatrag, Finn Olmsted, Furax-31, Imperator, Johan, Kerim Demirkaynak, oursonbleu, Owen, pinembour", R.drawable.flag_france)); + translationContributors.add(new Translation("Deutsche", "adth03, Chris, ducc1, Jan, Joe, Jorge, Kerim Demirkaynak, Lm41, Netto Hikari, Nikodiamond3, Nilsrie1, NotABot34, Tischleindeckdich, translatewingman, translatorwiz, vcdf", R.drawable.flag_germany)); translationContributors.add(new Translation("Ελληνικά", "fresh, Marios, Viktor", R.drawable.flag_greece)); - translationContributors.add(new Translation("עִברִית", "Yuval", R.drawable.flag_israel)); - translationContributors.add(new Translation("हिंदी", "a, Arya, charu, EnArvy, Harshit S Lawaniya, Mrigendra Bhandari, Nikhilcaddilac, prat, raghav, Sachin, Ved", R.drawable.flag_india)); + translationContributors.add(new Translation("עִברִית", "Ofek Bortz, Yuval", R.drawable.flag_israel)); + translationContributors.add(new Translation("हिंदी", "a, Anonymous, Arya, charu, EnArvy, Harshit S Lawaniya, Mrigendra Bhandari, Nikhilcaddilac, prat, raghav, Roshan, Sachin, Ved", R.drawable.flag_india)); translationContributors.add(new Translation("Magyar", "Balázs, Bro momento, ekaktusz, trebron, Zoltan", R.drawable.flag_hungary)); - translationContributors.add(new Translation("Italiana", "Daniele Basso, DanOlivaw, Enri. braga, Gianni00palmieri, Gillauino, Gio. gavio01, Giovanni, Giovanni Donisi, Lorenzo, Matisse, Simoneg. work, ztiaa", R.drawable.flag_italy)); - translationContributors.add(new Translation("日本語", "Hira, Issa, Kerim Demirkaynak, Mrigendra Bhandari, Ryan", R.drawable.flag_japan)); - translationContributors.add(new Translation("한국어", "noname", R.drawable.flag_south_korea)); + translationContributors.add(new Translation("Italiana", "Daniele Basso, DanOlivaw, Enri. braga, Gianni00palmieri, Gillauino, Gio. gavio01, Giovanni, Giovanni Donisi, Lorenzo, Marco, Marco, Matisse, Simoneg. work, ztiaa", R.drawable.flag_italy)); + translationContributors.add(new Translation("日本語", "Hira, Issa, Kerim Demirkaynak, Mrigendra Bhandari, nazo6, Ryan", R.drawable.flag_japan)); + translationContributors.add(new Translation("한국어", "Me, noname", R.drawable.flag_south_korea)); translationContributors.add(new Translation("norsk", "", R.drawable.flag_norway)); - translationContributors.add(new Translation("Polskie", "Chupacabra, Erax, Kajetan, Maks, quark, ultrakox", R.drawable.flag_poland)); - translationContributors.add(new Translation("Português", "., Bruno Guerreiro, Gabriel, Henry, Lucas, Ricky", R.drawable.flag_portugal)); - translationContributors.add(new Translation("Português (BR)", "., Asfuri, Davy, Júlia Angst Coelho, John Seila, Laura Vasconcellos Pereira Felippe, luccipriano, Raul S., Ricardo, Ricky, Super_Iguanna, T. tony. br01, vsc", R.drawable.flag_brazil)); - translationContributors.add(new Translation("Română", "Loading Official, RabdăInimăȘiTace", R.drawable.flag_romania)); - translationContributors.add(new Translation("русский язык", "Angela Thayer, Anon, Arseniy Tsekh, aveblazer, CaZzzer, Coolant, Craysy, Draer, elena, flexagoon, Georgiy, Overseen, Stambro, Tysontl2007, Vova", R.drawable.flag_russia)); + translationContributors.add(new Translation("Polskie", "Adam, Chupacabra, Erax, Kajetan, Maks, quark, ultrakox", R.drawable.flag_poland)); + translationContributors.add(new Translation("Português", "., Bruno Guerreiro, Francisco, Gabriel, Henry, Lucas, Miguel, Ricky", R.drawable.flag_portugal)); + translationContributors.add(new Translation("Português (BR)", "., Andreaugustoqueiroz999, Asfuri, Davy, Júlia Angst Coelho, João Vieira, John Seila, Laura Vasconcellos Pereira Felippe, luccipriano, menosmenos, Murilogs7002, Raul S., Ricardo, Ricky, Super_Iguanna, T. tony. br01, vsc", R.drawable.flag_brazil)); + translationContributors.add(new Translation("Română", "Edward, Loading Official, RabdăInimăȘiTace", R.drawable.flag_romania)); + translationContributors.add(new Translation("русский язык", "Angela Thayer, Anon, Arseniy Tsekh, aveblazer, CaZzzer, Coolant, Craysy, Draer, elena, flexagoon, Georgiy, Kerim Demirkaynak, Overseen, solokot, Stambro, Tysontl2007, Vova", R.drawable.flag_russia)); translationContributors.add(new Translation("Soomaali", "Nadir Nour", R.drawable.flag_somalia)); - translationContributors.add(new Translation("Español", "Agustin, Alejandro, Alfredo, Angel, Angela Thayer, Canutolab, Gaynus, Jorge, Luis Antonio, Meh, Miguel, mvstermoe, Nana Snixx, Sergio, Sofia Flores, Theofficialdork, Tirso Carranza", R.drawable.flag_spain)); + translationContributors.add(new Translation("Español", "Agustin, Alejandro, Alfredo, Angel, Angela Thayer, Armando, Armando Leyvaleyva, Armando Leyvaleyva, Canutolab, Gaynus, Iván Peña, Joel. chrono, Jorge, Kerim Demirkaynak, Luis Antonio, Marcelo, Mario, Meh, Miguel, mvstermoe, Nana Snixx, Sergio, Sofia Flores, Suol, Theofficialdork, Tirso Carranza", R.drawable.flag_spain)); translationContributors.add(new Translation("svenska", "Marcus Nordberg", R.drawable.flag_sweden)); - translationContributors.add(new Translation("Türkçe", "adth03, Berk Bakır \"Faoiltiarna\", Emir481, Faoiltiarna, Kerim Demirkaynak, Mehmet Yavuz, Mert, Serif", R.drawable.flag_turkey)); - translationContributors.add(new Translation("Tiếng Việt", "bruh, Kai, Laezzy, Lmao, Ryan, viecdet69", R.drawable.flag_vietnam)); + translationContributors.add(new Translation("தமிழ்", "Gobinathal8", -1)); + translationContributors.add(new Translation("Türkçe", "adth03, Berk Bakır \"Faoiltiarna\", cevirgen, Emir481, Faoiltiarna, Kerim Demirkaynak, Mehmet Yavuz, Mert, Serif", R.drawable.flag_turkey)); + translationContributors.add(new Translation("Українська", "@andmizyk", R.drawable.flag_ukraine)); + translationContributors.add(new Translation("Tiếng Việt", "bruh, Kai, Khai, Laezzy, Lmao, Ryan, viecdet69", R.drawable.flag_vietnam)); return translationContributors; } } -- cgit v1.2.3