Skip to content
Permalink
Browse files

Sneaker v2 - Moved project to Kotlin

  • Loading branch information...
Hammad Akram
Hammad Akram committed Jan 25, 2019
1 parent d4dccaa commit a98ea298f70907c5ec4520b8dcf64b88f809ea95
Showing with 996 additions and 961 deletions.
  1. +29 −0 .idea/codeStyles/Project.xml
  2. +0 −22 .idea/compiler.xml
  3. +0 −3 .idea/copyright/profiles_settings.xml
  4. 0 .idea/gradle.xml
  5. +16 −21 .idea/misc.xml
  6. +0 −1 .idea/modules.xml
  7. 0 .idea/runConfigurations.xml
  8. +1 −1 .idea/vcs.xml
  9. +16 −11 app/build.gradle
  10. +0 −26 app/src/androidTest/java/com/irozon/sneakersample/ExampleInstrumentedTest.java
  11. +0 −56 app/src/main/java/com/irozon/sneakersample/MainActivity.java
  12. +40 −0 app/src/main/java/com/irozon/sneakersample/MainActivity.kt
  13. +31 −0 app/src/main/java/com/irozon/sneakersample/MainFragment.kt
  14. BIN app/src/main/res/drawable/background.jpg
  15. +8 −0 app/src/main/res/drawable/round_background.xml
  16. BIN app/src/main/res/drawable/test.png
  17. +76 −17 app/src/main/res/layout/activity_main.xml
  18. +58 −0 app/src/main/res/layout/custom_view.xml
  19. +29 −0 app/src/main/res/layout/fragment_main.xml
  20. +3 −3 app/src/main/res/values/colors.xml
  21. +3 −0 app/src/main/res/values/strings.xml
  22. +0 −17 app/src/test/java/com/irozon/sneakersample/ExampleUnitTest.java
  23. +7 −4 build.gradle
  24. +2 −2 gradle/wrapper/gradle-wrapper.properties
  25. +10 −10 sneaker/build.gradle
  26. +0 −26 sneaker/src/androidTest/java/com/irozon/sneaker/ExampleInstrumentedTest.java
  27. +0 −659 sneaker/src/main/java/com/irozon/sneaker/Sneaker.java
  28. +505 −0 sneaker/src/main/java/com/irozon/sneaker/Sneaker.kt
  29. +87 −0 sneaker/src/main/java/com/irozon/sneaker/SneakerView.kt
  30. +0 −45 sneaker/src/main/java/com/irozon/sneaker/Utils.java
  31. +55 −0 sneaker/src/main/java/com/irozon/sneaker/Utils.kt
  32. +0 −11 sneaker/src/main/java/com/irozon/sneaker/interfaces/OnSneakerClickListener.java
  33. +11 −0 sneaker/src/main/java/com/irozon/sneaker/interfaces/OnSneakerClickListener.kt
  34. +0 −9 sneaker/src/main/java/com/irozon/sneaker/interfaces/OnSneakerDismissListener.java
  35. +9 −0 sneaker/src/main/java/com/irozon/sneaker/interfaces/OnSneakerDismissListener.kt
  36. +0 −17 sneaker/src/test/java/com/irozon/sneaker/ExampleUnitTest.java
@@ -0,0 +1,29 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
0 .idea/gradle.xml 100755 → 100644
No changes.
37 .idea/misc.xml 100755 → 100644
@@ -5,45 +5,40 @@
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<list size="10">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
1 .idea/modules.xml 100755 → 100644
@@ -3,7 +3,6 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Sneaker.iml" filepath="$PROJECT_DIR$/Sneaker.iml" />
<module fileurl="file://$PROJECT_DIR$/SneakerSample.iml" filepath="$PROJECT_DIR$/SneakerSample.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/sneaker/sneaker.iml" filepath="$PROJECT_DIR$/sneaker/sneaker.iml" />
</modules>
0 .idea/runConfigurations.xml 100755 → 100644
No changes.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>
@@ -1,12 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.irozon.sneakersample"
minSdkVersion 19
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -23,13 +25,16 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
implementation fileTree(include: ['*.jar'], dir: 'libs')

compile project(':sneaker')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

//implementation project(':sneaker')
implementation 'com.irozon.sneaker:sneaker:2.0.0'
}
repositories {
mavenCentral()
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,40 @@
package com.irozon.sneakersample

import android.graphics.Typeface
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.LayoutInflater
import android.widget.TextView
import android.widget.Toast
import com.irozon.sneaker.Sneaker
import com.irozon.sneaker.interfaces.OnSneakerDismissListener
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

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

with(supportFragmentManager.beginTransaction()) {
this.add(R.id.fragment, MainFragment())
this.commit()
}

btShowError.setOnClickListener {
Sneaker.with(this)
.setTitle("Error!!")
.setMessage("This is the error message")
.setTypeface(Typeface.createFromAsset(this.assets, "font/Slabo27px-Regular.ttf"))
.sneakError()
}
btShowSuccess.setOnClickListener {
val sneaker = Sneaker.with(viewGroup)
val view = LayoutInflater.from(this).inflate(R.layout.custom_view, sneaker.getView(), false)
view.findViewById<TextView>(R.id.tvInstall).setOnClickListener{
Toast.makeText(this, "Clicked", Toast.LENGTH_SHORT).show()
}
sneaker.sneakCustom(view)
}
}
}
@@ -0,0 +1,31 @@
package com.irozon.sneakersample

import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.irozon.sneaker.Sneaker
import kotlinx.android.synthetic.main.fragment_main.*

class MainFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
return inflater.inflate(R.layout.fragment_main, container, false)
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

btShowWarning.setOnClickListener {
Sneaker.with(this)
.setTitle("Warning!!")
.setCornerRadius(5, 5)
.setMessage("This is the warning message")
.sneakWarning()
}
}
}
Binary file not shown.
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="@android:color/black" />
<corners android:radius="5dp" />

</shape>
Binary file not shown.
Oops, something went wrong.

0 comments on commit a98ea29

Please sign in to comment.
You can’t perform that action at this time.