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
CustomHandler customHandler = new CustomHandler(this); | |
customHandler.sendEmptyMessage(0); | |
static class CustomHandler extends Handler{ | |
private final WeakReference<FriendListFragment> fragmentHolder; | |
public CustomHandler(FriendListFragment friendListFragment){ | |
fragmentHolder = new WeakReference<FriendListFragment>(friendListFragment); | |
} | |
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
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.widget.ScrollView; | |
public class VerticalScrollView extends ScrollView { | |
public VerticalScrollView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
} |
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 String ReadFromfile(String fileName, Context context) { | |
StringBuilder ReturnString = new StringBuilder(); | |
InputStream fIn = null; | |
InputStreamReader isr = null; | |
BufferedReader input = null; | |
try { | |
fIn = context.getResources().getAssets() | |
.open(fileName); | |
isr = new InputStreamReader(fIn); | |
input = new BufferedReader(isr); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" | |
android:src="@drawable/dvdr" | |
android:tileMode="disabled" android:gravity="top" > | |
</bitmap> |
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
/** | |
*http://stackoverflow.com/questions/5418510/disable-the-touch-events-for-all-the-views | |
* Enables/Disables all child views in a view group. | |
* | |
* @param viewGroup the view group | |
* @param enabled <code>true</code> to enable, <code>false</code> to disable | |
* the views. | |
*/ | |
public static void enableDisableViewGroup(ViewGroup viewGroup, boolean enabled) { | |
int childCount = viewGroup.getChildCount(); |
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
//as per cyrilmottier.com/2012/05/22/the-making-of-prixing-fly-in-app-menu-part-1/ | |
public class SmoothInterpolator extends LinearInterpolator { | |
@Override | |
public float getInterpolation(float input) { | |
return (float) Math.pow(input - 1, 5) + 1; | |
} | |
} |
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
private void valueAnimateAndDelete(final View view, | |
final int deletePosition) { | |
final ViewGroup.LayoutParams lp = view.getLayoutParams(); | |
final int originalHeight = view.getHeight(); | |
ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 0); | |
animator.addListener(new AnimatorListener() { | |
@Override | |
public void onAnimationStart(Animator arg0) { |
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
private void animateAndDelete(final View view, final int deletePosition) { | |
final int height = view.getMeasuredHeight(); | |
Animation animation = new Animation() { | |
@Override | |
protected void applyTransformation(float interpolatedTime, | |
Transformation t) { | |
view.getLayoutParams().height = height | |
- (int) (height * interpolatedTime); | |
view.requestLayout(); |
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
//Keep in mind the position should be actual size of ArrayList not ArrayList size -1 | |
chatListAdapter.notifyDataSetChanged(); | |
listView.getListView().postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
listView.getListView().smoothScrollToPosition( | |
messageItemList.size()); |
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 class ViewWeb extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.webview); | |
WebView wv; | |
wv = (WebView) findViewById(R.id.webView1); | |
wv.loadUrl("file:///android_asset/aboutcertified.html"); // now it will not fail here | |
} | |
} |
OlderNewer