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
class MyClass : BaseActivity() { | |
companion object { | |
val LOG = Logger.getLogger(MyClass::class.java.name) | |
} | |
fun foo() { | |
LOG.warn("Hello from MyClass") // works good | |
} | |
} | |
class MyClass2 : BaseActivity(), AnkoLogger { |
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 hello | |
fun main(args: Array<String>) { | |
println("Ок, чуваки буду пока так писать =) удобней") | |
} |
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
<!-- Google Analytics --> | |
<meta-data | |
android:name="com.google.android.gms.version" | |
android:value="@integer/google_play_services_version" /> | |
<receiver | |
android:name="com.google.android.gms.analytics.CampaignTrackingReceiver" | |
android:enabled="true" | |
android:exported="true" > | |
<intent-filter> |
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
Fresco.initialize(this, | |
ImagePipelineConfig.newBuilder(this) | |
.setBitmapsConfig(Bitmap.Config.RGB_565) | |
.build() | |
); |
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
@Multipart | |
@PUT("/users/me") | |
Observable<UserResponse> updateUser( | |
@PartMap Map<String, Object> userData, | |
@Part("user[avatar]") TypedFile avatar | |
); |
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
Realm realm = getRealmInstance(); | |
List<User> res = realm.where(User.class).findAll(); | |
List<User> list = new ArrayList<>(); | |
realm.close(); | |
return list; |
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
@Override | |
public <T extends RealmModel> Observable<T> get(Class<T> clazz, String primaryKey, | |
int pkValue) { | |
return Observable.fromCallable(() -> { | |
Realm realm = getRealmInstance(); | |
T object = realm.copyFromRealm(realm.where(clazz) | |
.equalTo(primaryKey, pkValue) | |
.findFirst()); | |
realm.close(); | |
return object; |
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
@WorkerThread | |
public static void writePage(NfcA nfca, byte offset, byte[] page) | |
throws NfcWritePageException { | |
byte[] cmd = new byte[] {COMMAND_WRITE_RECORD, offset, 0, 0, 0, 0}; | |
try { | |
System.arraycopy(page, 0, cmd, 2, 4); | |
nfca.transceive(cmd); | |
} catch (Exception e) { | |
throw new NfcWritePageException( | |
"Write page error. Offset " + StringUtils.byteToHex(offset)); |
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 static final String FORMAT_PAGE_STRING = "%-4s"; | |
public static final String ASCII = "US-ASCII"; | |
public static final byte END = (byte) 0x23; | |
public static final int READ_TIMEOUT_MS = 1000; | |
public static final byte SECTOR_0 = (byte) 0x00; | |
public static final byte SECTOR_1 = (byte) 0x01; | |
public static final byte SECTOR_3 = (byte) 0x03; | |
public static final byte SECTOR_0_PAGE_COUNT = 64; |
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 static Observable<String> resetClock(NfcA nfca, long timestamp) { | |
return Observable.fromCallable(() -> { | |
prepareToIO(nfca); | |
writeOperationCommand(nfca, | |
NfcOperationFactory.getCommandForTimeSetup(timestamp)); | |
//checkForOperationSuccess(nfca); ////////////////// | |
try { | |
selectSector(nfca, SECTOR_3); | |
} catch (Exception e) { | |
throw new NfcOperationException("select sector 3" + e.getMessage()); |
OlderNewer