forked from LucasGGamerM/moshidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Timeline/Hashtag): show confirmation sheet when muting
Shows a MuteHashtagConfirmationSheet when muting a hashtag, similar to the MuteAccountConfirmationSheet. This also adds the option for the mute to expire.
- Loading branch information
1 parent
5427b21
commit b0f8cbb
Showing
5 changed files
with
116 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
mastodon/src/main/java/org/joinmastodon/android/ui/sheets/MuteHashtagConfirmationSheet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.joinmastodon.android.ui.sheets; | ||
|
||
import android.content.Context; | ||
import android.view.View; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import org.joinmastodon.android.R; | ||
import org.joinmastodon.android.model.Account; | ||
import org.joinmastodon.android.model.Hashtag; | ||
|
||
import java.time.Duration; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
|
||
|
||
// MOSHIDON | ||
public class MuteHashtagConfirmationSheet extends AccountRestrictionConfirmationSheet{ | ||
public MuteHashtagConfirmationSheet(@NonNull Context context, Account user, AtomicReference<Duration> muteDuration, Hashtag hashtag, ConfirmCallback confirmCallback){ | ||
super(context, user, confirmCallback); | ||
titleView.setText(R.string.mo_mute_hashtag); | ||
confirmBtn.setText(R.string.do_mute); | ||
secondaryBtn.setVisibility(View.GONE); | ||
icon.setImageResource(R.drawable.ic_fluent_speaker_off_24_regular); | ||
subtitleView.setText("#"+hashtag.name); | ||
addRow(R.drawable.ic_fluent_number_symbol_24_regular, R.string.mo_mute_hashtag_explanation_muted_home); | ||
addRow(R.drawable.ic_fluent_eye_off_24_regular, R.string.mo_mute_hashtag_explanation_discreet); | ||
addRow(R.drawable.ic_fluent_search_24_regular, R.string.mo_mute_hashtag_explanation_search); | ||
addDurationRow(context, muteDuration); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters