Skip to content

Commit

Permalink
change bottomsheet class name
Browse files Browse the repository at this point in the history
  • Loading branch information
gun0912 committed Aug 30, 2016
1 parent 3c3f474 commit 1c1e7cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ android {
}


repositories {
maven { url "https://jitpack.io" }
}


dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import java.util.ArrayList;

import gun0912.tedbottompicker.CustomBottomSheetDialogFragment;
import gun0912.tedbottompicker.TedBottomPicker;

public class MainActivity extends AppCompatActivity {

Expand All @@ -41,8 +41,8 @@ public void onClick(View view) {
@Override
public void onPermissionGranted() {

CustomBottomSheetDialogFragment bottomSheetDialogFragment = new CustomBottomSheetDialogFragment.Builder(MainActivity.this)
.setOnImageSelectedListener(new CustomBottomSheetDialogFragment.OnImageSelectedListener() {
TedBottomPicker tedBottomPicker = new TedBottomPicker.Builder(MainActivity.this)
.setOnImageSelectedListener(new TedBottomPicker.OnImageSelectedListener() {
@Override
public void onImageSelected(Uri uri) {
Log.d("ted","uri: "+uri);
Expand All @@ -58,7 +58,7 @@ public void onImageSelected(Uri uri) {
.setPeekHeight(getResources().getDisplayMetrics().heightPixels/2)
.create();

bottomSheetDialogFragment.show(getSupportFragmentManager());
tedBottomPicker.show(getSupportFragmentManager());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

import gun0912.tedbottompicker.adapter.ImageGalleryAdapter;

public class CustomBottomSheetDialogFragment extends BottomSheetDialogFragment {
public class TedBottomPicker extends BottomSheetDialogFragment {

public static final String TAG = "ted";
static final int REQ_CODE_CAMERA = 1;
Expand Down Expand Up @@ -336,7 +336,7 @@ public Builder setPeekHeightResId(@DimenRes int dimenResId) {
return this;
}

public CustomBottomSheetDialogFragment create() {
public TedBottomPicker create() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
&& ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
throw new RuntimeException("Missing required WRITE_EXTERNAL_STORAGE permission. Did you remember to request it first?");
Expand All @@ -346,7 +346,7 @@ public CustomBottomSheetDialogFragment create() {
throw new RuntimeException("You have to setOnImageSelectedListener() for receive selected Uri");
}

CustomBottomSheetDialogFragment customBottomSheetDialogFragment = new CustomBottomSheetDialogFragment();
TedBottomPicker customBottomSheetDialogFragment = new TedBottomPicker();

customBottomSheetDialogFragment.builder = this;
return customBottomSheetDialogFragment;
Expand Down

0 comments on commit 1c1e7cf

Please sign in to comment.