Skip to content

Instantly share code, notes, and snippets.

View Ochornma's full-sized avatar
🎯
Looking for new opportunities

Promise Ochornma Ochornma

🎯
Looking for new opportunities
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.wear.widget.WearableRecyclerView
android:id="@+id/recycler_view"
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/menu_container"
xmlns:tools="http://schemas.android.com/tools">
<data>
<import type="androidx.core.content.ContextCompat"/>
class MainActivity : WearableActivity() {
private lateinit var binding: ActivityMainBinding
private lateinit var adapter:MainAdapter
private lateinit var mainScreen: MutableList<MainScreen>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
mainScreen = ArrayList<MainScreen>()
mainScreen.add(MainScreen(1, R.drawable.nlogo2, getString(R.string.app_radio)))
class MainAdapter(val main: MutableList<MainScreen>, val context: Context): RecyclerView.Adapter<MainAdapter.Holder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): Holder {
val binding = DataBindingUtil.inflate<ListItemBinding>(LayoutInflater.from(context), R.layout.list_item, parent, false)
return Holder(binding)
}
override fun getItemCount() = main.size
{
"meta": {
"count": 3316
},
"result": {
"current_page": 1,
"data": {
"3315": {
"sermonDataId": 3416,
"categoryId": 17,
fun jsonParseMessage(languageID: Int) {
var id = 0
val onDemands: MutableList<Message> = ArrayList<Message>()
val request: JsonObjectRequest = object :
JsonObjectRequest(Method.GET,
"https://api.dclmict.org/v1/sermon/data",
null,
Response.Listener { response: JSONObject ->
try {
val `object` = response.getJSONObject("meta")
<color name="colorPrimary">#4fc3f7</color>
<color name="colorPrimaryDark">#0093c4</color>
<color name="colorAccent">#e91e63</color>
<color name="colorPrimaryLight">#8bf6ff</color>
<color name="colorSecondaryLight">#ff6090</color>
<color name="colorSecondaryDark">#b0003a</color>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorOnPrimary">#000000</item>
<item name="colorOnSecondary">#000000</item>
<item name="colorError">@color/colorAccent</item>
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'com.google.android.material:material:1.2.0'
<service
android:name=".MyDownload"
android:enabled="true"
android:exported="true" />