| | |
| | | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.lifecycle.Observer; |
| | | import androidx.lifecycle.ViewModelProviders; |
| | | |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | import java.util.List; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.DB.Student; |
| | | import safeluck.drive.evaluation.DB.WokViewModel; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.adapter.ScoreAdapter; |
| | | import safeluck.drive.evaluation.bean.ScoreBean; |
| | |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public class TrainFragment extends SupportFragment implements View.OnClickListener { |
| | | |
| | | private static final String TAG = TrainFragment.class.getSimpleName(); |
| | | private ListView mListView ; |
| | | private ScoreAdapter mScoreAdapter; |
| | | |
| | |
| | | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | View view = inflater.inflate(R.layout.layout_train_fragment,container,false); |
| | | initView(view); |
| | | |
| | | WokViewModel wokViewModel = ViewModelProviders.of(this).get(WokViewModel.class); |
| | | wokViewModel.getStudents().observe(this, new Observer<List<Student>>() { |
| | | @Override |
| | | public void onChanged(List<Student> students) { |
| | | for (Student student: |
| | | students) { |
| | | Log.i(TAG, "onChanged: "+student.toString()); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return view; |
| | | } |
| | | private void initView(View view) { |