-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/hmh/hamyeonham/di/NavigatorModule.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,17 @@ | ||
package com.hmh.hamyeonham.di | ||
|
||
import com.hmh.hamyeonham.common.navigation.NavigationProvider | ||
import com.hmh.hamyeonham.navigation.DefaultNavigationProvider | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
interface NavigatorModule { | ||
@Binds | ||
@Singleton | ||
fun bindNavigator(navigator: DefaultNavigationProvider): NavigationProvider | ||
} |
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
20 changes: 20 additions & 0 deletions
20
feature/onboarding/src/main/java/com/hmh/hamyeonham/feature/onboarding/LockActivity.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,20 @@ | ||
package com.hmh.hamyeonham.feature.onboarding | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.hmh.hamyeonham.common.context.toast | ||
import com.hmh.hamyeonham.common.view.viewBinding | ||
import com.hmh.hamyeonham.feature.onboarding.databinding.ActivityLockBinding | ||
|
||
class LockActivity : AppCompatActivity() { | ||
private val binding by viewBinding(ActivityLockBinding::inflate) | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(binding.root) | ||
|
||
binding.btnLock.setOnClickListener { | ||
toast("유튜브 잠금 설정 완료") | ||
} | ||
} | ||
} |
10 changes: 7 additions & 3 deletions
10
...ing/src/main/java/com/hmh/hamyeonham/feature/onboarding/OnBoardingAccessibilityService.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 |
---|---|---|
@@ -1,17 +1,21 @@ | ||
package com.hmh.hamyeonham.feature.onboarding | ||
|
||
import android.accessibilityservice.AccessibilityService | ||
import android.content.Intent | ||
import android.util.Log | ||
import android.view.accessibility.AccessibilityEvent | ||
|
||
class OnBoardingAccessibilityService : AccessibilityService() { | ||
override fun onAccessibilityEvent(event: AccessibilityEvent) { | ||
if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) { | ||
val packageName = event.packageName ?: return | ||
Log.d("AccessibilityService", "현재 실행 중인 앱 패키지: $packageName") | ||
Log.d("OnBoardingAccessibilityService", "onAccessibilityEvent: $packageName") | ||
if (packageName != "com.google.android.youtube") return | ||
val intent = Intent(this, LockActivity::class.java) | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
startActivity(intent) | ||
} | ||
} | ||
|
||
override fun onInterrupt() { | ||
} | ||
override fun onInterrupt() {} | ||
} |
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,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<Button | ||
android:id="@+id/btn_lock" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="30dp" | ||
android:text="잠금 완료" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |