|
|
@ -1,10 +1,22 @@ |
|
|
package com.qhclh.ytzh.work.productiondaily; |
|
|
package com.qhclh.ytzh.work.productiondaily; |
|
|
|
|
|
|
|
|
|
|
|
import android.content.Intent; |
|
|
import android.support.v7.widget.Toolbar; |
|
|
import android.support.v7.widget.Toolbar; |
|
|
|
|
|
import android.view.Menu; |
|
|
|
|
|
import android.view.MenuItem; |
|
|
import android.view.View; |
|
|
import android.view.View; |
|
|
|
|
|
import android.widget.AdapterView; |
|
|
|
|
|
import android.widget.ListView; |
|
|
|
|
|
|
|
|
import com.qhclh.ytzh.R; |
|
|
import com.qhclh.ytzh.R; |
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
|
|
|
import com.qhclh.ytzh.bean.ProductionDailyBean; |
|
|
|
|
|
import com.qhclh.ytzh.ui.CalendarDialogFragment; |
|
|
|
|
|
import com.qhclh.ytzh.utils.DateTimeUtil; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
import butterknife.BindView; |
|
|
import butterknife.BindView; |
|
|
|
|
|
|
|
|
@ -12,9 +24,13 @@ import butterknife.BindView; |
|
|
* Created by 青花瓷 on 2017/12/4. |
|
|
* Created by 青花瓷 on 2017/12/4. |
|
|
*/ |
|
|
*/ |
|
|
///< 生产日报 |
|
|
///< 生产日报 |
|
|
public class ProductiondailyActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
public class ProductiondailyActivity extends BaseActivity implements CalendarDialogFragment.CalendarClickListener{ |
|
|
@BindView(R.id.toolbar) |
|
|
@BindView(R.id.toolbar) |
|
|
Toolbar mToolbar; |
|
|
Toolbar mToolbar; |
|
|
|
|
|
@BindView(R.id.lv_productiondaily) |
|
|
|
|
|
ListView lv_productiondaily; |
|
|
|
|
|
private List<ProductionDailyBean> productionDailyBeanList; |
|
|
|
|
|
private ProductiondailyAdapter productiondailyAdapter; |
|
|
@Override |
|
|
@Override |
|
|
protected int setLayoutId() { |
|
|
protected int setLayoutId() { |
|
|
return R.layout.act_productiondaily; |
|
|
return R.layout.act_productiondaily; |
|
|
@ -32,11 +48,48 @@ public class ProductiondailyActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void initData() { |
|
|
protected void initData() { |
|
|
|
|
|
|
|
|
|
|
|
productionDailyBeanList = new ArrayList<>(); |
|
|
|
|
|
for (int i=0;i<10;i++){ |
|
|
|
|
|
productionDailyBeanList.add(new ProductionDailyBean(i+2,"1"+i,"adfa0"+i,"adfagfaw"+i)); |
|
|
|
|
|
} |
|
|
|
|
|
productiondailyAdapter = new ProductiondailyAdapter(this,productionDailyBeanList); |
|
|
|
|
|
lv_productiondaily.setAdapter(productiondailyAdapter); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void initOper() { |
|
|
protected void initOper() { |
|
|
|
|
|
lv_productiondaily.setOnItemClickListener(new AdapterView.OnItemClickListener() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { |
|
|
|
|
|
startActivity(new Intent(ProductiondailyActivity.this,ProductiondailyInfoActivity.class)); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public boolean onCreateOptionsMenu(Menu menu) { |
|
|
|
|
|
getMenuInflater().inflate(R.menu.chosetime, menu); |
|
|
|
|
|
menu.findItem(R.id.chose_time).setVisible(true); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
|
|
|
switch (item.getItemId()) { |
|
|
|
|
|
case R.id.chose_time: |
|
|
|
|
|
new CalendarDialogFragment().show(getSupportFragmentManager(), "start"); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
return super.onOptionsItemSelected(item); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void onStartCalendarClick(Date date) { |
|
|
|
|
|
showToast(DateTimeUtil.FormatDate(date)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void onEndCalendarClick(Date date) { |
|
|
|
|
|
showToast(DateTimeUtil.FormatDate(date)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |