Skip to content
/ liwid Public
forked from GDGVIT/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.

License

Notifications You must be signed in to change notification settings

dk-a-dev/liwid

 
 

Repository files navigation

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

About

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.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 97.7%
  • Shell 1.9%
  • PowerShell 0.4%