Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.7.3 merge #2164

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 수정사항
1. Doctalk Service에 맞게 커스텀
2. 디자인 수정
3. 코드 정리

# PictureSelector 2.0
A Picture Selector for Android platform, support from the album to obtain pictures, video, audio & photo, support crop (single picture or multi-picture crop), compression, theme custom configuration and other functions, support dynamic access & adapt to Android 5.0+ system of open source picture selection framework。<br>

Expand Down
3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Expand Down
140 changes: 140 additions & 0 deletions app/src/main/java/com/luck/pictureselector/style/PictureUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
package com.luck.pictureselector.style;

import android.content.Context;
import android.graphics.Color;

import androidx.core.content.ContextCompat;

import com.luck.picture.lib.app.IApp;
import com.luck.picture.lib.app.PictureAppMaster;
import com.luck.picture.lib.style.PictureParameterStyle;
import com.luck.picture.lib.style.PictureSelectorUIStyle;
import com.luck.pictureselector.R;

public class PictureUtils {

public static PictureSelectorUIStyle ofDoctalkStyle () {
PictureSelectorUIStyle uiStyle = new PictureSelectorUIStyle();

IApp app = PictureAppMaster.getInstance().getApp();
Context context = app.getAppContext();
if (context != null) {

uiStyle.picture_statusBarBackgroundColor = ContextCompat.getColor(context, R.color.colorAccentDark);
uiStyle.picture_container_backgroundColor = ContextCompat.getColor(context, R.color.background_white);

// uiStyle.picture_navBarColor = ContextCompat.getColor(context, R.color.background_gray);

uiStyle.picture_check_style = R.drawable.selector_check;

uiStyle.picture_top_leftBack = R.drawable.ic_back_white_normal;
uiStyle.picture_top_titleRightTextColor = new int[]{ContextCompat.getColor(context, R.color.text_white), ContextCompat.getColor(context, R.color.text_white)};
uiStyle.picture_top_titleRightTextSize = 15;
uiStyle.picture_top_titleTextSize = 19;
uiStyle.picture_top_titleArrowUpDrawable = R.drawable.picture_icon_arrow_up;
uiStyle.picture_top_titleArrowDownDrawable = R.drawable.picture_icon_arrow_down;
uiStyle.picture_top_titleTextColor = ContextCompat.getColor(context, R.color.text_white);
uiStyle.picture_top_titleBarBackgroundColor = ContextCompat.getColor(context, R.color.colorAccent);

uiStyle.picture_album_textSize = 15;
uiStyle.picture_album_backgroundStyle = R.drawable.picture_item_select_bg;
uiStyle.picture_album_textColor = ContextCompat.getColor(context, R.color.text_black);
uiStyle.picture_album_checkDotStyle = R.drawable.shape_circle_select;

uiStyle.picture_bottom_previewTextSize = 13;
uiStyle.picture_bottom_previewTextColor = new int[]{ContextCompat.getColor(context, R.color.text_gray), ContextCompat.getColor(context, R.color.text_black)};

uiStyle.picture_bottom_completeRedDotTextSize = 11;
uiStyle.picture_bottom_completeTextSize = 13;
uiStyle.picture_bottom_completeRedDotTextColor = ContextCompat.getColor(context, R.color.text_white);
uiStyle.picture_bottom_completeRedDotBackground = R.drawable.shape_circle_select;
uiStyle.picture_bottom_completeTextColor = new int[]{ContextCompat.getColor(context, R.color.text_gray), ContextCompat.getColor(context, R.color.text_black)};
uiStyle.picture_bottom_barBackgroundColor = ContextCompat.getColor(context, R.color.background_white);

uiStyle.picture_adapter_item_camera_backgroundColor = ContextCompat.getColor(context, R.color.background_gray);
uiStyle.picture_adapter_item_camera_textColor = ContextCompat.getColor(context, R.color.text_white);
uiStyle.picture_adapter_item_camera_textSize = 15;
uiStyle.picture_adapter_item_camera_textTopDrawable = R.drawable.ic_camera;

uiStyle.picture_adapter_item_textSize = 13;
uiStyle.picture_adapter_item_textColor = ContextCompat.getColor(context, R.color.text_white);
uiStyle.picture_adapter_item_video_textLeftDrawable = R.drawable.picture_icon_video;
uiStyle.picture_adapter_item_audio_textLeftDrawable = R.drawable.picture_icon_audio;

uiStyle.picture_bottom_originalPictureTextSize = 13;
uiStyle.picture_bottom_originalPictureCheckStyle = R.drawable.picture_original_wechat_checkbox;
uiStyle.picture_bottom_originalPictureTextColor = ContextCompat.getColor(context, R.color.text_white);
uiStyle.picture_bottom_previewNormalText = R.string.picture_preview_num;
uiStyle.picture_bottom_originalPictureText = R.string.picture_original_image;
uiStyle.picture_bottom_completeDefaultText = R.string.picture_please_select;
uiStyle.picture_bottom_completeNormalText = R.string.picture_completed;
uiStyle.picture_adapter_item_camera_text = R.string.picture_take_picture;
uiStyle.picture_top_titleRightDefaultText = R.string.picture_done;
uiStyle.picture_bottom_previewDefaultText = R.string.picture_preview;

// 如果文本内容设置(%1$d/%2$d),请开启true
uiStyle.isCompleteReplaceNum = true;
}
return uiStyle;
}


private PictureParameterStyle getNumStyle () {
// 相册主题
PictureParameterStyle pictureParameterStyle = new PictureParameterStyle();

IApp app = PictureAppMaster.getInstance().getApp();
Context context = app.getAppContext();
if (context != null) {
// 是否改变状态栏字体颜色(黑白切换)
pictureParameterStyle.isChangeStatusBarFontColor = false;
// 是否开启右下角已完成(0/9)风格
pictureParameterStyle.isOpenCompletedNumStyle = false;
// 是否开启类似QQ相册带数字选择风格
pictureParameterStyle.isOpenCheckNumStyle = true;
// 相册状态栏背景色
pictureParameterStyle.pictureStatusBarColor = Color.parseColor("#7D7DFF");
// 相册列表标题栏背景色
pictureParameterStyle.pictureTitleBarBackgroundColor = Color.parseColor("#7D7DFF");
// 相册列表标题栏右侧上拉箭头
pictureParameterStyle.pictureTitleUpResId = R.drawable.picture_icon_arrow_up;
// 相册列表标题栏右侧下拉箭头
pictureParameterStyle.pictureTitleDownResId = R.drawable.picture_icon_arrow_down;
// 相册文件夹列表选中圆点
pictureParameterStyle.pictureFolderCheckedDotStyle = R.drawable.picture_orange_oval;
// 相册返回箭头
pictureParameterStyle.pictureLeftBackIcon = R.drawable.picture_icon_back;
// 标题栏字体颜色
pictureParameterStyle.pictureTitleTextColor = ContextCompat.getColor(context, R.color.app_color_white);
// 相册右侧取消按钮字体颜色 废弃 改用.pictureRightDefaultTextColor和.pictureRightDefaultTextColor
pictureParameterStyle.pictureCancelTextColor = ContextCompat.getColor(context, R.color.app_color_white);
// 选择相册目录背景样式
pictureParameterStyle.pictureAlbumStyle = R.drawable.picture_new_item_select_bg;
// 相册列表勾选图片样式
pictureParameterStyle.pictureCheckedStyle = R.drawable.picture_checkbox_num_selector;
// 相册列表底部背景色
pictureParameterStyle.pictureBottomBgColor = ContextCompat.getColor(context, R.color.picture_color_fa);
// 已选数量圆点背景样式
pictureParameterStyle.pictureCheckNumBgStyle = R.drawable.picture_num_oval_blue;
// 相册列表底下预览文字色值(预览按钮可点击时的色值)
pictureParameterStyle.picturePreviewTextColor = ContextCompat.getColor(context, R.color.picture_color_blue);
// 相册列表底下不可预览文字色值(预览按钮不可点击时的色值)
pictureParameterStyle.pictureUnPreviewTextColor = ContextCompat.getColor(context, R.color.app_color_blue);
// 相册列表已完成色值(已完成 可点击色值)
pictureParameterStyle.pictureCompleteTextColor = ContextCompat.getColor(context, R.color.app_color_blue);
// 相册列表未完成色值(请选择 不可点击色值)
pictureParameterStyle.pictureUnCompleteTextColor = ContextCompat.getColor(context, R.color.app_color_blue);
// 预览界面底部背景色
pictureParameterStyle.picturePreviewBottomBgColor = ContextCompat.getColor(context, R.color.picture_color_fa);
// 原图按钮勾选样式 需设置.isOriginalImageControl(true); 才有效
pictureParameterStyle.pictureOriginalControlStyle = R.drawable.picture_original_blue_checkbox;
// 原图文字颜色 需设置.isOriginalImageControl(true); 才有效
pictureParameterStyle.pictureOriginalFontColor = ContextCompat.getColor(context, R.color.app_color_blue);
// 外部预览界面删除按钮样式
pictureParameterStyle.pictureExternalPreviewDeleteStyle = R.drawable.picture_icon_delete;
// 外部预览界面是否显示删除按钮
pictureParameterStyle.pictureExternalPreviewGonePreviewDelete = true;
}
return pictureParameterStyle;
}
}
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_back_white_normal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/img_white"
android:fillType="nonZero"
android:pathData="M32,23H19.83l5.59,-5.59L24,16l-8,8 8,8 1.41,-1.41L19.83,25H32z" />
</vector>
14 changes: 14 additions & 0 deletions app/src/main/res/drawable/ic_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="38dp"
android:height="38dp"
android:viewportWidth="38"
android:viewportHeight="38">
<path
android:fillColor="@color/img_white"
android:fillType="evenOdd"
android:pathData="M18.958,2c8.814,0 15.959,7.145 15.959,15.958 0,8.814 -7.145,15.959 -15.959,15.959C10.145,33.917 3,26.772 3,17.958 3,9.145 10.145,2 18.958,2z" />
<path
android:fillColor="@color/img_light_gray"
android:fillType="nonZero"
android:pathData="M16.964,11.974l-1.217,1.33h-2.108a1.33,1.33 0,0 0,-1.33 1.33v7.979c0,0.735 0.595,1.33 1.33,1.33h10.639a1.33,1.33 0,0 0,1.33 -1.33v-7.98a1.33,1.33 0,0 0,-1.33 -1.33L22.17,13.303l-1.217,-1.329h-3.99zM18.958,20.751a2.128,2.128 0,1 0,0 -4.255,2.128 2.128,0 0,0 0,4.255zM18.958,21.948a3.326,3.326 0,0 1,0 -6.65,3.326 3.326,0 0,1 0,6.65z" />
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_check_normal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/img_light_gray"
android:fillType="nonZero"
android:pathData="M24,14c-5.523,0 -10,4.477 -10,10s4.477,10 10,10 10,-4.477 10,-10 -4.477,-10 -10,-10zM24,32.182a8.182,8.182 0,1 1,0 -16.364,8.182 8.182,0 0,1 0,16.364z" />
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_check_selected.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/colorAccent"
android:fillType="nonZero"
android:pathData="M24,14c-5.523,0 -10,4.477 -10,10s4.477,10 10,10 10,-4.477 10,-10 -4.477,-10 -10,-10zM24,32.182a8.182,8.182 0,1 1,0 -16.364,8.182 8.182,0 0,1 0,16.364zM26.415,21.539l-3.214,3.214 -1.286,-1.286a0.91,0.91 0,1 0,-1.285 1.286l1.928,1.928a0.91,0.91 0,0 0,1.286 0l3.857,-3.857a0.909,0.909 0,1 0,-1.286 -1.285z" />
</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/selector_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/ic_check_selected" android:state_selected="true" />
<item android:drawable="@drawable/ic_check_normal" />
</selector>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable/shape_circle_select.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">

