fixed some image cannot display
This commit is contained in:
parent
45d1ec1fc8
commit
fdc51aa637
11
README.md
11
README.md
|
|
@ -106,9 +106,10 @@ class CustomerActivity extends Activity implements MultiImageSelectorFragment.Ca
|
||||||
|
|
||||||
###Change Log
|
###Change Log
|
||||||
|
|
||||||
* 2015-4-9
|
* 2015-5-5
|
||||||
1. Fixed. When set `EXTRA_SHOW_CAMERA` to `true`, the first grid item onclick event were messed.
|
1. Fixed. Can't display some images. (Issue by[sd6352051](https://github.com/sd6352051), [larry](https://github.com/18611480882))
|
||||||
2. Add. Support initial selected image list.
|
2. Fixed. `ListPopupWindow` can not fill parent
|
||||||
|
3. Added. Add checked mask.
|
||||||
|
|
||||||
* 2015-4-16
|
* 2015-4-16
|
||||||
1. Fixed. Crack when rotate device. (Issue by [@Leminity](https://github.com/Leminity))
|
1. Fixed. Crack when rotate device. (Issue by [@Leminity](https://github.com/Leminity))
|
||||||
|
|
@ -116,6 +117,10 @@ class CustomerActivity extends Activity implements MultiImageSelectorFragment.Ca
|
||||||
3. Change. Demo application shortcut.
|
3. Change. Demo application shortcut.
|
||||||
4. Change. Readme file.
|
4. Change. Readme file.
|
||||||
|
|
||||||
|
* 2015-4-9
|
||||||
|
1. Fixed. When set `EXTRA_SHOW_CAMERA` to `true`, the first grid item onclick event were messed.
|
||||||
|
2. Add. Support initial selected image list.
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
###Thanks
|
###Thanks
|
||||||
|
|
|
||||||
12
README_zh.md
12
README_zh.md
|
|
@ -106,9 +106,10 @@ class CustomerActivity extends Activity implements MultiImageSelectorFragment.Ca
|
||||||
|
|
||||||
###更新日志
|
###更新日志
|
||||||
|
|
||||||
* 2015-4-9
|
* 2015-5-5
|
||||||
1. 修复. 当设置 `EXTRA_SHOW_CAMERA` 为 `true` 时, 点击第一个Item会混乱的问题.
|
1. 修复. 某些图片无法显示. (Issue by[sd6352051](https://github.com/sd6352051), [larry](https://github.com/18611480882))
|
||||||
2. 新增. 支持初始化图片选择设定。
|
2. 修复. `ListPopupWindow` 无法填充父控件
|
||||||
|
3. 新增. 选中的遮罩效果.
|
||||||
|
|
||||||
* 2015-4-16
|
* 2015-4-16
|
||||||
1. 修复. 旋转设备时,程序会崩溃. (Issue by [@Leminity](https://github.com/Leminity))
|
1. 修复. 旋转设备时,程序会崩溃. (Issue by [@Leminity](https://github.com/Leminity))
|
||||||
|
|
@ -116,6 +117,11 @@ class CustomerActivity extends Activity implements MultiImageSelectorFragment.Ca
|
||||||
3. 更改. 演示程序截图.
|
3. 更改. 演示程序截图.
|
||||||
4. 更改. Readme 文件.
|
4. 更改. Readme 文件.
|
||||||
|
|
||||||
|
* 2015-4-9
|
||||||
|
1. 修复. 当设置 `EXTRA_SHOW_CAMERA` 为 `true` 时, 点击第一个Item会混乱的问题.
|
||||||
|
2. 新增. 支持初始化图片选择设定。
|
||||||
|
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
###感谢
|
###感谢
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,5 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile 'com.android.support:appcompat-v7:22.0.0'
|
compile 'com.android.support:appcompat-v7:22.0.0'
|
||||||
compile 'com.squareup.picasso:picasso:2.5.2'
|
compile 'com.squareup.picasso:picasso:2.4.0'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,6 @@
|
||||||
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
|
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
|
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
|
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
|
||||||
<orderEntry type="library" exported="" name="picasso-2.5.2" level="project" />
|
<orderEntry type="library" exported="" name="picasso-2.4.0" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
@ -5,9 +5,12 @@ import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
|
@ -93,6 +96,9 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
private int mDesireImageCount;
|
private int mDesireImageCount;
|
||||||
|
|
||||||
private boolean hasFolderGened = false;
|
private boolean hasFolderGened = false;
|
||||||
|
private boolean mIsShowCamera = false;
|
||||||
|
|
||||||
|
private int mGridWidth, mGridHeight;
|
||||||
|
|
||||||
private File mTmpFile;
|
private File mTmpFile;
|
||||||
|
|
||||||
|
|
@ -130,16 +136,11 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否显示照相机
|
// 是否显示照相机
|
||||||
final boolean showCamera = getArguments().getBoolean(EXTRA_SHOW_CAMERA, true);
|
mIsShowCamera = getArguments().getBoolean(EXTRA_SHOW_CAMERA, true);
|
||||||
mImageAdapter = new ImageGridAdapter(getActivity(), showCamera);
|
mImageAdapter = new ImageGridAdapter(getActivity(), mIsShowCamera);
|
||||||
// 是否显示选择指示器
|
// 是否显示选择指示器
|
||||||
mImageAdapter.showSelectIndicator(mode == MODE_MULTI);
|
mImageAdapter.showSelectIndicator(mode == MODE_MULTI);
|
||||||
|
|
||||||
// 如果显示了照相机,则创建临时文件
|
|
||||||
if(showCamera){
|
|
||||||
mTmpFile = FileUtils.createTmpFile(getActivity());
|
|
||||||
}
|
|
||||||
|
|
||||||
mPopupAnchorView = view.findViewById(R.id.footer);
|
mPopupAnchorView = view.findViewById(R.id.footer);
|
||||||
|
|
||||||
mTimeLineText = (TextView) view.findViewById(R.id.timeline_area);
|
mTimeLineText = (TextView) view.findViewById(R.id.timeline_area);
|
||||||
|
|
@ -152,9 +153,14 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
mCategoryText.setOnClickListener(new View.OnClickListener() {
|
mCategoryText.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if(mFolderPopupWindow.isShowing()){
|
|
||||||
|
if(mFolderPopupWindow == null){
|
||||||
|
createPopupFolderList(mGridWidth, mGridHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mFolderPopupWindow.isShowing()) {
|
||||||
mFolderPopupWindow.dismiss();
|
mFolderPopupWindow.dismiss();
|
||||||
}else {
|
} else {
|
||||||
mFolderPopupWindow.show();
|
mFolderPopupWindow.show();
|
||||||
int index = mFolderAdapter.getSelectIndex();
|
int index = mFolderAdapter.getSelectIndex();
|
||||||
index = index == 0 ? index : index - 1;
|
index = index == 0 ? index : index - 1;
|
||||||
|
|
@ -215,16 +221,15 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
final int width = mGridView.getWidth();
|
final int width = mGridView.getWidth();
|
||||||
final int height = mGridView.getHeight();
|
final int height = mGridView.getHeight();
|
||||||
|
|
||||||
|
mGridWidth = width;
|
||||||
|
mGridHeight = height;
|
||||||
|
|
||||||
final int desireSize = getResources().getDimensionPixelOffset(R.dimen.image_size);
|
final int desireSize = getResources().getDimensionPixelOffset(R.dimen.image_size);
|
||||||
final int numCount = width / desireSize;
|
final int numCount = width / desireSize;
|
||||||
final int columnSpace = getResources().getDimensionPixelOffset(R.dimen.space_size);
|
final int columnSpace = getResources().getDimensionPixelOffset(R.dimen.space_size);
|
||||||
int columnWidth = (width - columnSpace*(numCount-1)) / numCount;
|
int columnWidth = (width - columnSpace*(numCount-1)) / numCount;
|
||||||
mImageAdapter.setItemSize(columnWidth);
|
mImageAdapter.setItemSize(columnWidth);
|
||||||
|
|
||||||
if(mFolderPopupWindow == null){
|
|
||||||
createPopupFolderList(width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
|
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
|
||||||
mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -260,33 +265,49 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
*/
|
*/
|
||||||
private void createPopupFolderList(int width, int height) {
|
private void createPopupFolderList(int width, int height) {
|
||||||
mFolderPopupWindow = new ListPopupWindow(getActivity());
|
mFolderPopupWindow = new ListPopupWindow(getActivity());
|
||||||
|
mFolderPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
mFolderPopupWindow.setAdapter(mFolderAdapter);
|
mFolderPopupWindow.setAdapter(mFolderAdapter);
|
||||||
mFolderPopupWindow.setContentWidth(width);
|
mFolderPopupWindow.setContentWidth(width);
|
||||||
mFolderPopupWindow.setHeight(height * 5/8);
|
mFolderPopupWindow.setWidth(width);
|
||||||
|
mFolderPopupWindow.setHeight(height * 5 / 8);
|
||||||
mFolderPopupWindow.setAnchorView(mPopupAnchorView);
|
mFolderPopupWindow.setAnchorView(mPopupAnchorView);
|
||||||
mFolderPopupWindow.setModal(true);
|
mFolderPopupWindow.setModal(true);
|
||||||
mFolderPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
mFolderPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
if (i == 0) {
|
|
||||||
getActivity().getSupportLoaderManager().restartLoader(LOADER_ALL, null, mLoaderCallback);
|
|
||||||
mCategoryText.setText(R.string.folder_all);
|
|
||||||
mImageAdapter.setShowCamera(true);
|
|
||||||
} else {
|
|
||||||
Folder folder = (Folder) adapterView.getAdapter().getItem(i);
|
|
||||||
if (null != folder) {
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
args.putString("path", folder.path);
|
|
||||||
getActivity().getSupportLoaderManager().restartLoader(LOADER_CATEGORY, args, mLoaderCallback);
|
|
||||||
mCategoryText.setText(folder.name);
|
|
||||||
}
|
|
||||||
mImageAdapter.setShowCamera(false);
|
|
||||||
}
|
|
||||||
mFolderAdapter.setSelectIndex(i);
|
|
||||||
mFolderPopupWindow.dismiss();
|
|
||||||
|
|
||||||
// 滑动到最初始位置
|
mFolderAdapter.setSelectIndex(i);
|
||||||
mGridView.smoothScrollToPosition(0);
|
|
||||||
|
final int index = i;
|
||||||
|
final AdapterView v = adapterView;
|
||||||
|
|
||||||
|
new Handler().postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
mFolderPopupWindow.dismiss();
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
getActivity().getSupportLoaderManager().restartLoader(LOADER_ALL, null, mLoaderCallback);
|
||||||
|
mCategoryText.setText(R.string.folder_all);
|
||||||
|
if (mIsShowCamera) {
|
||||||
|
mImageAdapter.setShowCamera(true);
|
||||||
|
} else {
|
||||||
|
mImageAdapter.setShowCamera(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Folder folder = (Folder) v.getAdapter().getItem(index);
|
||||||
|
if (null != folder) {
|
||||||
|
mImageAdapter.setData(folder.images);
|
||||||
|
mCategoryText.setText(folder.name);
|
||||||
|
}
|
||||||
|
mImageAdapter.setShowCamera(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 滑动到最初始位置
|
||||||
|
mGridView.smoothScrollToPosition(0);
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -303,13 +324,17 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
// 相机拍照完成后,返回图片路径
|
// 相机拍照完成后,返回图片路径
|
||||||
if(resultCode == Activity.RESULT_OK) {
|
if(requestCode == REQUEST_CAMERA){
|
||||||
if(requestCode == REQUEST_CAMERA){
|
if(resultCode == Activity.RESULT_OK) {
|
||||||
if (mTmpFile != null) {
|
if (mTmpFile != null) {
|
||||||
if (mCallback != null) {
|
if (mCallback != null) {
|
||||||
mCallback.onCameraShot(mTmpFile);
|
mCallback.onCameraShot(mTmpFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
if(mTmpFile != null && mTmpFile.exists()){
|
||||||
|
mTmpFile.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -318,8 +343,6 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
Log.d(TAG, "on change");
|
Log.d(TAG, "on change");
|
||||||
|
|
||||||
final int orientation = newConfig.orientation;
|
|
||||||
|
|
||||||
if(mFolderPopupWindow != null){
|
if(mFolderPopupWindow != null){
|
||||||
if(mFolderPopupWindow.isShowing()){
|
if(mFolderPopupWindow.isShowing()){
|
||||||
mFolderPopupWindow.dismiss();
|
mFolderPopupWindow.dismiss();
|
||||||
|
|
@ -327,27 +350,28 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
mGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
mGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
@Override @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
@Override
|
||||||
|
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
|
|
||||||
final int height = mGridView.getHeight();
|
final int height = mGridView.getHeight();
|
||||||
|
|
||||||
final int desireSize = getResources().getDimensionPixelOffset(R.dimen.image_size);
|
final int desireSize = getResources().getDimensionPixelOffset(R.dimen.image_size);
|
||||||
Log.d(TAG, "Desire Size = "+desireSize);
|
Log.d(TAG, "Desire Size = " + desireSize);
|
||||||
final int numCount = mGridView.getWidth() / desireSize;
|
final int numCount = mGridView.getWidth() / desireSize;
|
||||||
Log.d(TAG, "Grid Size = "+mGridView.getWidth());
|
Log.d(TAG, "Grid Size = " + mGridView.getWidth());
|
||||||
Log.d(TAG, "num count = "+numCount);
|
Log.d(TAG, "num count = " + numCount);
|
||||||
final int columnSpace = getResources().getDimensionPixelOffset(R.dimen.space_size);
|
final int columnSpace = getResources().getDimensionPixelOffset(R.dimen.space_size);
|
||||||
int columnWidth = (mGridView.getWidth() - columnSpace*(numCount-1)) / numCount;
|
int columnWidth = (mGridView.getWidth() - columnSpace * (numCount - 1)) / numCount;
|
||||||
mImageAdapter.setItemSize(columnWidth);
|
mImageAdapter.setItemSize(columnWidth);
|
||||||
|
|
||||||
if(mFolderPopupWindow != null){
|
if (mFolderPopupWindow != null) {
|
||||||
mFolderPopupWindow.setHeight(height * 5/8);
|
mFolderPopupWindow.setHeight(height * 5 / 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
}else{
|
} else {
|
||||||
mGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
|
mGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -365,6 +389,8 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||||
if(cameraIntent.resolveActivity(getActivity().getPackageManager()) != null){
|
if(cameraIntent.resolveActivity(getActivity().getPackageManager()) != null){
|
||||||
// 设置系统相机拍照后的输出路径
|
// 设置系统相机拍照后的输出路径
|
||||||
|
// 创建临时文件
|
||||||
|
mTmpFile = FileUtils.createTmpFile(getActivity());
|
||||||
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTmpFile));
|
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mTmpFile));
|
||||||
startActivityForResult(cameraIntent, REQUEST_CAMERA);
|
startActivityForResult(cameraIntent, REQUEST_CAMERA);
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -500,9 +526,9 @@ public class MultiImageSelectorFragment extends Fragment {
|
||||||
* 回调接口
|
* 回调接口
|
||||||
*/
|
*/
|
||||||
public interface Callback{
|
public interface Callback{
|
||||||
public void onSingleImageSelected(String path);
|
void onSingleImageSelected(String path);
|
||||||
public void onImageSelected(String path);
|
void onImageSelected(String path);
|
||||||
public void onImageUnselected(String path);
|
void onImageUnselected(String path);
|
||||||
public void onCameraShot(File imageFile);
|
void onCameraShot(File imageFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public class FolderAdapter extends BaseAdapter {
|
||||||
if(lastSelected == i){
|
if(lastSelected == i){
|
||||||
holder.indicator.setVisibility(View.VISIBLE);
|
holder.indicator.setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
holder.indicator.setVisibility(View.GONE);
|
holder.indicator.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
|
|
|
||||||
|
|
@ -208,10 +208,12 @@ public class ImageGridAdapter extends BaseAdapter {
|
||||||
class ViewHolde {
|
class ViewHolde {
|
||||||
ImageView image;
|
ImageView image;
|
||||||
ImageView indicator;
|
ImageView indicator;
|
||||||
|
View mask;
|
||||||
|
|
||||||
ViewHolde(View view){
|
ViewHolde(View view){
|
||||||
image = (ImageView) view.findViewById(R.id.image);
|
image = (ImageView) view.findViewById(R.id.image);
|
||||||
indicator = (ImageView) view.findViewById(R.id.checkmark);
|
indicator = (ImageView) view.findViewById(R.id.checkmark);
|
||||||
|
mask = view.findViewById(R.id.mask);
|
||||||
view.setTag(this);
|
view.setTag(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,9 +225,11 @@ public class ImageGridAdapter extends BaseAdapter {
|
||||||
if(mSelectedImages.contains(data)){
|
if(mSelectedImages.contains(data)){
|
||||||
// 设置选中状态
|
// 设置选中状态
|
||||||
indicator.setImageResource(R.drawable.btn_selected);
|
indicator.setImageResource(R.drawable.btn_selected);
|
||||||
|
mask.setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
// 未选择
|
// 未选择
|
||||||
indicator.setImageResource(R.drawable.btn_unselected);
|
indicator.setImageResource(R.drawable.btn_unselected);
|
||||||
|
mask.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
indicator.setVisibility(View.GONE);
|
indicator.setVisibility(View.GONE);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="#CDCECE" android:state_pressed="false" />
|
||||||
|
<item android:color="#232323" android:state_pressed="true" />
|
||||||
|
<item android:color="#232323" android:state_selected="true" />
|
||||||
|
<item android:color="#232323" android:state_checked="true" />
|
||||||
|
<item android:color="#CDCECE" />
|
||||||
|
</selector>
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:background="@android:color/black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<GridView
|
||||||
|
android:id="@+id/grid"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:horizontalSpacing="@dimen/space_size"
|
||||||
|
android:verticalSpacing="@dimen/space_size"
|
||||||
|
android:paddingBottom="?android:attr/actionBarSize"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:numColumns="auto_fit"
|
||||||
|
android:columnWidth="@dimen/image_size"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/timeline_area"
|
||||||
|
tools:text="2015年4月1日"
|
||||||
|
android:textColor="#CDCECE"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:paddingLeft="10sp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:background="#cc000000"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:clickable="true"
|
||||||
|
android:id="@+id/footer"
|
||||||
|
android:background="#cc000000"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?android:attr/actionBarSize">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/category_btn"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:textColor="@color/folder_text_color"
|
||||||
|
tools:text="所有图片"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:drawableRight="@drawable/text_indicator"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:background="@null"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_toLeftOf="@+id/preview"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:background="#8828292A"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/preview"
|
||||||
|
tools:text="预览(1)"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:minHeight="1dp"
|
||||||
|
android:minWidth="1dp"
|
||||||
|
android:background="@null"
|
||||||
|
android:textColor="@color/default_text_color"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
@ -31,28 +31,30 @@
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:id="@+id/footer"
|
android:id="@+id/footer"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:background="#cc000000"
|
android:background="#cc000000"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?android:attr/actionBarSize">
|
android:layout_height="?android:attr/actionBarSize">
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/category_btn"
|
android:id="@+id/category_btn"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:textColor="#CDCECE"
|
android:textColor="@color/folder_text_color"
|
||||||
tools:text="所有图片"
|
tools:text="所有图片"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:drawableRight="@drawable/text_indicator"
|
android:drawableRight="@drawable/text_indicator"
|
||||||
android:drawablePadding="5dp"
|
android:drawablePadding="5dp"
|
||||||
|
android:background="@null"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_toLeftOf="@+id/preview"
|
android:layout_toLeftOf="@+id/preview"
|
||||||
android:layout_width="1dp"
|
android:layout_width="1dp"
|
||||||
android:background="#8828292A"
|
android:background="#8828292A"
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
android:id="@+id/cover"
|
android:id="@+id/cover"
|
||||||
tools:src="@drawable/btn_back"
|
tools:src="@drawable/btn_back"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
|
@ -20,11 +20,13 @@
|
||||||
android:layout_height="@dimen/folder_cover_size" />
|
android:layout_height="@dimen/folder_cover_size" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:layout_toRightOf="@+id/cover"
|
||||||
|
android:layout_toLeftOf="@+id/indicator"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -36,6 +38,8 @@
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
android:id="@+id/size"
|
android:id="@+id/size"
|
||||||
tools:text="1张"
|
tools:text="1张"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
|
@ -47,12 +51,14 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
android:id="@+id/indicator"
|
android:id="@+id/indicator"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="20dp"
|
||||||
android:src="@drawable/default_check"
|
android:src="@drawable/default_check"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
@ -9,6 +9,13 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:visibility="gone"
|
||||||
|
android:id="@+id/mask"
|
||||||
|
android:background="#88000000"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/checkmark"
|
android:id="@+id/checkmark"
|
||||||
android:layout_gravity="top|right"
|
android:layout_gravity="top|right"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue