diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 729b4dd2..e6bfdb28 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,6 +19,7 @@ + \ No newline at end of file diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/BindingAdapters.kt b/app/src/main/java/com/fazemeright/myinventorytracker/BindingAdapters.kt index 890c12f8..15b31f77 100644 --- a/app/src/main/java/com/fazemeright/myinventorytracker/BindingAdapters.kt +++ b/app/src/main/java/com/fazemeright/myinventorytracker/BindingAdapters.kt @@ -1,21 +1,8 @@ package com.fazemeright.myinventorytracker -import android.graphics.Color import android.widget.TextView -import androidx.cardview.widget.CardView import androidx.databinding.BindingAdapter -@BindingAdapter("app:bgColor") -fun updateBackgroundColor(cardView: CardView, bagName: String) { - cardView.setBackgroundColor( - when (bagName) { - "Red" -> Color.parseColor("#C92214") - "Black AT" -> Color.parseColor("#000000") - else -> Color.parseColor("#0A3D62") - } - ) -} - @BindingAdapter("app:setBagName") fun setBagName(textView: TextView, bagName: String) { textView.text = bagName diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListActivity.kt b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListActivity.kt new file mode 100644 index 00000000..b6fb7eac --- /dev/null +++ b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListActivity.kt @@ -0,0 +1,161 @@ +package com.fazemeright.myinventorytracker.baglist + +import android.content.Intent +import android.os.Bundle +import android.view.Menu +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.SearchView +import androidx.databinding.DataBindingUtil +import androidx.lifecycle.Observer +import androidx.lifecycle.ViewModelProviders +import androidx.recyclerview.widget.LinearLayoutManager +import com.fazemeright.myinventorytracker.R +import com.fazemeright.myinventorytracker.addbag.AddBagActivity +import com.fazemeright.myinventorytracker.database.InventoryDatabase +import com.fazemeright.myinventorytracker.databinding.ActivityBagListBinding + +class BagListActivity : AppCompatActivity() { + + private lateinit var searchView: SearchView + private lateinit var viewModel: BagListViewModel + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + val binding: ActivityBagListBinding = + DataBindingUtil.setContentView(this, R.layout.activity_bag_list) + + val application = requireNotNull(this).application + + val dataSource = InventoryDatabase.getInstance(application) + + val viewModelFactory = BagListViewModelFactory(dataSource, application) + + viewModel = ViewModelProviders.of(this, viewModelFactory).get(BagListViewModel::class.java) + + binding.viewModel = viewModel + + binding.lifecycleOwner = this + + supportActionBar?.apply { + setHomeButtonEnabled(true) + setDisplayHomeAsUpEnabled(true) + title = getString(R.string.bag_list) + } + + val manager = LinearLayoutManager(this) + + binding.bagList.layoutManager = manager + + val adapter = BagListAdapter( + BagListAdapter.BagListener( + clickListener = { item -> + viewModel.onBagClicked(item) + }, + deleteClickListener = { itemId -> + showConfirmationDialog(itemId) +// TODO("Implement AlertDialog for confirmation before delete") +// viewModel.onDeleteItemClicked(itemId) + } + )) + + binding.bagList.adapter = adapter + + viewModel.bags.observe(this, Observer { + it?.let { + adapter.updateList(it) + } + }) + + viewModel.searchItems.observe(this, Observer { + it?.let { + adapter.updateList(it) + } + }) + + /*viewModel.deletedItem.observe(this, Observer { deletedItem -> + // Show a snack bar for undo option + Snackbar.make( + binding.root, // Parent view + "Item deleted from database.", // Message to show + Snackbar.LENGTH_LONG // + ).setAction( // Set an action for snack bar + "Undo" // Action button text + ) { + // Action button click listener + // Do something when undo action button clicked + viewModel.undoDeleteItem(deletedItem) + }.show() + })*/ + + viewModel.navigateToAddBagActivity.observe(this, Observer { navigate -> + if (navigate) { + startActivity(Intent(this, AddBagActivity::class.java)) + viewModel.onNavigationToAddBagFinished() + } + }) + + viewModel.navigateToBagDetailActivity.observe(this, Observer { itemInBag -> + itemInBag?.let { + /*val intent = Intent(this, ItemDetailActivity::class.java) + .apply { putExtra("itemInBag", it) } + startActivity(intent) TODO: Navigate to BagDetailActivity*/ + viewModel.onNavigationToItemDetailFinished() + } + }) + + viewModel.bags.observe(this, Observer { bagList -> + bagList?.let { + adapter.updateBagList(bagList) + } + }) + } + + private fun showConfirmationDialog(itemId: Long) { + // build alert dialog + val dialogBuilder = AlertDialog.Builder(this) + + // set message of alert dialog + dialogBuilder + // set title for alert dialog box + .setTitle("Are you sure") + .setMessage("Do you want to delete this entry?") + // if the dialog is cancelable + .setCancelable(false) + // positive button text and action + .setPositiveButton("Yes") { _, _ -> + viewModel.onDeleteItemClicked(itemId) + } + // negative button text and action + .setNegativeButton("No") { dialog, _ -> + dialog.cancel() + } + + // create dialog box + val alert = dialogBuilder.create() + // show alert dialog + alert.show() + } + + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + val inflater = menuInflater + inflater.inflate(R.menu.menu_bag_list, menu) + val searchItem = menu!!.findItem(R.id.action_search) + searchView = searchItem.actionView as SearchView + searchView.isSubmitButtonEnabled = true + searchView.queryHint = "Search Inventory for Items" + searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener { + override fun onQueryTextChange(newText: String): Boolean { + viewModel.onSearchClicked(newText) + return true + } + + override fun onQueryTextSubmit(query: String): Boolean { + viewModel.onSearchClicked(query) + return true + } + }) + return super.onCreateOptionsMenu(menu) + } +} diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListAdapter.kt b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListAdapter.kt new file mode 100644 index 00000000..6294f772 --- /dev/null +++ b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListAdapter.kt @@ -0,0 +1,87 @@ +package com.fazemeright.myinventorytracker.baglist + +import android.util.Log +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView +import com.fazemeright.myinventorytracker.database.BagItem +import com.fazemeright.myinventorytracker.databinding.ListBagItemBinding +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers + +class BagListAdapter(private val clickListener: BagListener) : + ListAdapter(ItemListDiffCallback()) { + + private lateinit var bagsList: List + + private val adapterScope = CoroutineScope(Dispatchers.Default) + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + return ViewHolder.from(parent) + } + + fun updateList(list: List?) { + Log.d("##DebugData", list.toString()) + submitList(list) + } + + fun updateBagList(updatedList: List) { + this.bagsList = updatedList + } + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + val item = getItem(position) + holder.bind(item, clickListener) + } + + class ViewHolder private constructor(val binding: ListBagItemBinding) : + RecyclerView.ViewHolder(binding.root) { + + + fun bind( + item: BagItem, + clickListener: BagListener + ) { + binding.item = item + binding.clickListener = clickListener + binding.executePendingBindings() + } + + companion object { + fun from(parent: ViewGroup): ViewHolder { + val layoutInflater = LayoutInflater.from(parent.context) + val binding = ListBagItemBinding.inflate(layoutInflater, parent, false) + return ViewHolder(binding) + } + } + } + + class ItemListDiffCallback : + DiffUtil.ItemCallback() { + override fun areItemsTheSame( + oldBag: BagItem, + newBag: BagItem + ): Boolean { + return oldBag.bagId == newBag.bagId + } + + override fun areContentsTheSame( + oldBag: BagItem, + newBag: BagItem + ): Boolean { + return oldBag == newBag + } + + } + + class BagListener( + val clickListener: (bag: BagItem) -> Unit, + val deleteClickListener: (bagId: Long) -> Unit + ) { + fun onClick(bag: BagItem) = clickListener(bag) + fun onDeleteClick(bag: BagItem) = deleteClickListener(bag.bagId) + } +} diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListViewModel.kt b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListViewModel.kt new file mode 100644 index 00000000..31ef3586 --- /dev/null +++ b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListViewModel.kt @@ -0,0 +1,115 @@ +package com.fazemeright.myinventorytracker.baglist + +import android.app.Application +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import com.fazemeright.myinventorytracker.database.BagItem +import com.fazemeright.myinventorytracker.database.InventoryDatabase +import com.fazemeright.myinventorytracker.database.InventoryItem +import kotlinx.coroutines.* + +/** + * ViewModel for BagListActivity. + */ +class BagListViewModel( + val database: InventoryDatabase, + application: Application +) : AndroidViewModel(application) { + + /** + * viewModelJob allows us to cancel all coroutines started by this ViewModel. + */ + private var viewModelJob = Job() + /** + * A [CoroutineScope] keeps track of all coroutines started by this ViewModel. + * + * Because we pass it [viewModelJob], any coroutine started in this uiScope can be cancelled + * by calling `viewModelJob.cancel()` + * + * By default, all coroutines started in uiScope will launch in [Dispatchers.Main] which is + * the main thread on Android. This is a sensible default because most coroutines started by + * a [BagListViewModel] update the UI after performing some processing. + */ + private val uiScope = CoroutineScope(Dispatchers.Main + viewModelJob) + + val searchItems: LiveData> + get() = _searchItems + + private val _searchItems = MutableLiveData>() + + val bags = database.bagItemDao.getAllBags() + + val navigateToBagDetailActivity = MutableLiveData() + + val navigateToAddBagActivity = MutableLiveData() + +// val deletedItem = MutableLiveData() + + init { + onSearchClicked("") + } + + fun onSearchClicked(searchText: String) { + uiScope.launch { + fetchSearchResults(searchText) + } + } + + private suspend fun fetchSearchResults(searchText: String) { + withContext(Dispatchers.IO) { + updateItems(database.inventoryItemDao.getSearchBags("%$searchText%")) + } + } + + private suspend fun updateItems(newItems: List) { + withContext(Dispatchers.Main) { + _searchItems.value = newItems + } + } + + fun addBagClicked() { + navigateToAddBagActivity.value = true + } + + fun onNavigationToAddBagFinished() { + navigateToAddBagActivity.value = false + } + + fun onBagClicked(item: BagItem) { + navigateToBagDetailActivity.value = item + } + + fun onNavigationToItemDetailFinished() { + navigateToBagDetailActivity.value = null + } + + // TODO: Update all delete, undo and insert functions with BagItem + fun onDeleteItemClicked(itemId: Long) { + uiScope.launch { + // deletedItem.value = deleteItem(itemId) + } + } + + /*private suspend fun deleteItem(itemId: Long): InventoryItem? { + return withContext(Dispatchers.IO) { + val deleteItem = database.inventoryItemDao.get(itemId) + deleteItem?.let { + database.inventoryItemDao.deleteItem(it) + } + deleteItem + } + }*/ + + fun undoDeleteItem(deletedItem: InventoryItem?) { + uiScope.launch { + insertItemBack(deletedItem) + } + } + + private suspend fun insertItemBack(deletedItem: InventoryItem?) { + withContext(Dispatchers.IO) { + deletedItem?.let { database.inventoryItemDao.insert(it) } + } + } +} diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListViewModelFactory.kt b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListViewModelFactory.kt new file mode 100644 index 00000000..511de05b --- /dev/null +++ b/app/src/main/java/com/fazemeright/myinventorytracker/baglist/BagListViewModelFactory.kt @@ -0,0 +1,25 @@ +package com.fazemeright.myinventorytracker.baglist + +import android.app.Application +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider +import com.fazemeright.myinventorytracker.database.InventoryDatabase + +/** + * This is pretty much boiler plate code for a ViewModel Factory. + * + * Provides the SleepDatabaseDao and context to the ViewModel. + */ +class BagListViewModelFactory( + private val dataSource: InventoryDatabase, + private val application: Application +) : ViewModelProvider.Factory { + @Suppress("unchecked_cast") + override fun create(modelClass: Class): T { + if (modelClass.isAssignableFrom(BagListViewModel::class.java)) { + return BagListViewModel(dataSource, application) as T + } + throw IllegalArgumentException("Unknown ViewModel class") + } +} + diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/database/BagItem.kt b/app/src/main/java/com/fazemeright/myinventorytracker/database/BagItem.kt index d9c46122..54d12c03 100644 --- a/app/src/main/java/com/fazemeright/myinventorytracker/database/BagItem.kt +++ b/app/src/main/java/com/fazemeright/myinventorytracker/database/BagItem.kt @@ -2,6 +2,7 @@ package com.fazemeright.myinventorytracker.database import androidx.room.Entity import androidx.room.PrimaryKey +import java.io.Serializable @Entity(tableName = "my_bag_table") @@ -14,4 +15,4 @@ data class BagItem( var bagColor: Int, var bagDesc: String -) \ No newline at end of file +) : Serializable \ No newline at end of file diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/database/InventoryItemDao.kt b/app/src/main/java/com/fazemeright/myinventorytracker/database/InventoryItemDao.kt index 2a763509..f7253b16 100644 --- a/app/src/main/java/com/fazemeright/myinventorytracker/database/InventoryItemDao.kt +++ b/app/src/main/java/com/fazemeright/myinventorytracker/database/InventoryItemDao.kt @@ -66,6 +66,9 @@ interface InventoryItemDao { @Query("SELECT * FROM my_inventory_table INNER JOIN my_bag_table WHERE itemName LIKE :searchText OR itemDesc LIKE :searchText ORDER BY itemName") fun getSearchItems(searchText: String): List + @Query("SELECT * FROM my_bag_table WHERE bagName LIKE :searchText OR bagDesc LIKE :searchText ORDER BY bagName") + fun getSearchBags(searchText: String): List + /*@Query("SELECT * FROM my_inventory_table INNER JOIN my_bag_table ON bagId = bagId") fun getAllItemsAndBags()*/ @@ -102,6 +105,7 @@ interface InventoryItemDao { @Query("DELETE FROM my_inventory_table WHERE itemId =:itemId") fun delete(itemId: Long) + // TODO: Check why it does not return the correct bag and also update it to return LiveData @Query("SELECT * FROM my_inventory_table INNER JOIN my_bag_table WHERE itemId = :itemId") fun getItemInBagFromId(itemId: Long): ItemInBag } diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/itemdetail/ItemDetailViewModel.kt b/app/src/main/java/com/fazemeright/myinventorytracker/itemdetail/ItemDetailViewModel.kt index 4109ca68..379880b9 100644 --- a/app/src/main/java/com/fazemeright/myinventorytracker/itemdetail/ItemDetailViewModel.kt +++ b/app/src/main/java/com/fazemeright/myinventorytracker/itemdetail/ItemDetailViewModel.kt @@ -38,7 +38,8 @@ class ItemDetailViewModel( init { uiScope.launch { - item.value = getItemInBagFromId(itemInBag.itemId) + item.value = itemInBag +// item.value = getItemInBagFromId(itemInBag.itemId) TODO: Check Implementation in @BagItemDao } } diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListActivity.kt b/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListActivity.kt index 54cef0e4..870a27a6 100644 --- a/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListActivity.kt +++ b/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListActivity.kt @@ -13,7 +13,7 @@ import androidx.lifecycle.ViewModelProviders import androidx.recyclerview.widget.LinearLayoutManager import com.fazemeright.myinventorytracker.R import com.fazemeright.myinventorytracker.additem.AddItemActivity -import com.fazemeright.myinventorytracker.addbag.AddBagActivity +import com.fazemeright.myinventorytracker.baglist.BagListActivity import com.fazemeright.myinventorytracker.database.InventoryDatabase import com.fazemeright.myinventorytracker.databinding.ActivityItemListBinding import com.fazemeright.myinventorytracker.itemdetail.ItemDetailActivity @@ -27,7 +27,8 @@ class ItemListActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val binding: ActivityItemListBinding = DataBindingUtil.setContentView(this, R.layout.activity_item_list) + val binding: ActivityItemListBinding = + DataBindingUtil.setContentView(this, R.layout.activity_item_list) val application = requireNotNull(this).application @@ -45,16 +46,17 @@ class ItemListActivity : AppCompatActivity() { binding.itemList.layoutManager = manager - val adapter = ItemListAdapter(ItemListAdapter.ItemListener( - clickListener = { item -> - viewModel.onItemClicked(item) - }, - deleteClickListener = { itemId -> - showConfirmationDialog(itemId) + val adapter = ItemListAdapter( + ItemListAdapter.ItemListener( + clickListener = { item -> + viewModel.onItemClicked(item) + }, + deleteClickListener = { itemId -> + showConfirmationDialog(itemId) // TODO("Implement AlertDialog for confirmation before delete") // viewModel.onDeleteItemClicked(itemId) - } - )) + } + )) binding.itemList.adapter = adapter @@ -136,7 +138,7 @@ class ItemListActivity : AppCompatActivity() { override fun onCreateOptionsMenu(menu: Menu?): Boolean { val inflater = menuInflater - inflater.inflate(R.menu.menu_search, menu) + inflater.inflate(R.menu.menu_item_list, menu) val searchItem = menu!!.findItem(R.id.action_search) searchView = searchItem.actionView as SearchView searchView.isSubmitButtonEnabled = true @@ -157,7 +159,7 @@ class ItemListActivity : AppCompatActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - R.id.action_add_bag -> startActivity(Intent(this, AddBagActivity::class.java)) + R.id.action_bag_list -> startActivity(Intent(this, BagListActivity::class.java)) } return true } diff --git a/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListViewModelFactory.kt b/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListViewModelFactory.kt index e7b23d58..fa204b1e 100644 --- a/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListViewModelFactory.kt +++ b/app/src/main/java/com/fazemeright/myinventorytracker/itemlist/ItemListViewModelFactory.kt @@ -1,11 +1,9 @@ - package com.fazemeright.myinventorytracker.itemlist import android.app.Application import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import com.fazemeright.myinventorytracker.database.InventoryDatabase -import com.fazemeright.myinventorytracker.database.InventoryItemDao /** * This is pretty much boiler plate code for a ViewModel Factory. diff --git a/app/src/main/res/drawable-anydpi/ic_edit.xml b/app/src/main/res/drawable-anydpi/ic_edit.xml new file mode 100644 index 00000000..b766187e --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_edit.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-hdpi/ic_edit.png b/app/src/main/res/drawable-hdpi/ic_edit.png new file mode 100644 index 00000000..a3226fb9 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_edit.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_edit.png b/app/src/main/res/drawable-mdpi/ic_edit.png new file mode 100644 index 00000000..f0c1fafa Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_edit.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_edit.png b/app/src/main/res/drawable-xhdpi/ic_edit.png new file mode 100644 index 00000000..b508285a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_edit.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_edit.png b/app/src/main/res/drawable-xxhdpi/ic_edit.png new file mode 100644 index 00000000..40ef06e3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_edit.png differ diff --git a/app/src/main/res/layout/activity_bag_list.xml b/app/src/main/res/layout/activity_bag_list.xml new file mode 100644 index 00000000..b327d6be --- /dev/null +++ b/app/src/main/res/layout/activity_bag_list.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_item_list.xml b/app/src/main/res/layout/activity_item_list.xml index 74a1ee56..92a2d174 100644 --- a/app/src/main/res/layout/activity_item_list.xml +++ b/app/src/main/res/layout/activity_item_list.xml @@ -1,13 +1,20 @@ - + + - + + + + @@ -16,22 +23,23 @@ android:id="@+id/item_list" android:layout_width="match_parent" android:layout_height="0dp" - android:paddingBottom="64dp" - android:scrollbars="vertical" android:clipToPadding="false" + android:paddingBottom="@dimen/spacing_huge" + android:scrollbars="vertical" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"/> + app:layout_constraintTop_toTopOf="parent" /> + + android:src="@drawable/ic_add_black_24dp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/list_bag_item.xml b/app/src/main/res/layout/list_bag_item.xml new file mode 100644 index 00000000..8369b1b6 --- /dev/null +++ b/app/src/main/res/layout/list_bag_item.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_bag_list.xml b/app/src/main/res/menu/menu_bag_list.xml new file mode 100644 index 00000000..d2e1990d --- /dev/null +++ b/app/src/main/res/menu/menu_bag_list.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_search.xml b/app/src/main/res/menu/menu_item_list.xml similarity index 57% rename from app/src/main/res/menu/menu_search.xml rename to app/src/main/res/menu/menu_item_list.xml index 50497782..41288c9b 100644 --- a/app/src/main/res/menu/menu_search.xml +++ b/app/src/main/res/menu/menu_item_list.xml @@ -1,16 +1,17 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> + app:showAsAction="ifRoom|collapseActionView" /> + android:id="@+id/action_bag_list" + android:title="@string/bag_list" + app:showAsAction="never" /> + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 5790eb13..9a4dc882 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -2,4 +2,5 @@ 16dp 8dp + 64dp \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 633b564b..094df26f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -17,4 +17,5 @@ Add Item Update Item + Bag List