<solid android:color="@color/colorAccent" />
<stroke
android:width="1dp"
android:color="@color/img_white" />
<size
android:width="18dp"
android:height="18dp" />
</shape>
73 changes: 73 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,77 @@
<color name="app_color_9b">#9b9b9b</color>
<color name="app_color_e0ff6100">#E0FF6100</color>
<color name="app_color_red">#FF0000</color>


<color name="colorAccent">#13bb00</color>
<color name="colorAccentDark">#0d8200</color>
<color name="actionButton">#13bb00</color>
<color name="toolbar">#13bb00</color>
<color name="refreshSchemeColor">#13bb00</color>

<color name="chartPie10">#ff5edb</color>
<color name="chartPie20">#84b000</color>
<color name="chartPie30">#00cd20</color>
<color name="chartPie40">#00cbcd</color>
<color name="chartPie50">#2046e7</color>
<color name="chartPie60">#b612ea</color>
<color name="chartPie70">#f88e06</color>
<color name="chartPie0">#ffc200</color>

<color name="edit_title">#F0F0F0</color>
<color name="edit_text">#000000</color>
<color name="edit_hint">#AAAAAA</color>
<color name="text_error">#FF4500</color>

<color name="text_white">#FFFFFF</color>
<color name="text_black">#000000</color>
<color name="text_dark_gray">#4a4a4a</color>
<color name="text_gray">#7A7A7A</color>
<color name="text_light_gray">#AAAAAA</color>
<color name="text_etc">#3e4759</color>
<color name="text_accent">#647188</color>
<color name="text_toolbar">#FFFFFF</color>
<color name="text_tag">#798bac</color>

