Skip to content

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
volkansahin45 committed Sep 11, 2022
2 parents 0f5929e + a43c21d commit 1718c85
Show file tree
Hide file tree
Showing 36 changed files with 605 additions and 675 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ captures/
.cxx/

# Google Services (e.g. APIs or Firebase)
# google-services.json
google-services.json

# Freeline
freeline.py
Expand All @@ -87,4 +87,5 @@ lint/tmp/
# lint/reports/

# Android Profiling
*.hprof
*.hprof
.idea/misc.xml
29 changes: 0 additions & 29 deletions .idea/misc.xml

This file was deleted.

60 changes: 39 additions & 21 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ plugins {
}

android {
compileSdk 31
compileSdk 33

defaultConfig {
applicationId "com.vsahin.praytimes"
minSdk 26
targetSdk 30
versionCode 2
versionName "1.0"
targetSdk 33
versionCode 3
versionName "1.1"
vectorDrawables {
useSupportLibrary true
}

}

Expand All @@ -30,6 +33,17 @@ android {
}
buildFeatures {
viewBinding true
compose true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
}

Expand All @@ -39,29 +53,33 @@ kapt {

dependencies {

implementation "androidx.core:core-ktx:1.6.0"
implementation "com.google.android.gms:play-services-wearable:17.1.0"
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.core:core-ktx:1.8.0"

implementation "androidx.compose.ui:ui-tooling-preview:1.2.1"
implementation "androidx.compose.ui:ui:1.2.1"
implementation "androidx.compose.runtime:runtime-livedata:1.3.0-beta01"
implementation 'androidx.compose.material:material-icons-core:1.2.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.2.1"
debugImplementation "androidx.compose.ui:ui-tooling:1.2.1"

implementation "androidx.wear:wear:1.1.0"
implementation "androidx.wear:wear-remote-interactions:1.0.0-beta01"
implementation "androidx.wear.tiles:tiles:1.0.0-alpha10"
debugImplementation "androidx.wear.tiles:tiles-renderer:1.0.0-alpha10"
implementation "androidx.wear:wear:1.2.0"
implementation "androidx.wear.compose:compose-material:1.1.0-alpha04"
implementation "androidx.wear.compose:compose-navigation:1.1.0-alpha04"
implementation "androidx.wear:wear-remote-interactions:1.0.0"
implementation "androidx.wear.tiles:tiles:1.1.0"
debugImplementation "androidx.wear.tiles:tiles-renderer:1.1.0"

implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.1'
implementation 'com.google.firebase:firebase-analytics:19.0.1'
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.12'
implementation 'com.google.firebase:firebase-analytics:21.1.0'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.5.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.4'

implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"

implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"

implementation "androidx.preference:preference-ktx:1.1.1"
implementation "androidx.preference:preference-ktx:1.2.0"

implementation "com.google.dagger:hilt-android:2.37"
kapt "com.google.dagger:hilt-compiler:2.37"
implementation "com.google.dagger:hilt-android:2.42"
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
kapt "com.google.dagger:hilt-compiler:2.42"
}
18 changes: 4 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
package="com.vsahin.praytimes">

<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature android:name="android.hardware.type.watch" />

<uses-permission android:name="android.permission.INTERNET" />

<application
Expand All @@ -28,18 +26,9 @@
android:value="true" />

<activity
android:name=".ui.about.AboutActivity"
android:exported="true"
android:label="@string/title_activity_about" />
<activity
android:name=".ui.locationSelector.LocationSelectorActivity"
android:exported="true"
android:label="@string/title_activity_location_selector" />
<activity
android:name=".ui.home.HomeActivity"
android:name=".ui.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTask">
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -51,7 +40,8 @@
android:name=".ui.tile.PrayTileService"
android:description="@string/tile_description"
android:label="@string/tile_label"
android:permission="com.google.android.wearable.permission.BIND_TILE_PROVIDER">
android:permission="com.google.android.wearable.permission.BIND_TILE_PROVIDER"
android:exported="true">
<intent-filter>
<action android:name="androidx.wear.tiles.action.BIND_TILE_PROVIDER" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.vsahin.praytimes.common

import android.app.Activity
import android.content.Intent
import android.net.Uri
import androidx.wear.remote.interactions.RemoteActivityHelper
import androidx.wear.widget.ConfirmationOverlay
import com.vsahin.praytimes.R
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.guava.await
import kotlinx.coroutines.launch

fun startRemoteActivity(
activity: Activity,
scope: CoroutineScope,
data: Uri
) {
val remoteActivityHelper = RemoteActivityHelper(activity)
val sentToYourPhoneMessage = activity.getString(R.string.sent_to_your_phone)
val unknownErrorMessage = activity.getString(R.string.unknown_error)

scope.launch {
try {
val intent = Intent(Intent.ACTION_VIEW)
.addCategory(Intent.CATEGORY_BROWSABLE)
.setData(data)

remoteActivityHelper.startRemoteActivity(intent).await()

ConfirmationOverlay()
.setMessage(sentToYourPhoneMessage)
.setDuration(2000)
.showOn(activity)
} catch (cancellationException: CancellationException) {
throw cancellationException
} catch (throwable: Throwable) {
ConfirmationOverlay()
.setType(ConfirmationOverlay.FAILURE_ANIMATION)
.setMessage(unknownErrorMessage)
.showOn(activity)
}
}
}
21 changes: 21 additions & 0 deletions app/src/main/java/com/vsahin/praytimes/ui/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.vsahin.praytimes.ui

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.vsahin.praytimes.ui.theme.PrayTimesTheme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
PrayTimesTheme {
Navigation()
}
}
}
}
39 changes: 39 additions & 0 deletions app/src/main/java/com/vsahin/praytimes/ui/NavigationGraph.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.vsahin.praytimes.ui

import androidx.compose.runtime.Composable
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.wear.compose.navigation.SwipeDismissableNavHost
import androidx.wear.compose.navigation.composable
import androidx.wear.compose.navigation.rememberSwipeDismissableNavController
import com.vsahin.praytimes.ui.about.AboutScreen
import com.vsahin.praytimes.ui.home.HomeScreen
import com.vsahin.praytimes.ui.locationSelector.LocationSelectorScreen

const val HOME = "home"
const val LOCATION_SELECTOR = "locationSelector"
const val ABOUT = "about"

@Composable
fun Navigation() {
val navController = rememberSwipeDismissableNavController()
SwipeDismissableNavHost(
navController = navController,
startDestination = HOME,
) {
composable(HOME) {
HomeScreen(
navController = navController,
viewModel = hiltViewModel(),
)
}
composable(LOCATION_SELECTOR) {
LocationSelectorScreen(
navController = navController,
viewModel = hiltViewModel()
)
}
composable(ABOUT) {
AboutScreen()
}
}
}
56 changes: 0 additions & 56 deletions app/src/main/java/com/vsahin/praytimes/ui/about/AboutActivity.kt

This file was deleted.

Loading

0 comments on commit 1718c85

Please sign in to comment.