Skip to content

Commit

Permalink
Whole codebase migrated to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
umer0586 committed Jun 6, 2023
1 parent c327433 commit 89ba9c5
Show file tree
Hide file tree
Showing 54 changed files with 2,628 additions and 3,032 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.externalNativeBuild
.cxx
local.properties
/.idea/kotlinc.xml
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

3 changes: 1 addition & 2 deletions .idea/gradle.xml

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

3 changes: 1 addition & 2 deletions .idea/misc.xml

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

9 changes: 9 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down Expand Up @@ -27,6 +28,11 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
}

namespace 'github.umer0586.sensorserver'
/* buildFeatures {
viewBinding true
Expand All @@ -51,6 +57,9 @@ dependencies {
implementation 'com.github.ybq:Android-SpinKit:1.4.0'

implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
implementation 'androidx.core:core-ktx:1.10.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"


}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package github.umer0586.sensorserver.activities

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.AppCompatTextView
import github.umer0586.sensorserver.BuildConfig
import github.umer0586.sensorserver.R

class AboutActivity : AppCompatActivity()
{


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

findViewById<View>(R.id.donationBtn).setOnClickListener {
openLink("http://www.buymeacoffee.com/umerfarooq")
}
findViewById<View>(R.id.sourceCodeBtn).setOnClickListener {
openLink("http://github.com/umer0586/SensorServer")
}

val version = findViewById<AppCompatTextView>(R.id.app_version)
version.text = "v" + BuildConfig.VERSION_NAME
}

private fun openLink(link: String)
{
val intent = Intent(Intent.ACTION_VIEW)
if (intent.resolveActivity(applicationContext.packageManager) != null)
{
intent.data = Uri.parse(link)
startActivity(Intent.createChooser(intent, "Select Browser"))
}
else
{
Toast.makeText(applicationContext, "Browser app not found", Toast.LENGTH_SHORT).show()
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package github.umer0586.sensorserver.activities

import android.graphics.drawable.Drawable
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.AppCompatImageView
import github.umer0586.sensorserver.R
import java.io.IOException

class DeviceAxisActivity : AppCompatActivity()
{


override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_device_axis)
val deviceAxisImage = findViewById<AppCompatImageView>(R.id.device_axis)
try
{
val ims = assets.open("axis_device.png")
val d = Drawable.createFromStream(ims, null)
deviceAxisImage.setImageDrawable(d)
ims.close()
}
catch (ex: IOException)
{
return
}
}
}
Loading

0 comments on commit 89ba9c5

Please sign in to comment.