This file contains hidden or 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
import android.content.Context; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.ShapeDrawable; | |
import android.graphics.drawable.shapes.OvalShape; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Random; | |
import pro.alex_zaitsev.currency.R; |
This file contains hidden or 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
if (isNewGooglePhotosUri(uri)) { | |
String pathUri = uri.getPath(); | |
String newUri = pathUri.substring(pathUri.indexOf("content"), pathUri.lastIndexOf("/ACTUAL")); | |
return getDataColumn(context, Uri.parse(newUri), null, null); | |
} | |
public static boolean isNewGooglePhotosUri(Uri uri) { | |
return "com.google.android.apps.photos.contentprovider".equals(uri.getAuthority()); | |
} |
This file contains hidden or 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.yalantis.util; | |
import android.text.TextUtils; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* Created by Aleksandr on 05.10.2015. | |
*/ |
This file contains hidden or 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
protected ErrorPopupHelper errorHelper = new ErrorPopupHelper(); | |
mEditTextEmail.setOnFocusChangeListener(new View.OnFocusChangeListener() { | |
@Override | |
public void onFocusChange(View view, boolean hasFocus) { | |
if (!hasFocus) { | |
if (!ValidatorUtil.isValidEmail(getEmail())) { | |
errorHelper.setError(mEditTextEmail, R.string.email_validation_error); | |
} | |
} |
This file contains hidden or 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.yalantis.contextmenu.sample; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.app.FragmentTransaction; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.Toolbar; | |
import android.view.Menu; | |
import android.view.MenuInflater; |
This file contains hidden or 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
Parse.Cloud.define("removeOldAdverts", function(request, response) { | |
var today = new Date(); | |
today.setMinutes(0); | |
today.setSeconds(0); | |
today.setMilliseconds(0); | |
var query = new Parse.Query("Advert"); | |
//query.lessThan("createdAt", today); | |
query.find({ |
This file contains hidden or 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
#!/bin/sh | |
set -e | |
if [ -z "$1" ]; then | |
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4 | |
else | |
shot_path="$*" | |
fi |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<gradient | |
android:angle="90" | |
android:endColor="#44000000" | |
android:startColor="@android:color/transparent" /> | |
</shape> |
This file contains hidden or 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
const bot = new builder.UniversalBot(connector); | |
bot.dialog(‘/’, [ | |
(session, args, next) => { | |
if (session.userData.languageSet) { | |
next(); | |
} else { | |
session.beginDialog(‘welcome:/pickLocale’); | |
} | |
}, | |
... |
This file contains hidden or 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 strict"; | |
const builder = require("botbuilder"); | |
const library = new builder.Library('welcome'); // welcome is a library name | |
const LANGUAGES = {'English': 'en', 'Русский': 'ru'}; | |
library.dialog('/pickLocale', [ | |
(session) => { | |
// Prompt the user to select their preferred locale | |
builder.Prompts.choice(session, "What language do you prefer?", Object.keys(LANGUAGES).join("|")); |
OlderNewer