Skip to content

Commit

Permalink
library initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
smhdk committed Oct 24, 2018
0 parents commit 81b3f55
Show file tree
Hide file tree
Showing 73 changed files with 2,039 additions and 0 deletions.
226 changes: 226 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# Created by .ignore support plugin (hsz.mobi)
### Android template
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries
.idea/modules.xml
app/build
# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json
### Kotlin template
# Compiled class file

# Log file

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# CMake
cmake-build-debug/


## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ


# JIRA plugin
atlassian-ide-plugin.xml


# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
vcs.xml

workspace.xml
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:

# Sensitive or high-churn files:

# Gradle:

# CMake
cmake-build-release/

# Mongo Explorer plugin:

## File-based project format:

## Plugin-specific files:

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# Crashlytics plugin (for Android Studio and IntelliJ)
### Android template
# Built application files

# Files for the ART/Dalvik VM

# Java class files

# Generated files

# Gradle files

# Local configuration file (sdk path, etc)

# Proguard folder generated by Eclipse

# Log Files

# Android Studio Navigation editor temp files

# Android Studio captures folder

# IntelliJ

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later

# Google Services (e.g. APIs or Firebase)

# Freeline
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:

# Sensitive or high-churn files:

# Gradle:

# CMake

# Mongo Explorer plugin:

## File-based project format:

## Plugin-specific files:

# IntelliJ

# mpeltonen/sbt-idea plugin

# JIRA plugin

# Cursive Clojure plugin

# Crashlytics plugin (for Android Studio and IntelliJ)
### Android template
# Built application files

# Files for the ART/Dalvik VM

# Java class files

# Generated files

# Gradle files

# Local configuration file (sdk path, etc)

# Proguard folder generated by Eclipse

# Log Files

# Android Studio Navigation editor temp files

# Android Studio captures folder

# IntelliJ

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later

# Google Services (e.g. APIs or Firebase)

.idea
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
34 changes: 34 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.kodmap.app.kmpopupslider"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':library')
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.kodmap.app.kmpopupslider

import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.kodmap.app.kmpopupslider", appContext.packageName)
}
}
24 changes: 24 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kodmap.app.kmpopupslider">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".test.TestActivity"></activity>
</application>

</manifest>
60 changes: 60 additions & 0 deletions app/src/main/java/com/kodmap/app/kmpopupslider/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.kodmap.app.kmpopupslider

import android.os.Bundle
import android.support.v4.content.ContextCompat
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
import com.kodmap.app.library.model.BaseItem

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val drawableList = arrayListOf<Int>()
drawableList.add(R.drawable.drawable1)
drawableList.add(R.drawable.drawable2)
drawableList.add(R.drawable.drawable3)
drawableList.add(R.drawable.drawable4)
drawableList.add(R.drawable.drawable5)

val urlList = arrayListOf<String>()
for (i in 0..10000) {
urlList.add("https://via.placeholder.com/800x1000/$i/0.png&text=Url+Image+$i")
}

val baseItemList = arrayListOf<BaseItem>()
for (i in 0..10) {
if (i % 2 == 0) {
baseItemList.add(BaseItem(imageUrl = urlList[i]))
} else {
baseItemList.add(BaseItem(drawableId = drawableList[i % 5]))
}
}


val button = findViewById<Button>(R.id.showDialog)
button.setOnClickListener(object : View.OnClickListener {
override fun onClick(v: View?) {
PopopDialogBuilder(this@MainActivity)
.setList(urlList)
.setHeaderBackgroundColor(android.R.color.holo_blue_light)
.setDialogBackgroundColor(R.color.color_dialog_bg)
.setCloseDrawable(ContextCompat.getDrawable(this@MainActivity, R.drawable.ic_close_white_24dp)!!)
.setLoadingView(R.layout.loading_view)
.setDialogStyle(R.style.DialogStyle)
.showThumbSlider(true)
.setSliderImageScaleType(ScaleType.FIT_XY)
.setSelectorIndicator(R.drawable.sample_indicator_selector)
.build()
.show();
}
})


}
}
Loading

0 comments on commit 81b3f55

Please sign in to comment.