Skip to content

Commit

Permalink
[droidknights#259, Widget Receiver Manifest 정의]
Browse files Browse the repository at this point in the history
[작업내용]
  - App module에 정의되어 있던 widget receiver 별도 manifest 정의
  - 위젯 모듈 내 노출 불필요한 class internal 처리
  • Loading branch information
jeongth9446 committed Sep 10, 2023
1 parent ce956ba commit 0ad9362
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
11 changes: 0 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
android:theme="@style/Theme.DroidKnights2023"
tools:targetApi="31">

<receiver
android:name=".widget.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>
19 changes: 19 additions & 0 deletions widget/src/main/AndroidManifest.xml
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>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import android.content.Intent
import androidx.glance.action.Action
import androidx.glance.appwidget.action.actionStartActivity

fun actionStartActivityWithSessionId(context: Context, sessionId: String): Action =
internal fun actionStartActivityWithSessionId(context: Context, sessionId: String): Action =
actionStartActivity(
Intent(
context.packageManager.getLaunchIntentForPackage(
Expand All @@ -15,7 +15,7 @@ fun actionStartActivityWithSessionId(context: Context, sessionId: String): Actio
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
)

fun actionLaunchIntentForPackage(context: Context): Action = actionStartActivity(
internal fun actionLaunchIntentForPackage(context: Context): Action = actionStartActivity(
Intent(
context.packageManager.getLaunchIntentForPackage(
context.packageName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

@AndroidEntryPoint
class DroidKnightsWidgetReceiver : GlanceAppWidgetReceiver() {
internal class DroidKnightsWidgetReceiver : GlanceAppWidgetReceiver() {

override val glanceAppWidget: GlanceAppWidget = DroidKnightsWidget()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.droidknights.app2023.core.model.Session
import kotlinx.datetime.toJavaLocalDateTime

@Composable
fun WidgetSessionCard(session: Session) {
internal fun WidgetSessionCard(session: Session) {
val context = LocalContext.current

Box(modifier = GlanceModifier.padding(bottom = 16.dp, end = 16.dp)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.glance.text.Text
import androidx.glance.text.TextDefaults

@Composable
fun WidgetTitle() {
internal fun WidgetTitle() {
val context = LocalContext.current

Text(
Expand Down

0 comments on commit 0ad9362

Please sign in to comment.