Skip to content

Commit

Permalink
- convert to koltin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycoola committed Dec 20, 2018
1 parent 316b7b9 commit d1738e3
Show file tree
Hide file tree
Showing 126 changed files with 1,209 additions and 13,737 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

4 changes: 4 additions & 0 deletions .idea/encodings.xml

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

30 changes: 29 additions & 1 deletion .idea/misc.xml

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

61 changes: 29 additions & 32 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,55 +37,52 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':liband')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'androidx.room:room-runtime:2.1.0-alpha02'
annotationProcessor "androidx.room:room-compiler:2.1.0-alpha02"
testImplementation 'androidx.room:room-testing:2.1.0-alpha02'
implementation 'androidx.room:room-runtime:2.1.0-alpha03'
annotationProcessor "androidx.room:room-compiler:2.1.0-alpha03"
testImplementation 'androidx.room:room-testing:2.1.0-alpha03'

implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0"
implementation "androidx.lifecycle:lifecycle-reactivestreams:2.0.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha01'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0-alpha01'
implementation 'androidx.lifecycle:lifecycle-reactivestreams:2.1.0-alpha01'
testImplementation "androidx.arch.core:core-testing:2.0.0"

implementation 'com.google.android.gms:play-services-maps:16.0.0'

implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha01'
implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'



implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.10'
implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation "com.google.android.material:material:1.0.0"
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'com.google.android.material:material:1.1.0-alpha02'

// architecture components
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
implementation "androidx.lifecycle:lifecycle-runtime:2.0.0"
implementation "androidx.room:room-runtime:2.1.0-alpha02"
implementation "androidx.paging:paging-runtime:2.1.0-beta01"
kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
kapt "androidx.room:room-compiler:2.1.0-alpha02"
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha01'
implementation 'androidx.lifecycle:lifecycle-runtime:2.1.0-alpha01'
implementation "androidx.room:room-runtime:2.1.0-alpha03"
implementation "androidx.paging:paging-runtime:2.1.0-rc01"
kapt 'androidx.lifecycle:lifecycle-compiler:2.1.0-alpha01'
kapt "androidx.room:room-compiler:2.1.0-alpha03"

// retrofit
implementation "com.squareup.retrofit2:retrofit:2.4.0"
implementation"com.squareup.retrofit2:converter-gson:2.4.0"
implementation "com.squareup.retrofit2:retrofit-mock:2.4.0"
implementation "com.squareup.okhttp3:logging-interceptor:3.10.0"
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:retrofit-mock:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.0'

// testing
testImplementation "junit:junit:4.12"
androidTestImplementation "androidx.test:runner:1.1.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.0"


testImplementation 'junit:junit:4.13-beta-1'
androidTestImplementation "androidx.test:runner:1.1.1"
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.1"


}
Expand Down
49 changes: 0 additions & 49 deletions app/src/main/java/com/libandexample/Main2Activity.java

This file was deleted.

45 changes: 45 additions & 0 deletions app/src/main/java/com/libandexample/Main2Activity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.libandexample

import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Environment
import android.widget.Button
import android.widget.ImageView

import java.io.File


class Main2Activity : Activity() {
private var imageView: ImageView? = null

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

val button = findViewById<Button>(R.id.button)
imageView = findViewById(R.id.imageView)
button.setOnClickListener {
val intent = Intent("com.intsig.camscanner.ACTION_SCAN")
// Or content uri picked from gallery

val uri = Uri.fromFile(File(Environment.getExternalStorageDirectory().path + "/source.jpg"))
intent.putExtra(Intent.EXTRA_STREAM, uri)
intent.putExtra("scanned_image", Environment.getExternalStorageDirectory().path + "/source.jpg")
// intent.putExtra("pdf_path", Environment.getExternalStorageDirectory().getPath() + "/source.jpg");
// intent.putExtra("org_image", Environment.getExternalStorageDirectory().getPath() + "/source.jpg");
startActivityForResult(intent, 100)
}
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == 100) {
data!!.getIntExtra("RESULT_OK", -1)
if (resultCode == Activity.RESULT_FIRST_USER) {
// Fail
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.libandexample.courses.udemy.Kotlin.Calculator
package com.libandexample.courses.udemy.kotlin.Calculator

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -98,7 +98,7 @@ private var isNewOp=true
isNewOp=true
}

fun buEqualEvent(view:View){
fun buEqualEvent() {
val newNumber=etShowNumber.text.toString()
var finalNumber:Double?=null
when(op){
Expand All @@ -120,15 +120,15 @@ private var isNewOp=true
isNewOp=true
}

fun buPercent(view:View){
fun buPercent() {
val number:Double=etShowNumber.text.toString().toDouble()/100

etShowNumber.setText(number.toString())
isNewOp=true

}

fun buClean(view:View){
fun buClean() {
etShowNumber.setText("0")
isNewOp=true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.libandexample.courses.udemy.Kotlin.findmyage
package com.libandexample.courses.udemy.kotlin.findmyage

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.view.View
import com.libandexample.R
import kotlinx.android.synthetic.main.activity_main.*
import java.util.*
Expand All @@ -19,7 +18,7 @@ class MainActivity : AppCompatActivity() {


@SuppressLint("OnClick")
protected fun BuClickEvent(view: View) {
protected fun BuClickEvent() {

// fire click button
val userDOB: String = etDOB.text.toString()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.libandexample.courses.udemy.Kotlin.foodapp
package com.libandexample.courses.udemy.kotlin.foodapp

class Food(name: String, des: String, image: Int) {
var name:String? = name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.libandexample.courses.udemy.Kotlin.foodapp
package com.libandexample.courses.udemy.kotlin.foodapp

import android.content.Context
import android.content.Intent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.libandexample.courses.udemy.Kotlin.foodapp
package com.libandexample.courses.udemy.kotlin.foodapp

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
Expand All @@ -11,7 +11,7 @@ class FoodDetails : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_food_details)
val bundle=intent.extras
val bundle = intent!!.extras!!

ivFoodImage.setImageResource(bundle.getInt("image"))
tvName.text = bundle.getString("name")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.libandexample.courses.udemy.Kotlin.getsunset
package com.libandexample.courses.udemy.kotlin.getsunset

import android.annotation.SuppressLint
import android.os.AsyncTask
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.libandexample.R
import kotlinx.android.synthetic.main.activity_main_getsunset.*
Expand All @@ -23,7 +22,7 @@ class GetSunSetMainActivity : AppCompatActivity() {


@SuppressLint("OnClick")
protected fun GetSunset(view: View) {
protected fun GetSunset() {

val city = etCityName.text.toString()
val url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22" + city + "%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"
Expand Down Expand Up @@ -91,7 +90,8 @@ class GetSunSetMainActivity : AppCompatActivity() {
if (line != null) {
AllString += line
}
} while (line != null)
} while (true)

inputStream.close()
} catch (ex: Exception) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.libandexample.courses.udemy.Kotlin.noteapp
package com.libandexample.courses.udemy.kotlin.noteapp

import android.content.ContentValues
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import com.libandexample.R
import kotlinx.android.synthetic.main.activity_add_notes.*
Expand All @@ -30,7 +29,7 @@ class AddNotes : AppCompatActivity() {

}

fun buAdd(view:View){
fun buAdd() {
val dbManager= DbManager(this)

val values= ContentValues()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.libandexample.courses.udemy.Kotlin.noteapp
package com.libandexample.courses.udemy.kotlin.noteapp

import android.content.ContentValues
import android.content.Context
Expand Down
Loading

0 comments on commit d1738e3

Please sign in to comment.