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
// | |
// File: /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation | |
// UUID: C3548955-29E4-3B77-BB2D-687FDA287B87 | |
// | |
// Arch: x86_64 | |
// Current version: 104.2.0 | |
// Compatibility version: 1.0.0 | |
// Source version: 104.2.0.0.0 | |
// Minimum Mac OS X version: 10.12.0 | |
// SDK version: 10.12.0 |
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
/** | |
* Removes spaces from a string | |
* @param raw - the string with spaces | |
* @return - the string without spaces | |
*/ | |
public static String removeSpaces(String raw) { | |
return raw.replace(" ", ""); | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/** | |
* Function that inserts a specified string into another string. It uses java's StringBuilder. | |
* Usage: insertStringInString("dogs cats", "and", 4) -> "dogs and cats" | |
* @param string - The main string that should contain the new piece | |
* @param insertion - The piece to add | |
* @param position - The position from which to add the piece | |
* @return - The final string | |
*/ | |
public static String insertStringInString(String string, String insertion, int position) { | |
// Only insert if the position is > -1 (useful with string.indexOf which returns -1 |
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
/** | |
* Handy method that pairs with onTouchEvent to determine when the event is a click action. | |
* Works by checking difference from initial to final finger position and the duration of the | |
* event (to make sure event is not a long click). | |
* @param startX: initial position of the finger - for instance event.getX() in ACTION_DOWN | |
* @param endX: final position of the finger - for instance event.getX() in ACTION_UP | |
* @param duration: duration of the touch - has to be implemented | |
* @return whether the event is a click or not | |
*/ | |
private boolean isAClick(float startX, float endX, long duration) { |
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
/** | |
* Quick method to remove a specified part of a string | |
* @param remove - the string part to remove | |
* @param from - the original string | |
* @return - the cut string | |
*/ | |
public static String removeStringFromString(String remove, String from) { | |
char lastCharacter = remove.charAt(remove.length() - 1); | |
int cutStart = from.lastIndexOf(lastCharacter) + 1; | |
return from.substring(cutStart); |
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.edge.utils; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.KeyEvent; | |
import android.view.MenuItem; | |
import android.view.inputmethod.InputMethodManager; | |
import android.widget.EditText; | |
import android.widget.ListView; |