From 14a17ad0384dc0811f3c7b0b1897c4d6691de0b3 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:40:26 -0400 Subject: Version 6.3.0-beta1. Rename RedditAPIInfoBottomSheetFragment to ImportantInfoBottomSheetFragment. Disable showing ImportantInfoBottomSheetFragment. --- .../infinityforreddit/activities/MainActivity.java | 8 +-- .../ImportantInfoBottomSheetFragment.java | 67 ++++++++++++++++++++ .../RedditAPIInfoBottomSheetFragment.java | 67 -------------------- .../fragment_important_info_bottom_sheet.xml | 72 ++++++++++++++++++++++ .../fragment_reddit_api_info_bottom_sheet.xml | 72 ---------------------- 5 files changed, 143 insertions(+), 143 deletions(-) create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/ImportantInfoBottomSheetFragment.java delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/RedditAPIInfoBottomSheetFragment.java create mode 100644 app/src/main/res/layout/fragment_important_info_bottom_sheet.xml delete mode 100644 app/src/main/res/layout/fragment_reddit_api_info_bottom_sheet.xml (limited to 'app/src/main') 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 df9274f5..c08dbb68 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -92,7 +92,7 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.FABMoreOptionsB import ml.docilealligator.infinityforreddit.bottomsheetfragments.PostLayoutBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.PostTypeBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.RandomBottomSheetFragment; -import ml.docilealligator.infinityforreddit.bottomsheetfragments.RedditAPIInfoBottomSheetFragment; +import ml.docilealligator.infinityforreddit.bottomsheetfragments.ImportantInfoBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTimeBottomSheetFragment; import ml.docilealligator.infinityforreddit.bottomsheetfragments.SortTypeBottomSheetFragment; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; @@ -339,11 +339,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb mNewAccountName = getIntent().getStringExtra(EXTRA_NEW_ACCOUNT_NAME); } - if (!mInternalSharedPreferences.getBoolean(SharedPreferencesUtils.DO_NOT_SHOW_REDDIT_API_INFO_V2_AGAIN, false)) { - RedditAPIInfoBottomSheetFragment fragment = new RedditAPIInfoBottomSheetFragment(); + /*if (!mInternalSharedPreferences.getBoolean(SharedPreferencesUtils.DO_NOT_SHOW_REDDIT_API_INFO_V2_AGAIN, false)) { + ImportantInfoBottomSheetFragment fragment = new ImportantInfoBottomSheetFragment(); fragment.setCancelable(false); fragment.show(getSupportFragmentManager(), fragment.getTag()); - } + }*/ initializeNotificationAndBindView(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/ImportantInfoBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/ImportantInfoBottomSheetFragment.java new file mode 100644 index 00000000..4c177863 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/ImportantInfoBottomSheetFragment.java @@ -0,0 +1,67 @@ +package ml.docilealligator.infinityforreddit.bottomsheetfragments; + +import android.content.Context; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; + +import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.activities.MainActivity; +import ml.docilealligator.infinityforreddit.customviews.LandscapeExpandedRoundedBottomSheetDialogFragment; +import ml.docilealligator.infinityforreddit.databinding.FragmentImportantInfoBottomSheetBinding; +import ml.docilealligator.infinityforreddit.utils.Utils; + +public class ImportantInfoBottomSheetFragment extends LandscapeExpandedRoundedBottomSheetDialogFragment { + + private MainActivity mainActivity; + + public ImportantInfoBottomSheetFragment() { + // Required empty public constructor + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + FragmentImportantInfoBottomSheetBinding binding = FragmentImportantInfoBottomSheetBinding.inflate(inflater, container, false); + + if (mainActivity != null && mainActivity.typeface != null) { + Utils.setFontToAllTextViews(binding.getRoot(), mainActivity.typeface); + } + + binding.getRoot().setNestedScrollingEnabled(true); + + /*SpannableString message = new SpannableString(getString(R.string.reddit_api_info, "https://www.reddit.com/r/reddit/comments/145bram/addressing_the_community_about_changes_to_our_api", "https://www.reddit.com/r/Infinity_For_Reddit/comments/147bhsg/the_future_of_infinity")); + Linkify.addLinks(message, Linkify.WEB_URLS); + binding.messageTextViewRedditApiInfoBottomSheetFragment.setText(message); + binding.messageTextViewRedditApiInfoBottomSheetFragment.setMovementMethod(BetterLinkMovementMethod.newInstance().setOnLinkClickListener((textView, url) -> { + Intent intent = new Intent(mainActivity, LinkResolverActivity.class); + intent.setData(Uri.parse(url)); + startActivity(intent); + return true; + }));*/ + binding.messageTextViewRedditApiInfoBottomSheetFragment.setLinkTextColor(getResources().getColor(R.color.colorAccent)); + + binding.doNotShowThisAgainTextView.setOnClickListener(view -> { + binding.doNotShowThisAgainCheckBox.toggle(); + }); + + binding.continueButtonRedditApiInfoBottomSheetFragment.setOnClickListener(view -> { + if (binding.doNotShowThisAgainCheckBox.isChecked()) { + mainActivity.doNotShowRedditAPIInfoAgain(); + } + dismiss(); + }); + + return binding.getRoot(); + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + mainActivity = (MainActivity) context; + } +} \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/RedditAPIInfoBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/RedditAPIInfoBottomSheetFragment.java deleted file mode 100644 index 85d50993..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/RedditAPIInfoBottomSheetFragment.java +++ /dev/null @@ -1,67 +0,0 @@ -package ml.docilealligator.infinityforreddit.bottomsheetfragments; - -import android.content.Context; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import androidx.annotation.NonNull; - -import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.activities.MainActivity; -import ml.docilealligator.infinityforreddit.customviews.LandscapeExpandedRoundedBottomSheetDialogFragment; -import ml.docilealligator.infinityforreddit.databinding.FragmentRedditApiInfoBottomSheetBinding; -import ml.docilealligator.infinityforreddit.utils.Utils; - -public class RedditAPIInfoBottomSheetFragment extends LandscapeExpandedRoundedBottomSheetDialogFragment { - - private MainActivity mainActivity; - - public RedditAPIInfoBottomSheetFragment() { - // Required empty public constructor - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - // Inflate the layout for this fragment - FragmentRedditApiInfoBottomSheetBinding binding = FragmentRedditApiInfoBottomSheetBinding.inflate(inflater, container, false); - - if (mainActivity != null && mainActivity.typeface != null) { - Utils.setFontToAllTextViews(binding.getRoot(), mainActivity.typeface); - } - - binding.getRoot().setNestedScrollingEnabled(true); - - /*SpannableString message = new SpannableString(getString(R.string.reddit_api_info, "https://www.reddit.com/r/reddit/comments/145bram/addressing_the_community_about_changes_to_our_api", "https://www.reddit.com/r/Infinity_For_Reddit/comments/147bhsg/the_future_of_infinity")); - Linkify.addLinks(message, Linkify.WEB_URLS); - binding.messageTextViewRedditApiInfoBottomSheetFragment.setText(message); - binding.messageTextViewRedditApiInfoBottomSheetFragment.setMovementMethod(BetterLinkMovementMethod.newInstance().setOnLinkClickListener((textView, url) -> { - Intent intent = new Intent(mainActivity, LinkResolverActivity.class); - intent.setData(Uri.parse(url)); - startActivity(intent); - return true; - }));*/ - binding.messageTextViewRedditApiInfoBottomSheetFragment.setLinkTextColor(getResources().getColor(R.color.colorAccent)); - - binding.doNotShowThisAgainTextView.setOnClickListener(view -> { - binding.doNotShowThisAgainCheckBox.toggle(); - }); - - binding.continueButtonRedditApiInfoBottomSheetFragment.setOnClickListener(view -> { - if (binding.doNotShowThisAgainCheckBox.isChecked()) { - mainActivity.doNotShowRedditAPIInfoAgain(); - } - dismiss(); - }); - - return binding.getRoot(); - } - - @Override - public void onAttach(@NonNull Context context) { - super.onAttach(context); - mainActivity = (MainActivity) context; - } -} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_important_info_bottom_sheet.xml b/app/src/main/res/layout/fragment_important_info_bottom_sheet.xml new file mode 100644 index 00000000..06f94a97 --- /dev/null +++ b/app/src/main/res/layout/fragment_important_info_bottom_sheet.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_reddit_api_info_bottom_sheet.xml b/app/src/main/res/layout/fragment_reddit_api_info_bottom_sheet.xml deleted file mode 100644 index 8fc71245..00000000 --- a/app/src/main/res/layout/fragment_reddit_api_info_bottom_sheet.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3