-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1013 from zhazhahui9527/master
- Loading branch information
Showing
10 changed files
with
504 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
15 changes: 0 additions & 15 deletions
15
...pp/src/main/java/edu/hzuapps/androidlabs/Soft1714080902232/Soft1714080902232Activity.java
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
...pp/src/main/java/edu/hzuapps/androidlabs/soft1714080902232/Soft1714080902232Activity.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package edu.hzuapps.androidlabs.soft1714080902232; | ||
|
||
import android.os.Bundle; | ||
import android.os.Handler; | ||
import android.os.Message; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.widget.TextView; | ||
|
||
import java.util.Timer; | ||
import java.util.TimerTask; | ||
|
||
public class Soft1714080902232Activity extends AppCompatActivity { | ||
TextView score_show; | ||
Soft1714080902232Activity_GameView gv; | ||
TextView new_game; | ||
Handler handler = new Handler(){ | ||
@Override | ||
public void handleMessage(Message msg) { | ||
super.handleMessage(msg); | ||
int num =msg.arg1; | ||
score_show.setText(num+""); | ||
} | ||
|
||
}; | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.soft_1714080902232_activity); | ||
score_show = (TextView) findViewById(R.id.tv_score_show); | ||
gv = (Soft1714080902232Activity_GameView) findViewById(R.id.gv_show); | ||
new_game = (TextView) findViewById(R.id.tv_newgame); | ||
new_game.setOnClickListener(new View.OnClickListener() { | ||
|
||
@Override | ||
public void onClick(View arg0){ | ||
gv.GameStart(); | ||
gv.score = 0; | ||
} | ||
}); | ||
|
||
Timer timer = new Timer(); | ||
timer.schedule(new TimerTask() { | ||
|
||
@Override | ||
public void run() { | ||
Message msg = new Message(); | ||
msg.arg1 = gv.score; | ||
handler.sendMessage(msg); | ||
} | ||
}, 80, 150); | ||
score_show.setText(100 + ""); | ||
|
||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...main/java/edu/hzuapps/androidlabs/soft1714080902232/Soft1714080902232Activity_Before.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package edu.hzuapps.androidlabs.soft1714080902232; | ||
|
||
import android.content.Intent; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.Toast; | ||
|
||
public class Soft1714080902232Activity_Before extends AppCompatActivity { | ||
Button b1,b2,b3; | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.soft_1714080902232_activity_before); | ||
b1 =(Button)findViewById(R.id.button1); | ||
b1.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v){ | ||
Intent intent = new Intent(Soft1714080902232Activity_Before.this, Soft1714080902232Activity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
b2 =(Button)findViewById(R.id.button2); | ||
b2.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Toast.makeText(Soft1714080902232Activity_Before.this,"Please look forward",Toast.LENGTH_LONG).show(); | ||
} | ||
}); | ||
b3 =(Button)findViewById(R.id.button3); | ||
b3.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Toast.makeText(Soft1714080902232Activity_Before.this,"Please look forward",Toast.LENGTH_LONG).show(); | ||
} | ||
}); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...c/main/java/edu/hzuapps/androidlabs/soft1714080902232/Soft1714080902232Activity_Card.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package edu.hzuapps.androidlabs.soft1714080902232; | ||
|
||
import android.content.Context; | ||
import android.view.Gravity; | ||
import android.widget.FrameLayout; | ||
import android.widget.TextView; | ||
|
||
public class Soft1714080902232Activity_Card extends FrameLayout { | ||
private TextView text; | ||
private int number=0; | ||
public int getNumber() { | ||
return number; | ||
} | ||
|
||
public void setNumber(int number) { | ||
this.number = number; | ||
if(number<2){ | ||
text.setText(""); | ||
}else{ | ||
if(number>=64){ | ||
text.setTextColor(0xffffff00); | ||
}else{ | ||
text.setTextColor(0xff000000); | ||
} | ||
text.setText(number+""); | ||
} | ||
} | ||
|
||
public Soft1714080902232Activity_Card(Context context) { | ||
super(context); | ||
text = new TextView(context); | ||
text.setTextSize(28); | ||
text.setBackgroundColor(0x9966cccc); | ||
text.setGravity(Gravity.CENTER); | ||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(-1,-1); | ||
params.setMargins(10, 10, 0,0); | ||
addView(text,params); | ||
} | ||
} |
Oops, something went wrong.