diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index 0cce9f1..79bd5d6 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -12,6 +12,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/other.xml b/.idea/other.xml
new file mode 100644
index 0000000..f3d4a2e
--- /dev/null
+++ b/.idea/other.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidInfoLib/build.gradle b/AndroidInfoLib/build.gradle
index fe4219c..393c45d 100644
--- a/AndroidInfoLib/build.gradle
+++ b/AndroidInfoLib/build.gradle
@@ -31,6 +31,8 @@ android {
}
dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.10"
+
implementation 'androidx.appcompat:appcompat:1.5.1'
// Network
@@ -39,7 +41,6 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:4.9.3"
implementation "com.squareup.okhttp3:logging-interceptor:4.9.3"
-
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformation.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformation.kt
index d0bdb55..a1f6fec 100644
--- a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformation.kt
+++ b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformation.kt
@@ -71,4 +71,6 @@ interface DeviceInformation {
fun getBatteryInformation(): BatteryInformation
fun getSARInformation(): SARInformation
+
+ fun getInfoById(id: Int, context: Context): Map
}
\ No newline at end of file
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformationFactory.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformationFactory.kt
index c38a4e3..e8df2c9 100644
--- a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformationFactory.kt
+++ b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/DeviceInformationFactory.kt
@@ -17,6 +17,7 @@
package com.udfsoft.androidinfo.lib
import android.Manifest
+import android.annotation.SuppressLint
import android.content.Context
import androidx.annotation.RequiresPermission
import androidx.annotation.WorkerThread
@@ -30,6 +31,7 @@ import com.udfsoft.androidinfo.lib.command.codecs.GetCodecsInformationCommand
import com.udfsoft.androidinfo.lib.command.cpu.GetCpuInformationCommand
import com.udfsoft.androidinfo.lib.command.design.GetNetworkDesignInformationCommand
import com.udfsoft.androidinfo.lib.command.display.GetDisplayInformationCommand
+import com.udfsoft.androidinfo.lib.command.entity.MenuIds
import com.udfsoft.androidinfo.lib.command.general.GetGeneralInformationCommand
import com.udfsoft.androidinfo.lib.command.gpu.GetGPUInformationCommand
import com.udfsoft.androidinfo.lib.command.network.GetNetworkTechnologiesInformationCommand
@@ -44,6 +46,7 @@ import com.udfsoft.androidinfo.lib.di.NetworkFactory
import com.udfsoft.androidinfo.lib.entity.CPUInformation
import com.udfsoft.androidinfo.lib.entity.OSInformation
import com.udfsoft.androidinfo.lib.entity.RAMInformation
+import com.udfsoft.androidinfo.lib.util.asMap
@WorkerThread
object DeviceInformationFactory : DeviceInformation {
@@ -112,4 +115,30 @@ object DeviceInformationFactory : DeviceInformation {
override fun getBatteryInformation() = GetBatteryInformationCommand(api).invoke(Unit)
override fun getSARInformation() = GetSARInformationCommand(api).invoke(Unit)
+
+ @SuppressLint("MissingPermission")
+ override fun getInfoById(id: Int, context: Context): Map =
+ when (MenuIds.findMenuIdByIndex(id)) {
+ MenuIds.MENU_ID_GENERAL -> getGeneralInformation().asMap()
+ MenuIds.MENU_ID_DESIGN -> getDesignInformation().asMap()
+ MenuIds.MENU_ID_SIM -> getSIMCardInformation(context).asMap()
+ MenuIds.MENU_ID_MOBILE_NETWORK -> getNetworkTechnologiesInformation(context).asMap()
+ MenuIds.MENU_ID_OS -> getOSInformation().asMap()
+ MenuIds.MENU_ID_PROCESSOR -> getCPUInformation().asMap()
+ MenuIds.MENU_ID_GPU -> getGPUInformation().asMap()
+ MenuIds.MENU_ID_MEMORY -> getRAMInformation(context).asMap()
+ MenuIds.MENU_ID_STORAGE -> getStorageInformation().asMap()
+ MenuIds.MENU_ID_DISPLAY -> getDisplayInformation(context).asMap()
+ MenuIds.MENU_ID_SENSORS -> getSensorsInformation().asMap()
+ MenuIds.MENU_ID_REAR_CAMERA -> getRearCameraInformation().asMap()
+ MenuIds.MENU_ID_FRONT_CAMERA -> getFrontCameraInformation().asMap()
+ MenuIds.MENU_ID_AUDIO -> getAudioInformation().asMap()
+ MenuIds.MENU_ID_WIRELESS -> getWirelessInformation().asMap()
+ MenuIds.MENU_ID_USB -> getUSBInformation().asMap()
+ MenuIds.MENU_ID_BROWSER -> getBrowserInformation().asMap()
+ MenuIds.MENU_ID_CODECS -> getCodecsInformation().asMap()
+ MenuIds.MENU_ID_BATTERY -> getBatteryInformation().asMap()
+ MenuIds.MENU_ID_SAR -> getSARInformation().asMap()
+ else -> throw UnsupportedOperationException()
+ }
}
\ No newline at end of file
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/command/entity/MenuIds.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/command/entity/MenuIds.kt
index fc1fd46..f6322ea 100644
--- a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/command/entity/MenuIds.kt
+++ b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/command/entity/MenuIds.kt
@@ -21,6 +21,9 @@ enum class MenuIds(val menuId: Int) {
MENU_ID_BROWSER(22000),
MENU_ID_CODECS(23000),
MENU_ID_BATTERY(25000),
- MENU_ID_SAR(26000),
- MENU_ID_ADDITIONAL_FEATURES(27000)
+ MENU_ID_SAR(26000);
+
+ companion object {
+ fun findMenuIdByIndex(index: Int) = values().firstOrNull { it.ordinal == index }
+ }
}
\ No newline at end of file
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/entity/BluetoothInformation.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/entity/BluetoothInformation.kt
deleted file mode 100644
index a4c6d63..0000000
--- a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/entity/BluetoothInformation.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.udfsoft.androidinfo.lib.entity
-
-class BluetoothInformation {
-
-}
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/entity/ConnectivityInformation.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/entity/ConnectivityInformation.kt
deleted file mode 100644
index f91a564..0000000
--- a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/entity/ConnectivityInformation.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.udfsoft.androidinfo.lib.entity
-
-class ConnectivityInformation {
-
-}
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/network/interceptor/StaticHeadersInterceptor.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/network/interceptor/StaticHeadersInterceptor.kt
index 7bf0a7a..89755cb 100644
--- a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/network/interceptor/StaticHeadersInterceptor.kt
+++ b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/network/interceptor/StaticHeadersInterceptor.kt
@@ -1,6 +1,6 @@
package com.udfsoft.androidinfo.lib.network.interceptor
-import android.content.Context
+import android.os.Build
import com.udfsoft.androidinfo.lib.BuildConfig
import com.udfsoft.androidinfo.lib.network.Headers.ACCEPT
import com.udfsoft.androidinfo.lib.network.Headers.ACCEPT_LANGUAGE
@@ -25,8 +25,8 @@ class StaticHeadersInterceptor : Interceptor {
.addHeader(CONTENT_TYPE, APPLICATION_JSON_CONTENT_TYPE)
.addHeader(USER_AGENT, userAgent)
.addHeader(ACCEPT_LANGUAGE, Locale.getDefault().language)
- .addHeader(DEVICE_BRAND_KEY, "xiaomi")//Build.BRAND)
- .addHeader(DEVICE_MODEL_KEY, "redmi note 7") //Build.MODEL)
+ .addHeader(DEVICE_BRAND_KEY, Build.BRAND)
+ .addHeader(DEVICE_MODEL_KEY, Build.MODEL)
return chain.proceed(requestBuilder.build())
}
diff --git a/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/util/OtherExtensions.kt b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/util/OtherExtensions.kt
new file mode 100644
index 0000000..2324afe
--- /dev/null
+++ b/AndroidInfoLib/src/main/java/com/udfsoft/androidinfo/lib/util/OtherExtensions.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2022 Javavirys
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.udfsoft.androidinfo.lib.util
+
+import kotlin.reflect.full.memberProperties
+
+inline fun T.asMap(): Map {
+ val props = T::class.memberProperties.associateBy { it.name }
+ return props.keys.associateWith { props[it]?.get(this) }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index ec922e2..461f309 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,66 @@
-# AndroidInfoLib
\ No newline at end of file
+# AndroidInfoLib
+
+This is a library that will help you get all the information from android
+
+[](https://jitpack.io/#LiteSoftware/SectorProgressBar)
+
+
+
+## How to use
+1. Add this in your root `build.gradle` at the end of `repositories` in `allprojects` section:
+```groovy
+allprojects {
+ repositories {
+ maven { url 'https://jitpack.io' }
+ }
+}
+```
+
+2. Then add this dependency to your **module-level** `build.gradle` in `dependencies` section:
+```groovy
+implementation 'com.github.LiteSoftware:SectorProgressBar:$version'
+```
+
+3. Call any of the methods below to get information about your android
+```kotlin
+DeviceInformationFactory.getGeneralInformation()
+DeviceInformationFactory.getRAMInformation(context)
+DeviceInformationFactory.getOSInformation()
+DeviceInformationFactory.getCPUInformation()
+DeviceInformationFactory.getSIMCardInformation(context)
+DeviceInformationFactory.getDisplayInformation(context)
+DeviceInformationFactory.getNetworkTechnologiesInformation(context)
+DeviceInformationFactory.getDesignInformation()
+DeviceInformationFactory.getStorageInformation()
+DeviceInformationFactory.getGPUInformation()
+DeviceInformationFactory.getSensorsInformation()
+DeviceInformationFactory.getRearCameraInformation()
+DeviceInformationFactory.getFrontCameraInformation()
+DeviceInformationFactory.getAudioInformation()
+DeviceInformationFactory.getWirelessInformation()
+DeviceInformationFactory.getUSBInformation()
+DeviceInformationFactory.getBrowserInformation()
+DeviceInformationFactory.getCodecsInformation()
+DeviceInformationFactory.getBatteryInformation()
+DeviceInformationFactory.getSARInformation()
+```
+
+---
+
+## License
+
+```
+ Copyright 2022 Javavirys. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+```
diff --git a/sample/build.gradle b/sample/build.gradle
index 25c5d39..b4e40cf 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -30,6 +30,10 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
+ buildFeatures {
+ viewBinding true
+ dataBinding true
+ }
}
dependencies {
@@ -42,11 +46,13 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-livedata:2.5.1'
implementation "androidx.core:core-ktx:1.9.0"
- implementation "androidx.activity:activity-ktx:1.6.0"
- implementation "androidx.fragment:fragment-ktx:1.5.3"
+ implementation "androidx.activity:activity-ktx:1.6.1"
+ implementation "androidx.fragment:fragment-ktx:1.5.4"
// Widgets
- implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
+ implementation "androidx.constraintlayout:constraintlayout:2.1.4"
+ implementation "androidx.recyclerview:recyclerview:1.2.1"
+ implementation "com.google.android.material:material:1.7.0"
// Tests
testImplementation 'junit:junit:4.13.2'
diff --git a/sample/src/main/java/com/udfsoft/androidinfo/sample/MainActivity.kt b/sample/src/main/java/com/udfsoft/androidinfo/sample/MainActivity.kt
index c9feb52..979b384 100644
--- a/sample/src/main/java/com/udfsoft/androidinfo/sample/MainActivity.kt
+++ b/sample/src/main/java/com/udfsoft/androidinfo/sample/MainActivity.kt
@@ -18,6 +18,7 @@ package com.udfsoft.androidinfo.sample
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
+import androidx.fragment.app.commitNow
import com.udfsoft.androidinfo.sample.ui.main.MainFragment
class MainActivity : AppCompatActivity() {
@@ -26,9 +27,9 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
if (savedInstanceState == null) {
- supportFragmentManager.beginTransaction()
- .replace(R.id.container, MainFragment.newInstance())
- .commitNow()
+ supportFragmentManager.commitNow {
+ replace(R.id.container, MainFragment.newInstance())
+ }
}
}
}
\ No newline at end of file
diff --git a/sample/src/main/java/com/udfsoft/androidinfo/sample/core/entity/MenuItem.kt b/sample/src/main/java/com/udfsoft/androidinfo/sample/core/entity/MenuItem.kt
new file mode 100644
index 0000000..d122f5a
--- /dev/null
+++ b/sample/src/main/java/com/udfsoft/androidinfo/sample/core/entity/MenuItem.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2022 Javavirys
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.udfsoft.androidinfo.sample.core.entity
+
+import androidx.annotation.DrawableRes
+
+data class MenuItem(
+ val id: Int,
+ val name: String,
+ @DrawableRes val logoId: Int
+)
diff --git a/sample/src/main/java/com/udfsoft/androidinfo/sample/core/entity/MenuItemEnum.kt b/sample/src/main/java/com/udfsoft/androidinfo/sample/core/entity/MenuItemEnum.kt
new file mode 100644
index 0000000..c23ba22
--- /dev/null
+++ b/sample/src/main/java/com/udfsoft/androidinfo/sample/core/entity/MenuItemEnum.kt
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2022 Javavirys
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.udfsoft.androidinfo.sample.core.entity
+
+import androidx.annotation.DrawableRes
+import com.udfsoft.androidinfo.sample.R
+
+enum class MenuItemEnum(
+ val title: String,
+ @DrawableRes val logoId: Int
+) {
+
+ General("General", R.drawable.ic_general),
+ Design("Design", R.drawable.ic_launcher_foreground),
+ SIMCard("SIM card", R.drawable.ic_launcher_foreground),
+ MobileNetworkTechnologies("Mobile network technologies", R.drawable.ic_launcher_foreground),
+ OperatingSystem("Operating system", R.drawable.ic_launcher_foreground),
+ CPU("CPU", R.drawable.ic_launcher_foreground),
+ GPU("GPU", R.drawable.ic_launcher_foreground),
+ RAM("RAM", R.drawable.ic_launcher_foreground),
+ Storage("Storage", R.drawable.ic_launcher_foreground),
+ Display("Display", R.drawable.ic_launcher_foreground),
+ Sensors("Sensors", R.drawable.ic_launcher_foreground),
+ RearCamera("Rear camera", R.drawable.ic_launcher_foreground),
+ FrontCamera("Front camera", R.drawable.ic_launcher_foreground),
+ Audio("Audio", R.drawable.ic_launcher_foreground),
+ WirelessTechnology("Wireless technology", R.drawable.ic_launcher_foreground),
+ USB("USB", R.drawable.ic_launcher_foreground),
+ Browser("Browser", R.drawable.ic_launcher_foreground);
+}
diff --git a/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MapAdapter.kt b/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MapAdapter.kt
new file mode 100644
index 0000000..e41d55c
--- /dev/null
+++ b/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MapAdapter.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2022 Javavirys
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.udfsoft.androidinfo.sample.ui.adapter
+
+import android.annotation.SuppressLint
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.udfsoft.androidinfo.sample.R
+
+class MapAdapter : RecyclerView.Adapter() {
+
+ private val items = mutableMapOf()
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MapViewHolder {
+ val view = LayoutInflater.from(parent.context)
+ .inflate(R.layout.layout_info_item, parent, false)
+ return MapViewHolder(view)
+ }
+
+ override fun onBindViewHolder(holder: MapViewHolder, position: Int) {
+ val name = items.keys.elementAt(position)
+ holder.onBind(name to items[name])
+ }
+
+ override fun getItemCount() = items.size
+
+ @SuppressLint("NotifyDataSetChanged")
+ fun setItems(map: Map) {
+ items.clear()
+ items.putAll(map)
+ notifyDataSetChanged()
+ }
+}
\ No newline at end of file
diff --git a/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MapViewHolder.kt b/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MapViewHolder.kt
new file mode 100644
index 0000000..ffd1bbe
--- /dev/null
+++ b/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MapViewHolder.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2022 Javavirys
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.udfsoft.androidinfo.sample.ui.adapter
+
+import android.view.View
+import android.widget.TextView
+import androidx.core.view.ViewCompat
+import androidx.recyclerview.widget.RecyclerView
+import com.udfsoft.androidinfo.sample.R
+
+class MapViewHolder(
+ view: View
+) : RecyclerView.ViewHolder(view) {
+
+ private val nameTextView: TextView = ViewCompat.requireViewById(itemView, R.id.nameTextView)
+
+ private val valueTextView: TextView = ViewCompat.requireViewById(itemView, R.id.valueTextView)
+
+ fun onBind(item: Pair) {
+ val name = item.first.replaceFirstChar { it.uppercase() }
+ nameTextView.text = name
+ valueTextView.text = item.second.toString()
+ }
+}
\ No newline at end of file
diff --git a/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MenuItemAdapter.kt b/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MenuItemAdapter.kt
new file mode 100644
index 0000000..ad73f80
--- /dev/null
+++ b/sample/src/main/java/com/udfsoft/androidinfo/sample/ui/adapter/MenuItemAdapter.kt
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 Javavirys
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.udfsoft.androidinfo.sample.ui.adapter
+
+import android.annotation.SuppressLint
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.udfsoft.androidinfo.sample.R
+import com.udfsoft.androidinfo.sample.core.entity.MenuItem
+
+class MenuItemAdapter(
+ private val onItemClick: (MenuItem) -> Unit
+) : RecyclerView.Adapter() {
+
+ private val items = mutableListOf