Skip to content

Instantly share code, notes, and snippets.

Nakamoto sshnakamoto

Block or report user

Report or block sshnakamoto

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
@sshnakamoto
sshnakamoto / privacy.mk
Last active Jul 27, 2018
Visual Timer - Privacy Policy
View privacy.mk
Veja abaixo / See below
@sshnakamoto
sshnakamoto / stacktrace.log
Created Jul 27, 2018
Android Kitkat bug on setResquetedOrientation Method (Possible Genymotion Emulator)
View stacktrace.log
07-26 22:13:14.046 3912-3912/? D/dalvikvm: Late-enabling CheckJNI
07-26 22:13:14.130 3912-3912/example.android.com I/dalvikvm: Could not find method android.view.Window$Callback.onPointerCaptureChanged, referenced from method android.support.v7.view.WindowCallbackWrapper.onPointerCaptureChanged
07-26 22:13:14.130 3912-3912/example.android.com W/dalvikvm: VFY: unable to resolve interface method 20920: Landroid/view/Window$Callback;.onPointerCaptureChanged (Z)V
07-26 22:13:14.130 3912-3912/example.android.com D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
07-26 22:13:14.130 3912-3912/example.android.com I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
07-26 22:13:14.130 3912-3912/example.android.com W/dalvikvm: VFY: unable to resolve interface method 20922: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
07-26 22:13:14.130 3
@sshnakamoto
sshnakamoto / DateFormattingBasedOnLocale.java
Created Jun 2, 2018
Formate date based on User Locale on Android
View DateFormattingBasedOnLocale.java
String weddingDate = "26/02/1974";
/* Specify which format is */
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date date = null;
try {
/* Parse to date object */
date = sdf.parse(weddingDate);
} catch (ParseException e) {
// handle exception here !
@sshnakamoto
sshnakamoto / changeDrawableXmlColorOnAndroid.java
Created May 31, 2018
How to change Icon color (Drawable, XML, whatever you want), on Android dynamically (programmatically, whatever)
View changeDrawableXmlColorOnAndroid.java
// Explained Method
Drawable deleteIcon = ContextCompat.getDrawable(context, R.drawable.ic_delete);
Drawable deleteIconCompat = DrawableCompat.wrap(deleteIcon).mutate();
Drawable deleteIconMute = deleteIconCompat.mutate();
DrawableCompat.setTint(deleteIconMute, Color.RED);
// Compact Method
DrawableCompat.setTint(
DrawableCompat.wrap(
ContextCompat.getDrawable(context, R.drawable.ic_check).mutate()), Color.WHITE);
@sshnakamoto
sshnakamoto / CursorRecyclerAdapter.java
Created May 27, 2018 — forked from Shywim/CursorRecyclerAdapter.java
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
View CursorRecyclerAdapter.java
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@sshnakamoto
sshnakamoto / CustomScrollviewWithTabs.xml
Created May 24, 2018
A custom Scrollview with TabLayout and ImageView inside with parallax effect
View CustomScrollviewWithTabs.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.AquaInfo">
<android.support.design.widget.AppBarLayout
@sshnakamoto
sshnakamoto / AndroidManifest.xml
Created May 24, 2018 — forked from androidfu/AndroidManifest.xml
When pushing code from your IDE, wake the device and show the activity.
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
@sshnakamoto
sshnakamoto / AnimatedLinearLayout.java
Last active May 23, 2018
Simple android:animateLayoutChanges="true" example
View AnimatedLinearLayout.java
package com.example.nakamoto.fishtool;
import android.animation.LayoutTransition;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
public class AnimatedLinearLayout extends Activity {
View CursorRecyclerViewAdapter.java
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@sshnakamoto
sshnakamoto / AndroidDeviceMonitor.log
Created Feb 24, 2018
Android Device Monitor Error - java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
View AndroidDeviceMonitor.log
!SESSION 2018-02-23 19:13:37.248 -----------------------------------------------
eclipse.buildId=unknown
java.version=9.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=pt_BR
Framework arguments: -keyring /Users/phartmann/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -data @noDefault -keyring /Users/phartmann/.eclipse_keyring -showlocation
!ENTRY org.eclipse.osgi 4 0 2018-02-23 19:13:37.966
!MESSAGE Bundle reference:file:org.apache.ant_1.8.3.v201301120609/@4 not found.
You can’t perform that action at this time.