diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2022-11-08 12:17:26 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2022-11-08 12:17:26 +0000 |
commit | 071ce78b7cb6e1249e56faaef6f05fa311b83a1c (patch) | |
tree | 5a281f624cfb40722b92338cdc5d7ead3cf7e626 /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | 2c9ffbc6142f63b72a1b53f24d2100d9d0d63751 (diff) | |
download | infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.tar infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.tar.gz infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.tar.bz2 infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.tar.lz infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.tar.xz infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.tar.zst infinity-for-reddit-071ce78b7cb6e1249e56faaef6f05fa311b83a1c.zip |
Material Design 3 Switch. Target Sdk 33.
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
14 files changed, 63 insertions, 38 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java index d86da54a..5721cc50 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizePostFilterActivity.java @@ -27,7 +27,7 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.checkbox.MaterialCheckBox; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import com.r0adkll.slidr.Slidr; @@ -122,13 +122,13 @@ public class CustomizePostFilterActivity extends BaseActivity { @BindView(R.id.only_nsfw_text_view_customize_post_filter_activity) TextView onlyNSFWTextView; @BindView(R.id.only_nsfw_switch_customize_post_filter_activity) - SwitchMaterial onlyNSFWSwitch; + MaterialSwitch onlyNSFWSwitch; @BindView(R.id.only_spoiler_linear_layout_customize_post_filter_activity) LinearLayout onlySpoilerLinearLayout; @BindView(R.id.only_spoiler_text_view_customize_post_filter_activity) TextView onlySpoilerTextView; @BindView(R.id.only_spoiler_switch_customize_post_filter_activity) - SwitchMaterial onlySpoilerSwitch; + MaterialSwitch onlySpoilerSwitch; @BindView(R.id.title_excludes_strings_text_input_layout_customize_post_filter_activity) TextInputLayout titleExcludesStringsTextInputLayout; @BindView(R.id.title_excludes_strings_text_input_edit_text_customize_post_filter_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java index d3b32e4e..971e0b19 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/GiveAwardActivity.java @@ -21,7 +21,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.android.material.materialswitch.MaterialSwitch; import com.r0adkll.slidr.Slidr; import java.util.concurrent.Executor; @@ -115,12 +115,12 @@ public class GiveAwardActivity extends BaseActivity { adapter = new AwardRecyclerViewAdapter(this, mCustomThemeWrapper, award -> { LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.dialog_give_award, null); - SwitchMaterial switchMaterial = layout.findViewById(R.id.switch_material_give_award_dialog); + MaterialSwitch materialSwitch = layout.findViewById(R.id.switch_material_give_award_dialog); new MaterialAlertDialogBuilder(this) .setTitle(R.string.give_award_dialog_title) .setView(layout) .setPositiveButton(R.string.yes, (dialogInterface, i) -> { - boolean isAnonymous = switchMaterial.isChecked(); + boolean isAnonymous = materialSwitch.isChecked(); GiveAward.giveAwardV2(mExecutor, new Handler(), mOauthRetrofit, mAccessToken, thingFullname, award.getId(), isAnonymous, new GiveAward.GiveAwardListener() { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java index 0b746fc9..fe42c979 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostGalleryActivity.java @@ -36,8 +36,8 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.divider.MaterialDivider; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.snackbar.Snackbar; -import com.google.android.material.switchmaterial.SwitchMaterial; import com.google.gson.Gson; import com.libRG.CustomTextView; @@ -133,7 +133,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee @BindView(R.id.receive_post_reply_notifications_text_view_post_gallery_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_post_gallery_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_2_post_gallery_activity) MaterialDivider divider2; @BindView(R.id.post_title_edit_text_post_gallery_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java index 3d595b09..739d6a66 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java @@ -34,8 +34,8 @@ import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.divider.MaterialDivider; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.snackbar.Snackbar; -import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -120,7 +120,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF @BindView(R.id.receive_post_reply_notifications_text_view_post_image_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_post_image_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_2_post_image_activity) MaterialDivider divider2; @BindView(R.id.post_title_edit_text_post_image_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java index 562b55db..caa5c873 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java @@ -28,8 +28,8 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.divider.MaterialDivider; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.snackbar.Snackbar; -import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -117,7 +117,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr @BindView(R.id.receive_post_reply_notifications_text_view_post_link_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_post_link_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.post_title_edit_text_post_link_activity) EditText titleEditText; @BindView(R.id.suggest_title_button_post_link_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java index 945fb86f..fccbd61b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostPollActivity.java @@ -30,6 +30,7 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.divider.MaterialDivider; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.slider.Slider; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.switchmaterial.SwitchMaterial; @@ -118,7 +119,7 @@ public class PostPollActivity extends BaseActivity implements FlairBottomSheetFr @BindView(R.id.receive_post_reply_notifications_text_view_post_poll_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_post_poll_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_2_post_poll_activity) MaterialDivider divider2; @BindView(R.id.post_title_edit_text_post_poll_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java index 2b608bbf..c1c3dfe0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java @@ -34,6 +34,7 @@ import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.divider.MaterialDivider; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; @@ -129,7 +130,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr @BindView(R.id.receive_post_reply_notifications_text_view_post_text_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_post_text_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_2_post_text_activity) MaterialDivider divider2; @BindView(R.id.post_title_edit_text_post_text_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java index d9e36ee5..7289835d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java @@ -40,8 +40,8 @@ import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.divider.MaterialDivider; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.snackbar.Snackbar; -import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -123,7 +123,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF @BindView(R.id.receive_post_reply_notifications_text_view_post_video_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_post_video_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_2_post_video_activity) MaterialDivider divider2; @BindView(R.id.post_title_edit_text_post_video_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java index 9ce13935..392535c0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java @@ -35,8 +35,8 @@ import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; +import com.google.android.material.materialswitch.MaterialSwitch; import com.google.android.material.snackbar.Snackbar; -import com.google.android.material.switchmaterial.SwitchMaterial; import com.libRG.CustomTextView; import org.greenrobot.eventbus.EventBus; @@ -120,7 +120,7 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom @BindView(R.id.receive_post_reply_notifications_text_view_submit_crosspost_activity) TextView receivePostReplyNotificationsTextView; @BindView(R.id.receive_post_reply_notifications_switch_material_submit_crosspost_activity) - SwitchMaterial receivePostReplyNotificationsSwitchMaterial; + MaterialSwitch receivePostReplyNotificationsSwitchMaterial; @BindView(R.id.divider_3_submit_crosspost_activity) View divider3; @BindView(R.id.post_title_edit_text_submit_crosspost_activity) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CustomizeThemeRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CustomizeThemeRecyclerViewAdapter.java index 5c31046b..eb4fddb5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CustomizeThemeRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CustomizeThemeRecyclerViewAdapter.java @@ -13,7 +13,7 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.android.material.materialswitch.MaterialSwitch; import java.util.ArrayList; @@ -166,7 +166,7 @@ public class CustomizeThemeRecyclerViewAdapter extends RecyclerView.Adapter<Recy @BindView(R.id.theme_item_info_text_view_item_custom_theme_switch_item) TextView themeItemInfoTextView; @BindView(R.id.theme_item_switch_item_custom_theme_switch_item) - SwitchMaterial themeItemSwitch; + MaterialSwitch themeItemSwitch; ThemeSwitchItemViewHolder(@NonNull View itemView) { super(itemView); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CustomFontSwitchPreference.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CustomFontSwitchPreference.java index 8a4ee1b8..347d8b29 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CustomFontSwitchPreference.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CustomFontSwitchPreference.java @@ -7,39 +7,62 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.NonNull; import androidx.preference.PreferenceViewHolder; import androidx.preference.SwitchPreference; +import com.google.android.material.materialswitch.MaterialSwitch; + import ml.docilealligator.infinityforreddit.CustomFontReceiver; import ml.docilealligator.infinityforreddit.CustomThemeWrapperReceiver; +import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; public class CustomFontSwitchPreference extends SwitchPreference implements CustomFontReceiver, CustomThemeWrapperReceiver { private CustomThemeWrapper customThemeWrapper; private Typeface typeface; + private MaterialSwitch materialSwitch; public CustomFontSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); + setWidgetLayoutResource(R.layout.preference_switch); + } public CustomFontSwitchPreference(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); + setWidgetLayoutResource(R.layout.preference_switch); } public CustomFontSwitchPreference(Context context, AttributeSet attrs) { super(context, attrs); + setWidgetLayoutResource(R.layout.preference_switch); } public CustomFontSwitchPreference(Context context) { super(context); + setWidgetLayoutResource(R.layout.preference_switch); + } + + @Override + public void setChecked(boolean checked) { + super.setChecked(checked); + if (materialSwitch != null) { + materialSwitch.setChecked(checked); + } } @Override - public void onBindViewHolder(PreferenceViewHolder holder) { + public void onBindViewHolder(@NonNull PreferenceViewHolder holder) { super.onBindViewHolder(holder); View iconImageView = holder.findViewById(android.R.id.icon); View titleTextView = holder.findViewById(android.R.id.title); View summaryTextView = holder.findViewById(android.R.id.summary); + materialSwitch = (MaterialSwitch) holder.findViewById(R.id.material_switch_switch_preference); + materialSwitch.setChecked(isChecked()); + materialSwitch.setOnClickListener(view -> { + onClick(); + }); if (customThemeWrapper != null) { if (iconImageView instanceof ImageView) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java index 1a5cab8a..4346fef7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/CustomizeMainPageTabsFragment.java @@ -21,7 +21,7 @@ import androidx.constraintlayout.widget.ConstraintLayout; import androidx.fragment.app.Fragment; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.android.material.materialswitch.MaterialSwitch; import javax.inject.Inject; import javax.inject.Named; @@ -55,7 +55,7 @@ public class CustomizeMainPageTabsFragment extends Fragment { @BindView(R.id.show_tab_names_title_text_view_customize_main_page_tabs_fragment) TextView showTabNamesTitleTextView; @BindView(R.id.show_tab_names_switch_material_customize_main_page_tabs_fragment) - SwitchMaterial showTabNamesSwitch; + MaterialSwitch showTabNamesSwitch; @BindView(R.id.divider_1_customize_main_page_tabs_fragment) View divider1; @BindView(R.id.tab_1_group_summary_customize_main_page_tabs_fragment) @@ -139,25 +139,25 @@ public class CustomizeMainPageTabsFragment extends Fragment { @BindView(R.id.show_favorite_multireddits_title_text_view_customize_main_page_tabs_fragment) TextView showFavoriteMultiredditsTitleTextView; @BindView(R.id.show_favorite_multireddits_switch_material_customize_main_page_tabs_fragment) - SwitchMaterial showFavoriteMultiredditsSwitchMaterial; + MaterialSwitch showFavoriteMultiredditsSwitchMaterial; @BindView(R.id.show_multireddits_linear_layout_customize_main_page_tabs_fragment) LinearLayout showMultiredditsLinearLayout; @BindView(R.id.show_multireddits_title_text_view_customize_main_page_tabs_fragment) TextView showMultiredditsTitleTextView; @BindView(R.id.show_multireddits_switch_material_customize_main_page_tabs_fragment) - SwitchMaterial showMultiredditsSwitchMaterial; + MaterialSwitch showMultiredditsSwitchMaterial; @BindView(R.id.show_subscribed_subreddits_linear_layout_customize_main_page_tabs_fragment) LinearLayout showSubscribedSubredditsLinearLayout; @BindView(R.id.show_subscribed_subreddits_title_text_view_customize_main_page_tabs_fragment) TextView showSubscribedSubredditsTitleTextView; @BindView(R.id.show_subscribed_subreddits_switch_material_customize_main_page_tabs_fragment) - SwitchMaterial showSubscribedSubredditsSwitchMaterial; + MaterialSwitch showSubscribedSubredditsSwitchMaterial; @BindView(R.id.show_favorite_subscribed_subreddits_linear_layout_customize_main_page_tabs_fragment) LinearLayout showFavoriteSubscribedSubredditsLinearLayout; @BindView(R.id.show_favorite_subscribed_subreddits_title_text_view_customize_main_page_tabs_fragment) TextView showFavoriteSubscribedSubredditsTitleTextView; @BindView(R.id.show_favorite_subscribed_subreddits_switch_material_customize_main_page_tabs_fragment) - SwitchMaterial showFavoriteSubscribedSubredditsSwitchMaterial; + MaterialSwitch showFavoriteSubscribedSubredditsSwitchMaterial; @Inject @Named("main_activity_tabs") SharedPreferences mainActivityTabsSharedPreferences; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NsfwAndSpoilerFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NsfwAndSpoilerFragment.java index b61f4635..a17649c5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NsfwAndSpoilerFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NsfwAndSpoilerFragment.java @@ -13,7 +13,7 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.android.material.materialswitch.MaterialSwitch; import org.greenrobot.eventbus.EventBus; @@ -40,25 +40,25 @@ public class NsfwAndSpoilerFragment extends Fragment { @BindView(R.id.enable_nsfw_text_view_nsfw_and_spoiler_fragment) TextView enableNsfwTextView; @BindView(R.id.enable_nsfw_switch_nsfw_and_spoiler_fragment) - SwitchMaterial enableNsfwSwitchMaterial; + MaterialSwitch enableNsfwSwitchMaterial; @BindView(R.id.blur_nsfw_linear_layout_nsfw_and_spoiler_fragment) LinearLayout blurNsfwLinearLayout; @BindView(R.id.blur_nsfw_text_view_nsfw_and_spoiler_fragment) TextView blurNsfwTextView; @BindView(R.id.blur_nsfw_switch_nsfw_and_spoiler_fragment) - SwitchMaterial blurNsfwSwitchMaterial; + MaterialSwitch blurNsfwSwitchMaterial; @BindView(R.id.do_not_blur_nsfw_in_nsfw_subreddits_linear_layout_nsfw_and_spoiler_fragment) LinearLayout doNotBlurNsfwInNsfwSubredditsLinearLayout; @BindView(R.id.do_not_blur_nsfw_text_view_nsfw_and_spoiler_fragment) TextView doNotBlurNsfwInNsfwSubredditsTextView; @BindView(R.id.do_not_blur_nsfw_in_nsfw_subreddits_switch_nsfw_and_spoiler_fragment) - SwitchMaterial doNotBlurNsfwInNsfwSubredditsSwitch; + MaterialSwitch doNotBlurNsfwInNsfwSubredditsSwitch; @BindView(R.id.blur_spoiler_linear_layout_nsfw_and_spoiler_fragment) LinearLayout blurSpoilerLinearLayout; @BindView(R.id.blur_spoiler_text_view_nsfw_and_spoiler_fragment) TextView blurSpoilerTextView; @BindView(R.id.blur_spoiler_switch_nsfw_and_spoiler_fragment) - SwitchMaterial blurSpoilerSwitchMaterial; + MaterialSwitch blurSpoilerSwitchMaterial; @BindView(R.id.dangerous_text_view_nsfw_and_spoiler_fragment) TextView dangerousTextView; @BindView(R.id.disable_nsfw_forever_linear_layout_nsfw_and_spoiler_fragment) @@ -66,7 +66,7 @@ public class NsfwAndSpoilerFragment extends Fragment { @BindView(R.id.disable_nsfw_forever_text_view_nsfw_and_spoiler_fragment) TextView disableNsfwForeverTextView; @BindView(R.id.disable_nsfw_forever_switch_nsfw_and_spoiler_fragment) - SwitchMaterial disableNsfwForeverSwitchMaterial; + MaterialSwitch disableNsfwForeverSwitchMaterial; @Inject @Named("default") SharedPreferences sharedPreferences; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java index 0384f050..3ac6dcef 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java @@ -13,7 +13,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import com.google.android.material.switchmaterial.SwitchMaterial; +import com.google.android.material.materialswitch.MaterialSwitch; import javax.inject.Inject; import javax.inject.Named; @@ -37,25 +37,25 @@ public class PostHistoryFragment extends Fragment { @BindView(R.id.mark_posts_as_read_text_view_post_history_fragment) TextView markPostsAsReadTextView; @BindView(R.id.mark_posts_as_read_switch_post_history_fragment) - SwitchMaterial markPostsAsReadSwitch; + MaterialSwitch markPostsAsReadSwitch; @BindView(R.id.mark_posts_as_read_after_voting_linear_layout_post_history_fragment) LinearLayout markPostsAsReadAfterVotingLinearLayout; @BindView(R.id.mark_posts_as_read_after_voting_text_view_post_history_fragment) TextView markPostsAsReadAfterVotingTextView; @BindView(R.id.mark_posts_as_read_after_voting_switch_post_history_fragment) - SwitchMaterial markPostsAsReadAfterVotingSwitch; + MaterialSwitch markPostsAsReadAfterVotingSwitch; @BindView(R.id.mark_posts_as_read_on_scroll_linear_layout_post_history_fragment) LinearLayout markPostsAsReadOnScrollLinearLayout; @BindView(R.id.mark_posts_as_read_on_scroll_text_view_post_history_fragment) TextView markPostsAsReadOnScrollTextView; @BindView(R.id.mark_posts_as_read_on_scroll_switch_post_history_fragment) - SwitchMaterial markPostsAsReadOnScrollSwitch; + MaterialSwitch markPostsAsReadOnScrollSwitch; @BindView(R.id.hide_read_posts_automatically_linear_layout_post_history_fragment) LinearLayout hideReadPostsAutomaticallyLinearLayout; @BindView(R.id.hide_read_posts_automatically_text_view_post_history_fragment) TextView hideReadPostsAutomaticallyTextView; @BindView(R.id.hide_read_posts_automatically_switch_post_history_fragment) - SwitchMaterial hideReadPostsAutomaticallySwitch; + MaterialSwitch hideReadPostsAutomaticallySwitch; @Inject @Named("post_history") SharedPreferences postHistorySharedPreferences; |