zoukankan      html  css  js  c++  java
  • 团队冲刺0207

    今天主要对作业状态的设计进行修改

    package com.example.shazidouhuiapp.activity;



    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;

    import android.util.AttributeSet;
    import android.util.Log;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.LinearLayout;
    import android.widget.TextView;
    import android.widget.Toast;

    import androidx.annotation.NonNull;
    import androidx.annotation.Nullable;
    import androidx.appcompat.app.AppCompatActivity;
    import androidx.fragment.app.Fragment;
    import androidx.recyclerview.widget.LinearLayoutManager;
    import androidx.recyclerview.widget.RecyclerView;
    import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

    import com.example.shazidouhuiapp.Adapter.HomeAdatpter;
    import com.example.shazidouhuiapp.Adapter.receiveAdapter;
    import com.example.shazidouhuiapp.Bean.User;
    import com.example.shazidouhuiapp.Bean.homework;
    import com.example.shazidouhuiapp.Bean.homeworkContent;
    import com.example.shazidouhuiapp.R;


    import java.util.ArrayList;
    import java.util.List;

    import cn.bmob.v3.BmobQuery;
    import cn.bmob.v3.BmobUser;
    import cn.bmob.v3.datatype.BmobPointer;
    import cn.bmob.v3.exception.BmobException;
    import cn.bmob.v3.listener.FindListener;

    public class student_unfinished_receive extends AppCompatActivity {
        private String id;
        private RecyclerView rv;
        private SwipeRefreshLayout srlayout;
        private TextView helloquestion;
        //    private TextView HelloHome;
    //    private TextView username,ok;
        private LinearLayout homesearch;

        List<homeworkContent> data;



        private receiveAdapter receiveAdapter;



        @Override
        protected void onCreate(@Nullable Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.student_unfinished_question);
            initView();

            //初始刷新
            Refresh();

            srlayout.setColorSchemeResources(android.R.color.holo_green_light,android.R.color.holo_red_light,android.R.color.holo_blue_light);
            srlayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
                @Override
                public void onRefresh() {
                    //刷新;
                    Refresh();
                }
            });
        }

        private void Refresh() {

            Intent a=getIntent();
             id=a.getStringExtra("id");

            String title=a.getStringExtra("title");
            helloquestion.setText(title+"");
            homework homework=new homework();
            homework.setObjectId(id+"");

            BmobQuery<homeworkContent> query=new BmobQuery();
            query.addWhereRelatedTo("homeworkContent",new BmobPointer(homework));

            query.findObjects(new FindListener<homeworkContent>() {
                @Override
                public void done(List<homeworkContent> list, BmobException e) {
                    if(e==null){
                        data=list;
                        receiveAdapter =new receiveAdapter(student_unfinished_receive.this,data,id);
                        rv.setLayoutManager(new LinearLayoutManager(student_unfinished_receive.this));
                        rv.setAdapter(receiveAdapter);
                    }
                    else {
                        Toast.makeText(student_unfinished_receive.this, "题目数据获取失败", Toast.LENGTH_SHORT).show();
                    }
                }
            });




        }

        private void initView() {
            rv = findViewById(R.id.question_recyclerview);
            srlayout =findViewById(R.id.question_swipe);
            helloquestion=findViewById(R.id.helloquestion);
        }
    }

  • 相关阅读:
    SQLAlchemy(2):多表操作 & 连接方式及原生SQL
    SQLAlchemy(1):单表操作
    requests模块发送POST请求
    Flask(4):wtforms组件 & 数据库连接池 DBUtils
    爬虫(1):requests模块
    socketserver模块使用 & websocket
    Flask基础(3):session、flash、特殊装饰器、蓝图、路由正则匹配、上下文管理 & flask-session
    MySQL:视图、触发器、存储过程、事务
    UICollectionViewLayout
    iOS7自定义statusbar和navigationbar的若干问题
  • 原文地址:https://www.cnblogs.com/yanwenhui/p/13087926.html
Copyright © 2011-2022 走看看