Skip to content

Commit

Permalink
Remove vibration demo (closes #780)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Nov 18, 2023
1 parent 2e0322c commit 7a5bde7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion demo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools">

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

<application
android:name="com.chaquo.python.utils.App"
Expand Down
13 changes: 3 additions & 10 deletions demo/app/src/main/python/chaquopy/demo/ui_demo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from java import dynamic_proxy, jboolean, jvoid, Override, static_proxy

from android.app import AlertDialog
from android.content import Context, DialogInterface
from android.content import DialogInterface
from android.graphics.drawable import ColorDrawable
from android.os import Bundle
from androidx.appcompat.app import AppCompatActivity
Expand Down Expand Up @@ -68,11 +68,8 @@ def onCreatePreferences(self, state, rootKey):
@Override(jboolean, [Preference])
def onPreferenceTreeClick(self, pref):
method = getattr(self, pref.getKey())
if method:
method(self.getActivity())
return True
else:
return False
method(self.getActivity())
return True

def demo_dialog(self, activity):
ColorDialog().show(self.getFragmentManager(), "color")
Expand All @@ -85,10 +82,6 @@ def demo_toast(self, activity):
def demo_sound(self, activity):
self.sound_pool.play(self.sound_id, 1, 1, 0, 0, 1)

def demo_vibrate(self, activity):
activity.getSystemService(Context.VIBRATOR_SERVICE)\
.vibrate(200)


class ColorDialog(static_proxy(DialogFragment)):
@Override(AlertDialog, [Bundle])
Expand Down
1 change: 0 additions & 1 deletion demo/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<string name="demo_toast">Toast</string>
<string name="demo_toast_text">Toast from Python</string>
<string name="demo_sound">Sound</string>
<string name="demo_vibrate">Vibration</string>

<string name="java_demo">Java API demo</string>
<string name="java_demo_summary">Demonstrates using a Python library from Java code</string>
Expand Down
1 change: 0 additions & 1 deletion demo/app/src/main/res/xml/activity_ui_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
<Preference android:title="@string/demo_dialog" android:key="demo_dialog"/>
<Preference android:title="@string/demo_toast" android:key="demo_toast"/>
<Preference android:title="@string/demo_sound" android:key="demo_sound"/>
<Preference android:title="@string/demo_vibrate" android:key="demo_vibrate"/>

</PreferenceScreen>

0 comments on commit 7a5bde7

Please sign in to comment.