This GitLab instance reached the end of its service life. It won't be possible to create new users or projects.

Please read the deprecation notice for more information concerning the deprecation timeline

Visit migration.git.tu-berlin.de (internal network only) to import your old projects to the new GitLab platform 📥

hide favorite when no item is selected (large view)

parent 0dcd586e
......@@ -102,14 +102,18 @@ implements SeekBar.OnSeekBarChangeListener, OnItemSelectedListener {
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.buy_menu, menu);
if(mFavorite)
menu.findItem(R.id.menu_favorite).setIcon(
getResources().getDrawable(R.drawable.ic_action_favorite_checked));
menu.findItem(R.id.menu_favorite).setIcon(
getResources().getDrawable(R.drawable.ic_action_favorite_checked));
if (!mBuy.isEnabled())
menu.findItem(R.id.menu_favorite).setVisible(false);
}
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_favorite:
mFavorite = !mFavorite;
final ContentValues favorite = new ContentValues(1);
favorite.put(KassenSQLiteHelper.Products.COLUMN_FAVORITE, (mFavorite ? 1 : 0));
......@@ -223,6 +227,7 @@ implements SeekBar.OnSeekBarChangeListener, OnItemSelectedListener {
else
mName.setText(name);
mBuy.setEnabled(true);
getActivity().invalidateOptionsMenu();
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment