Skip to content

Instantly share code, notes, and snippets.

View notdrone's full-sized avatar
🦊

droan notdrone

🦊
View GitHub Profile
@notdrone
notdrone / .block
Last active March 31, 2018 12:21
Entry-Append
license: mit
@notdrone
notdrone / .block
Last active March 31, 2018 12:04
Selection and Data
license: mit
@notdrone
notdrone / RecyclerViewWithFooter.java
Created February 4, 2016 10:08
Recyclerview with footer template
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;
@notdrone
notdrone / plurals.txt
Created December 30, 2015 06:17
Plurals
<?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()));
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 December 21, 2015 18:22
firebas write/remove methods
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 August 13, 2015 05:22
Creating a custom view to block image clicks
@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);
Bundle intent=getIntent().getExtras();
String message= intent.getString("key");
TextView text=(TextView)rootView.findViewById(R.id.text);
text.setText(message);
Intent Detail = new Intent(getActivity(),DetailActivity.class).putExtra("key",some_string);
startActivity(Detail);
@notdrone
notdrone / toast
Created February 15, 2015 21:27
list clicks and 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();