Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SedentaryBehaviourApplication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Joseph De Jonckheere CESM2014
SedentaryBehaviourApplication
Commits
b2121f6c
Commit
b2121f6c
authored
6 years ago
by
Peter Joseph De Jonckheere CESM2014
Browse files
Options
Downloads
Patches
Plain Diff
One more.
parent
d3556d7b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/notificationFramework/sedentary/frontEnd/NotificationClicked.java
+28
-8
28 additions, 8 deletions
...tionFramework/sedentary/frontEnd/NotificationClicked.java
with
28 additions
and
8 deletions
src/main/java/com/notificationFramework/sedentary/frontEnd/NotificationClicked.java
+
28
−
8
View file @
b2121f6c
...
...
@@ -11,10 +11,23 @@ import android.widget.ProgressBar;
/**
* Created by Peter De Jonckheere on 22/01/2018.
* <p>
* The activity whihc is used when a notification is clicked on. This currently uses the main
* activity layout and is only a class on its own so that a notification click can be recorded
* in the logs.
* </p>
*/
public
class
NotificationClicked
extends
AppCompatActivity
{
/**
* Called when a notification is clicked on. Sets up the layout using that which is defined in
* activity_main.xml and the delegates to further methods to set up the buttons for the page.
*
* @param savedInstanceState contains information pertaining to previous states of the activity
* if it has been used before
* @see android.support.v7.app.AppCompatActivity
*/
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -22,15 +35,21 @@ public class NotificationClicked extends AppCompatActivity {
setUpButtons
();
}
/**
* When this activity is started regardless of whether it has been created a clicked
* notification is recorded.
*/
@Override
protected
void
onStart
(){
protected
void
onStart
()
{
super
.
onStart
();
SaveFile
.
recordNotification
(
0
,
1
,
0
,
this
);
SaveFile
.
recordNotification
(
0
,
1
,
0
,
this
);
}
private
void
setUpButtons
(){
Button
settings
=
(
Button
)
findViewById
(
R
.
id
.
settings
);
/**
* Sets up the buttons for this page and also adds the current minute value to the progress bar.
*/
private
void
setUpButtons
()
{
Button
settings
=
findViewById
(
R
.
id
.
settings
);
settings
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
...
...
@@ -38,9 +57,10 @@ public class NotificationClicked extends AppCompatActivity {
startActivity
(
intent
);
}
});
SharedPreferences
shared
=
this
.
getSharedPreferences
(
getString
(
R
.
string
.
preference_file_key
),
Context
.
MODE_PRIVATE
);
ProgressBar
progress
=
(
ProgressBar
)
findViewById
(
R
.
id
.
progressBar
);
SharedPreferences
shared
=
this
.
getSharedPreferences
(
getString
(
R
.
string
.
preference_file_key
),
Context
.
MODE_PRIVATE
);
ProgressBar
progress
=
findViewById
(
R
.
id
.
progressBar
);
progress
.
setMax
((
shared
.
getInt
(
getString
(
R
.
string
.
daily_goal_set
),
R
.
integer
.
daily_goal_minutes
)));
progress
.
setProgress
(
shared
.
getInt
(
getString
(
R
.
string
.
daily_progress
),
0
));
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment