Commit cac33bbe by 郭倩芳

album_v1.1.0

parent c883149d
......@@ -21,8 +21,8 @@ dependencies {
compileOnly 'androidx.appcompat:appcompat:1.1.0'
compileOnly 'androidx.recyclerview:recyclerview:1.0.0'
compileOnly 'com.google.android.material:material:1.4.0'
api 'com.sobot.library:widget_x:1.2.7'
api 'com.sobot.library:sobotcommon_x:1.7.7.3'
api 'com.sobot.library:widget_x:1.3.0'
api 'com.sobot.library:sobotcommon_x:2.2.0'
}
......
......@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'album' //项目名
PUBLISH_VERSION = '1.0.4.5' //版本号
PUBLISH_VERSION = '1.1.0' //版本号
}
......
......@@ -83,10 +83,10 @@ public class AlbumActivity extends SobotBaseActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
changeAppLanguage();
initializeArgument();
limitText=getResources().getQuantityString(R.plurals.album_check_image_limit, mLimitCount, mLimitCount);
super.onCreate(savedInstanceState);
limitText= getResources().getText(R.string.album_check_album_limit).toString();
limitText = String.format(limitText, 15);
}
......@@ -245,22 +245,23 @@ public class AlbumActivity extends SobotBaseActivity implements
int messageRes;
switch (mFunction) {
case SobotAlbum.FUNCTION_CHOICE_IMAGE: {
messageRes = R.plurals.album_check_image_limit_camera;
messageRes = R.string.album_check_image_limit_camera;
break;
}
case SobotAlbum.FUNCTION_CHOICE_VIDEO: {
messageRes = R.plurals.album_check_video_limit_camera;
messageRes = R.string.album_check_video_limit_camera;
break;
}
case SobotAlbum.FUNCTION_CHOICE_ALBUM: {
messageRes = R.plurals.album_check_album_limit_camera;
messageRes = R.string.album_check_album_limit_camera;
break;
}
default: {
throw new AssertionError("This should not be the case.");
}
}
mView.toast(getResources().getQuantityString(messageRes, mLimitCount, mLimitCount));
String text = getResources().getText(messageRes).toString();
mView.toast(String.format(text, mLimitCount));
} else {
switch (mFunction) {
case SobotAlbum.FUNCTION_CHOICE_IMAGE: {
......@@ -406,24 +407,6 @@ public class AlbumActivity extends SobotBaseActivity implements
AlbumFile albumFile = mAlbumFolders.get(mCurrentFolder).getAlbumFiles().get(position);
if (button.isChecked()) {
if (mCheckedList.size() >= mLimitCount) {
int messageRes;
switch (mFunction) {
case SobotAlbum.FUNCTION_CHOICE_IMAGE: {
messageRes = R.plurals.album_check_image_limit;
break;
}
case SobotAlbum.FUNCTION_CHOICE_VIDEO: {
messageRes = R.plurals.album_check_video_limit;
break;
}
case SobotAlbum.FUNCTION_CHOICE_ALBUM: {
messageRes = R.plurals.album_check_album_limit;
break;
}
default: {
throw new AssertionError("This should not be the case.");
}
}
mView.toast(limitText);
button.setChecked(false);
} else {
......
......@@ -108,12 +108,12 @@ public class GalleryActivity extends SobotBaseActivity implements Contract.Galle
mView.setChecked(albumFile.isChecked());
mView.setLayerDisplay(albumFile.isDisable());
if (albumFile.getMediaType() == AlbumFile.TYPE_VIDEO) {
mView.setDuration(AlbumUtils.convertDuration(albumFile.getDuration()));
mView.setDurationDisplay(true);
} else {
mView.setDurationDisplay(false);
}
// if (albumFile.getMediaType() == AlbumFile.TYPE_VIDEO) {
// mView.setDuration(AlbumUtils.convertDuration(albumFile.getDuration()));
// mView.setDurationDisplay(true);
// } else {
// mView.setDurationDisplay(false);
// }
}
@Override
......@@ -128,22 +128,23 @@ public class GalleryActivity extends SobotBaseActivity implements Contract.Galle
int messageRes;
switch (mFunction) {
case SobotAlbum.FUNCTION_CHOICE_IMAGE: {
messageRes = R.plurals.album_check_image_limit;
messageRes = R.string.album_check_image_limit;
break;
}
case SobotAlbum.FUNCTION_CHOICE_VIDEO: {
messageRes = R.plurals.album_check_video_limit;
messageRes = R.string.album_check_video_limit;
break;
}
case SobotAlbum.FUNCTION_CHOICE_ALBUM: {
messageRes = R.plurals.album_check_album_limit;
messageRes = R.string.album_check_album_limit;
break;
}
default: {
throw new AssertionError("This should not be the case.");
}
}
mView.toast(getResources().getQuantityString(messageRes, mAllowSelectCount, mAllowSelectCount));
String text = getResources().getText(messageRes).toString();
mView.toast(String.format(text, mAllowSelectCount));
mView.setChecked(false);
} else if(albumFile.getSize()>= 50 * 1024 * 1024){
mView.toast(getResources().getString(R.string.sobot_pic_siza_xiaoyu) );
......
......@@ -112,14 +112,15 @@ public class GalleryAlbumActivity extends SobotAlbumBaseActivity implements Cont
if (mCheckable) mView.setChecked(albumFile.isChecked());
mView.setLayerDisplay(albumFile.isDisable());
if (albumFile.getMediaType() == AlbumFile.TYPE_VIDEO) {
if (!mCheckable) mView.setBottomDisplay(true);
mView.setDuration(AlbumUtils.convertDuration(albumFile.getDuration()));
mView.setDurationDisplay(true);
} else {
if (!mCheckable) mView.setBottomDisplay(false);
mView.setDurationDisplay(false);
}
//多语言显示不下,不显示视频秒数
// if (albumFile.getMediaType() == AlbumFile.TYPE_VIDEO) {
// if (!mCheckable) mView.setBottomDisplay(true);
// mView.setDuration(AlbumUtils.convertDuration(albumFile.getDuration()));
// mView.setDurationDisplay(true);
// } else {
// if (!mCheckable) mView.setBottomDisplay(false);
// mView.setDurationDisplay(false);
// }
}
@Override
......
......@@ -154,6 +154,9 @@
android:paddingTop="5dp"
android:paddingRight="10dp"
android:paddingBottom="5dp"
android:autoSizeTextType="uniform"
android:autoSizeMaxTextSize="16sp"
android:autoSizeMinTextSize="9sp"
android:text="@string/sobot_add_photos"
android:textColor="@color/sobot_wo_white_color"
android:textSize="16sp" />
......
......@@ -49,35 +49,12 @@
<string name="album_permission_camera_image_failed_hint">No Camera permission or Storage permission, please authorize before use.</string>
<string name="album_permission_camera_video_failed_hint">No Camera permission, Storage permission or Microphone permission, please authorize it before use.</string>
<plurals name="album_check_image_limit">
<item quantity="one">You can only select %1$d image item.</item>
<item quantity="other">You can only select %1$d image items.</item>
</plurals>
<plurals name="album_check_image_limit_camera">
<item quantity="one">You can only select %1$d image item, can\'t use camera.</item>
<item quantity="other">You can only select %1$d image items, can\'t use camera.</item>
</plurals>
<plurals name="album_check_video_limit">
<item quantity="one">You can only select %1$d video.</item>
<item quantity="other">You can only select %1$d videos.</item>
</plurals>
<plurals name="album_check_video_limit_camera">
<item quantity="one">You can only select %1$d video item, can\'t use camera.</item>
<item quantity="other">You can only select %1$d video items, can\'t use camera.</item>
</plurals>
<plurals name="album_check_album_limit">
<item quantity="one">You can only select %1$d media item.</item>
<item quantity="other">You can only select %1$d media items.</item>
</plurals>
<plurals name="album_check_album_limit_camera">
<item quantity="one">You can only select %1$d media item, can\'t use camera.</item>
<item quantity="other">You can only select %1$d media items, can\'t use camera.</item>
</plurals>
<string name="album_check_image_limit">You can only select %s image item.</string>
<string name="album_check_image_limit_camera">You can only select %s image item, can\'t use camera.</string>
<string name="album_check_album_limit_camera">You can only select %s media item, can\'t use camera.</string>
<string name="album_check_video_limit_camera">You can only select %s video item, can\'t use camera.</string>
<string name="album_check_video_limit">You can only select %s video.</string>
<string name="album_check_album_limit">You can only select %s media item.</string>
<string name="album_item_unavailable">Unavailable</string>
<string name="album_take_file_unavailable">Unavailable file, please try again.</string>
......
......@@ -47,35 +47,13 @@
<string name="album_permission_storage_failed_hint">没有存储权限,请在使用前进行授权</string>
<string name="album_permission_camera_image_failed_hint">没有相机权限或存储权限,请在使用前进行授权</string>
<string name="album_permission_camera_video_failed_hint">没有相机权限、存储权限或麦克风权限,请在使用前进行授权</string>
<plurals name="album_check_image_limit">
<item quantity="one">最多可选择 %1$d 张照片</item>
<item quantity="other">最多可选择 %1$d 张照片</item>
</plurals>
<string name="album_check_image_limit">最多可选择 %s 张照片</string>
<string name="album_check_image_limit_camera">您只能选择 %s 个图片,不能使用相机。</string>
<string name="album_check_album_limit_camera">您只能选择 %s个媒体项目,不能使用相机</string>
<string name="album_check_video_limit_camera">您只能选择 %s 个视频,不能使用相机。</string>
<string name="album_check_video_limit">您只能选择 %s 个视频。</string>
<string name="album_check_album_limit">最多可选择 %s 张照片</string>
<plurals name="album_check_image_limit_camera">
<item quantity="one">您只能选择 %1$d 个图片,不能使用相机。</item>
<item quantity="other">您只能选择 %1$d 个图片,不能使用相机。</item>
</plurals>
<plurals name="album_check_video_limit">
<item quantity="one">您只能选择 %1$d 个视频。</item>
<item quantity="other">您只能选择 %1$d 个视频。</item>
</plurals>
<plurals name="album_check_video_limit_camera">
<item quantity="one">您只能选择 %1$d 个视频,不能使用相机。</item>
<item quantity="other">您只能选择 %1$d 个视频,不能使用相机。</item>
</plurals>
<plurals name="album_check_album_limit">
<item quantity="one">最多可选择 %1$d 张照片</item>
<item quantity="other">最多可选择 %1$d 张照片</item>
</plurals>
<plurals name="album_check_album_limit_camera">
<item quantity="one">您只能选择%1$d个媒体项目,不能使用相机</item>
<item quantity="other">您只能选择%1$d个媒体项目,不能使用相机</item>
</plurals>
<string name="album_item_unavailable">不可用</string>
<string name="album_take_file_unavailable">文件不可用,请重试</string>
<string name="btn_function_camera">相机</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment