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
Handler mHandler; | |
Runnable mRunnable = new Runnable() { | |
@Override | |
public void run() { | |
Log.v("Handlers", "Calls"); | |
} | |
}; |
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
Fragment frag; | |
//ajout d'un fragment | |
TonFragment newFragment = new TonFragment(); | |
android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); | |
transaction.add(R.id.fragment_container, newFragment).addToBackStack("A_B_TAG"); | |
transaction.commit(); | |
//remplacement d'un fragment |
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
<!-- A ajouter dans l'activité de l'application --> | |
android:windowSoftInputMode="stateHidden" | |
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)kilometersfromPlace:(CLLocationCoordinate2D)from andToPlace:(CLLocationCoordinate2D)to { | |
CLLocation *userloc = [[CLLocation alloc]initWithLatitude:from.latitude longitude:from.longitude]; | |
CLLocation *dest = [[CLLocation alloc]initWithLatitude:to.latitude longitude:to.longitude]; | |
CLLocationDistance dist = [userloc distanceFromLocation:dest]*4; | |
NSString *distance = [NSString stringWithFormat:@"%f",dist]; | |
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 density = getResources().getDisplayMetrics().density; |
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
final SpannableString textVidOTW = new SpannableString(Html.fromHtml("Video<br/>OF THE WEEK")); | |
textVidOTW.setSpan(new RelativeSizeSpan(0.7f*density), 0, 5, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
textVidOTW.setSpan(new TypefaceSpan(this, "fonts/Lighthouse_PersonalUse.ttf"), 0, 5,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
textVidOTW.setSpan(new RelativeSizeSpan(0.3f*density), 5, textVidOTW.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
//and add class | |
public class TypefaceSpan extends MetricAffectingSpan { | |
/** An <code>LruCache</code> for previously loaded typefaces. */ |