Skip to content

Commit

Permalink
remove package set fab
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed May 26, 2023
1 parent 0217487 commit b152390
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import androidx.annotation.NonNull;
Expand All @@ -15,7 +17,6 @@
import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

import github.tornaco.android.thanos.R;
Expand Down Expand Up @@ -91,10 +92,21 @@ protected int getTitleRes() {

@Override
protected void onSetupFab(ExtendedFloatingActionButton fab) {
fab.setText(R.string.common_fab_title_add);
fab.setIconResource(R.drawable.module_common_ic_add_fill);
fab.show();
fab.setOnClickListener(v -> onRequestAddPackageSet());
fab.hide();
}

@Override
protected void onInflateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.pkg_set_list_menu, menu);
}

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
if (R.id.action_add == item.getItemId()) {
onRequestAddPackageSet();
return true;
}
return super.onOptionsItemSelected(item);
}

private void onRequestAddPackageSet() {
Expand Down
16 changes: 16 additions & 0 deletions android/app/src/main/res/menu/pkg_set_list_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_search"
android:icon="@drawable/module_common_ic_search_2_line"
android:title="@string/common_menu_title_search"
app:showAsAction="ifRoom" />

<item
android:id="@+id/action_add"
android:icon="@drawable/module_common_ic_add_fill"
android:title="@string/common_fab_title_add"
app:showAsAction="ifRoom" />

</menu>

0 comments on commit b152390

Please sign in to comment.