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
// Language detection and translation thanks to the Google language APIs | |
// Script inspired by Glen Smith's article: | |
// http://blogs.bytecode.com.au/glen/2009/07/30/getting-groovy-with-google-language-translation-apis.html | |
def text = URLEncoder.encode("J'ai envie de manger des fraises", "UTF-8") | |
def detectUrl = "http://www.google.com/uds/GlangDetect?v=1.0&q=${text}".toURL() | |
def langGuessResponse = jsonToGroovyMap(detectUrl.text) | |
def lang = langGuessResponse.responseData.language |
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
private int longClickDuration = 3000; | |
private boolean isLongPress = false; | |
numEquipeCheat.setOnTouchListener(new View.OnTouchListener() { | |
@Override | |
public boolean onTouch(View v, MotionEvent event) { | |
if (event.getAction() == MotionEvent.ACTION_DOWN) { | |
isLongPress = true; | |
Handler handler = new Handler(); | |
handler.postDelayed(new Runnable() { |
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
package com.custom.keyboard; | |
import android.content.SharedPreferences; | |
import android.preference.PreferenceManager; | |
// import androidx.appcompat.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import top.defaults.colorpicker.ColorPickerPopup; |
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
EditText editText = new EditText(this) { | |
@Override | |
public InputConnection onCreateInputConnection(EditorInfo editorInfo) { | |
final InputConnection ic = super.onCreateInputConnection(editorInfo); | |
EditorInfoCompat.setContentMimeTypes(editorInfo, | |
new String [] {"image/png"}); | |
final InputConnectionCompat.OnCommitContentListener callback = | |
new InputConnectionCompat.OnCommitContentListener() { | |
@Override |
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
wordbar.setOnTouchListener(new View.OnTouchListener() { | |
@Override | |
public boolean onTouch(View view, MotionEvent motionEvent) { | |
System.out.println(view+" "+motionEvent); | |
if (motionEvent.getX() < 0 || motionEvent.getX() > popupWindow.getWidth()) return true; | |
if (motionEvent.getY() < 0 || motionEvent.getY() > popupWindow.getHeight()) return true; | |
return false; | |
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
public static void makeKeyboardTransparent(InputMethodService service) { | |
try { | |
View decorView = service.getWindow().getWindow().getDecorView(); | |
final int viewId = fetchInternalRId("fullscreenArea"); | |
View fullscreenArea = decorView.findViewById(viewId); | |
if (fullscreenArea != null) { | |
modifyView(fullscreenArea); | |
return; | |
} | |
} catch (Exception e) { |
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
float x1, x2, y1, y2, dx, dy; | |
String direction; | |
boolean isDown = false; | |
Keyboard.Key activeKey; | |
public String getDirection(MotionEvent me) { | |
switch(me.getAction()) { | |
case MotionEvent.ACTION_DOWN: { | |
isDown = true; |
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
package name.boyle.chris.sgtpuzzles; | |
import java.util.ArrayList; | |
import java.util.LinkedHashMap; | |
import java.util.List; | |
import java.util.Map; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.SharedPreferences; |
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
/* | |
* Copyright (C) 2008-2009 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
package sra.keyboard; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.view.View.OnFocusChangeListener; | |
import android.view.View.OnTouchListener; | |
import android.view.WindowManager; |