Browse Source

肉禽

master
lh 8 years ago
parent
commit
9936ddef65
15 changed files with 357 additions and 1 deletions
  1. +3
    -0
      app/src/main/AndroidManifest.xml
  2. +2
    -1
      app/src/main/java/com/qhclh/ytzh/work/WorkFragment.java
  3. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/tablepoultry/AnqiuFragment.java
  4. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/tablepoultry/ChangleFragment.java
  5. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/tablepoultry/QiupingFragment.java
  6. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/tablepoultry/ShouguangdFragment.java
  7. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/tablepoultry/ShouguangxFragment.java
  8. +120
    -0
      app/src/main/java/com/qhclh/ytzh/work/tablepoultry/TablepoultryActivity.java
  9. +27
    -0
      app/src/main/res/layout/act_tablepoultry.xml
  10. +10
    -0
      app/src/main/res/layout/fragment_anqiu.xml
  11. +10
    -0
      app/src/main/res/layout/fragment_changle.xml
  12. +10
    -0
      app/src/main/res/layout/fragment_qiuping.xml
  13. +10
    -0
      app/src/main/res/layout/fragment_shouguangd.xml
  14. +10
    -0
      app/src/main/res/layout/fragment_shouguangx.xml
  15. +5
    -0
      app/src/main/res/values/strings.xml

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

@ -73,6 +73,9 @@
<activity
android:name=".work.breedpoultry.DatanalysisSActivity"
android:screenOrientation="portrait" />
<activity
android:name=".work.tablepoultry.TablepoultryActivity"
android:screenOrientation="portrait" />
<!-- 设置竖屏扫码 -->
<activity


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

@ -10,6 +10,7 @@ import com.qhclh.ytzh.utils.GlideImageLoader;
import com.qhclh.ytzh.work.breedpoultry.DatanalysisActivity;
import com.qhclh.ytzh.work.carsmannage.CarsManageActivity;
import com.qhclh.ytzh.work.scan.ScanResultActivity;
import com.qhclh.ytzh.work.tablepoultry.TablepoultryActivity;
import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;
import com.youth.banner.Transformer;
@ -103,7 +104,7 @@ public class WorkFragment extends BaseFragment implements View.OnClickListener {
}else if (view.equals(work_scan)){
startActivity(new Intent(getActivity(), ScanResultActivity.class));
}else if (view.equals(work_tablepoultry)){
showToast("敬请期待!");
startActivity(new Intent(getActivity(), TablepoultryActivity.class));
}
}


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

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.tablepoultry;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2017/12/4.
*/
public class AnqiuFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.fragment_anqiu;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

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

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.tablepoultry;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2017/12/4.
*/
public class ChangleFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.fragment_changle;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

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

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.tablepoultry;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2017/12/4.
*/
public class QiupingFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.fragment_qiuping;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

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

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.tablepoultry;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2017/12/4.
*/
public class ShouguangdFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.fragment_shouguangd;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

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

@ -0,0 +1,30 @@
package com.qhclh.ytzh.work.tablepoultry;
import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseFragment;
/**
* Created by 青花瓷 on 2017/12/4.
*/
public class ShouguangxFragment extends BaseFragment {
@Override
protected int setLayout() {
return R.layout.fragment_shouguangx;
}
@Override
protected void initView() {
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
}

+ 120
- 0
app/src/main/java/com/qhclh/ytzh/work/tablepoultry/TablepoultryActivity.java View File

@ -0,0 +1,120 @@
package com.qhclh.ytzh.work.tablepoultry;
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 com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseActivity;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
/**
* Created by 青花瓷 on 2017/12/4.
*/
///< 肉禽
public class TablepoultryActivity extends BaseActivity {
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.tabLayout_tablep)
TabLayout mTabLayout;
@BindView(R.id.viewPager_tablep)
ViewPager mViewPager;
private List<Fragment> mFragmentList = new ArrayList<>();
private List<String> mTitleList = new ArrayList<>();
private TabViewPagerAdapter mViewPagerAdapter;
private int x=0;
@Override
protected int setLayoutId() {
return R.layout.act_tablepoultry;
}
@Override
protected void initView() {
x=1;
initToolbar(mToolbar, "肉禽", new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
initTabLayout();
initViewPager();
}
@Override
protected void initData() {
}
@Override
protected void initOper() {
}
private void initViewPager() {
if (x==0) {
mFragmentList.add(new ChangleFragment());
mFragmentList.add(new ShouguangdFragment());
mFragmentList.add(new ShouguangxFragment());
mFragmentList.add(new AnqiuFragment());
mFragmentList.add(new QiupingFragment());
}else if (x==1){
mFragmentList.add(new ShouguangxFragment());
mFragmentList.add(new AnqiuFragment());
}
mViewPagerAdapter = new TabViewPagerAdapter(getSupportFragmentManager());
mViewPager.setAdapter(mViewPagerAdapter);
mViewPager.setOffscreenPageLimit(2);
mTabLayout.setupWithViewPager(mViewPager);
}
private void initTabLayout() {
if (x==0) {
mTitleList.add(getString(R.string.changle));
mTitleList.add(getString(R.string.shouguangdong));
mTitleList.add(getString(R.string.shouguangxi));
mTitleList.add(getString(R.string.anqiu));
mTitleList.add(getString(R.string.qiuping));
}else if (x==1){
mTitleList.add(getString(R.string.shouguangxi));
mTitleList.add(getString(R.string.anqiu));
}
for (String title : mTitleList) {
mTabLayout.addTab(mTabLayout.newTab().setText(title));
}
mTabLayout.setTabMode(TabLayout.MODE_FIXED);
}
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);
}
}
}

+ 27
- 0
app/src/main/res/layout/act_tablepoultry.xml View File

@ -0,0 +1,27 @@
<?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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/include_tool_bar"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager_tablep"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout_tablep"
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:tabTextColor="@color/grey666666" />
</android.support.v4.view.ViewPager>
</LinearLayout>

+ 10
- 0
app/src/main/res/layout/fragment_anqiu.xml View File

@ -0,0 +1,10 @@
<?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="@string/anqiu"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

+ 10
- 0
app/src/main/res/layout/fragment_changle.xml View File

@ -0,0 +1,10 @@
<?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="@string/changle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

+ 10
- 0
app/src/main/res/layout/fragment_qiuping.xml View File

@ -0,0 +1,10 @@
<?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="@string/qiuping"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

+ 10
- 0
app/src/main/res/layout/fragment_shouguangd.xml View File

@ -0,0 +1,10 @@
<?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="@string/shouguangdong"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

+ 10
- 0
app/src/main/res/layout/fragment_shouguangx.xml View File

@ -0,0 +1,10 @@
<?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="@string/shouguangxi"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

+ 5
- 0
app/src/main/res/values/strings.xml View File

@ -53,5 +53,10 @@
<string name="Deathofemale">母死亡数</string>
<string name="condition">条件</string>
<string name="Buildinghomes">栋舍</string>
<string name="changle">昌乐</string>
<string name="shouguangdong">寿光东</string>
<string name="shouguangxi">寿光西</string>
<string name="anqiu">安丘</string>
<string name="qiuping">邱平</string>
</resources>

Loading…
Cancel
Save