Skip to content

Commit

Permalink
- Updated sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
smhdk committed Oct 25, 2018
1 parent c89f1fd commit db740d2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
30 changes: 18 additions & 12 deletions app/src/main/java/com/kodmap/app/kmpopupslider/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.kodmap.app.kmpopupslider

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import android.widget.Button
import com.kodmap.app.library.PopopDialogBuilder
import com.kodmap.app.library.constant.ScaleType
Expand Down Expand Up @@ -35,27 +34,34 @@ class MainActivity : AppCompatActivity() {
}
}

val dialog = PopopDialogBuilder(this@MainActivity)
.setList(urlList)
.setHeaderBackgroundColor(android.R.color.holo_blue_light)
val dialog1 = PopopDialogBuilder(this@MainActivity)
.setList(baseItemList)
.setHeaderBackgroundColor(android.R.color.holo_blue_dark)
.setDialogBackgroundColor(R.color.color_dialog_bg)
.setCloseDrawable(R.drawable.ic_close_white_24dp)
.setLoadingView(R.layout.loading_view)
.setDialogStyle(R.style.DialogStyle)
.showThumbSlider(true)
.showThumbSlider(false)
.setSliderImageScaleType(ScaleType.FIT_XY)
.setSelectorIndicator(R.drawable.sample_indicator_selector)
.build()

val dialog2 = PopopDialogBuilder(this@MainActivity)
.setList(urlList)
.setHeaderBackgroundColor(android.R.color.holo_blue_bright)
.setDialogBackgroundColor(R.color.color_dialog_bg)
.setCloseDrawable(R.drawable.ic_close_white_24dp)
.setLoadingView(R.layout.loading_view)
.setDialogStyle(R.style.DialogStyle)
.showThumbSlider(true)
.setSliderImageScaleType(ScaleType.FIT_XY)
.build()

val button = findViewById<Button>(R.id.showDialog)
button.setOnClickListener(object : View.OnClickListener {
override fun onClick(v: View?) {

dialog.show()
}
})
val button1 = findViewById<Button>(R.id.dialog1)
button1.setOnClickListener { dialog1.show() }

val button2 = findViewById<Button>(R.id.dialog2)
button2.setOnClickListener { dialog2.show() }

}
}
21 changes: 18 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".MainActivity">

<Button
android:id="@+id/showDialog"
android:id="@+id/dialog1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/dialog2"
android:layout_centerInParent="true"
android:layout_margin="16dp"
android:background="@android:color/holo_blue_dark"
android:elevation="4dp"
android:padding="16dp"
android:text="SHOW DIALOG" />
android:text="SHOW DIALOG WITH INDICATOR SELECTOR"
android:textColor="@android:color/white" />

<Button
android:id="@+id/dialog2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="16dp"
android:padding="16dp"
android:background="@android:color/holo_blue_bright"
android:elevation="4dp"
android:text="SHOW DIALOG WITH THUMBNAIL SELECTOR"
android:textColor="@android:color/white" />

</RelativeLayout>
4 changes: 2 additions & 2 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorPrimary">#ff00ddff</color>
<color name="colorPrimaryDark">#ff0099cc</color>
<color name="colorAccent">#FF4081</color>
</resources>

0 comments on commit db740d2

Please sign in to comment.