Browse Source

生产报表中基本属性,单据明细

master
lh 8 years ago
parent
commit
aee63ac0f5
7 changed files with 165 additions and 4 deletions
  1. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/productiondailyw/BasicattributesFragment.java
  2. +30
    -0
      app/src/main/java/com/qhclh/ytzh/work/productiondailyw/DetailsofdocumentsFragment.java
  3. +63
    -0
      app/src/main/java/com/qhclh/ytzh/work/productiondailyw/ProductiondailywActivity.java
  4. +18
    -4
      app/src/main/res/layout/act_productiondailyw.xml
  5. +12
    -0
      app/src/main/res/layout/fragment_basicattr.xml
  6. +10
    -0
      app/src/main/res/layout/fragment_detailsofdoc.xml
  7. +2
    -0
      app/src/main/res/values/strings.xml

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

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

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

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

+ 63
- 0
app/src/main/java/com/qhclh/ytzh/work/productiondailyw/ProductiondailywActivity.java View File

@ -1,11 +1,19 @@
package com.qhclh.ytzh.work.productiondailyw;
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;
/**
@ -15,6 +23,14 @@ import butterknife.BindView;
public class ProductiondailywActivity extends BaseActivity {
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.tabLayout_productiondailyw)
TabLayout mTabLayout;
@BindView(R.id.viewPager_productiondailyw)
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_productiondailyw;
@ -28,6 +44,8 @@ public class ProductiondailywActivity extends BaseActivity {
finish();
}
});
initTabLayout();
initViewPager();
}
@Override
@ -39,4 +57,49 @@ public class ProductiondailywActivity extends BaseActivity {
protected void initOper() {
}
private void initViewPager() {
mFragmentList.add(new BasicattributesFragment());
mFragmentList.add(new DetailsofdocumentsFragment());
mViewPagerAdapter = new TabViewPagerAdapter(getSupportFragmentManager());
mViewPager.setAdapter(mViewPagerAdapter);
mViewPager.setOffscreenPageLimit(2);
mTabLayout.setupWithViewPager(mViewPager);
}
private void initTabLayout() {
mTitleList.add(getString(R.string.Basicattributes));
mTitleList.add(getString(R.string.Detailsofdocuments));
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);
}
}
}

+ 18
- 4
app/src/main/res/layout/act_productiondailyw.xml View File

@ -1,12 +1,26 @@
<?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"/>
<TextView
android:layout_width="wrap_content"
android:text="@string/Productiondaily_w"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager
android:id="@+id/viewPager_productiondailyw"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout_productiondailyw"
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>

+ 12
- 0
app/src/main/res/layout/fragment_basicattr.xml View File

@ -0,0 +1,12 @@
<?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/Basicattributes"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

+ 10
- 0
app/src/main/res/layout/fragment_detailsofdoc.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/Detailsofdocuments"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

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

@ -60,5 +60,7 @@
<string name="qiuping">邱平</string>
<string name="Productiondaily">生产日报表</string>
<string name="Productiondaily_w">生产日报</string>
<string name="Basicattributes">基本属性</string>
<string name="Detailsofdocuments">单据明细</string>
</resources>

Loading…
Cancel
Save