Skip to content

Commit b42b6d0

Browse files
authored
Merge pull request #2 from dk-a-dev/master
Ready for release
2 parents 650970a + 02b35f2 commit b42b6d0

File tree

67 files changed

+1161
-512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1161
-512
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16+
.vscode

.idea/deploymentTargetDropDown.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/migrations.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 81 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,107 @@
22
<a href="https://dscvit.com">
33
<img width="400" src="https://user-images.githubusercontent.com/56252312/159312411-58410727-3933-4224-b43e-4e9b627838a3.png#gh-light-mode-only" alt="GDSC VIT"/>
44
</a>
5-
<h2 align="center"> < Insert Project Title Here > </h2>
6-
<h4 align="center"> < Insert Project Description Here > <h4>
7-
</p>
8-
9-
---
10-
[![Join Us](https://img.shields.io/badge/Join%20Us-Developer%20Student%20Clubs-red)](https://dsc.community.dev/vellore-institute-of-technology/)
11-
[![Discord Chat](https://img.shields.io/discord/760928671698649098.svg)](https://discord.gg/498KVdSKWR)
12-
13-
[![DOCS](https://img.shields.io/badge/Documentation-see%20docs-green?style=flat-square&logo=appveyor)](INSERT_LINK_FOR_DOCS_HERE)
14-
[![UI ](https://img.shields.io/badge/User%20Interface-Link%20to%20UI-orange?style=flat-square&logo=appveyor)](INSERT_UI_LINK_HERE)
15-
16-
17-
## Features
18-
- [ ] < feature >
19-
- [ ] < feature >
20-
- [ ] < feature >
21-
- [ ] < feature >
5+
<h2 align="center">Liwid</h2>
6+
<h4 align="center">Liwid is an Android Library designed to simplify the integration of dynamic and customisable widgets on the lock screen.
7+
It uses sophisticated notification integration, placing widgets as notifications on the lock screen.
8+
This approach grants users immediate access to the dynamic content from their lock screen, transforming their experience
9+
</h4>
2210

23-
<br>
11+
## Table of Contents
12+
- [Key Features](#key-features)
13+
- [Configure](#configure)
14+
- [Usage](#usage)
15+
- [Contributors](#contributors)
2416

25-
## Dependencies
26-
- < dependency >
27-
- < dependency >
17+
## Key Features
18+
- [x] Dynamic and Customisable Widgets: Effortlessly integrate customisable and dynamic widgets, enhancing your Android applications.
19+
- [x] Error Handling: handle errors and exceptions gracefully.
20+
- [ ] Custom UI: Easily customize the look and feel of the widget as per your app requirements.
21+
- [ ] 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.
2822

23+
<br>
2924

30-
## Running
25+
## Configure
26+
### Gradle
27+
Add the following to your project level root `build.gradle`:
28+
```gradle
29+
allprojects {
30+
repositories {
31+
...
32+
maven { url "https://jitpack.io" }
33+
}
34+
}
35+
```
36+
Add the dependency:
37+
```gradle
38+
dependencies {
39+
implementation 'com.github.GDGVIT:Liwid:1.0.0'
40+
}
41+
```
3142

43+
User permissions required:
44+
```xml
45+
<manifest>
46+
<uses-permission android:name="android.permission.INTERNET"/>
47+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
48+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
49+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
50+
.
51+
.
52+
</manifest>
53+
```
3254

33-
< directions to install >
34-
```bash
35-
< insert code >
55+
## Usage
56+
### Changing the notification channel
57+
```kotlin
58+
fun createCustomChannel(context: Context, activity: Activity) {
59+
val liveWidget = LiveWidget(context = context, activity = activity, widgetType = LiveWidget.WidgetType.SPORTS)
60+
// Configure channel settings
61+
liveWidget.configureChannel(
62+
id = "Custom_Channel_Id",
63+
name = "Custom Channel Name",
64+
description = "Custom Channel Description"
65+
)
66+
}
3667
```
3768

38-
< directions to execute >
69+
### Specifying the API attributes as per widget
70+
```kotlin
71+
fun startSportsWidgetService(context: Any) {
72+
LiveSportsWidget.create(
73+
context = context,
74+
activity = context as Activity,
75+
baseUrl = BASE_URL,
76+
endpoint = GAME_TYPE,
77+
params = mapOf(
78+
"met" to MATCH_TYPE,
79+
"APIkey" to API_KEY,
80+
"leagueID" to league_id,
81+
)
82+
)
83+
}
84+
```
3985

40-
```bash
41-
< insert code >
86+
### Stopping the widget service
87+
```kotlin
88+
GlobalScope.launch {
89+
LiveSportsWidget.stopSportsWidget()
90+
}
4291
```
4392

4493
## Contributors
45-
4694
<table>
4795
<tr align="center">
4896
<td>
49-
John Doe
97+
Dev Keshwani
5098
<p align="center">
51-
<img src = "https://dscvit.com/images/dsc-logo-square.svg" width="150" height="150" alt="Your Name Here (Insert Your Image Link In Src">
99+
<img src = "https://avatars.githubusercontent.com/u/84137299?s=400&u=706239e377f631a79fc68c59c73370c9503d6b44&v=4" width="150" height="150" alt="Your Name Here (Insert Your Image Link In Src">
52100
</p>
53101
<p align="center">
54-
<a href = "https://github.com/person1">
102+
<a href = "https://github.com/dk-a-dev">
55103
<img src = "http://www.iconninja.com/files/241/825/211/round-collaboration-social-github-code-circle-network-icon.svg" width="36" height = "36" alt="GitHub"/>
56104
</a>
57-
<a href = "https://www.linkedin.com/in/person1">
105+
<a href = "https://www.linkedin.com/in/dev-keshwani-38958a21a/">
58106
<img src = "http://www.iconninja.com/files/863/607/751/network-linkedin-social-connection-circular-circle-media-icon.svg" width="36" height="36" alt="LinkedIn"/>
59107
</a>
60108
</p>

app/build.gradle

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ plugins {
44
}
55

66
android {
7-
namespace 'com.liwid.liwid_extension'
7+
namespace 'com.liwid.example'
88
compileSdk 34
99

1010
defaultConfig {
11-
applicationId "com.liwid.liwid_extension"
11+
applicationId "com.liwid.example"
1212
minSdk 24
1313
targetSdk 34
1414
versionCode 1
@@ -37,12 +37,11 @@ android {
3737
kotlinOptions {
3838
jvmTarget = '1.8'
3939
}
40+
composeOptions {
41+
kotlinCompilerExtensionVersion '1.5.7'
42+
}
4043
buildFeatures {
4144
compose true
42-
buildConfig=true
43-
}
44-
composeOptions {
45-
kotlinCompilerExtensionVersion '1.5.6'
4645
}
4746
packagingOptions {
4847
resources {
@@ -56,23 +55,18 @@ dependencies {
5655
implementation 'androidx.core:core-ktx:1.12.0'
5756
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
5857
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
58+
implementation 'androidx.compose.material3:material3'
5959
implementation 'androidx.activity:activity-compose:1.8.2'
6060
implementation platform('androidx.compose:compose-bom:2022.10.00')
6161
implementation 'androidx.compose.ui:ui'
6262
implementation 'androidx.compose.ui:ui-graphics'
6363
implementation 'androidx.compose.ui:ui-tooling-preview'
64-
implementation 'androidx.compose.material3:material3'
65-
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
66-
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
67-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0-RC'
68-
implementation 'androidx.cardview:cardview:1.0.0'
69-
implementation 'com.github.bumptech.glide:glide:4.12.0'
70-
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
7164
testImplementation 'junit:junit:4.13.2'
7265
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
7366
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
7467
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
7568
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
7669
debugImplementation 'androidx.compose.ui:ui-tooling'
7770
debugImplementation 'androidx.compose.ui:ui-test-manifest'
71+
implementation project(':liwid')
7872
}

app/src/androidTest/java/com/liwid/liwid_extension/ExampleInstrumentedTest.kt renamed to app/src/androidTest/java/com/liwid/example/ExampleInstrumentedTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.liwid.liwid_extension
1+
package com.liwid.example
22

33
import androidx.test.platform.app.InstrumentationRegistry
44
import androidx.test.ext.junit.runners.AndroidJUnit4

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,26 @@
55
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
66
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
77
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
8+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
89
<application
910
android:allowBackup="true"
1011
android:dataExtractionRules="@xml/data_extraction_rules"
1112
android:fullBackupContent="@xml/backup_rules"
1213
android:icon="@mipmap/ic_launcher"
13-
android:label="@string/app_name"
1414
android:roundIcon="@mipmap/ic_launcher_round"
1515
android:supportsRtl="true"
1616
android:theme="@style/Theme.Liwidapp"
1717
tools:targetApi="31">
1818
<activity
19-
android:name=".example.MainActivity"
19+
android:name="MainActivity"
2020
android:exported="true"
21-
android:label="@string/app_name"
2221
android:theme="@style/Theme.Liwidapp">
2322
<intent-filter>
2423
<action android:name="android.intent.action.MAIN" />
2524
<category android:name="android.intent.category.LAUNCHER" />
2625
</intent-filter>
2726
</activity>
28-
<receiver android:name=".NotificationActionReceiver" />
29-
<service android:name=".example.ForegroundService"/>
27+
<service android:name="com.dscvit.liwid.WidgetForegroundService" android:foregroundServiceType="dataSync"/>
3028
</application>
3129

3230
</manifest>

0 commit comments

Comments
 (0)