This commit is contained in:
Ilia Kurtov 2016-09-14 13:48:01 +00:00 committed by GitHub
commit c28cfd7b8d
25 changed files with 297 additions and 245 deletions

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "me.nereo.multiimageselector"
minSdkVersion 12
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
@ -21,6 +21,8 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-compat:24.2.0'
compile 'com.android.support:design:24.2.0'
compile project(':multi-image-selector')
}

View File

@ -1,19 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}

View File

@ -1,6 +1,6 @@
#Wed May 18 11:49:16 CST 2016
#Tue Aug 23 14:55:54 MSK 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

View File

@ -1,20 +1,27 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
apply plugin: 'com.android.library'
allprojects {
repositories {
jcenter()
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
minSdkVersion 12
minSdkVersion 14
//noinspection OldTargetApi
targetSdkVersion 23
versionCode 1
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
resourcePrefix "mis_"
@ -22,6 +29,9 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-compat:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.squareup.picasso:picasso:2.4.0'
}

View File

@ -5,13 +5,13 @@ import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import java.io.File;
import java.util.ArrayList;
@ -22,43 +22,52 @@ import java.util.ArrayList;
* Updated by nereo on 2016/1/19.
* Updated by nereo on 2016/5/18.
*/
public class MultiImageSelectorActivity extends AppCompatActivity
implements MultiImageSelectorFragment.Callback{
public class MultiImageSelectorActivity extends AppCompatActivity implements MultiImageSelectorFragment.Callback {
// Single choice
public static final int MODE_SINGLE = 0;
// Multi choice
public static final int MODE_MULTI = 1;
/** Max image sizeint{@link #DEFAULT_IMAGE_SIZE} by default */
/**
* Max image sizeint{@link #DEFAULT_IMAGE_SIZE} by default
*/
public static final String EXTRA_SELECT_COUNT = "max_select_count";
/** Select mode{@link #MODE_MULTI} by default */
/**
* Select mode{@link #MODE_MULTI} by default
*/
public static final String EXTRA_SELECT_MODE = "select_count_mode";
/** Whether show cameratrue by default */
/**
* Whether show cameratrue by default
*/
public static final String EXTRA_SHOW_CAMERA = "show_camera";
/** Result data setArrayList<String>*/
/**
* Result data setArrayList<String>
*/
public static final String EXTRA_RESULT = "select_result";
/** Original data set */
/**
* Original data set
*/
public static final String EXTRA_DEFAULT_SELECTED_LIST = "default_list";
// Default image size
private static final int DEFAULT_IMAGE_SIZE = 9;
@NonNull
private ArrayList<String> resultList = new ArrayList<>();
private Button mSubmitButton;
private int mDefaultCount = DEFAULT_IMAGE_SIZE;
private View submitButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.MIS_NO_ACTIONBAR);
setContentView(R.layout.mis_activity_default);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setStatusBarColor(Color.BLACK);
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if(toolbar != null){
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
@ -68,37 +77,36 @@ public class MultiImageSelectorActivity extends AppCompatActivity
}
final Intent intent = getIntent();
mDefaultCount = intent.getIntExtra(EXTRA_SELECT_COUNT, DEFAULT_IMAGE_SIZE);
final int mDefaultCount = intent.getIntExtra(EXTRA_SELECT_COUNT, DEFAULT_IMAGE_SIZE);
final int mode = intent.getIntExtra(EXTRA_SELECT_MODE, MODE_MULTI);
final boolean isShow = intent.getBooleanExtra(EXTRA_SHOW_CAMERA, true);
if(mode == MODE_MULTI && intent.hasExtra(EXTRA_DEFAULT_SELECTED_LIST)) {
if (mode == MODE_MULTI && intent.hasExtra(EXTRA_DEFAULT_SELECTED_LIST)) {
resultList = intent.getStringArrayListExtra(EXTRA_DEFAULT_SELECTED_LIST);
}
mSubmitButton = (Button) findViewById(R.id.commit);
if(mode == MODE_MULTI){
updateDoneText(resultList);
mSubmitButton.setVisibility(View.VISIBLE);
mSubmitButton.setOnClickListener(new View.OnClickListener() {
submitButton = findViewById(R.id.multi_image_selector_submit_button);
if (mode == MODE_MULTI) {
updateSubmitButton();
submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(resultList != null && resultList.size() >0){
public void onClick(final View v) {
if (!resultList.isEmpty()) {
// Notify success
Intent data = new Intent();
data.putStringArrayListExtra(EXTRA_RESULT, resultList);
setResult(RESULT_OK, data);
}else{
} else {
setResult(RESULT_CANCELED);
}
finish();
}
});
}else{
mSubmitButton.setVisibility(View.GONE);
} else {
submitButton.setVisibility(View.GONE);
}
if(savedInstanceState == null){
Bundle bundle = new Bundle();
if (savedInstanceState == null) {
final Bundle bundle = new Bundle();
bundle.putInt(MultiImageSelectorFragment.EXTRA_SELECT_COUNT, mDefaultCount);
bundle.putInt(MultiImageSelectorFragment.EXTRA_SELECT_MODE, mode);
bundle.putBoolean(MultiImageSelectorFragment.EXTRA_SHOW_CAMERA, isShow);
@ -122,26 +130,13 @@ public class MultiImageSelectorActivity extends AppCompatActivity
return super.onOptionsItemSelected(item);
}
/**
* Update done button by select image data
* @param resultList selected image data
*/
private void updateDoneText(ArrayList<String> resultList){
int size = 0;
if(resultList == null || resultList.size()<=0){
mSubmitButton.setText(R.string.mis_action_done);
mSubmitButton.setEnabled(false);
}else{
size = resultList.size();
mSubmitButton.setEnabled(true);
}
mSubmitButton.setText(getString(R.string.mis_action_button_string,
getString(R.string.mis_action_done), size, mDefaultCount));
private void updateSubmitButton() {
submitButton.setEnabled(!resultList.isEmpty());
}
@Override
public void onSingleImageSelected(String path) {
Intent data = new Intent();
public void onSingleImageSelected(final String path) {
final Intent data = new Intent();
resultList.add(path);
data.putStringArrayListExtra(EXTRA_RESULT, resultList);
setResult(RESULT_OK, data);
@ -149,24 +144,24 @@ public class MultiImageSelectorActivity extends AppCompatActivity
}
@Override
public void onImageSelected(String path) {
if(!resultList.contains(path)) {
public void onImageSelected(final String path) {
if (!resultList.contains(path)) {
resultList.add(path);
}
updateDoneText(resultList);
updateSubmitButton();
}
@Override
public void onImageUnselected(String path) {
if(resultList.contains(path)){
public void onImageUnselected(final String path) {
if (resultList.contains(path)) {
resultList.remove(path);
}
updateDoneText(resultList);
updateSubmitButton();
}
@Override
public void onCameraShot(File imageFile) {
if(imageFile != null) {
public void onCameraShot(final File imageFile) {
if (imageFile != null) {
// notify system the image has change
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(imageFile)));
@ -177,4 +172,4 @@ public class MultiImageSelectorActivity extends AppCompatActivity
finish();
}
}
}
}

View File

@ -41,7 +41,7 @@ public class ImageGridAdapter extends BaseAdapter {
final int mGridWidth;
public ImageGridAdapter(Context context, boolean showCamera, int column){
public ImageGridAdapter(Context context, boolean showCamera, int column) {
mContext = context;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.showCamera = showCamera;
@ -51,38 +51,41 @@ public class ImageGridAdapter extends BaseAdapter {
Point size = new Point();
wm.getDefaultDisplay().getSize(size);
width = size.x;
}else{
} else {
width = wm.getDefaultDisplay().getWidth();
}
mGridWidth = width / column;
}
/**
* 显示选择指示器
*
* @param b
*/
public void showSelectIndicator(boolean b) {
showSelectIndicator = b;
}
public void setShowCamera(boolean b){
if(showCamera == b) return;
public void setShowCamera(boolean b) {
if (showCamera == b) return;
showCamera = b;
notifyDataSetChanged();
}
public boolean isShowCamera(){
public boolean isShowCamera() {
return showCamera;
}
/**
* 选择某个图片改变选择状态
*
* @param image
*/
public void select(Image image) {
if(mSelectedImages.contains(image)){
if (mSelectedImages.contains(image)) {
mSelectedImages.remove(image);
}else{
} else {
mSelectedImages.add(image);
}
notifyDataSetChanged();
@ -90,24 +93,25 @@ public class ImageGridAdapter extends BaseAdapter {
/**
* 通过图片路径设置默认选择
*
* @param resultList
*/
public void setDefaultSelected(ArrayList<String> resultList) {
for(String path : resultList){
for (String path : resultList) {
Image image = getImageByPath(path);
if(image != null){
if (image != null) {
mSelectedImages.add(image);
}
}
if(mSelectedImages.size() > 0){
if (mSelectedImages.size() > 0) {
notifyDataSetChanged();
}
}
private Image getImageByPath(String path){
if(mImages != null && mImages.size()>0){
for(Image image : mImages){
if(image.path.equalsIgnoreCase(path)){
private Image getImageByPath(String path) {
if (mImages != null && mImages.size() > 0) {
for (Image image : mImages) {
if (image.path.equalsIgnoreCase(path)) {
return image;
}
}
@ -117,14 +121,15 @@ public class ImageGridAdapter extends BaseAdapter {
/**
* 设置数据集
*
* @param images
*/
public void setData(List<Image> images) {
mSelectedImages.clear();
if(images != null && images.size()>0){
if (images != null && images.size() > 0) {
mImages = images;
}else{
} else {
mImages.clear();
}
notifyDataSetChanged();
@ -137,25 +142,25 @@ public class ImageGridAdapter extends BaseAdapter {
@Override
public int getItemViewType(int position) {
if(showCamera){
return position==0 ? TYPE_CAMERA : TYPE_NORMAL;
if (showCamera) {
return position == 0 ? TYPE_CAMERA : TYPE_NORMAL;
}
return TYPE_NORMAL;
}
@Override
public int getCount() {
return showCamera ? mImages.size()+1 : mImages.size();
return showCamera ? mImages.size() + 1 : mImages.size();
}
@Override
public Image getItem(int i) {
if(showCamera){
if(i == 0){
if (showCamera) {
if (i == 0) {
return null;
}
return mImages.get(i-1);
}else{
return mImages.get(i - 1);
} else {
return mImages.get(i);
}
}
@ -168,22 +173,22 @@ public class ImageGridAdapter extends BaseAdapter {
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if(isShowCamera()){
if(i == 0){
if (isShowCamera()) {
if (i == 0) {
view = mInflater.inflate(R.layout.mis_list_item_camera, viewGroup, false);
return view;
}
}
ViewHolder holder;
if(view == null){
if (view == null) {
view = mInflater.inflate(R.layout.mis_list_item_image, viewGroup, false);
holder = new ViewHolder(view);
}else{
} else {
holder = (ViewHolder) view.getTag();
}
if(holder != null) {
if (holder != null) {
holder.bindData(getItem(i));
}
@ -193,30 +198,30 @@ public class ImageGridAdapter extends BaseAdapter {
class ViewHolder {
ImageView image;
ImageView indicator;
View mask;
// View mask;
ViewHolder(View view){
ViewHolder(View view) {
image = (ImageView) view.findViewById(R.id.image);
indicator = (ImageView) view.findViewById(R.id.checkmark);
mask = view.findViewById(R.id.mask);
// mask = view.findViewById(R.id.mask);
view.setTag(this);
}
void bindData(final Image data){
if(data == null) return;
void bindData(final Image data) {
if (data == null) return;
// 处理单选和多选状态
if(showSelectIndicator){
if (showSelectIndicator) {
indicator.setVisibility(View.VISIBLE);
if(mSelectedImages.contains(data)){
if (mSelectedImages.contains(data)) {
// 设置选中状态
indicator.setImageResource(R.drawable.mis_btn_selected);
mask.setVisibility(View.VISIBLE);
}else{
indicator.setImageResource(R.drawable.mis_checked_button);
// mask.setVisibility(View.VISIBLE);
} else {
// 未选择
indicator.setImageResource(R.drawable.mis_btn_unselected);
mask.setVisibility(View.GONE);
indicator.setImageResource(R.drawable.mis_unchecked_button);
// mask.setVisibility(View.GONE);
}
}else{
} else {
indicator.setVisibility(View.GONE);
}
File imageFile = new File(data.path);
@ -229,7 +234,7 @@ public class ImageGridAdapter extends BaseAdapter {
.resize(mGridWidth, mGridWidth)
.centerCrop()
.into(image);
}else{
} else {
image.setImageResource(R.drawable.mis_default_error);
}
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#999" android:state_enabled="false"/>
<item android:color="@color/mis_global_main_dark_blue"/>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/mis_global_black_12">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
</shape>
</item>
</ripple>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/mis_global_white_12">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
</shape>
</item>
</ripple>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/mis_global_white_12" android:state_pressed="true"/>
</selector>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/mis_global_black_12" android:state_pressed="true"/>
</selector>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/mis_global_white_12" android:state_pressed="true"/>
</selector>

View File

@ -1,47 +1,45 @@
<?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">
xmlns:tools="http://schemas.android.com/tools"
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/mis_space_size"
android:verticalSpacing="@dimen/mis_space_size"
android:paddingBottom="?android:attr/actionBarSize"
android:clipToPadding="false"
android:columnWidth="@dimen/mis_image_size"
android:horizontalSpacing="@dimen/mis_space_size"
android:numColumns="auto_fit"
android:columnWidth="@dimen/mis_image_size"/>
android:paddingBottom="?android:attr/actionBarSize"
android:verticalSpacing="@dimen/mis_space_size"/>
<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">
android:layout_height="?android:attr/actionBarSize"
android:layout_alignParentBottom="true"
android:background="#cc000000"
android:clickable="true">
<Button
android:id="@+id/category_btn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:background="@null"
android:drawablePadding="5dp"
android:drawableRight="@drawable/mis_text_indicator"
android:ellipsize="end"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_centerVertical="true"
android:textColor="@color/mis_folder_text_color"
tools:text="所有图片"
android:textSize="16sp"
android:gravity="center_vertical"
android:drawableRight="@drawable/mis_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" />
android:textColor="#cfcfcf"
android:textSize="16sp"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -1,40 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="#181819"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
<android.support.design.widget.AppBarLayout
android:id="@+id/main_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/mis_actionbar_color"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:minHeight="?android:attr/actionBarSize">
android:layout_height="56dp"
android:background="@color/mis_global_main_gray">
<Button
android:id="@+id/commit"
android:background="@drawable/mis_action_btn"
android:minHeight="1dp"
android:minWidth="1dp"
android:layout_marginRight="16dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="@color/mis_default_text_color"
android:textSize="14sp"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentInsetLeft="17dp"
app:contentInsetStart="17dp">
</android.support.v7.widget.Toolbar>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textColor="@color/mis_global_main_dark_gray"
android:textSize="20sp"
android:text="@string/mis_toolbar_title"/>
<TextView
android:id="@+id/multi_image_selector_submit_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:background="@drawable/mis_global_dark_selector"
android:textColor="@color/mis_main_menu_button_selector"
android:textSize="14sp"
android:text="@string/mis_toolbar_submit_button_text"
android:paddingRight="19dp"
android:paddingLeft="19dp"
android:textAllCaps="true"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/image_grid"
android:background="@color/mis_global_main_gray"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"/>
</LinearLayout>

View File

@ -1,45 +1,43 @@
<?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">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<GridView
android:id="@+id/grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:horizontalSpacing="@dimen/mis_space_size"
android:verticalSpacing="@dimen/mis_space_size"
android:paddingBottom="?android:attr/actionBarSize"
android:clipToPadding="false"
android:numColumns="3"/>
android:horizontalSpacing="@dimen/mis_space_size"
android:numColumns="3"
android:paddingBottom="?android:attr/actionBarSize"
android:verticalSpacing="@dimen/mis_space_size"/>
<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">
android:layout_height="?android:attr/actionBarSize"
android:layout_alignParentBottom="true"
android:background="#cc000000"
android:clickable="true">
<Button
android:id="@+id/category_btn"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:background="@null"
android:drawablePadding="5dp"
android:drawableRight="@drawable/mis_text_indicator"
android:ellipsize="end"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:layout_centerVertical="true"
android:textColor="@color/mis_folder_text_color"
tools:text="所有图片"
android:textSize="16sp"
android:gravity="center_vertical"
android:drawableRight="@drawable/mis_text_indicator"
android:drawablePadding="5dp"
android:background="@null"
android:singleLine="true"
android:ellipsize="end"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
android:textColor="@color/mis_folder_text_color"
android:textSize="16sp"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -1,17 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<me.nereo.multi_image_selector.view.SquareFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#343535"
android:layout_width="match_parent" android:layout_height="match_parent">
<me.nereo.multi_image_selector.view.SquareFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#343535">
<TextView
android:drawableTop="@drawable/mis_asy"
android:drawablePadding="10dp"
android:layout_gravity="center"
android:text="@string/mis_tip_take_photo"
android:textSize="14sp"
android:textColor="#CDCECE"
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="4dp"
android:drawablePadding="7dp"
android:drawableTop="@drawable/mis_photo_icon"
android:gravity="center_horizontal"
android:text="@string/mis_tip_take_photo"
android:textColor="#fff"
android:textSize="14sp"/>
</me.nereo.multi_image_selector.view.SquareFrameLayout>

View File

@ -1,28 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<me.nereo.multi_image_selector.view.SquareFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<me.nereo.multi_image_selector.view.SquareFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<me.nereo.multi_image_selector.view.SquaredImageView
android:id="@+id/image"
android:scaleType="centerInside"
android:src="@drawable/mis_default_error"
android:layout_width="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" />
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/mis_default_error"/>
<ImageView
android:id="@+id/checkmark"
android:layout_gravity="top|right"
android:layout_marginTop="5.5dp"
android:layout_marginRight="5.5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/mis_btn_unselected"/>
android:layout_gravity="top|right"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:src="@drawable/mis_unchecked_button"/>
</me.nereo.multi_image_selector.view.SquareFrameLayout>

View File

@ -1,4 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="mis_actionbar_color">#21282C</color>
<color name="mis_global_main_gray">#e8e8e8</color>
<color name="mis_global_main_dark_gray">#333</color>
<color name="mis_global_black_12">#1e000000</color>
<color name="mis_global_white_12">#1effffff</color>
<color name="mis_global_main_dark_blue">#205090</color>
<color name="mis_camera_item_background">#343535</color>
</resources>

View File

@ -1,17 +1,19 @@
<resources>
<string name="mis_folder_all">All Images</string>
<string name="mis_preview">Preview</string>
<string name="mis_msg_no_camera">No system camera found</string>
<string name="mis_msg_amount_limit">Select images amount is limit</string>
<string name="mis_folder_all">Все изображения</string>
<string name="mis_preview">Предпросмотр</string>
<string name="mis_msg_no_camera">Не найдена камера</string>
<string name="mis_msg_amount_limit">Выбрано максимум изображений</string>
<string name="mis_action_done">Done</string>
<string name="mis_action_button_string">%1$s(%2$d/%3$d)</string>
<string name="mis_photo_unit">Shot</string>
<string name="mis_tip_take_photo">Take photo</string>
<string name="mis_error_image_not_exist">Image error</string>
<string name="mis_error_no_permission">Has no permission</string>
<string name="mis_photo_unit">Снять</string>
<string name="mis_tip_take_photo">Сделать фото</string>
<string name="mis_error_image_not_exist">Ошибка изображения</string>
<string name="mis_error_no_permission">Нет разрешения</string>
<string name="mis_permission_dialog_title">Permission Deny</string>
<string name="mis_permission_dialog_ok">OK</string>
<string name="mis_permission_dialog_cancel">CANCEL</string>
<string name="mis_permission_dialog_ok">ОК</string>
<string name="mis_permission_dialog_cancel">ОТМЕНА</string>
<string name="mis_permission_rationale">Storage read permission is needed to pick files.</string>
<string name="mis_permission_rationale_write_storage">Storage write permission is needed to save the image.</string>
<string name="mis_toolbar_title">Галерея</string>
<string name="mis_toolbar_submit_button_text">Добавить</string>
</resources>