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
Intent intent = new Intent(Intent.ACTION_SEND); | |
intent.setData(Uri.parse("mailto:")); | |
intent.setType("message/rfc822"); | |
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { email }); | |
intent.putExtra(Intent.EXTRA_SUBJECT, Constants.SHARE_MSG); | |
intent.putExtra(Intent.EXTRA_TEXT, Constants.INVITE_MSG); | |
intent.putExtra(Constants.EXIT_ON_SENT, true); | |
startActivity(Intent.createChooser(intent, | |
getString(R.string.invite_via))); |
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
float a = 221, b = 77, c = 17, d = 88, e = 22, f = 44; | |
float total = a + b + c + d + e + f; | |
int sum = (int) Math.round(100.0 / total * a) | |
+ (int) Math.round(100.0 / total * b) | |
+ (int) Math.round(100.0 / total * c) | |
+ (int) Math.round(100.0 / total * d) | |
+ (int) Math.round(100.0 / total * e) | |
+ (int) Math.round(100.0 / total * f); | |
System.out.println(Math.round(100.0 / total * a)); | |
System.out.println(Math.round(100.0 / total * b)); |
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 | |
} | |
} |
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
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
/** | |
*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
<?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
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<!-- Drop Shadow Stack --> | |
<item> | |
<shape> | |
<corners android:radius="10dp" /> | |
<padding | |
android:bottom="1dp" |
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
// | |
// Source code recreated from a .class file by IntelliJ IDEA | |
// (powered by Fernflower decompiler) | |
// | |
package tw.com.android.singularsdk.lib2; | |
import android.media.AudioTrack; | |
import android.os.SystemClock; | |
import android.util.Log; |