Android SDK Samples as a Photo Gallery
Photo Gallery of Android SDK Samples.
For better understanding of what the source knows there is a gallery of images.
After clicking on the preview displays the actual size and Titlebar
You can read the path to the source file as: Graphics/AnimateDrawables see the project folder
/ApiDemos/src/com/example/android/apis/graphics/AnimateDrawable.java
For better understanding of what the source knows there is a gallery of images.
After clicking on the preview displays the actual size and Titlebar
You can read the path to the source file as: Graphics/AnimateDrawables see the project folder
/ApiDemos/src/com/example/android/apis/graphics/AnimateDrawable.java
396LW NO topic_id
AD
Další témata ....(Topics)
Draw the trajectory of shot.
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);
}
private static void makePath(Path p) {
p.moveTo(10, 0);
p.cubicTo(100, -50, 200, 150, 300, 0);
}
@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(5);
// opacity
//p.setAlpha(0x80);
p.setColor(Color.BLACK);
Path mPath = new Path();
makePath(mPath);
canvas.drawPath(mPath, p); //(rectF, 90, 45, true, p);
}
}
}
Open your workspace folder and subfolder .metadata:
C:\Users\workspace\.metadata\
Delete .lock file
C:\Users\workspace\.metadata\
Delete .lock file
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) {
Paint paint = new Paint();
canvas.drawColor(Color.GREEN);
Bitmap b = Bitmap.createBitmap(200, 200, Bitmap.Config.ALPHA_8);
paint.setColor(Color.BLUE);
Canvas c = new Canvas(b);
c.drawRect(0, 0, 200, 200, paint);
canvas.drawBitmap(b, 10,10, paint);
}
}
}
xml example source code with image.
<TableLayout android:layout_width="match_parent" android:id="@+id/idTableInRadioGroup" android:layout_height="wrap_content">
<TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">
<RadioGroup android:id="@+id/idRadio_group_1_column"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<RadioButton android:id="@+id/idRadio_1"
android:text="@string/textLabel_1"/>
<RadioButton android:id="@+id/idRadio_2"
android:text="@string/textLabel_2"/>
<RadioButton android:id="@+id/idRadio_3"
android:text="@string/textLabel_3"/>
</RadioGroup>
<RadioGroup android:id="@+id/idRadio_group_2_column"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<RadioButton android:id="@+id/idRadio_4"
android:text="@string/textLabel_4"/>
<RadioButton android:id="@+id/idRadio_5"
android:text="@string/textLabel_5"/>
<RadioButton android:id="@+id/idRadio_6"
android:text="@string/textLabel_6"/>
</RadioGroup>
</TableRow>
</TableLayout>
Spinner _spin1 = (Spinner) findViewById(R.id.spinLangFirst);
ArrayAdapter<String> adapterJazyky = new ArrayAdapter<String>(this,
R.layout.spinner_text_layout.xml, {"one","two","etc...."});
adapterJazyky.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
_spin1.setAdapter(adapterJazyky);
spinner_text_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="//schemas.android.com/apk/res/android"
android:id="@+id/spinnerText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
/>
Editace: 2013-12-09 13:07:08
Počet článků v kategorii: 396
Url:android-sdk-samples-as-photo-serial