Skip to content

Commit dd72bd7

Browse files
author
Bene0202
committed
Final UI-Update Benedikt
1 parent ae52519 commit dd72bd7

9 files changed

Lines changed: 11 additions & 24 deletions

File tree

0 Bytes
Binary file not shown.

app/src/main/java/com/nlinterface/activities/PlaceDetailsActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ class PlaceDetailsActivity : AppCompatActivity(), PlaceDetailsItemCallback {
580580
* Three functions handling the google maps place search.
581581
*/
582582
/**
583-
* Just launches the intent. It wrapped in function to be called from the different fragments.
583+
* Just launches the intent. It is wrapped in function to be called from the different fragments.
584584
*
585585
* TODO: Make country flexible
586586
*/

app/src/main/java/com/nlinterface/fragments/GroceryListScreen1.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class GroceryListScreen1 : Fragment(), SwipeAction {
5555
override fun onSwipeRight() {}
5656

5757
/**
58-
* Swiping down makes the app read out the current grocery list.
58+
* Swiping down makes the app read out the current grocery list and the items in the cart.
59+
*
5960
*/
6061
override fun onSwipeUp() {
6162
val activityViewmodel = (activity as GroceryListActivity).viewModel
@@ -70,7 +71,8 @@ class GroceryListScreen1 : Fragment(), SwipeAction {
7071
}
7172

7273
/**
73-
* Swiping up clears the grocery list and removes all corresponding fragments.
74+
*
75+
* Swiping down makes the app read out all item that are not yet in the cart.
7476
*/
7577
override fun onSwipeDown() {
7678
for ((itemName, _, inCart) in (activity as GroceryListActivity).groceryItemList) {

app/src/main/java/com/nlinterface/fragments/GroceryListScreen2.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class GroceryListScreen2 : Fragment(), SwipeAction {
9090
}
9191

9292
/**
93-
* Swiping down makes the app read out all item that are not yet in the cart.
93+
* Swiping up clears the grocery list and removes all corresponding fragments.
9494
*/
9595
override fun onSwipeDown() {
9696
(activity as? GroceryListActivity)?.let {

app/src/main/java/com/nlinterface/fragments/GroceryListScreenBase.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,7 @@ class GroceryListScreenBase : Fragment(), SwipeAction {
158158
}
159159
else {
160160
(activity as? GroceryListActivity)?.let {
161-
Log.i(
162-
"GroceryList",
163-
it.viewModel.groceryList.toString()
164-
)
165161
it.addItemToCart(itemTop)
166-
it.deleteGroceryItem(itemTop)
167-
Log.i(
168-
"GroceryList",
169-
it.viewModel.groceryList.toString()
170-
)
171162
itemTop = default
172163
viewModel.updateButtonTexts(itemTop, itemBottom)
173164
val fragmentList = it.groceryListFragmentAdapter.fragmentList
@@ -209,16 +200,7 @@ class GroceryListScreenBase : Fragment(), SwipeAction {
209200
}
210201
else {
211202
(activity as? GroceryListActivity)?.let {
212-
Log.i(
213-
"GroceryList",
214-
it.viewModel.groceryList.toString()
215-
)
216203
it.addItemToCart(itemBottom)
217-
it.deleteGroceryItem(itemBottom)
218-
Log.i(
219-
"GroceryList",
220-
it.viewModel.groceryList.toString()
221-
)
222204
itemBottom = default
223205
viewModel.updateButtonTexts(itemTop, itemBottom)
224206
val fragmentList = it.groceryListFragmentAdapter.fragmentList

app/src/main/java/com/nlinterface/fragments/PlaceDetailsScreen1.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ class PlaceDetailsScreen1 : Fragment(), SwipeAction {
9292
}
9393
else {
9494
for (place in activityViewmodel.placeDetailsItemList) {
95-
(activity as PlaceDetailsActivity).viewModel.say(place.storeName, TextToSpeech.QUEUE_ADD)
95+
(activity as PlaceDetailsActivity).viewModel.say(
96+
place.storeName + place.address, TextToSpeech.QUEUE_ADD)
9697
}
9798
}
9899
}

app/src/main/res/layout/grocerylist_screen1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
android:id="@+id/option_left"
134134
android:layout_width="130dp"
135135
android:layout_height="wrap_content"
136-
android:text="@string/main_menu"
136+
android:text="@string/list_view"
137137
android:backgroundTint="?colorPrimary"
138138
android:textColor="?android:textColorPrimary"
139139
app:autoSizeMaxTextSize="100sp"

app/src/main/res/values-de/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@
264264
<string name="grocery_items">Artikel</string>
265265
<string name="remove_item">Entferne einen Artikel</string>
266266
<string name="more_items">Weitere Artikel</string>
267+
<string name="list_view">Listen Ansicht</string>
267268

268269
<!-- Place Details -->
269270

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@
292292
<string name="grocery_items">Grocery items</string>
293293
<string name="remove_item">Remove an item</string>
294294
<string name="more_items">More items</string>
295+
<string name="list_view">List view</string>
295296

296297
<!-- Place Details -->
297298

0 commit comments

Comments
 (0)