Skip to content

Instantly share code, notes, and snippets.

Mustafa Sevgi mustafasevgi

Block or report user

Report or block mustafasevgi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mustafasevgi
mustafasevgi / gist:f4c0ce40105fc7ced93e
Created Feb 26, 2015
Adapter load image and change view visibility in asynctask
View gist:f4c0ce40105fc7ced93e
// Using an AsyncTask to load the slow images in a background thread
new AsyncTask<ViewHolder, Void, Bitmap>() {
private ViewHolder v;
@Override
protected Bitmap doInBackground(ViewHolder... params) {
v = params[0];
return mFakeImageLoader.getImage();
}
View get hour 24 hours format
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("K:mm a");
String formattedTime = sdf.format(now);
@mustafasevgi
mustafasevgi / Maps link
Created Feb 20, 2015
Create maps link android
View Maps link
@mustafasevgi
mustafasevgi / gist:fd021ae54331ac1d6188
Created Jan 29, 2015
Add event Calendar, send SMS, installed package, send message with FB Messenger, send Email
View gist:fd021ae54331ac1d6188
private void addCalendar() {
Uri eventsUri;
if (android.os.Build.VERSION.SDK_INT <= 7) {
eventsUri = Uri.parse("content://calendar/events");
}
else {
View gist:dbfae7eccad177090d0a
private String getDistanceBetweenTwoLocations(double latA, double lngA, double latB, double lngB, String suffix) {
Location locationA = new Location("point A");
locationA.setLatitude(latA);
locationA.setLongitude(lngA);
Location locationB = new Location("point B");
locationB.setLatitude(latB);
locationB.setLongitude(lngB);
View gist:a60a9367d8de07a7a47e
android:contentInsetStart="0dp"
android:contentInsetLeft="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
View gist:2406dfec218594e6a8aa
// To animate view slide out from left to right
public void slideToRight(View view){
TranslateAnimation animate = new TranslateAnimation(0,view.getWidth(),0,0);
animate.setDuration(500);
animate.setFillAfter(true);
view.startAnimation(animate);
view.setVisibility(View.GONE);
}
// To animate view slide out from right to left
public void slideToLeft(View view){
View RoundedImageView
package com.Yahya.Utils;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
You can’t perform that action at this time.