-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainActivity.kt
More file actions
41 lines (32 loc) · 1.19 KB
/
MainActivity.kt
File metadata and controls
41 lines (32 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package info.hannes.github.sample
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import info.hannes.github.AppUpdateHelper
import info.hannes.github.sample.databinding.ActivityMainBinding
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
setSupportActionBar(findViewById(R.id.toolbar))
supportActionBar?.apply {
setHomeAsUpIndicator(R.drawable.ic_menu)
setDisplayHomeAsUpEnabled(true)
}
AppUpdateHelper.checkForNewVersion(
this,
BuildConfig.GIT_REPOSITORY,
token = "abcdefgh"
)
binding.buttonGithub.setOnClickListener {
AppUpdateHelper.checkWithDialog(
this,
BuildConfig.GIT_REPOSITORY,
{ msg -> Log.d("result", msg) },
force = true // just to enable debugging, without you can only debug once a day
)
}
}
}