diff --git a/app/src/main/java/com/readrops/app/MainActivity.java b/app/src/main/java/com/readrops/app/MainActivity.java index 14d9e066..02aef04d 100644 --- a/app/src/main/java/com/readrops/app/MainActivity.java +++ b/app/src/main/java/com/readrops/app/MainActivity.java @@ -25,6 +25,7 @@ import android.widget.Toast; import com.bumptech.glide.Glide; import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader; import com.bumptech.glide.util.ViewPreloadSizeProvider; +import com.github.clans.fab.FloatingActionMenu; import com.readrops.app.database.ItemWithFeed; import com.readrops.app.database.entities.Item; import com.readrops.app.utils.GlideApp; @@ -47,13 +48,15 @@ public class MainActivity extends AppCompatActivity implements SimpleCallback, S private NavigationView navigationView; private DrawerLayout drawerLayout; + private FloatingActionMenu actionMenu; private List newItems; - private TreeMap itemsMap; private MainViewModel viewModel; + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -67,6 +70,8 @@ public class MainActivity extends AppCompatActivity implements SimpleCallback, S drawerLayout.addDrawerListener(toggle); toggle.syncState(); + actionMenu = findViewById(R.id.fab_menu); + navigationView = findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener((menuItem) -> { menuItem.setChecked(true); @@ -208,12 +213,13 @@ public class MainActivity extends AppCompatActivity implements SimpleCallback, S } public void displayAddFeedDialog(View view) { + actionMenu.close(true); Dialog dialog = new AddFeedDialog(this, R.layout.add_feed_layout); dialog.show(); } public void addFolder(View view) { - + actionMenu.close(true); } public void insertNewFeed(ParsingResult result) { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index ba01a7fe..00e836c3 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -47,6 +47,7 @@ android:layout_height="match_parent">