Skip to content

Commit

Permalink
Release v1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
ginkage committed Jan 3, 2024
1 parent 6fcfeae commit 22913cd
Show file tree
Hide file tree
Showing 30 changed files with 153 additions and 38 deletions.
27 changes: 14 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ apply plugin: 'com.android.application'

android {
namespace 'com.ginkage.wearmouse'
compileSdkVersion 33
compileSdk 33

defaultConfig {
applicationId "com.ginkage.wearmouse"
minSdkVersion 28
minSdkVersion 26
targetSdkVersion 33
versionCode 31
versionName "1.23"
versionCode 36
versionName "1.24"
externalNativeBuild {
cmake {
arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang"
cppFlags.addAll([
"-std=c++11",
"-Os",
"-ffunction-sections",
"-fdata-sections",
"-fvisibility=hidden",
"-std=c++11",
"-Os",
"-ffunction-sections",
"-fdata-sections",
"-fvisibility=hidden",
])
}
}
Expand All @@ -39,8 +39,8 @@ android {
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
}
lint {
checkReleaseBuilds false
Expand All @@ -67,7 +67,8 @@ dependencies {
implementation 'com.google.guava:guava:31.1-android'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.5.1'
implementation 'androidx.wear:wear:1.2.0'
implementation 'androidx.core:core-splashscreen:1.0.1'
}
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
tools:ignore="DataExtractionRules,GoogleAppIndexingWarning"
tools:targetApi="31">

<meta-data android:name="com.google.android.wearable.standalone" android:value="false" />
<meta-data android:name="com.google.android.wearable.standalone" android:value="true" />
<uses-library android:name="com.google.android.wearable" android:required="false" />

<service android:name=".sensors.SensorService" />
Expand All @@ -58,7 +58,8 @@
<activity
android:name=".ui.devices.WelcomeActivity"
android:exported="true"
android:launchMode="singleTop">
android:launchMode="singleTop"
android:theme="@style/Theme.App.Starting" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public View onCreateView(
return root;
}

@Override
public void onResume() {
super.onResume();
getView().requestFocus();
}

private static void createLicenseDialog(Context context) {
Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.dialog_open_source);
Expand All @@ -70,6 +76,7 @@ private static void createLicenseDialog(Context context) {
getTextFromInputStream(
context.getResources().openRawResource(R.raw.apache_license)));
dialog.show();
dialog.findViewById(R.id.root_view).requestFocus();
}

private static String getTextFromInputStream(InputStream stream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ public void onCreate(Bundle savedInstanceState) {
FULL_WAKE_LOCK | ACQUIRE_CAUSES_WAKEUP, "WearMouse:PokeScreen");
}

@Override
public void onResume() {
super.onResume();
getView().requestFocus();
}

@Override
public void onRequestPermissionsResult(
int requestCode, String[] permissions, int[] grantResults) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void onStart() {
public void onResume() {
super.onResume();
updateBluetoothStateAndDevices();
getView().requestFocus();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import android.os.Build;
import android.os.Bundle;
import android.support.wearable.preference.WearablePreferenceActivity;

import androidx.core.splashscreen.SplashScreen;

import com.ginkage.wearmouse.ui.onboarding.OnboardingController.ScreenKey;
import com.ginkage.wearmouse.ui.onboarding.OnboardingRequest;
import com.google.common.collect.ImmutableList;
Expand All @@ -44,7 +47,7 @@ public void onRequestPermissionsResult(
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 1) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startPreferenceFragment(new PairedDevicesFragment(), false);
maybeStartOnboarding();
return;
}
finish();
Expand All @@ -53,6 +56,7 @@ public void onRequestPermissionsResult(

@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.installSplashScreen(this);
super.onCreate(savedInstanceState);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
Expand All @@ -68,12 +72,7 @@ protected void onCreate(Bundle savedInstanceState) {
}
}

onboardingRequest = new OnboardingRequest(this, ScreenKey.WELCOME);
if (onboardingRequest.isComplete()) {
startPreferenceFragment(new PairedDevicesFragment(), false);
} else {
onboardingRequest.start();
}
maybeStartOnboarding();
}

@Override
Expand All @@ -87,4 +86,17 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
super.onActivityResult(requestCode, resultCode, data);
}

private void maybeStartOnboarding() {
onboardingRequest = new OnboardingRequest(this, ScreenKey.WELCOME);
if (onboardingRequest.isComplete()) {
startDevicesFragment();
} else {
onboardingRequest.start();
}
}

private void startDevicesFragment() {
startPreferenceFragment(new PairedDevicesFragment(), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void onEnterAmbient(Bundle ambientDetails) {
protected void onResume() {
super.onResume();
keyboardController.onResume();
getFragment().getView().requestFocus();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public void onCreate(Bundle savedInstanceState) {
});
}

@Override
public void onResume() {
super.onResume();
getView().requestFocus();
}

private void initBooleanPref(@SettingKey final String key) {
final SwitchPreference pref = (SwitchPreference) findPreference(key);
pref.setChecked(settings.getBoolean(key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private boolean onTouchHint(View v, MotionEvent event) {
public void onResume() {
super.onResume();
controller.onResume();
getView().requestFocus();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void onCreate(Bundle savedInstanceState) {
public void onResume() {
super.onResume();
keyboardController.onResume();
getView().requestFocus();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public void onResume() {
super.onResume();
navigationDrawer.getController().peekDrawer();
actionDrawer.getController().peekDrawer();
getView().requestFocus();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public void onDestroy() {
super.onDestroy();
}

@Override
public void onResume() {
super.onResume();
getView().requestFocus();
}

public boolean onTouchEvent(MotionEvent e) {
if (e.getActionMasked() == MotionEvent.ACTION_DOWN) {
// Prevent Swipe-To-Dismiss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
findViewById(R.id.roundbutton_image).setOnClickListener(this::onClick);
}

@Override
protected void onResume() {
super.onResume();
findViewById(R.id.root_view).requestFocus();
}

private void onClick(View v) {
setResult(RESULT_OK, getIntent());
finish();
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/button_left.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="10dp">
<solid android:color="#404040"/>
<corners
android:bottomRightRadius="5dp"
android:bottomLeftRadius="40dp"
android:topLeftRadius="40dp"
android:topRightRadius="5dp"/>
</shape>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/button_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:padding="10dp">
<solid android:color="#404040"/>
<corners
android:bottomRightRadius="40dp"
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="40dp"/>
</shape>
8 changes: 8 additions & 0 deletions app/src/main/res/drawable/splash_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="@dimen/splash_screen_icon_size"
android:height="@dimen/splash_screen_icon_size"
android:drawable="@drawable/ic_launcher"
android:gravity="center" />
</layer-list>
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_bt_state.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@color/black"
>
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_calibration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@color/black"
android:id="@+id/calibrating">
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_card_flip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:background="@color/black"
tools:deviceIds="wear"
/>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_onboarding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none"
android:background="@color/black"
android:id="@+id/root_view"
tools:context=".ui.onboarding.OnboardingActivity" >

<LinearLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/dialog_open_source.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none"
android:background="@color/black"
android:id="@+id/root_view"
tools:context=".ui.onboarding.OnboardingActivity" >

<LinearLayout
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:overScrollMode="never"
android:scrollbars="none">
android:background="@color/black">

<LinearLayout
android:layout_width="match_parent"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_keypad.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/black"
>

<ImageView
android:id="@+id/background_image"
Expand Down
Loading

0 comments on commit 22913cd

Please sign in to comment.