Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Fixed #163 (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
DreierF authored Oct 9, 2016
1 parent 40d10a2 commit 433366e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ abstract class EditableListFragmentBase<T extends IIdSettable> extends ListFragm
implements OnCardClickListener<T>, LoaderManager.LoaderCallbacks<List<T>> {

protected boolean supportsStatistics = false;
protected boolean supportsDeletion = true;
@State(SelectorBundler.class)
MultiSelector mSelector = new MultiSelector();
@PluralsRes
Expand All @@ -48,8 +49,8 @@ abstract class EditableListFragmentBase<T extends IIdSettable> extends ListFragm
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
MenuItem edit = menu.findItem(R.id.action_edit);
edit.setVisible(mSelector.getSelectedIds().size() == 1);
MenuItem stats = menu.findItem(R.id.action_statistics);
stats.setVisible(supportsStatistics);
menu.findItem(R.id.action_statistics).setVisible(supportsStatistics);
menu.findItem(R.id.action_delete).setVisible(supportsDeletion);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.List;
import java.util.Locale;

import de.dreier.mytargets.ApplicationInstance;
import de.dreier.mytargets.R;
import de.dreier.mytargets.activities.ScoreboardActivity;
import de.dreier.mytargets.activities.SimpleFragmentActivityBase;
Expand Down Expand Up @@ -127,8 +126,8 @@ public Loader<List<Round>> onCreateLoader(int id, Bundle args) {
public void onLoadFinished(Loader<List<Round>> loader, List<Round> data) {
// Hide fab for standard rounds
StandardRound standardRound = standardRoundDataSource.get(training.standardRoundId);
binding.fab.setVisibility(
standardRound.club == StandardRoundFactory.CUSTOM_PRACTICE ? View.VISIBLE : View.GONE);
supportsDeletion = standardRound.club == StandardRoundFactory.CUSTOM_PRACTICE;
binding.fab.setVisibility(supportsDeletion ? View.VISIBLE : View.GONE);

// Set round info
int weatherDrawable = R.drawable.ic_house_24dp;
Expand Down Expand Up @@ -210,7 +209,7 @@ private class ViewHolder extends SelectableViewHolder<Round> {
@Override
public void bindItem() {
binding.title.setText(String.format(Locale.ENGLISH, "%s %d",
ApplicationInstance.getContext().getString(R.string.round),
getContext().getString(R.string.round),
mItem.info.index + 1));
binding.subtitle.setText(HtmlUtils.fromHtml(HtmlUtils.getRoundInfo(mItem, equals)));
if (binding.subtitle.getText().toString().isEmpty()) {
Expand Down

0 comments on commit 433366e

Please sign in to comment.