zoukankan      html  css  js  c++  java
  • 团队冲刺第五天-KeepRunningAPP

    摘要:今天完成了对APP首页的设计,使用的是侧滑栏功能。完成了在用户登录后获取其信息的功能,并让其显示在用户基础信息的指导位置,包括头像和用户名,方便了后续涉及到的用户功能。另外就是对闹钟功能的有了基本设计及思路,目前只完成了添加闹钟的界面设计,明天再继续完成详细功能。下面是主要代码和截图

    protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.home);
            muserOperator = new UserOperator(this);
            Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
            setSupportActionBar(toolbar);
            DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                    this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
            drawer.addDrawerListener(toggle);
            toggle.syncState();
            NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
            navigationView.setNavigationItemSelectedListener(this);
    //        LayoutInflater layoutInflater = this.getLayoutInflater();
    //        view =layoutInflater.inflate(R.layout.home_header,null);
    //        imageView=(ImageView)view.findViewById(R.id.userimageView);
    //        textView=(TextView) view.findViewById(R.id.usernameView);
            Intent intent = getIntent();//获取Intent对象
            String username = intent.getStringExtra("username");
            textView=navigationView.getHeaderView(0).findViewById(R.id.usernameView);
            imageView=navigationView.getHeaderView(0).findViewById(R.id.userimageView);
            User bean = muserOperator.isExit(username);
            String userpicture = bean.userpicture;
    
            //Log.d("volley", userpicture);
            textView.setText(username);
                Bitmap bitmap= BitmapFactory.decodeFile(userpicture);
    
                imageView.setImageBitmap(bitmap);
            fm = this.getSupportFragmentManager();
            switchFragment("首页");
        }

  • 相关阅读:
    两道挺有意思的思考题
    IEEE浮点数表示法
    MD5 Bump Mapping
    MD5 PolyBump + DetailBump
    DOOM3 MD5渲染方式的另一种猜测
    Relief Mapping
    如何计算投影纹理坐标
    Toon Shading, step 3
    c++数组初始化赋值
    c++重载部分运算符以及输入输出运算符
  • 原文地址:https://www.cnblogs.com/MoooJL/p/12733728.html
Copyright © 2011-2022 走看看