refactor(filter/AltText): set filter title
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package org.joinmastodon.android.model;
|
||||
|
||||
import org.joinmastodon.android.GlobalUserPreferences;
|
||||
import org.joinmastodon.android.MastodonApp;
|
||||
import org.joinmastodon.android.R;
|
||||
import org.jsoup.internal.StringUtil;
|
||||
|
||||
import java.util.EnumSet;
|
||||
@@ -9,8 +11,9 @@ public class AltTextFilter extends LegacyFilter {
|
||||
|
||||
public AltTextFilter(FilterAction filterAction, EnumSet<FilterContext> filterContexts) {
|
||||
this.filterAction=filterAction;
|
||||
isRemote = false;
|
||||
context = filterContexts;
|
||||
this.title=MastodonApp.context.getString(R.string.sk_no_alt_text);
|
||||
this.isRemote=false;
|
||||
this.context=filterContexts;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,14 +8,11 @@ import android.widget.TextView;
|
||||
|
||||
import org.joinmastodon.android.R;
|
||||
import org.joinmastodon.android.fragments.BaseStatusListFragment;
|
||||
import org.joinmastodon.android.model.AltTextFilter;
|
||||
import org.joinmastodon.android.model.Filter;
|
||||
import org.joinmastodon.android.model.LegacyFilter;
|
||||
import org.joinmastodon.android.model.Status;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// Mind the gap!
|
||||
public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
|
||||
public boolean loading;
|
||||
public List<StatusDisplayItem> filteredItems;
|
||||
@@ -51,7 +48,7 @@ public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
|
||||
@Override
|
||||
public void onBind(WarningFilteredStatusDisplayItem item){
|
||||
filteredItems=item.filteredItems;
|
||||
String title = item.applyingFilter instanceof AltTextFilter ? item.parentFragment.getString(R.string.sk_no_alt_text) : item.applyingFilter.title;
|
||||
String title=item.applyingFilter.title;
|
||||
text.setText(item.parentFragment.getString(R.string.sk_filtered, title));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user