Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
CPTR405
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kaelan Willauer
CPTR405
Commits
be3293a4
Commit
be3293a4
authored
Apr 16, 2021
by
Kaelan Willauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished pizzappp
parent
9a768c13
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-0
app/src/main/java/com/zybooks/pizzaparty/MainActivity.java
app/src/main/java/com/zybooks/pizzaparty/MainActivity.java
+2
-3
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-0
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
be3293a4
...
...
@@ -8,7 +8,9 @@
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:screenOrientation=
"sensor"
android:theme=
"@style/Theme.PizzaParty"
>
<activity
android:name=
".MainActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/zybooks/pizzaparty/MainActivity.java
View file @
be3293a4
...
...
@@ -42,7 +42,6 @@ public class MainActivity extends AppCompatActivity {
mNumAttendEditText
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
}
@Override
...
...
@@ -62,7 +61,7 @@ public class MainActivity extends AppCompatActivity {
R
.
array
.
hunger_array
,
android
.
R
.
layout
.
simple_spinner_item
);
adapter
.
setDropDownViewResource
(
android
.
R
.
layout
.
simple_spinner_dropdown_item
);
mHowHungrySpinner
.
setAdapter
(
adapter
);
//
mHowHungrySpinner.setSelection(0,false); // does not work as intended?
//mHowHungrySpinner.setSelection(0,false); // does not work as intended?
mHowHungrySpinner
.
setOnItemSelectedListener
(
new
AdapterView
.
OnItemSelectedListener
()
{
@Override
public
void
onItemSelected
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
...
...
@@ -108,7 +107,7 @@ public class MainActivity extends AppCompatActivity {
int
totalPizzas
=
calc
.
getTotalPizzas
();
// Place totalPizzas into the string resource and display
String
totalText
=
getString
(
R
.
string
.
total_pizzas
,
totalPizzas
)
;
String
totalText
=
getString
(
R
.
string
.
total_pizzas
)
+
" "
+
totalPizzas
;
mNumPizzasTextView
.
setText
(
totalText
);
}
}
...
...
app/src/main/res/layout/activity_main.xml
View file @
be3293a4
...
...
@@ -52,6 +52,7 @@
<TextView
android:id=
"@+id/answerTextView"
android:freezesText=
"true"
android:text=
"@string/total_pizzas"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/values/strings.xml
View file @
be3293a4
...
...
@@ -6,7 +6,7 @@
<string
name=
"light"
>
Light
</string>
<string
name=
"medium"
>
Medium
</string>
<string
name=
"ravenous"
>
Ravenous
</string>
<string
name=
"total_pizzas"
>
Total pizzas:
%d
</string>
<string
name=
"total_pizzas"
>
Total pizzas:
</string>
<string
name=
"calculate"
>
Calculate
</string>
<string-array
name=
"hunger_array"
>
<item>
Light
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment