Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-android
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8fb78afe
authored
Jul 16, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
872f3b82
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
5 deletions
app/src/main/java/com/polysoft/nafmii/fragment/TestHomeFragment.java
app/src/main/java/com/whaty/nafmii/activity/TestHomeActivity.java
app/src/main/java/com/polysoft/nafmii/fragment/TestHomeFragment.java
0 → 100644
View file @
8fb78af
package
com
.
polysoft
.
nafmii
.
fragment
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.fragment.app.Fragment
;
import
com.whaty.nafmii.R
;
public
class
TestHomeFragment
extends
Fragment
{
public
static
Fragment
newInstance
(
String
value
)
{
TestHomeFragment
fragment
=
new
TestHomeFragment
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"text"
,
value
);
fragment
.
setArguments
(
bundle
);
return
fragment
;
}
@Nullable
@Override
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
super
.
setHasOptionsMenu
(
true
);
return
inflater
.
inflate
(
R
.
layout
.
test_fragment
,
null
,
false
);
}
@Override
public
void
onViewCreated
(
@NonNull
View
view
,
@Nullable
Bundle
savedInstanceState
)
{
super
.
onViewCreated
(
view
,
savedInstanceState
);
String
text
=
getArguments
().
getString
(
"text"
);
TextView
tv
=
view
.
findViewById
(
R
.
id
.
test_fragment_text
);
tv
.
setText
(
text
);
}
}
app/src/main/java/com/whaty/nafmii/activity/TestHomeActivity.java
View file @
8fb78af
...
...
@@ -11,7 +11,7 @@ import androidx.fragment.app.FragmentManager;
import
androidx.fragment.app.FragmentTransaction
;
import
com.polysoft.nafmii.enums.ModulesEnum
;
import
com.polysoft.nafmii.fragment.TestFragment
;
import
com.polysoft.nafmii.fragment.Test
Home
Fragment
;
import
com.whaty.nafmii.R
;
import
com.polysoft.nafmii.fragment.home.ModulesFragmentMgr
;
...
...
@@ -62,10 +62,10 @@ public class TestHomeActivity extends WebviewActivity implements View.OnClickLis
private
void
initHomeModule
()
{
int
containerId
=
R
.
id
.
home_container_framelayout
;
this
.
mFragmentMap
.
put
(
ModulesEnum
.
HOME
,
TestFragment
.
newInstance
(
"首页"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
MEMBER
,
TestFragment
.
newInstance
(
"会员"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
LEARN
,
TestFragment
.
newInstance
(
"学习"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
MY
,
TestFragment
.
newInstance
(
"我的"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
HOME
,
Test
Home
Fragment
.
newInstance
(
"首页"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
MEMBER
,
Test
Home
Fragment
.
newInstance
(
"会员"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
LEARN
,
Test
Home
Fragment
.
newInstance
(
"学习"
));
this
.
mFragmentMap
.
put
(
ModulesEnum
.
MY
,
Test
Home
Fragment
.
newInstance
(
"我的"
));
FragmentManager
manager
=
getSupportFragmentManager
();
Iterator
<
ModulesEnum
>
iterator
=
this
.
mFragmentMap
.
keySet
().
iterator
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment