gzu-liyujiang / gzu-liyujiang/AndroidPicker

在文件夹选择器的时候,我关于一些代码的修改,忘采纳

Open
#163 2 comments 0 reactions 0 assignees View on GitHub
enhancement expired
Dominant language
Java
Stars
6.8k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

很多时候,比如我现在需要的就是返回上一层、返回home和普通的文件item要求有不一样的颜色。
楼主木有提供方法,我就自己下的源码进行封装了下。
FileAdapter:
/**
* 显示主页颜色
*/
private int homeColor = Color.WHITE;
/**
* 显示返回上一层颜色
*/
private int upColor = Color.WHITE;
/**
* 显示文件条目颜色
*/
private int fileColor = Color.WHITE;

public int getHomeColor() {
return homeColor;
}

public void setHomeColor(int homeColor) {
this.homeColor = homeColor;
}

public int getUpColor() {
return upColor;
}

public void setUpColor(int upColor) {
this.upColor = upColor;
}

public int getFileColor() {
return fileColor;
}

public void setFileColor(int fileColor) {
this.fileColor = fileColor;
}

FileItem item = data.get(position);
holder.imageView.setImageDrawable(item.getIcon());
holder.textView.setText(item.getName());
CompatUtils.setBackground(convertView, new StateColorDrawable(item.getColor(), Color.LTGRAY));
return convertView;

FileItem:
private int Color;

public int getColor() {
return Color;
}

public void setColor(int color) {
Color = color;
}

FilePicker:
public void setHomeColor(int homeColor) {
adapter.setHomeColor(homeColor);
}

public void setUpColor(int upColor) {
adapter.setUpColor(upColor);
}

public void setFileColor(int fileColor) {
adapter.setFileColor(fileColor);
}

都是一些比较简单的东西,希望可以采纳。更期待与楼主一起维护代码(虽然我现在能力很低,还是实习生)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the folder picker’s FileAdapter, FileItem, and FilePicker classes and trace how home, parent-directory, and ordinary file items are created and rendered. Done means those three item types can receive distinct configurable colors through the picker API and the project still builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.