Skip to content

Latest commit

 

History

History
115 lines (105 loc) · 3.62 KB

README.md

File metadata and controls

115 lines (105 loc) · 3.62 KB

GDSC VIT

Liwid

Liwid is an Android Library designed to simplify the integration of dynamic and customisable widgets on the lock screen. It uses sophisticated notification integration, placing widgets as notifications on the lock screen. This approach grants users immediate access to the dynamic content from their lock screen, transforming their experience

Table of Contents

Key Features

  • Dynamic and Customisable Widgets: Effortlessly integrate customisable and dynamic widgets, enhancing your Android applications.

  • Error Handling: handle errors and exceptions gracefully.

  • Custom UI: Easily customize the look and feel of the widget as per your app requirements.

  • Support to more types of widgets: Currently, it supports tracking and sports type widgets, and can be extended to add more widgets in the future.


Configure

Gradle

Add the following to your project level root build.gradle:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Add the dependency:

dependencies {
    implementation 'com.github.GDGVIT:Liwid:1.0.0'
}

User permissions required:

<manifest>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
.
.
</manifest>

Usage

Changing the notification channel

fun createCustomChannel(context: Context, activity: Activity) {
  val liveWidget = LiveWidget(context = context, activity = activity, widgetType = LiveWidget.WidgetType.SPORTS)
// Configure channel settings
  liveWidget.configureChannel(
    id = "Custom_Channel_Id",
    name = "Custom Channel Name",
    description = "Custom Channel Description"
  )
}

Specifying the API attributes as per widget

fun startSportsWidgetService(context: Any) {
    LiveSportsWidget.create(
        context = context,
        activity = context as Activity,
        baseUrl = BASE_URL,
        endpoint = GAME_TYPE,
        params = mapOf(
            "met" to MATCH_TYPE,
            "APIkey" to API_KEY,
            "leagueID" to league_id,
        )
    )
}

Stopping the widget service

GlobalScope.launch {
    LiveSportsWidget.stopSportsWidget()
}

Contributors

Dev Keshwani

Your Name Here (Insert Your Image Link In Src

GitHub LinkedIn

Made with ❤ by GDSC-VIT