Skip to content

Instantly share code, notes, and snippets.

Avatar
🦊

droan notdrone

🦊
View GitHub Profile
@notdrone
notdrone / .block
Last active Mar 31, 2018
Entry-Append
View .block
license: mit
@notdrone
notdrone / .block
Last active Mar 31, 2018
Selection and Data
View .block
license: mit
@notdrone
notdrone / RecyclerViewWithFooter.java
Created Feb 4, 2016
Recyclerview with footer template
View RecyclerViewWithFooter.java
package com.mobile.clubgecko.CanvasCard;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import com.mobile.clubgecko.R;
View plurals.txt
<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="see_new_update">
<item quantity="one">1 new update</item>
<item quantity="other">%d new updates</item>
</plurals>
</resources>
String quantityString = context.getResources().getQuantityString(R.plurals.see_new_update,
StringUtil.str2Int(feed.getContent()),StringUtil.str2Int(feed.getContent()));
View While writing pen source apps
public static final String FIREBASE_URL = BuildConig.UNIQUE_FIREBASE_ROOT_URL;
inside gradle.properties, add
UNIQUE_FIREBASE_ROOT_URL=”https://url.com/”
inside build.gradle, add
buildTypes.each{
@notdrone
notdrone / FirebaseReadWrite.java
Created Dec 21, 2015
firebas write/remove methods
View FirebaseReadWrite.java
setValue() writes/ replces data at the specified path replacig any data
at that path
updateChildren() write to specific childern of a parent node but without overwriting
other child nodes
push() add to list of data a. A unique id is generated by push depending
on the timestamp
runTransaction() used in ase of a counter, when seeralpeople update the same list
@notdrone
notdrone / RestrictedImagView.java
Created Aug 13, 2015
Creating a custom view to block image clicks
View RestrictedImagView.java
@Override
public void setOnClickListener ( OnClickListener listener ) {
OnClickListener listnerNew= new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.e("DROAN","replace with this log");
}
};
if (!true)
super.setOnClickListener(listener);
View Recieving Intents
Bundle intent=getIntent().getExtras();
String message= intent.getString("key");
TextView text=(TextView)rootView.findViewById(R.id.text);
text.setText(message);
View Starting Explicit Intent
Intent Detail = new Intent(getActivity(),DetailActivity.class).putExtra("key",some_string);
startActivity(Detail);
@notdrone
notdrone / toast
Created Feb 15, 2015
list clicks and toast
View toast
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String text = (String) listView.getItemAtPosition(position);
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(getActivity(), text, duration);
toast.show();