-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
119 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...rc/main/java/com/classichu/photoselector/customselector/ClassicPhotoSelectorActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.classichu.photoselector.customselector; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
|
||
import com.classichu.photoselector.R; | ||
import com.classichu.photoselector.customselector.bean.ImagePickerDataWrapper; | ||
import com.classichu.photoselector.imagespicker.ImagePickBean; | ||
import com.classichu.photoselector.imagespicker.ImagePickRecyclerView; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ClassicPhotoSelectorActivity extends AppCompatActivity { | ||
private ImagePickRecyclerView iprv; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_classic_photo_selector); | ||
|
||
|
||
iprv = (ImagePickRecyclerView) findViewById(R.id.id_iprv); | ||
iprv.setOnAddClickListener(new ImagePickRecyclerView.OnAddClickListener() { | ||
@Override | ||
public void onAddClick(View view, int maxPickImageCount, int hasImageCount) { | ||
//## ClassicSelectPhotoHelper.initBottomSheetDialog(MainActivity.this,false); | ||
|
||
Intent intent = new Intent(ClassicPhotoSelectorActivity.this, CustomPhotoSelectorActivity.class); | ||
Bundle bundle = new Bundle(); | ||
bundle.putBoolean("isToolbarTitleCenter", true); | ||
bundle.putInt("maxSelectCount", maxPickImageCount-hasImageCount); | ||
intent.putExtras(bundle); | ||
startActivityForResult(intent, 44544); | ||
|
||
} | ||
|
||
|
||
}); | ||
|
||
} | ||
|
||
@Override | ||
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | ||
super.onActivityResult(requestCode, resultCode, data); | ||
// | ||
if (requestCode == 44544) { | ||
if (resultCode == RESULT_OK) { | ||
ImagePickerDataWrapper imagePickerDataWrapper = (ImagePickerDataWrapper) data.getSerializableExtra("imagePickerDataWrapper"); | ||
List<String> selectedList = imagePickerDataWrapper.getSelectedImageList(); | ||
List<ImagePickBean> imagePickBeanList=new ArrayList<>(); | ||
for (String s : selectedList) { | ||
ImagePickBean imagePickBean=new ImagePickBean(); | ||
imagePickBean.setImagePathOrUrl(s); | ||
imagePickBean.setImageWebIdStr(s); | ||
imagePickBeanList.add(imagePickBean); | ||
} | ||
// Toast.makeText(this, "已选择:"+sb.toString(), Toast.LENGTH_SHORT).show(); | ||
iprv.addDataList(imagePickBeanList); | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
library/src/main/res/layout/activity_classic_photo_selector.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?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" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context="com.classichu.photoselector.customselector.ClassicPhotoSelectorActivity"> | ||
|
||
<com.classichu.photoselector.imagespicker.ImagePickRecyclerView | ||
android:id="@+id/id_iprv" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
/> | ||
|
||
</LinearLayout> |