This file contains hidden or 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 class NumberTextWatcher implements TextWatcher { | |
//usage | |
//editText.addTextChangedListener(new NumberTextWatcher(editText)); | |
private DecimalFormat df; | |
private DecimalFormat dfnd; | |
private boolean hasFractionalPart; |
This file contains hidden or 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
//http://stackoverflow.com/questions/2423498/how-to-get-the-html-source-of-a-page-from-a-html-link-in-android | |
HttpClient client = new DefaultHttpClient(); | |
HttpGet request = new HttpGet(url); | |
HttpResponse response = client.execute(request); | |
String html = ""; | |
InputStream in = response.getEntity().getContent(); | |
BufferedReader reader = new BufferedReader(new InputStreamReader(in)); | |
StringBuilder str = new StringBuilder(); | |
String line = null; |
This file contains hidden or 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
import android.content.Context; | |
import android.content.SharedPreferences; | |
//usage: | |
// SettingsManager sm=new SettingsManager(getApplicationContext()); | |
// String firstName=sm.getFirstName(); | |
public class SettingsManager { | |
SharedPreferences pref; |
This file contains hidden or 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 class ImageHolder implements Parcelable { | |
public String name=""; | |
@Override | |
public int describeContents() { | |
return 0; | |
} | |
@Override | |
public void writeToParcel(Parcel dest, int flags) { |
This file contains hidden or 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 class SpinnerDataHolder { | |
public String spinnerText; | |
public String value; | |
public SpinnerDataHolder( String spinnerText, String value ) { | |
this.spinnerText = spinnerText; | |
this.value = value; | |
} | |
public String toString() { | |
return spinnerText; |
This file contains hidden or 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 class FontHelper { | |
private static final Map<String, Typeface> TYPEFACES = new HashMap<>(); | |
public static Typeface get(Context context,String fontFileName){ | |
Typeface typeface = TYPEFACES.get(fontFileName); | |
if(typeface == null){ | |
typeface = Typeface.createFromAsset(context.getResources().getAssets(), fontFileName); | |
TYPEFACES.put(fontFileName, typeface); | |
} | |
return typeface; |
This file contains hidden or 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 ir.paaaa.android.utils; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. |
This file contains hidden or 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 org.wordpress.android.ui.main; | |
import android.app.Fragment; | |
import android.app.FragmentManager; | |
import android.os.Parcelable; | |
import android.support.v13.app.FragmentStatePagerAdapter; | |
import android.util.SparseArray; | |
import android.view.ViewGroup; | |
import org.wordpress.android.ui.notifications.NotificationsListFragment; |
This file contains hidden or 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 com.example.abbas.testssd; | |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="horizontal" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:id="@+id/imgProfile" | |
android:layout_width="70dp" | |
android:padding="5dp" |