Browse Source

种禽日报表

master
lh 7 years ago
parent
commit
3a17dc992a
8 changed files with 226 additions and 1 deletions
  1. +4
    -0
      app/src/main/AndroidManifest.xml
  2. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/Poultrydailyreport/ChandanFragment.java
  3. +104
    -0
      app/src/main/java/com/qhclh/ytzh/work/Poultrydailyreport/PoultryDailyReportActivity.java
  4. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/Poultrydailyreport/YuchuFragment.java
  5. +2
    -1
      app/src/main/java/com/qhclh/ytzh/work/WorkFragment.java
  6. +34
    -0
      app/src/main/res/layout/act_poultrydailyreport.xml
  7. +11
    -0
      app/src/main/res/layout/frag_chandan.xml
  8. +11
    -0
      app/src/main/res/layout/frag_yuchu.xml

+ 4
- 0
app/src/main/AndroidManifest.xml View File

@ -167,6 +167,10 @@
<activity <activity
android:name=".work.weighingsingle.WeightInfoActivity" android:name=".work.weighingsingle.WeightInfoActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".work.Poultrydailyreport.PoultryDailyReportActivity"
android:screenOrientation="portrait" />
<!-- 设置竖屏扫码 --> <!-- 设置竖屏扫码 -->
<activity <activity
android:name=".work.scan.ScanActivity" android:name=".work.scan.ScanActivity"


+ 30
- 0
app/src/main/java/com/qhclh/ytzh/work/Poultrydailyreport/ChandanFragment.java View File

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.Poultrydailyreport;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2018/3/22.
*/
public class ChandanFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.frag_chandan;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

+ 104
- 0
app/src/main/java/com/qhclh/ytzh/work/Poultrydailyreport/PoultryDailyReportActivity.java View File

@ -0,0 +1,104 @@
package com.qhclh.ytzh.work.Poultrydailyreport;
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.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseActivity;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
/**
* Created by 青花瓷 on 2018/3/22.
*/
///< 种禽日报表
public class PoultryDailyReportActivity extends BaseActivity {
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.tv_toolbar_title)
TextView tv_toolbar_title;
@BindView(R.id.tabLayout_pdr)
TabLayout mTabLayout;
@BindView(R.id.viewPager_pdr)
ViewPager mViewPager;
private List<Fragment> mFragmentList = new ArrayList<>();
private List<String> mTitleList = new ArrayList<>();
private TabViewPagerAdapter mViewPagerAdapter;
@Override
protected int setLayoutId() {
return R.layout.act_poultrydailyreport;
}
@Override
protected void initView() {
initToolbar(mToolbar, "种禽日报表", new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
initTabLayout();
initViewPager();
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
private void initTabLayout() {
mTitleList.add("育雏育成期");
mTitleList.add("产蛋期");
mTabLayout.setTabMode(TabLayout.MODE_FIXED);
}
private void initViewPager() {
mFragmentList.add(new YuchuFragment());
mFragmentList.add(new ChandanFragment());
mViewPagerAdapter = new TabViewPagerAdapter(getSupportFragmentManager());
mViewPager.setAdapter(mViewPagerAdapter);
mViewPager.setOffscreenPageLimit(1);
mTabLayout.setupWithViewPager(mViewPager);
}
private class TabViewPagerAdapter extends FragmentPagerAdapter {
public TabViewPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
@Override
public CharSequence getPageTitle(int position) {
return mTitleList.get(position);
}
}
}

+ 30
- 0
app/src/main/java/com/qhclh/ytzh/work/Poultrydailyreport/YuchuFragment.java View File

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.Poultrydailyreport;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2018/3/22.
*/
public class YuchuFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.frag_yuchu;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

+ 2
- 1
app/src/main/java/com/qhclh/ytzh/work/WorkFragment.java View File

@ -15,6 +15,7 @@ import com.qhclh.ytzh.home.MainActivity;
import com.qhclh.ytzh.index.WorkEvent; import com.qhclh.ytzh.index.WorkEvent;
import com.qhclh.ytzh.utils.GlideImageLoader; import com.qhclh.ytzh.utils.GlideImageLoader;
import com.qhclh.ytzh.utils.RecyclerViewUtil; import com.qhclh.ytzh.utils.RecyclerViewUtil;
import com.qhclh.ytzh.work.Poultrydailyreport.PoultryDailyReportActivity;
import com.qhclh.ytzh.work.breedpoultry.DatanalysisActivity; import com.qhclh.ytzh.work.breedpoultry.DatanalysisActivity;
import com.qhclh.ytzh.work.carsmannage.CarsManageActivity; import com.qhclh.ytzh.work.carsmannage.CarsManageActivity;
import com.qhclh.ytzh.work.carsmannage.FumudaiCarsManageActivity; import com.qhclh.ytzh.work.carsmannage.FumudaiCarsManageActivity;
@ -101,7 +102,7 @@ public class WorkFragment extends BaseFragment {
long x = workAdapter.getItemId(position); long x = workAdapter.getItemId(position);
if (x == 1) { if (x == 1) {
///< 种禽日报表 ///< 种禽日报表
startActivity(new Intent(getActivity(), DatanalysisActivity.class));
startActivity(new Intent(getActivity(), PoultryDailyReportActivity.class));
} }
if (x == 2) { if (x == 2) {
///< 种禽周报表 ///< 种禽周报表


+ 34
- 0
app/src/main/res/layout/act_poultrydailyreport.xml View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
android:background="@color/greyf4f4f4"
android:orientation="vertical">
<include layout="@layout/include_tool_bar" />
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout_pdr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="@color/white"
android:elevation="@dimen/dp_2"
app:tabIndicatorColor="@color/green029737"
app:tabSelectedTextColor="@color/green029737"
app:tabTextAppearance="@style/TabLayoutTextStyle"
app:tabTextColor="@color/grey666666" />
<include layout="@layout/include_line" />
<android.support.v4.view.ViewPager
android:id="@+id/viewPager_pdr"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</android.support.v4.view.ViewPager>
</LinearLayout>

+ 11
- 0
app/src/main/res/layout/frag_chandan.xml View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="产蛋期"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

+ 11
- 0
app/src/main/res/layout/frag_yuchu.xml View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="yuchu"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

Loading…
Cancel
Save