摘要: 可以观察到,原本CrimeFragment的边距没有了。 要修改很简单,只需要在fragment_crime.xml里面修改一下就可以。 把 1 android:layout_margin="16dp" 修改成 1 android:padding="16dp" 效果: 阅读全文
posted @ 2018-11-20 21:27 杜王町上班族 阅读(418) 评论(0) 推荐(0) 编辑
摘要: Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S = 阅读全文
posted @ 2018-11-14 15:04 杜王町上班族 阅读(179) 评论(0) 推荐(0) 编辑
摘要: You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' 阅读全文
posted @ 2018-11-14 00:20 杜王町上班族 阅读(169) 评论(0) 推荐(0) 编辑
摘要: You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2018-11-13 11:27 杜王町上班族 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Design your implementation of the linked list. You can choose to use the singly linked list or the doubly linked list. A node in a singly linked list 阅读全文
posted @ 2018-11-08 22:31 杜王町上班族 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 把原本使用的Adapter的notifyDataSetChanged方法换成定位刷新RecyclerView.Adapter的notifyItem。 1.在CrimeListFragment里面定义一个全局变量 1 private static int mCrimeIndex; 2.修改CrimeL 阅读全文
posted @ 2018-11-07 17:34 杜王町上班族 阅读(819) 评论(0) 推荐(0) 编辑
摘要: 把原本的Date对象的toString()方法换成android.text.format.DateFormat类实例。 1.导入import android.text.format.DateFormat; 1 import android.text.format.DateFormat; 2.在Cri 阅读全文
posted @ 2018-11-05 12:53 杜王町上班族 阅读(559) 评论(0) 推荐(0) 编辑
摘要: 请在RecyclerView中创建两类列表项:一般性crime,以及需警方介入的crime。要完成这个挑战,你需要用到RecyclerView.Adapter的视图类别功能(view type)。在Crime对象里,再添加一个mRequiresPolice实例变量,使用它并借助getItemView 阅读全文
posted @ 2018-11-03 20:42 杜王町上班族 阅读(1666) 评论(0) 推荐(1) 编辑
摘要: 允许用户最多作弊3次。记录用户查看答案的次数,在CHEAT按钮下显示剩余次数。超出后,禁用偷看按钮。 因为只有点击mShowAnswerButton按钮才是作弊,所以需要从QuizActivity传数据到CheatActivity再传回去。 1.首先定义好新的控件显示剩余作弊次数 2.然后再在Qui 阅读全文
posted @ 2018-11-01 16:38 杜王町上班族 阅读(561) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2018-11-01 00:22 杜王町上班族 阅读(169) 评论(0) 推荐(0) 编辑