Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-005
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
2022-005
2022-005
Commits
90ef4468
Commit
90ef4468
authored
Oct 09, 2022
by
Chathura IT19243986
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
6ebb89ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
HealthyHeart.java
HealthyHeart.java
+73
-0
No files found.
HealthyHeart.java
0 → 100644
View file @
90ef4468
package
com.example.peopluz1
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.viewpager2.widget.ViewPager2
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
com.google.android.material.tabs.TabLayout
;
public
class
HealthyHeart
extends
AppCompatActivity
{
TabLayout
tabLayout
;
ViewPager2
viewPager2
;
ViewPagerAdapter2
ViewPagerAdapter2
;
Button
workoutBtn
,
mealBtn
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_healthy_heart
);
tabLayout
=
findViewById
(
R
.
id
.
tab_layout2
);
viewPager2
=
findViewById
(
R
.
id
.
view_pager2
);
ViewPagerAdapter2
=
new
ViewPagerAdapter2
(
this
);
viewPager2
.
setAdapter
(
ViewPagerAdapter2
);
tabLayout
.
addOnTabSelectedListener
(
new
TabLayout
.
OnTabSelectedListener
()
{
@Override
public
void
onTabSelected
(
TabLayout
.
Tab
tab
)
{
viewPager2
.
setCurrentItem
(
tab
.
getPosition
());
}
@Override
public
void
onTabUnselected
(
TabLayout
.
Tab
tab
)
{
}
@Override
public
void
onTabReselected
(
TabLayout
.
Tab
tab
)
{
}
});
viewPager2
.
registerOnPageChangeCallback
(
new
ViewPager2
.
OnPageChangeCallback
()
{
@Override
public
void
onPageSelected
(
int
position
)
{
super
.
onPageSelected
(
position
);
tabLayout
.
getTabAt
(
position
).
select
();
}
});
// workoutBtn=findViewById(R.id.button10);
// mealBtn=findViewById(R.id.button2);
//
//
// workoutBtn.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(final View v) {
// startActivity(new Intent(getApplicationContext(),workoutplan.class));
// overridePendingTransition(0,0);
// }
// });
//
// mealBtn.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(final View v) {
// startActivity(new Intent(getApplicationContext(),MealPlan.class));
// overridePendingTransition(0,0);
// }
// });
}
}
\ No newline at end of file
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