Get all ID from xml file for Android developers utility
This software allow find all IDs from xml layout file source code and create variables with findViewById for onCreate, for onClick and load save preferences functions.
Get all ID is for Windows XP and higher.
2017,04,28
Download 1.0.2.0
[caption id="attachment_903" align="alignleft" width="300" caption="Get all ID from xml file for Android developers utility."][/caption]
Get all ID is for Windows XP and higher.
2017,04,28
Download 1.0.2.0
[caption id="attachment_903" align="alignleft" width="300" caption="Get all ID from xml file for Android developers utility."][/caption]
396LW NO topic_id
AD
Další témata ....(Topics)
static boolean mbThemeLight = false;
@Override
public void onCreate(Bundle savedInstanceState) {
if(mbThemeLight)
setTheme(android.R.style.Theme_Light);
super.onCreate(savedInstanceState);
// bla bla bla..........
}
private void switchTheme(){
mbThemeLight = true;
this.recreate();
}
- create div with class with name e.g. circle
- create in styleSheet.css class circle
html code
<div class="circle" id="">3</div>
css code
.circle {
border-radius: 50%;
width: 50px;
height: 50px;
background: yellow;
position: absolute;
display: block;
border: 6px solid blue;
font-size: 50px;
text-align: center;
}
3
Landscape - portrait orientation change:
boolean mbOrientationLandscape = true;
if(mbOrientationLandscape ){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mbOrientationLandscape =false;
}else{
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
mbOrientationLandscape =true;
}
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);
}
}
}
public static Bitmap createBitmap (int[] colors, int offset, int stride, int width, int height, Bitmap.Config config)
public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)
public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)
// //www.apache.org/licenses/LICENSE-2.0
public class MainActivity extends Activity {
private static final int WIDTH = 50;
private static final int HEIGHT = 50;
private static final int STRIDE = 64; // must be >= WIDTH
private static int[] createColors() {
int[] colors = new int[STRIDE * HEIGHT];
for (int y = 0; y < HEIGHT; y++) {
for (int x = 0; x < WIDTH; x++) {
int r = x * 255 / (WIDTH - 1);
int g = y * 255 / (HEIGHT - 1);
int b = 255 - Math.min(r, g);
int a = Math.max(r, g);
colors[y * STRIDE + x] = (a << 24) | (r << 16) | (g << 8) | b;
}
}
return colors;
}
@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);
int[] mColors = createColors();
int[] colors = mColors;
Bitmap bitmap = Bitmap.createBitmap(colors, 0, STRIDE, WIDTH, HEIGHT,
Bitmap.Config.RGB_565);
canvas.drawBitmap(bitmap, 50,20, paint);
}
}
}
Editace: 2017-04-28 09:13:35
Počet článků v kategorii: 396
Url:get-all-id-from-xml-file-for-android-developers-utility