aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-07-14 14:26:28 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-07-14 14:26:28 +0000
commitd31d348788677288b5e334a4e2b33aa775497ae6 (patch)
tree36274f3edb7df38ec33718d207b2ebde42a88ea7 /app/src/main/java/ml
parent4363731a8113bd4c4c929223c76f1ee1e6556c9d (diff)
downloadinfinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.tar
infinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.tar.gz
infinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.tar.bz2
infinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.tar.lz
infinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.tar.xz
infinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.tar.zst
infinity-for-reddit-d31d348788677288b5e334a4e2b33aa775497ae6.zip
Choose whether receiving post reply notifications or not in PostLinkActivity.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java23
1 files changed, 20 insertions, 3 deletions
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 ab1852bc..a6b24027 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java
@@ -12,6 +12,7 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -28,6 +29,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.snackbar.Snackbar;
+import com.google.android.material.switchmaterial.SwitchMaterial;
import com.libRG.CustomTextView;
import org.greenrobot.eventbus.EventBus;
@@ -94,14 +96,22 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
View divider1;
@BindView(R.id.divider_2_post_link_activity)
View divider2;
- @BindView(R.id.divider_3_post_link_activity)
- View divider3;
+ @BindView(R.id.divider_4_post_link_activity)
+ View divider4;
@BindView(R.id.flair_custom_text_view_post_link_activity)
CustomTextView flairTextView;
@BindView(R.id.spoiler_custom_text_view_post_link_activity)
CustomTextView spoilerTextView;
@BindView(R.id.nsfw_custom_text_view_post_link_activity)
CustomTextView nsfwTextView;
+ @BindView(R.id.receive_post_reply_notifications_linear_layout_post_link_activity)
+ LinearLayout receivePostReplyNotificationsLinearLayout;
+ @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;
+ @BindView(R.id.divider_3_post_link_activity)
+ View divider3;
@BindView(R.id.post_title_edit_text_post_link_activity)
EditText titleEditText;
@BindView(R.id.suggest_title_button_post_link_activity)
@@ -310,6 +320,10 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
}
});
+ receivePostReplyNotificationsLinearLayout.setOnClickListener(view -> {
+ receivePostReplyNotificationsSwitchMaterial.performClick();
+ });
+
suggestTitleButton.setOnClickListener(view -> {
Toast.makeText(this, R.string.please_wait, Toast.LENGTH_SHORT).show();
String url = linkEditText.getText().toString().trim();
@@ -355,11 +369,13 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());
rulesButton.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimaryLightTheme()));
+ primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
+ receivePostReplyNotificationsTextView.setTextColor(primaryTextColor);
int dividerColor = mCustomThemeWrapper.getDividerColor();
divider1.setBackgroundColor(dividerColor);
divider2.setBackgroundColor(dividerColor);
divider3.setBackgroundColor(dividerColor);
- primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
+ divider4.setBackgroundColor(dividerColor);
flairBackgroundColor = mCustomThemeWrapper.getFlairBackgroundColor();
flairTextColor = mCustomThemeWrapper.getFlairTextColor();
spoilerBackgroundColor = mCustomThemeWrapper.getSpoilerBackgroundColor();
@@ -475,6 +491,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
intent.putExtra(SubmitPostService.EXTRA_FLAIR, flair);
intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler);
intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW);
+ intent.putExtra(SubmitPostService.EXTRA_RECEIVE_POST_REPLY_NOTIFICATIONS, receivePostReplyNotificationsSwitchMaterial.isChecked());
intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TEXT_OR_LINK);
ContextCompat.startForegroundService(this, intent);