Skip to content

Instantly share code, notes, and snippets.

Nicolas POMEPUY PomepuyN

  • LevelUp Studio
  • France
Block or report user

Report or block PomepuyN

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:db67516349330ad9c988
DisplayManager.DisplayListener displayListener = new DisplayManager.DisplayListener() {
@Override
public void onDisplayAdded(int displayId) {
}
@Override
public void onDisplayRemoved(int displayId) {
}
@PomepuyN
PomepuyN / loop_screencap.sh
Created Dec 15, 2014
Take a screenshot by second on android
View loop_screencap.sh
#!/bin/sh
LEVEL=3
ISCHARGING=false
while [ 1=1 ]
do
adb shell screencap -p | sed 's/\r$//' > screen${LEVEL}.png
@PomepuyN
PomepuyN / SettingsAdapter.java
Last active Jun 5, 2018
Functional example of WearableListView
View SettingsAdapter.java
public class SettingsAdapter extends WearableListView.Adapter {
private final Context context;
private final List<SettingsItems> items;
public SettingsAdapter(Context context, List<SettingsItems> items) {
this.context = context;
this.items = items;
}
@PomepuyN
PomepuyN / gist:7b29e2592d39d687e95a
Last active Aug 29, 2015
Request Wear Mini Launcher to be disabled on your app
View gist:7b29e2592d39d687e95a

As Wear Mini launcher constantly retain a zone of the screen from being touched, it may cause issue with your app. Here is how you can disable it when your app is running.

Manifest

Add this line to your Manifest. Wear Mini Launcher will retrieve this meta to put your app in the exclusion list by default (the user will be able to revert this setting).

<manifest>
@PomepuyN
PomepuyN / Watch face Ambient mode detection
Last active Nov 5, 2018
Allow to detect Ambient mode to switch Watch face display on Wear devices
View Watch face Ambient mode detection
Handler handler = new Handler(Looper.getMainLooper());
final DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
displayManager.registerDisplayListener(new DisplayManager.DisplayListener() {
@Override
public void onDisplayAdded(int displayId) {
}
@Override
You can’t perform that action at this time.