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
<TextView | |
android:autoLink="web|phone|email|map|all|none" | |
android:text="Texto texto site.com.br texto texto 0800-123-0000"/> |
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
/// <summary> | |
/// Extension methods for DependencyObjects | |
/// used for walking the visual tree with | |
/// LINQ expressions. | |
/// These simplify using VisualTreeHelper to one line calls. | |
/// </summary> | |
public static class VisualTreeHelperExtensions | |
{ | |
/// <summary> | |
/// Gets the first descendant that is of the given type. |
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 MyAdapter extends ResourceCursorAdapter{ | |
TextDrawable ic1; | |
public MyAdapter (Context context, int layout, Cursor c, int flags){ | |
super(context, layout, c, flags); | |
} | |
@Override | |
public View newView(Context context, Cursor cursor, ViewGroup parent) { | |
LayoutInflater inflater = LayoutInflater.from(parent.getContext()); |
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 ariani.starbuckscard; | |
import android.app.Activity; | |
import android.app.Dialog; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.graphics.drawable.AnimationDrawable; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.ViewGroup; |
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
<!-- DIALOG GIF --> | |
<style name="dialog_gif" parent="android:style/Theme.Dialog"> | |
<item name="android:windowFrame">@null</item> | |
<item name="android:windowNoTitle">true</item> | |
<item name="android:windowBackground">@android:color/transparent</item> | |
<item name="android:windowIsFloating">true</item> | |
<item name="android:windowContentOverlay">@null</item> | |
<item name="android:windowIsTranslucent">true</item> | |
<item name="android:background">#80ffffff</item> | |
<item name="android:backgroundDimEnabled">false</item> |
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
---Iniciar a Activity filha com: | |
startActivityForResult(intent, REQUEST_CODE); | |
---Na activity filha: | |
case R.id.sair: | |
private OnClickListener cancelar() { | |
return new OnClickListener(){ | |
@Override | |
public void onClick(View v){ | |
setResult(RESULT_OK, 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
Intent intent = new Intent(Activity1.this, Activity2.class); | |
ByteArrayOutputStream stream = new ByteArrayOutputStream(); | |
Bitmap bitmap = myBitmap; | |
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, stream); | |
bitmap.recycle(); | |
byte[] byteArray = stream.toByteArray(); | |
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
intent.putExtra("picture", byteArray); | |
startActivity(intent); |
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
private void configActionBar() { | |
Typeface type = Typeface.createFromAsset(HomeActivity.this.getAssets(),"font_name.ttf"); | |
ActionBar actionBar = getActionBar(); | |
actionBar.setDisplayShowCustomEnabled(true); | |
actionBar.setDisplayShowTitleEnabled(false); | |
LayoutInflater inflator = LayoutInflater.from(this); | |
View v = inflator.inflate(R.layout.titleview, null); | |
TextView titulo = (TextView) v.findViewById(R.id.titleActionBar); | |
titulo.setText("SelfieCup"); | |
titulo.setTypeface(type); |
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 int getStatusBarHeight() { | |
int result = 0; | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
result = getResources().getDimensionPixelSize(resourceId); | |
} | |
return result; | |
} |
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 Bitmap screenShot(View view) { | |
View v = view.getRootView(); | |
Bitmap bitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); | |
v.draw(canvas); | |
canvas.drawBitmap(bitmap, 0, 0, null); | |
return bitmap; | |
} |