Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
steadymoka committed Nov 13, 2019
1 parent 6bd330e commit 3b04ff9
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 71 deletions.
16 changes: 0 additions & 16 deletions app/src/main/java/moka/land/app/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_main)

findViewById<TextView>(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<TextView>(R.id.textView02).setOnClickListener {
Expand Down
55 changes: 0 additions & 55 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,4 @@
<attr name="motionPathRotate" />
<attr name="duration" />

<declare-styleable name="HashupIndicator">
<attr name="ci_width" format="dimension" />
<attr name="ci_height" format="dimension" />
<attr name="ci_margin" format="dimension" />
<attr name="ci_animator" format="reference" />
<attr name="ci_animator_reverse" format="reference" />
<attr name="ci_drawable" format="reference" />
<attr name="ci_drawable_unselected" format="reference" />

<attr name="ci_orientation" format="enum">
<!-- Defines an horizontal widget. -->
<enum name="horizontal" value="0" />
<!-- Defines a vertical widget. -->
<enum name="vertical" value="1" />
</attr>

<attr name="ci_gravity">
<!-- Push object to the top of its container, not changing its size. -->
<flag name="top" value="0x30" />
<!-- Push object to the bottom of its container, not changing its size. -->
<flag name="bottom" value="0x50" />
<!-- Push object to the left of its container, not changing its size. -->
<flag name="left" value="0x03" />
<!-- Push object to the right of its container, not changing its size. -->
<flag name="right" value="0x05" />
<!-- Place object in the vertical center of its container, not changing its size. -->
<flag name="center_vertical" value="0x10" />
<!-- Grow the vertical size of the object if needed so it completely fills its container. -->
<flag name="fill_vertical" value="0x70" />
<!-- Place object in the horizontal center of its container, not changing its size. -->
<flag name="center_horizontal" value="0x01" />
<!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
<flag name="fill_horizontal" value="0x07" />
<!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
<flag name="center" value="0x11" />
<!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
<flag name="fill" value="0x77" />
<!-- Additional option that can be set to have the top and/or bottom edges of
the child clipped to its container's bounds.
The clip will be based on the vertical gravity: a top gravity will clip the bottom
edge, a bottom gravity will clip the top edge, and neither will clip both edges. -->
<flag name="clip_vertical" value="0x80" />
<!-- Additional option that can be set to have the left and/or right edges of
the child clipped to its container's bounds.
The clip will be based on the horizontal gravity: a left gravity will clip the right
edge, a right gravity will clip the left edge, and neither will clip both edges. -->
<flag name="clip_horizontal" value="0x08" />
<!-- Push object to the beginning of its container, not changing its size. -->
<flag name="start" value="0x00800003" />
<!-- Push object to the end of its container, not changing its size. -->
<flag name="end" value="0x00800005" />
</attr>

</declare-styleable>

</resources>
Original file line number Diff line number Diff line change
@@ -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() {

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,10 @@ class ImageViewerLayout : AppCompatActivity() {
}
}

override fun onDestroy() {
ImageViewer.addHeader = null
ImageViewer.addFooter = null
super.onDestroy()
}

}

0 comments on commit 3b04ff9

Please sign in to comment.