Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Commit 7832ad1

Browse files
Fixed rotation issue
1 parent 470d955 commit 7832ad1

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

mobile/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ dependencies {
2929
compile fileTree(dir: 'libs', include: ['*.jar'])
3030
compile project(':locale-api')
3131
wearApp project(':wear')
32-
compile 'com.android.support:appcompat-v7:22.2.0'
33-
compile 'com.android.support:recyclerview-v7:21.0.3'
32+
compile 'com.android.support:appcompat-v7:22.2.1'
33+
compile 'com.android.support:recyclerview-v7:22.2.1'
3434
compile 'com.google.android.gms:play-services-wearable:7.3.0'
35-
compile 'com.android.support:support-v4:22.2.0'
35+
compile 'com.android.support:support-v4:22.2.1'
3636
}
3737

3838
def Properties props = new Properties()

mobile/src/main/AndroidManifest.xml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,51 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="org.codechimp.ttw"
5-
android:installLocation="internalOnly" >
2+
<manifest package="org.codechimp.ttw"
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:installLocation="internalOnly">
66

7-
<uses-permission android:name="android.permission.VIBRATE" />
7+
<uses-permission android:name="android.permission.VIBRATE"/>
88

99
<application
1010
android:allowBackup="true"
1111
android:icon="@mipmap/ic_launcher"
1212
android:label="@string/app_name"
13-
android:theme="@style/AppTheme" >
13+
android:theme="@style/AppTheme">
1414
<activity
1515
android:name=".MainActivity"
1616
android:label="@string/app_name"
17-
android:launchMode="singleTop" >
17+
android:launchMode="singleTop">
1818
<intent-filter>
19-
<action android:name="android.intent.action.MAIN" />
19+
<action android:name="android.intent.action.MAIN"/>
2020

21-
<category android:name="android.intent.category.LAUNCHER" />
21+
<category android:name="android.intent.category.LAUNCHER"/>
2222
</intent-filter>
2323
</activity>
2424

2525
<!-- Locale specifics -->
2626
<activity
2727
android:name=".PluginActivity"
28+
android:configChanges="orientation|screenSize"
2829
android:exported="true"
2930
android:label="@string/app_name"
3031
android:windowSoftInputMode="adjustResize"
31-
tools:ignore="ExportedActivity" >
32+
tools:ignore="ExportedActivity"
33+
>
3234

3335
<!-- this Intent filter allows the plug-in to be discovered by Locale -->
3436
<intent-filter>
35-
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
37+
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING"/>
3638
</intent-filter>
3739
</activity>
3840

3941
<receiver
4042
android:name=".FireReceiver"
4143
android:exported="true"
42-
tools:ignore="ExportedReceiver" >
44+
tools:ignore="ExportedReceiver">
4345

4446
<!-- this Intent filter allows the plug-in to be discovered by Locale -->
4547
<intent-filter>
46-
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING" />
48+
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING"/>
4749
</intent-filter>
4850
</receiver>
4951
<!-- End Locale specifics -->

mobile/src/main/java/org/codechimp/ttw/PluginActivity.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public final class PluginActivity extends AbstractPluginActivity {
5050
ArrayList<Long> taps = new ArrayList<>();
5151
private boolean resetOnNextTap = false;
5252

53+
private Dialog dialog;
54+
5355
@Override
5456
protected void onCreate(final Bundle savedInstanceState) {
5557
super.onCreate(savedInstanceState);
@@ -90,7 +92,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
9092
@Override
9193
public void onClick(View v) {
9294
// display custom tap dialog
93-
final Dialog dialog = new Dialog(context);
95+
dialog = new Dialog(context);
9496
dialog.setContentView(R.layout.dialog_custom);
9597
dialog.setTitle(R.string.vibrate_pattern);
9698

@@ -189,6 +191,14 @@ protected void onStart() {
189191
resetTapPattern();
190192
}
191193

194+
@Override
195+
protected void onPause() {
196+
super.onPause();
197+
198+
if (dialog != null)
199+
dialog.dismiss();
200+
}
201+
192202
/**
193203
* Clears and adds a starting 0 tap required for vibration patterns
194204
*/

0 commit comments

Comments
 (0)