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 class NewIntentProcessor extends AbstractProcessor { | |
private static final String METHOD_PREFIX = "start"; | |
private static final ClassName classIntent = ClassName.get("android.content", "Intent"); | |
private static final ClassName classContext = ClassName.get("android.content", "Context"); | |
private Filer filer; | |
private Messager messager; | |
private Elements elements; | |
private Map<String, String> activitiesWithPackage; |
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 View.OnKeyListener getOnKeyListener(){ | |
return (v, keyCode, event) -> { | |
if(keyCode == KeyEvent.KEYCODE_DEL && searchText.get().equals("")) { | |
if (event.getAction()!=KeyEvent.ACTION_DOWN) | |
return true; | |
rxBus.send(new DeleteAddedUserFromKeyboardEvent()); | |
} | |
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
keytool -changealias -alias "ALIAS_WITH_SPECIAL_CHARACTER" -destalias "MY_NEW_ALIAS_NAME" -keypass MY_PASSWORD -keystore MY_KEYSTORE_PATH -storepass MY_PASSWORD |
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 static File bitmapToFile(Context context, Bitmap bitmap, String fileName) throws IOException { | |
File f = new File(context.getCacheDir(), fileName); | |
f.createNewFile(); | |
ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.JPEG, 50 , bos); | |
byte[] bitmapdata = bos.toByteArray(); | |
FileOutputStream fos = new FileOutputStream(f); | |
fos.write(bitmapdata); |
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 class FileUtil { | |
public static File getPickedPictureFile(Context context, Uri selectedImage) { | |
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; | |
// DocumentProvider | |
if (isKitKat && DocumentsContract.isDocumentUri(context, selectedImage)) { | |
// ExternalStorageProvider | |
if (isExternalStorageDocument(selectedImage)) { |
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
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<data> | |
<variable | |
name="viewModel" | |
type="com.main.MainViewModel"/> | |
</data> | |
<TextView | |
android:id="@+id/textview2" |
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
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<data> | |
<variable | |
name="viewModel" | |
type="com.main.MainViewModel"/> | |
</data> | |
<TextView | |
android:layout_width="wrap_content" |
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
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:bind="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<data> | |
<variable | |
name="viewModel" | |
type="com.main.MainViewModel" /> | |
</data> |
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
//Create gesture listener | |
GestureDetector.SimpleOnGestureListener viewPagerTouch = new GestureDetector.SimpleOnGestureListener(){ | |
@Override | |
public boolean onSingleTapConfirmed(MotionEvent e) { | |
//DO WHAT YOU WANT TO DO ON CLICK | |
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
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:font="@{`robotoBlack.ttf`}"/> |