Skip to content

Instantly share code, notes, and snippets.

💭
💯

Yusuke Konishi konifar

💭
💯
Block or report user

Report or block konifar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View skip_smart_lock.kt
fun skipSmartLock() {
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
val noneButton = device.findObject(UiSelector().textMatches("(上記以外)|(NONE OF THE ABOVE)").className("android.widget.Button"))
if (noneButton.exists()) {
noneButton.click()
}
}
@konifar
konifar / auto_remove_unused_resources.sh
Last active May 15, 2018
auto_remove_unused_resources.sh
View auto_remove_unused_resources.sh
#!/bin/bash -xe
# Usage:
# ./auto_remove_unused_resources.sh {github token} master
readonly GITHUB_TOKEN=${1}
readonly BASE_BRANCH=${2}
readonly ROOT_DIR=$PWD
readonly SRC_DIR="app/src"
readonly COMPARE_BRANCH="remove_unused_resources"
@konifar
konifar / android_unused_resource_remover.py
Created Apr 20, 2018
android_unused_resource_remover.py
View android_unused_resource_remover.py
# -*- coding: utf-8 -*-
import commands
import glob
import os
import xml.etree.ElementTree as ElementTree
# http://stackoverflow.com/questions/33573807/faithfully-preserve-comments-in-parsed-xml-python-2-7
class CommentedTreeBuilder(ElementTree.TreeBuilder):
def __init__(self, *args, **kwargs):
@konifar
konifar / Activity.java
Created Nov 15, 2017
Change menu item icon color
View Activity.java
private void refreshMenuItem(@Nullable MenuItem menuItem) {
if (menuItem != null) {
Drawable drawable = ContextCompat.getDrawable(this, R.drawable.vec_ic_refresh_22);
drawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_ATOP);
DrawableCompat.setTint(drawable, ResourcesCompat.getColor(getResources(), R.color.grey600, null));
menuItem.setIcon(drawable);
}
}
@konifar
konifar / upload_sessions_to_firebase_database.dart
Created Jun 6, 2017
upload_sessions_to_firebase_database.dart
View upload_sessions_to_firebase_database.dart
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
main() async {
var response = await http.read(
'https://raw.githubusercontent.com/konifar/droidkaigi2016/master/app/src/main/res/raw/sessions_ja.json');
var json = {'ja': JSON.decode(response)};
@konifar
konifar / droidkaigi2017_sessions_ja.json
Created Jan 14, 2017
DroidKaig2017 sessions json sample
View droidkaigi2017_sessions_ja.json
[
{
"id": 1,
"title": "ウェルカムトーク",
"description": "",
"speaker": {
"id": 1,
"name": "mhidaka",
"image_url": "",
"twitter_name": "",
@konifar
konifar / gist:6809d1aae8cc79fb9523
Created Feb 28, 2016
Android localization CFP for English
View gist:6809d1aae8cc79fb9523
# Sammary
Many people think localization is diffecult. But actually it's just because they don't know what they have to do for localization. So I'm gonna talk about what and how we have to do for localization. For example, how to manage many strings.xml files, to implement plurals by languages, to apply Right-to-Left language.
If you will hear this talk, you become a localization master.
I'm developing Android app called Taptrip (https://play.google.com/store/apps/details?id=com.taptrip), 17 languages supports. And I developed DroidKaigi 2016 (The biggest Android conference in Tokyo) app (https://github.com/konifar/droidkaigi2016). It supports Japanese, English, Arabic, Korean. So I gonna talk by using these app as sample code.
# Detail
- How to manage many strings.xml files
- How to implement plural strings, diffrent time format
- How to implement Right-to-Left language text
@konifar
konifar / build.gradle
Last active Aug 29, 2015
EclipseからAndroidStudioへの移行手順まとめ ref: http://qiita.com/konifar/items/b86c6f2e0b0d9dc4269c
View build.gradle
buildTypes {
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
@konifar
konifar / file0.txt
Created Dec 9, 2014
AndroidStudio完全アンインストールマニュアル ref: http://qiita.com/konifar/items/508e26dba72cab52cebd
View file0.txt
$ rm -Rf /Applications/Android\ Studio.app
$ rm -Rf ~/Library/Application\ Support/AndroidStudio*
$ rm -Rf ~/Library/Logs/AndroidStudio*
$ rm -Rf ~/Library/Caches/AndroidStudio*
@konifar
konifar / build.gradle
Last active Aug 29, 2015
EclipseからAndroid Studioのせかえ時のgradle対応でハマったエラーまとめ ref: http://qiita.com/konifar/items/dbbbfd94ad103239c627
View build.gradle
android {
dexOptions {
jumboMode true
}
}
You can’t perform that action at this time.