<color name="img_dark">#3F4558</color>
<color name="img_white">#FFFFFF</color>
<color name="img_disable">#f0f0f0</color>
<color name="img_black">#000000</color>
<color name="img_accent">#647188</color>
<color name="img_gray">#7A7A7A</color>
<color name="img_dark_gray">#4a4a4a</color>
<color name="img_light_gray">#AAAAAA</color>
<color name="img_etc">#3e4759</color>
<color name="img_red">#FF4500</color>
<color name="img_torch_red">#ff002c</color>

<color name="divider">#f0f0f0</color>

<color name="red_flush_orange">#FF7E00</color>

<color name="background_white">#FFFFFF</color>
<color name="background_gray">#f0f0f0</color>
<color name="background_chat_toolbar">#d4dbe8</color>
<color name="background_chat_row">#C6CFDF</color>
<color name="background_add_tag">#DADADA</color>
<color name="background_etc">#8f9fbf</color>
<color name="background_black">#000000</color>
<color name="background_pink">#FF5C78</color>

<color name="facebook">#4460a0</color>
<color name="naver">#13bb00</color>
<color name="chat_message">#13bb00</color>

<color name="tooltip_green_jungle">#249676</color>

<color name="chat_download_background">#F8F8F8</color>
<color name="chat_download_button">#5A5A5A</color>
<color name="chat_download_text_name">#2C2C2C</color>
<color name="chat_download_text_etc">#7A7A7A</color>

