app/src/main/java/safeluck/drive/evaluation/adapter/MyFragmetAdapter.java
New file @@ -0,0 +1,48 @@ package safeluck.drive.evaluation.adapter; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.fragment.BaseSettingFragment; import safeluck.drive.evaluation.fragment.SingleJudgeFragment; import safeluck.drive.evaluation.fragment.VPFragment; /** * MyApplication2 * Created by lzw on 2019/3/19. 16:50:38 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class MyFragmetAdapter extends FragmentPagerAdapter { private String[] mTitles = new String[]{"基本设置","信号评判"}; public MyFragmetAdapter(FragmentManager fm) { super(fm); } @Override public SupportFragment getItem(int i) { if(i==0){ return BaseSettingFragment.newInstance(); }else{ return SingleJudgeFragment.newInstance(); } } @Override public int getCount() { return 2; } @Nullable @Override public CharSequence getPageTitle(int position) { return mTitles[position]; } } app/src/main/java/safeluck/drive/evaluation/adapter/SimpleFragmentAdapter.java
New file @@ -0,0 +1,38 @@ package safeluck.drive.evaluation.adapter; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import safeluck.drive.evaluation.fragment.VPFragment; /** * MyApplication2 * Created by lzw on 2019/3/20. 15:26:26 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class SimpleFragmentAdapter extends FragmentPagerAdapter { private String[] mTitles = new String[]{"基础数据","FTP配置","驾校信息"}; public SimpleFragmentAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int i) { return VPFragment.newInstance(mTitles[i]); } @Override public int getCount() { return mTitles.length; } @Nullable @Override public CharSequence getPageTitle(int position) { return mTitles[position]; } } app/src/main/java/safeluck/drive/evaluation/fragment/BaseSettingFragment.java
New file @@ -0,0 +1,65 @@ package safeluck.drive.evaluation.fragment; import android.content.Context; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.adapter.MyFragmetAdapter; import safeluck.drive.evaluation.adapter.SimpleFragmentAdapter; /** * MyApplication2 * Created by lzw on 2019/3/20. 11:19:26 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class BaseSettingFragment extends SupportFragment { private ViewPager viewPager; private TabLayout tabLayout; private SimpleFragmentAdapter myFragmetAdapter; public static SupportFragment newInstance(){ return new BaseSettingFragment(); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_base_set,container,false); initView(view); return view; } private void initView(View view) { tabLayout = view.findViewById(R.id.tab_base_set); viewPager = view.findViewById(R.id.vp_base_set); tabLayout.setTabMode(TabLayout.MODE_FIXED); tabLayout.addTab(tabLayout.newTab()); tabLayout.addTab(tabLayout.newTab()); } @Override public void onLazyInitView(@Nullable Bundle savedInstanceState) { myFragmetAdapter = new SimpleFragmentAdapter(this.getChildFragmentManager()); viewPager.setAdapter(myFragmetAdapter); tabLayout.setupWithViewPager(viewPager); } } app/src/main/java/safeluck/drive/evaluation/fragment/HomeFragment.java
@@ -83,6 +83,11 @@ break; case R.id.system_setting: SysSettingFragment sysSetingFragment = findFragment(SysSettingFragment.class); if (sysSetingFragment == null){ sysSetingFragment = (SysSettingFragment) SysSettingFragment.newInstance(); } start(sysSetingFragment); break; } } app/src/main/java/safeluck/drive/evaluation/fragment/NetWorkTrainFragment.java
@@ -38,7 +38,7 @@ @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_stu_score,container,false); View view = inflater.inflate(R.layout.layout_train_fragment,container,false); initView(view); return view; } app/src/main/java/safeluck/drive/evaluation/fragment/SingleJudgeFragment.java
New file @@ -0,0 +1,40 @@ package safeluck.drive.evaluation.fragment; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.R; /**信号评判UI * MyApplication2 * Created by lzw on 2019/3/20. 11:22:39 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class SingleJudgeFragment extends SupportFragment { public static SupportFragment newInstance(){ return new SingleJudgeFragment(); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // TextView textView = new TextView(_mActivity); // ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); // textView.setGravity(Gravity.CENTER); // textView.setLayoutParams(layoutParams); // // textView.setText("信号评判"); // return textView; View view = inflater.inflate(R.layout.layout_jiaxiao_info,container,false); return view; } } app/src/main/java/safeluck/drive/evaluation/fragment/SysSettingFragment.java
New file @@ -0,0 +1,73 @@ package safeluck.drive.evaluation.fragment; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import me.yokeyword.fragmentation.SupportFragment; import safeluck.drive.evaluation.R; import safeluck.drive.evaluation.adapter.MyFragmetAdapter; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; /** * MyApplication2 * Created by lzw on 2019/3/15. 14:32:50 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class SysSettingFragment extends SupportFragment { private ViewPager viewPager; private TabLayout tabLayout; private MyFragmetAdapter myFragmetAdapter; private Toolbar tb; public static SupportFragment newInstance(){ return new SysSettingFragment(); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.layout_sys_setting,container,false); initView(view); return view; } private void initView(View view) { tabLayout = view.findViewById(R.id.tab); tabLayout.setTabMode(TabLayout.MODE_FIXED); tabLayout.addTab(tabLayout.newTab()); tabLayout.addTab(tabLayout.newTab()); tb = view.findViewById(R.id.toolbar); tb.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp); tb.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { _mActivity.onBackPressed(); } }); tb.setTitle(R.string.sys_setting); tb.setSubtitle(R.string.sys_setting_sub); viewPager = view.findViewById(R.id.vp); } @Override public void onLazyInitView(@Nullable Bundle savedInstanceState) { super.onLazyInitView(savedInstanceState); myFragmetAdapter = new MyFragmetAdapter(getChildFragmentManager()); viewPager.setAdapter(myFragmetAdapter); tabLayout.setupWithViewPager(viewPager); } } app/src/main/java/safeluck/drive/evaluation/fragment/VPFragment.java
New file @@ -0,0 +1,45 @@ package safeluck.drive.evaluation.fragment; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import me.yokeyword.fragmentation.SupportFragment; /** * MyApplication2 * Created by lzw on 2019/3/19. 16:55:04 * 邮箱:632393724@qq.com * All Rights Saved! Chongqing AnYun Tech co. LTD */ public class VPFragment extends SupportFragment { public static SupportFragment newInstance(String s){ VPFragment vpFragment = new VPFragment(); Bundle bundle = new Bundle(); bundle.putString("argu",s); vpFragment.setArguments(bundle); return vpFragment; } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { TextView textView = new TextView(_mActivity); ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); textView.setGravity(Gravity.CENTER); textView.setLayoutParams(layoutParams); Bundle bundle = getArguments(); if (bundle != null){ textView.setText(bundle.getString("argu")); }else textView.setText("kong"); return textView; } } app/src/main/res/drawable-xxhdpi/ic_arrow_back_white_24dp.png
app/src/main/res/layout/layout_base_set.xml
New file @@ -0,0 +1,31 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.TabLayout android:layout_width="match_parent" android:layout_height="45dp" android:background="@color/colorAccent" android:id="@+id/tab_base_set"> <android.support.design.widget.TabItem android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="基础数据" /> <android.support.design.widget.TabItem android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="FTP配置" /> <android.support.design.widget.TabItem android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="驾校信息" /> </android.support.design.widget.TabLayout> <android.support.v4.view.ViewPager android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/vp_base_set"> </android.support.v4.view.ViewPager> </LinearLayout> app/src/main/res/layout/layout_ftp_setting.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> </LinearLayout> app/src/main/res/layout/layout_jiaxiao_info.xml
New file @@ -0,0 +1,115 @@ <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp"> <TableRow> <TextView android:id="@+id/tv_d" style="@style/jiaxiao_info_text" android:text="驾校名称:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="涡阳驾校" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="准驾车型:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="C1" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="业务类型:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="初次申领" android:background="@android:drawable/edit_text"/> </TableRow> <TableRow> <TextView style="@style/jiaxiao_info_text" android:text="预约次数:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="第一次" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="车牌号:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="渝B1260学" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="考试网点:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="235689554" android:background="@android:drawable/edit_text"/> </TableRow><TableRow> <TextView style="@style/jiaxiao_info_text" android:text="考试科目:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="科目二" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="考场名称:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="涡阳驾校" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="考试地点:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="5445687" android:background="@android:drawable/edit_text"/> </TableRow> <TableRow> <TextView style="@style/jiaxiao_info_text" android:text="考场序号:"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="科目二" android:background="@android:drawable/edit_text"/> <TextView style="@style/jiaxiao_info_text" android:text="@string/on_board_sn"/> <EditText android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="涡阳驾校" android:background="@android:drawable/edit_text"/> </TableRow> <TableRow android:gravity="center_horizontal"> <Button android:id="@+id/btn_save_jiaxiao_info" android:text="@string/save" android:textSize="18sp" android:background="@android:drawable/btn_default_small" android:padding="10dp"/> </TableRow> </TableLayout> app/src/main/res/layout/layout_sys_setting.xml
New file @@ -0,0 +1,37 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay" app:titleTextAppearance="@style/Toolbar_TextAppearance_White"/> <android.support.design.widget.TabLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/tab" android:background="@color/profile_bg" android:layout_below="@+id/toolbar_set"> </android.support.design.widget.TabLayout> </android.support.design.widget.AppBarLayout> <android.support.v4.view.ViewPager android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/vp"></android.support.v4.view.ViewPager> </LinearLayout> app/src/main/res/layout/layout_train_fragment.xml
@@ -1,9 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@color/home_bg_color"> <include android:layout_marginBottom="10dp" android:layout_weight="1" android:layout_width="match_parent" android:layout_height="0dp" android:id="@+id/profile" layout="@layout/profile_layout"/> <include android:layout_marginBottom="10dp" android:layout_weight="1.5" android:layout_width="match_parent" android:layout_height="0dp" android:id="@+id/profile" layout="@layout/layout_net_train"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/ll" android:orientation="vertical"> <include android:layout_marginBottom="10dp" android:layout_width="match_parent" android:layout_height="120dp" android:id="@+id/profile" layout="@layout/profile_layout"/> <include android:layout_marginBottom="10dp" android:layout_width="match_parent" android:layout_height="170dp" layout="@layout/layout_net_train"/> <include android:layout_marginBottom="10dp" android:layout_width="match_parent" android:layout_height="240dp" layout="@layout/layout_stu_score"/> </LinearLayout> </ScrollView> app/src/main/res/values/strings.xml
@@ -7,4 +7,8 @@ <string name="version_name">v3.1</string> <string name="user_id">身份证号:                </string> <string name="inspector">考核员编号:</string> <string name="sys_setting">系统配置</string> <string name="sys_setting_sub">智能考培,助力驾考新旅程</string> <string name="save">保存</string> <string name="on_board_sn">车载设备号:</string> </resources> app/src/main/res/values/styles.xml
@@ -42,4 +42,9 @@ <item name="android:layout_marginTop">10dp</item> </style> <style name="jiaxiao_info_text" parent="home_fragment_text"> <item name="android:textColor">@android:color/black</item> <item name="android:textSize">20sp</item> </style> </resources>