diff --git a/app/src/main/java/moka/land/app/main/MainActivity.kt b/app/src/main/java/moka/land/app/main/MainActivity.kt index 3360b0f..20b2f73 100644 --- a/app/src/main/java/moka/land/app/main/MainActivity.kt +++ b/app/src/main/java/moka/land/app/main/MainActivity.kt @@ -17,22 +17,6 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) findViewById(R.id.textView01).setOnClickListener { - val header = OverlayView(this, R.layout.layout_header) - header.getTextView(R.id.textViewTitle)?.setOnClickListener { - ImageViewer.finish() - } - ImageViewer.onPageSelected = { position: Int -> - Log.wtf("aaaaaa", "position: ${position}") - } - - ImageViewer.addHeader(header) - ImageViewer.show( - this@MainActivity, - arrayListOf( - "https://s3.ap-northeast-2.amazonaws.com/ai.hashup.co/191014/____072728.png", - "https://s3.ap-northeast-2.amazonaws.com/ai.hashup.co/191014/room708_official_69452159_402669076973677_6822960396756110049_n_083606.jpg", - "https://s3.ap-northeast-2.amazonaws.com/ai.hashup.co/191014/____072728.png"), - 1) } findViewById(R.id.textView02).setOnClickListener { diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 493648d..e6810db 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -9,59 +9,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/imagehelper/src/main/java/io/haruharu/imagehelper/picker/ImagePicker.kt b/imagehelper/src/main/java/io/haruharu/imagehelper/picker/ImagePicker.kt new file mode 100644 index 0000000..61357ec --- /dev/null +++ b/imagehelper/src/main/java/io/haruharu/imagehelper/picker/ImagePicker.kt @@ -0,0 +1,55 @@ +package io.haruharu.imagehelper.picker + +import android.annotation.SuppressLint +import android.os.Bundle +import android.os.Handler +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.appcompat.app.AppCompatDialogFragment +import androidx.fragment.app.DialogFragment +import io.haruharu.imagehelper.R + +class ImagePicker : AppCompatDialogFragment() { + + override fun onCreate(savedInstanceState: Bundle?) { + setStyle(DialogFragment.STYLE_NO_TITLE, 0) + super.onCreate(savedInstanceState) + } + +// override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { +// return if (viewModel.flagOfDirectAlbum) { +// Handler().postDelayed({ pickImageFromAlbum() }, 600) +// inflater.inflate(R.layout.dialog_empty, null) +// } +// else { +// inflater.inflate(R.layout.dialog_image_picker, null) +// } +// } +// +// override fun onViewCreated(view: View, savedInstanceState: Bundle?) { +// super.onViewCreated(view, savedInstanceState) +// +// if (!viewModel.flagOfDirectAlbum) { +// initViews() +// bindViews() +// } +// } + + @SuppressLint("MissingSuperCall") + override fun onResume() { + super.onResume() + dialog?.window!!.setLayout((280 * context!!.resources.displayMetrics.densityDpi / 160.0).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) + } + + // - + + private fun initViews() { + + } + + private fun bindViews() { + + } + +} diff --git a/imagehelper/src/main/java/io/haruharu/imagehelper/viewer/ImageViewerLayout.kt b/imagehelper/src/main/java/io/haruharu/imagehelper/viewer/ImageViewerLayout.kt index ac5d4e9..310c8d3 100644 --- a/imagehelper/src/main/java/io/haruharu/imagehelper/viewer/ImageViewerLayout.kt +++ b/imagehelper/src/main/java/io/haruharu/imagehelper/viewer/ImageViewerLayout.kt @@ -52,4 +52,10 @@ class ImageViewerLayout : AppCompatActivity() { } } + override fun onDestroy() { + ImageViewer.addHeader = null + ImageViewer.addFooter = null + super.onDestroy() + } + }