Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert app module to kotlin code #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.ldoublem.loadingView"
minSdkVersion 15
Expand All @@ -20,16 +21,20 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha3'
compile 'com.android.support:design:23.4.0'
compile "com.android.support:appcompat-v7:$project.ext.supportLibraryVersion"
compile 'com.android.support.constraint:constraint-layout:+'
compile "com.android.support:design:$project.ext.supportLibraryVersion"
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
androidTestCompile "com.android.support:support-annotations:$project.ext.supportLibraryVersion"
compile 'com.ldoublem.appleviewlib:appleviewlib:0.0.1'
compile project(path: ':loadingviewlib')
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
// compile 'com.ldoublem.loadingview:loadingviewlib:1.0'


}
repositories {
mavenCentral()
}
5 changes: 2 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MacActivity">

</activity>
<activity android:name=".MacActivity"/>
<activity android:name=".TestActivity"/>
</application>

</manifest>
42 changes: 0 additions & 42 deletions app/src/main/java/com/ldoublem/loadingView/MacActivity.java

This file was deleted.

42 changes: 42 additions & 0 deletions app/src/main/java/com/ldoublem/loadingView/MacActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.ldoublem.loadingView

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import android.view.WindowManager
import com.ldoublem.appleviewlib.LVComputer
import com.ldoublem.appleviewlib.LVComputerDesktop
import com.ldoublem.appleviewlib.LVComputerIpad

/**
* Created by steve_000 on 24/7/2017.
* for project LoadingView
* package name com.ldoublem.loadingView
*/
class MacActivity: AppCompatActivity(){

lateinit internal var mLVComputerDesktop: LVComputerDesktop
lateinit internal var mLVComputer: LVComputer

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN)//去掉信息栏
setContentView(R.layout.layout_mac)
mLVComputerDesktop = findViewById(R.id.lv_computer_desktop) as LVComputerDesktop
mLVComputer = findViewById(R.id.lv_computer) as LVComputer

}

fun startAnim(v: View) {
if (v.id == R.id.lv_computer_ipad) {
(v as LVComputerIpad).startAnim(4000)
mLVComputerDesktop.startAnim(4000)
mLVComputer.startAnim(4000)
} else if (v.id == R.id.lv_computer_desktop) {
(v as LVComputerDesktop).startAnim(4000)
} else if (v.id == R.id.lv_computer) {
(v as LVComputer).startAnim(6000)
}
}
}
Loading