<color name="alpha_black_half_black">#80000000</color>
<color name="alpha_gray_silver">#CABBBBBB</color>
<color name="alpha_red_froly">#80f2798d</color>
<color name="alpha_white_white">#88000000</color>
<color name="alpha_login">#BBFFFFFF</color>
</resources>
10 changes: 5 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">PictureSelector</string>
<string name="app_drag_delete">拖动到此处删除</string>
<string name="app_let_go_drag_delete">松手即可删除</string>
<string name="app_wechat_send">发送</string>
<string name="app_wechat_send_num">发送(%1$d/%2$d)</string>
<string name="app_name">PictureSelector</string>
<string name="app_drag_delete">삭제하려면 여기로 드래그 하세요</string>
<string name="app_let_go_drag_delete">삭제하기</string>
<string name="app_wechat_send">확인</string>
<string name="app_wechat_send_num">확인(%1$d/%2$d)</string>
</resources>
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue Apr 27 15:06:02 CST 2021
#Tue Mar 30 14:33:22 KST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk11
4 changes: 1 addition & 3 deletions picture_library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ android {
abortOnError false
}

resourcePrefix 'ucrop_'
// resourcePrefix 'ucrop_'
}

apply from: '../publish.gradle'

dependencies {
implementation "androidx.appcompat:appcompat:${cfgs.version_appcompat}"
implementation "androidx.recyclerview:recyclerview:${cfgs.version_recyclerview}"
Expand Down
Loading