Skip to content

Commit

Permalink
禁用启用算法重写
Browse files Browse the repository at this point in the history
  • Loading branch information
StarrySky123123123 committed Feb 10, 2020
1 parent 3d6356a commit 2d9bc08
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.example.customdatelibrary.bean.Customdatebean;
import com.example.customdatelibrary.bean.Notebean;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -454,5 +455,4 @@ public List<String> getList(){
}
return res;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,21 @@ public void onBindViewHolder(@NonNull ViewHolder viewHolder, final int i) {
//每种模式可以指定选中日期 1
//每种模式可以选择指定日期禁用 2
if (type == 1 || type == 2){
for (String s : jys) {
if (s.equals(list.get(i))) {
viewHolder.dayItemL1.setEnabled(sta == 1 ? true : false);
if (sta == 2) viewHolder.dayItemT1.setTextColor(Color.parseColor("#cccccc"));
} else {
viewHolder.dayItemL1.setEnabled(sta == 1 ? false : true);
if (sta == 1) viewHolder.dayItemT1.setTextColor(Color.parseColor("#cccccc"));
if (sta == 1){
viewHolder.dayItemL1.setEnabled(false);
viewHolder.dayItemT1.setTextColor(Color.parseColor("#cccccc"));
for (String s : jys){
if (s.equals(list.get(i))){
viewHolder.dayItemL1.setEnabled(true);
viewHolder.dayItemT1.setTextColor(Color.parseColor("#8B8989"));
}
}
}else if (sta == 2){
for (String s : jys){
if (s.equals(list.get(i))){
viewHolder.dayItemL1.setEnabled(false);
viewHolder.dayItemT1.setTextColor(Color.parseColor("#cccccc"));
}
}
}
}
Expand Down

0 comments on commit 2d9bc08

Please sign in to comment.