Transparent Background Android example
android:background="@android:color/transparent"
<LinearLayout
android:baselineAligned="false"
android:background="@android:color/transparent"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<LinearLayout>
////////////////////////////
LinearLayout mLinearLayout1 = (LinearLayout)findViewById(R.id.linearLayout1);
mLinearLayout1.setBackgroundColor(Color.TRANSPARENT);
396LW NO topic_id
AD
Další témata ....(Topics)
Brand | Samsung |
Model (codename) | Galaxy Y (S5360) |
Cena, včetně DPH | 2400 / 06.2012 |
Display size (v palcích) | 3 |
Display-resolution | 240x320 |
Dotek-typ | kapacitní |
CPU typ | BCM21553 |
CPU MHz | 832 |
CPU core | |
L2 cache | ? |
RAM | 256 |
ROM | 512 |
GPU | VideoCore IV |
NenaMark2 Benchmark | 12 |
GPU-GLBenchmark | |
Baterie mAh | 1200 |
Foto MPx | 2 |
Autofocus | ne |
Video | |
Official Android ICS | Android OS v 2.3 |
CyanogenMod support | |
Dotek-prstů-max | |
Display-ppi | 133 |
Display-retina | 41% |
Network | čîtyřpásmový GSM 850/900/1800/1900 MHz , HSDPA 2100 MHz |
Connectivity | Bluetooth v2.0 plus EDR plus support A2DP, USB host |
Pozn. | CPU ARMv6, GPU 20MT/s OpenGL ES 2.0 |
Canvas, drawCircle(), Paint, onDraw(), setStrokeWidth(), setStyle()
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawColor(Color.CYAN);
Paint p = new Paint();
// smooths
p.setAntiAlias(true);
p.setColor(Color.RED);
p.setStyle(Paint.Style.STROKE);
p.setStrokeWidth(4.5f);
// opacity
//p.setAlpha(0x80); //
canvas.drawCircle(50, 50, 30, p);
}
}
}
public class ApokusActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
canvas.drawColor(Color.GREEN);
Bitmap b = Bitmap.createBitmap(200, 200, Bitmap.Config.ALPHA_8);
paint.setColor(Color.BLUE);
Shader mShader = new LinearGradient(0, 0, 100, 70, new int[] {
Color.RED, Color.GREEN, Color.BLUE },
null, Shader.TileMode.MIRROR); // CLAMP MIRROR REPEAT
Canvas c = new Canvas(b);
paint.setShader(mShader);
//c.drawCircle(60, 60, 30, paint);
c.drawRect(0, 0, 200, 200, paint);
canvas.drawBitmap(b, 10,10, paint);
}
}
}
Brand | Samsung |
Model (codename) | Galaxy Mini (S5570) |
Price (cena, včetně DPH) | 3500 / 06.2012 |
Display size in Inch (v palcích) | 3.14 |
Display-resolution | 240x320 |
Dotek-typ | kapacitní |
CPU typ | MSM7227 |
CPU MHz | 600 |
CPU core | |
L2 cache | yes |
RAM | 256 |
ROM | 512 |
GPU | Adreno 200 |
NenaMark2 Benchmark | |
GPU-GLBenchmark | |
Baterie mAh | 1200 |
Foto MPx | 3 |
Autofocus | no |
Video | QVGA (320 x 240) při 15 frames/s |
Official Android ICS | Android Froyo 2.2 |
CyanogenMod support | yes |
Dotek-prstů-max | Dual-touch (two fingers) |
Display-ppi | 127 |
Display-retina | 39% |
Networks | GSM&EDGE (850 / 900 / 1.800 / 1.900 MHz) 3G (900 / 2.100 MHz) |
Connectivity | Bluetooth V2.1 , USB V2.0 , USB mass storage , SyncML(DM) , WIFI , AGPS, 3.5 mm jack |
Note |
Samsung S5570 Galaxy Mini - image
Black and white bitmap image pictures, gray scale colormatrix Android example.
public class ApokusActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
canvas.drawColor(Color.YELLOW);
// you need to insert a image flower_blue into res/drawable folder
paint.setFilterBitmap(true);
Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),
R.drawable.flower_blue);
canvas.drawBitmap(bitmapOrg, 10, 10, paint);
int width, height;
ColorMatrix cm = new ColorMatrix(
new float[]{
0.5f,0.5f,0.5f,0,0,
0.5f,0.5f,0.5f,0,0,
0.5f,0.5f,0.5f,0,0,
0,0,0,1,0,0,
0,0,0,0,1,0
});
cm.setSaturation(0);
ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);
paint.setColorFilter(f);
int h = bitmapOrg.getHeight();
//canvas.drawBitmap(bitmapOrg, 10, 10, paint);
canvas.drawBitmap(bitmapOrg, 10, 10 + h + 10, paint);
}
}
}
Editace: 2012-03-08 22:14:48
Počet článků v kategorii: 396
Url:transparent-background-android-example