forked from KieronQuinn/TapTap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request KieronQuinn#272 from KieronQuinn/release/0.9_beta
Release/0.9 beta
- Loading branch information
Showing
114 changed files
with
3,877 additions
and
566 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
53 changes: 53 additions & 0 deletions
53
app/src/androidTest/java/com/kieronquinn/app/taptap/ScreenSizeTests.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,53 @@ | ||
package com.kieronquinn.app.taptap | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import com.kieronquinn.app.taptap.models.TfModel | ||
import com.kieronquinn.app.taptap.models.getDefaultTfModel | ||
import junit.framework.Assert.assertTrue | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class ScreenSizeTests { | ||
|
||
private val context by lazy { | ||
InstrumentationRegistry.getInstrumentation().context | ||
} | ||
|
||
@Test | ||
fun testSmallScreen(){ | ||
val screenSize = 5.0 | ||
val tfModel = context.getDefaultTfModel(screenSize) | ||
assertTrue("Small size not handled correctly", tfModel == TfModel.PIXEL4) | ||
} | ||
|
||
@Test | ||
fun testMediumScreen(){ | ||
val screenSize = 6.5 | ||
val tfModel = context.getDefaultTfModel(screenSize) | ||
assertTrue("Medium size not handled correctly", tfModel == TfModel.PIXEL4XL) | ||
} | ||
|
||
@Test | ||
fun testLargeScreen(){ | ||
val screenSize = 7.0 | ||
val tfModel = context.getDefaultTfModel(screenSize) | ||
assertTrue("Large size not handled correctly", tfModel == TfModel.PIXEL4XL) | ||
} | ||
|
||
@Test | ||
fun testMediumLowerBound(){ | ||
val screenSize = 6.24 | ||
val tfModel = context.getDefaultTfModel(screenSize) | ||
assertTrue("Medium lower bound size not handled correctly", tfModel == TfModel.PIXEL4XL) | ||
} | ||
|
||
@Test | ||
fun testSmallUpperBound(){ | ||
val screenSize = 6.23 | ||
val tfModel = context.getDefaultTfModel(screenSize) | ||
assertTrue("Small upper bound size not handled correctly", tfModel == TfModel.PIXEL4) | ||
} | ||
|
||
} |
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,98 +1,114 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.kieronquinn.app.taptap"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> | ||
<uses-permission android:name="android.permission.WAKE_LOCK"/> | ||
<uses-permission android:name="android.permission.VIBRATE"/> | ||
<uses-permission android:name="android.permission.CAMERA"/> | ||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> | ||
<uses-permission android:name="android.permission.CALL_PHONE"/> | ||
<uses-permission android:name="net.dinglisch.android.tasker.PERMISSION_RUN_TASKS"/> | ||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
<uses-permission android:name="android.permission.VIBRATE" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> | ||
<uses-permission android:name="android.permission.CALL_PHONE" /> | ||
<uses-permission android:name="net.dinglisch.android.tasker.PERMISSION_RUN_TASKS" /> | ||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> | ||
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /> | ||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> | ||
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true"/> | ||
|
||
<application | ||
android:name=".TapTapApplication" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:name=".TapTapApplication" | ||
android:theme="@style/AppTheme"> | ||
|
||
<activity android:name="com.kieronquinn.app.taptap.activities.SettingsActivity"> | ||
<activity android:name=".activities.SettingsActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
|
||
<intent-filter> | ||
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/> | ||
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name=".activities.WakeUpActivity" | ||
android:theme="@style/TransparentActivity"/> | ||
<activity | ||
android:name=".activities.WakeUpActivity" | ||
android:theme="@style/TransparentActivity" /> | ||
|
||
<activity android:name=".activities.AppPickerActivity" /> | ||
<activity android:name=".activities.ModalActivity" /> | ||
|
||
<service | ||
android:name=".services.TapAccessibilityService" | ||
android:label="@string/accessibility_service_label" | ||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"> | ||
<intent-filter> | ||
<action android:name="android.accessibilityservice.AccessibilityService" /> | ||
</intent-filter> | ||
|
||
<service android:name="com.kieronquinn.app.taptap.services.TapAccessibilityService" | ||
<meta-data | ||
android:name="android.accessibilityservice" | ||
android:resource="@xml/accessibilityservice" /> | ||
</service> | ||
|
||
<service | ||
android:name=".services.TapGestureAccessibilityService" | ||
android:label="@string/accessibility_service_label_gesture" | ||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"> | ||
<intent-filter> | ||
<action android:name="android.accessibilityservice.AccessibilityService" /> | ||
</intent-filter> | ||
<meta-data android:name="android.accessibilityservice" android:resource="@xml/accessibilityservice" /> | ||
|
||
<meta-data | ||
android:name="android.accessibilityservice" | ||
android:resource="@xml/gestureaccessibilityservice" /> | ||
</service> | ||
|
||
<provider | ||
android:name=".providers.SharedPrefsProvider" | ||
android:authorities="com.kieronquinn.app.taptap.provider.sharedprefs" | ||
android:grantUriPermissions="true" | ||
android:exported="false" /> | ||
android:exported="false" | ||
android:grantUriPermissions="true" /> | ||
|
||
<activity | ||
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity" | ||
android:theme="@style/AppTheme.ThirdPartyLicences" /> | ||
|
||
<activity | ||
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity" | ||
android:theme="@style/AppTheme.ThirdPartyLicences" /> | ||
|
||
<activity android:name=".activities.ActivityConfigTaskerEvent" | ||
<activity | ||
android:name=".activities.ActivityConfigTaskerEvent" | ||
android:exported="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/tasker_config_label"> | ||
<intent-filter> | ||
<action android:name="net.dinglisch.android.tasker.ACTION_EDIT_EVENT" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name=".activities.ActivityConfigTaskerEventTriple" | ||
<activity | ||
android:name=".activities.ActivityConfigTaskerEventTriple" | ||
android:exported="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/tasker_config_label_triple"> | ||
<intent-filter> | ||
<action android:name="net.dinglisch.android.tasker.ACTION_EDIT_EVENT" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name=".activities.ReachabilityActivity" | ||
android:theme="@style/ReachabilityTheme"/> | ||
<activity | ||
android:name=".activities.ReachabilityActivity" | ||
android:theme="@style/ReachabilityTheme" /> | ||
|
||
<service android:name=".services.TapForegroundService" /> | ||
|
||
<service | ||
android:name=".services.TapQSTile" | ||
android:icon="@drawable/ic_taptap_logo" | ||
android:label="@string/app_name" | ||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"> | ||
<intent-filter> | ||
<action | ||
android:name="android.service.quicksettings.action.QS_TILE"/> | ||
<action android:name="android.service.quicksettings.action.QS_TILE" /> | ||
</intent-filter> | ||
</service> | ||
|
||
</application> | ||
|
||
</manifest> |
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
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/kieronquinn/app/taptap/activities/ModalActivity.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,37 @@ | ||
package com.kieronquinn.app.taptap.activities | ||
|
||
import android.content.res.Configuration | ||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.navigation.fragment.NavHostFragment | ||
import com.kieronquinn.app.taptap.R | ||
import dev.chrisbanes.insetter.Insetter | ||
|
||
class ModalActivity: AppCompatActivity() { | ||
|
||
companion object { | ||
const val KEY_NAV_GRAPH = "nav_graph" | ||
} | ||
|
||
private val isLightTheme | ||
get() = resources.configuration.uiMode.and(Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_YES | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
Insetter.setEdgeToEdgeSystemUiFlags(window.decorView, true) | ||
if(isLightTheme){ | ||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility.or(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR).or(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR) | ||
} | ||
val navId = intent.getIntExtra(KEY_NAV_GRAPH, 0) | ||
if(navId == 0){ | ||
finish() | ||
return | ||
} | ||
setContentView(R.layout.activity_modal) | ||
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment | ||
val graph = navHostFragment.navController.navInflater.inflate(navId) | ||
navHostFragment.navController.graph = graph | ||
} | ||
|
||
} |
Oops, something went wrong.