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
# Set of lanes for control android emulators | |
require 'open3' | |
platform :android do | |
# time in seconds, to wait until emulator will finish launching | |
emulator_launch_timeout = 600 # 10 mins should be more, than enough for any relevant configuration | |
desc "Starts needed emulator, given though 'device_name' option, kills all others and deletes all redundant apks" | |
private_lane :prepare_emulator do |options| | |
device_name = options[:device_name] |
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
// | |
// SafeTypes.h | |
// | |
// Contains functions for safe values extraction from id types | |
// | |
// Created by Alexs on 17.11.16. | |
// | |
/** | |
* Accepts string and return string itself if it's not nil and empty string otherwise |
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
android { | |
def versionPropsFile = file("version.properties") | |
if (!versionPropsFile.canRead()) { | |
throw new GradleException("Could not read version.properties, please, provide this file with VERSION_NUMBER parameter") | |
} | |
def Properties versionProps = new Properties() | |
versionProps.load(new FileInputStream(versionPropsFile)) | |
def versionNumber = versionProps['VERSION_CODE'].toInteger() | |
defaultConfig { |
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
###### Simple script parses app metadata from android-like strings.xml and sets up values for deliver | |
###### You can always last version of this script at https://gist.github.com/SemenovAlexander/0b84606fa1439ebfe802 | |
baseLanguage = "en-US" | |
# Selecting all subfolder names of metadata directory as available locales | |
supportedLanguages = Dir.entries('metadata').select {|entry| File.directory? File.join('metadata',entry) and !(entry =='.' || entry == '..') } | |
# Creating variables for fields in each language, with dummy stub for base language | |
titleHash = { | |
baseLanguage => "" |
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
android { | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def filename = output.outputFile.name.replace(".apk", "-" + variant.versionName+"-"+variant.versionCode + ".apk") | |
//we should replace this only for release builds, because it cause bugs in development | |
if (filename.contains("release")){ | |
output.outputFile = new File(getProject().getRootDir(), | |
"${getProject().getName()}${File.separator}apk${File.separator}${filename}") | |
} | |
} |
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 void createLog() { | |
File logFile = new File(Environment.getExternalStorageDirectory() + File.separator + "FILE_NAME.log"); | |
if (!logFile.exists()) { | |
try { | |
logFile.createNewFile(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
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
import android.view.View; | |
import android.view.ViewGroup; | |
import android.view.animation.Animation; | |
import android.view.animation.Transformation; | |
/** | |
* Helper class, that allows to smoothly collapse and expand view vertically | |
*/ | |
public class ExpandCollapseAnimatorUtils { |