|
|
I am trying to follow Val Okafor's Drawing App Tutorial.
Under Create CustomView, Step 2: Implement Constructor:
How do I have the CustomView class extend the framework’s View class?
I have just installed Android Studio and would like to get this running so that I can understand Android better.
Gerhard Oosthuizen
-- modified 22-Nov-16 13:05pm.
|
|
|
|
|
Ask Val Okafor, we have no idea what he told you.
|
|
|
|
|
Member 10654350 wrote: How do I have the CustomView class extend the framework’s View class? This comes to mind:
public class CustomView extends View
{
...
}
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
i want to know how can i make seat booking system of a movie in my application??
|
|
|
|
|
Research, design, develop, code, test, fix ...
|
|
|
|
|
It will take a lot of code. What exactly is your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
i want to save text in android application using sqllite database... plz any one help me to do this i am newly to coding and android..
|
|
|
|
|
|
You can open my profile and see my article "Android SQLite", it is poor but simply.
|
|
|
|
|
please help me to make this app
|
|
|
|
|
This type of mobile app can be found all over the Internet. The first three hits from here[^] would be a good starting point.
Which part do you need help with SPECIFICALLY?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Member 12838657 wrote: please help me to make this app How can we help?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
i'm developing an app with warp function but my code does not working peoperly
i need to move pixels with fingers like liquify in PS
any help would be great.
tnx
private static final int WIDTH = 20;
private static final int HEIGHT = 20;
private static final int COUNT = (WIDTH + 1) * (HEIGHT + 1);
private final Bitmap mBitmap;
private final float[] mVerts = new float[COUNT * 2];
private final float[] mOrig = new float[COUNT * 2];
private final Matrix mMatrix = new Matrix();
private final Matrix mInverse = new Matrix();
private float[] matrixInverse;
private int mLastWarpX = -9999;
private int mLastWarpY;
private static void setXY(float[] array, int index, float x, float y) {
array[(index * 2)] = x;
array[(index * 2) + 1] = y;
}
public Warp(Bitmap imgBitmap, float i, float j, Canvas myCanvas) {
mBitmap = imgBitmap;
float w = mBitmap.getWidth();
float h = mBitmap.getHeight();
int index = 0;
for (int y = 0; y <= HEIGHT; y++) {
float fy = h * y / HEIGHT;
for (int x = 0; x <= WIDTH; x++) {
float fx = w * x / WIDTH;
setXY(mVerts, index, fx, fy);
setXY(mOrig, index, fx, fy);
index++;
}
}
mMatrix.invert(mInverse);
float[] pt = {i, j};
mInverse.mapPoints(pt);
int x = (int) pt[0];
int y = (int) pt[1];
if (mLastWarpX != x || mLastWarpY != y) {
mLastWarpX = x;
mLastWarpY = y;
draw(pt[0], pt[1], myCanvas);
}
}
private void draw(float cx, float cy, Canvas canvas) {
final float K = 10000;
float[] src = mOrig;
float[] dst = mVerts;
for (int i = 0; i < COUNT * 2; i += 2) {
float x = src[i + 0];
float y = src[i + 1];
float dx = cx - x;
float dy = cy - y;
float dd = dx * dx + dy * dy;
float d = dd/2;
float pull = K / (dd + 0.000001f);
pull /= (d + 0.000001f);
if (pull >= 1) {
dst[i + 0] = cx;
dst[i + 1] = cy;
} else {
dst[i + 0] = x + dx * pull;
dst[i + 1] = y + dy * pull;
}
}
canvas.drawColor(0xFFCCCCCC);
canvas.concat(mMatrix);
canvas.drawBitmapMesh(mBitmap, WIDTH, HEIGHT, mVerts, 0,
null, 0, null);
}
|
|
|
|
|
mr ar wrote: ...but my code does not working peoperly And we're supposed to be able to decipher this?
Exactly what does not work?
What is it supposed to do? What is it doing instead?
What did you find when you stepped through the code using the debugger?
Have you narrowed the code down to just a few lines of code rather than several dozen, most of which is irrelevant?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
i want something like this :
[^]
my code just makes some distortion in the thoched point and minimizes the area.
unfortunately i did not find any primary line in the code they are very hard to understand
i thought this feature is already known to everyone
thank you for reply
|
|
|
|
|
mr ar wrote: ...they are very hard to understand Um, it's your code, isn't it?
mr ar wrote: i thought this feature is already known to everyone Why in the world would you think this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
you sound like a doctor
this code is everywhere i just change it a little bit for fit inside a class
i managed to do some changes with changing
final float K = 10000;
float[] src = mOrig;
float[] dst = mVerts;
for (int i = 0; i < COUNT * 2; i += 2) {
float x = src[i + 0];
float y = src[i + 1];
float dx = cx - x;
float dy = cy - y;
float dd = (dx * dx + dy * dy) /2;
float d = (float) Math.pow(dd, 2);
float pull = K / (dd + 0.000001f);
i bold them!
it still does wrong action but much better than previous one
do you have any solution?
|
|
|
|
|
mr ar wrote:
do you have any solution? To what? You've shown a few random pieces of code, but haven't explained what they are doing nor what they are supposed to do.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
|
By reading Pressure data from Grib2 File , i have to plot it using (isobars) on google map in my Xamarin.Android/Android App , I search from internet regarding this ,but not getting much help.
Help me how to plot isobars on Google Maps V2
modified 27-Oct-16 3:55am.
|
|
|
|
|
|
Funny how the first three results from that search are from the OP!
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|