33
This commit is contained in:
@@ -0,0 +1,115 @@
|
||||
package cn.shangyu.gdxzExpert.activity;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RadioGroup.OnCheckedChangeListener;
|
||||
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
|
||||
import cn.shangyu.gdxzExpert.R;
|
||||
import cn.shangyu.gdxzExpert.base.BaseActivity;
|
||||
import cn.shangyu.gdxzExpert.fragment.ScientificMyFragment;
|
||||
import cn.shangyu.gdxzExpert.fragment.ScientificOtherFragment;
|
||||
import cn.shangyu.gdxzExpert.fragment.ScientificSystemFragment;
|
||||
import cn.shangyu.gdxzExpert.widget.LoadingPage.ResultState;
|
||||
|
||||
/**
|
||||
* 我的科研
|
||||
*
|
||||
* 类名称:MyScientificResearchActivity
|
||||
* 类描述:TODO
|
||||
* 创建人:苏三元
|
||||
* 时间:2015-12-14 下午4:36:08
|
||||
* 版权:河南商宇科技有限公司--版权所有 (c) 2015
|
||||
*
|
||||
*/
|
||||
|
||||
public class MyScientificResearchActivity extends BaseActivity implements OnCheckedChangeListener{
|
||||
|
||||
private RadioGroup main_radiogroup;
|
||||
private FragmentManager fm;
|
||||
@Override
|
||||
public void setTitle() {
|
||||
// TODO Auto-generated method stub
|
||||
top_back_layout.setVisibility(View.VISIBLE);
|
||||
top_title.setText("科研项目");
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateSuccessedView() {
|
||||
// TODO Auto-generated method stub
|
||||
ImmersionBar.with(this).keyboardEnable(true).statusBarDarkFont(true).titleBar(mToolbar).init();
|
||||
View view = View.inflate(ct, R.layout.activity_my_scientific_research, null);
|
||||
main_radiogroup = (RadioGroup) view.findViewById(R.id.main_radiogroup_scientific);
|
||||
main_radiogroup.setOnCheckedChangeListener(this);
|
||||
fm = getSupportFragmentManager();
|
||||
changeSystem();
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
needreportPage("科研项目");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultState onLoad() {
|
||||
return ResultState.STATE_SUCCESSED;
|
||||
}
|
||||
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
|
||||
// AGP 8.0+ R.id 不再是 final 常量,不能用于 switch,改用 if-else
|
||||
if (checkedId == R.id.tab_rbn_system) {
|
||||
changeSystem();
|
||||
} else if (checkedId == R.id.tab_rbn_other) {
|
||||
changeOther();
|
||||
} else if (checkedId == R.id.tab_rbn_my) {
|
||||
changeMy();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台项目
|
||||
* changePending
|
||||
*
|
||||
* void
|
||||
*/
|
||||
private void changeSystem() {
|
||||
ScientificSystemFragment mySystemFragment = new ScientificSystemFragment();
|
||||
fm.beginTransaction()
|
||||
.replace(R.id.frame_container, mySystemFragment, "ScientificSystemFragment").commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他项目
|
||||
* changeServices
|
||||
*
|
||||
* void
|
||||
*/
|
||||
private void changeOther() {
|
||||
ScientificOtherFragment myOtherFragment = new ScientificOtherFragment();
|
||||
fm.beginTransaction()
|
||||
.replace(R.id.frame_container, myOtherFragment, "ScientificOtherFragment").commit();
|
||||
}
|
||||
/**
|
||||
* 我的项目
|
||||
* changeComplete
|
||||
*
|
||||
* void
|
||||
*/
|
||||
private void changeMy() {
|
||||
ScientificMyFragment myMyFragment = new ScientificMyFragment();
|
||||
fm.beginTransaction()
|
||||
.replace(R.id.frame_container, myMyFragment, "ScientificMyFragment").commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user