-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#259, 위젯 기능 추가] #260
Merged
Merged
[#259, 위젯 기능 추가] #260
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
feature/main/src/main/java/com/droidknights/app2023/feature/main/MainViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ android { | |
|
||
dependencies { | ||
implementation(libs.kotlinx.immutable) | ||
implementation(projects.widget) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,6 @@ include( | |
":feature:setting", | ||
":feature:contributor", | ||
":feature:bookmark", | ||
|
||
":widget" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id("droidknights.android.library") | ||
id("droidknights.android.compose") | ||
} | ||
|
||
android { | ||
namespace = "com.droidknights.app2023.widget" | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidx.glance) | ||
implementation(libs.androidx.glance.appwidget) | ||
implementation(libs.glance.tools.appwidget.host) | ||
|
||
implementation(projects.core.designsystem) | ||
|
||
implementation(projects.core.domain) | ||
implementation(project(mapOf("path" to ":core:model"))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application tools:targetApi="31"> | ||
|
||
<receiver | ||
android:name=".DroidKnightsWidgetReceiver" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | ||
</intent-filter> | ||
<meta-data | ||
android:name="android.appwidget.provider" | ||
android:resource="@xml/widget_info" /> | ||
</receiver> | ||
|
||
</application> | ||
|
||
</manifest> |
24 changes: 24 additions & 0 deletions
24
widget/src/main/kotlin/com/droidknights/app2023/widget/Action.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.droidknights.app2023.widget | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import androidx.glance.action.Action | ||
import androidx.glance.appwidget.action.actionStartActivity | ||
|
||
internal fun actionStartActivityWithSessionId(context: Context, sessionId: String): Action = | ||
actionStartActivity( | ||
Intent( | ||
context.packageManager.getLaunchIntentForPackage( | ||
context.packageName | ||
) | ||
).putExtra(DroidKnightsWidget.KEY_SESSION_ID, sessionId) | ||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) | ||
) | ||
|
||
internal fun actionLaunchIntentForPackage(context: Context): Action = actionStartActivity( | ||
Intent( | ||
context.packageManager.getLaunchIntentForPackage( | ||
context.packageName | ||
) | ||
) | ||
) |
16 changes: 16 additions & 0 deletions
16
widget/src/main/kotlin/com/droidknights/app2023/widget/Command.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.droidknights.app2023.widget | ||
|
||
import android.appwidget.AppWidgetManager | ||
import android.content.Context | ||
import android.content.Intent | ||
|
||
fun sendWidgetUpdateCommand(context: Context) { | ||
context.sendBroadcast( | ||
Intent( | ||
context, | ||
DroidKnightsWidgetReceiver::class.java | ||
).setAction( | ||
AppWidgetManager.ACTION_APPWIDGET_UPDATE | ||
) | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
베타를 적용함으로써 이 작업에서 처음 의도한 것과 달리 기능을 모두 드러내지 못한 부분이 있었나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
의도했던 부분을 드러내지 못한 것은 없습니다.
실제 제가 개발하고 운영중인 서비스에도 beta01 버전이 적용되어 있습니다.